<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>John Taylor - Natural Sciences</title>
	<atom:link href="http://jtnatsci.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jtnatsci.wordpress.com</link>
	<description>Dissertation Progress Diary</description>
	<lastBuildDate>Mon, 08 Mar 2010 13:13:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jtnatsci.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>John Taylor - Natural Sciences</title>
		<link>http://jtnatsci.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jtnatsci.wordpress.com/osd.xml" title="John Taylor - Natural Sciences" />
	<atom:link rel='hub' href='http://jtnatsci.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Pitch Class Profile problem</title>
		<link>http://jtnatsci.wordpress.com/2010/03/08/pitch-class-profile-problem/</link>
		<comments>http://jtnatsci.wordpress.com/2010/03/08/pitch-class-profile-problem/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 13:13:20 +0000</pubDate>
		<dc:creator>jtnatsci</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://jtnatsci.wordpress.com/2010/03/08/pitch-class-profile-problem/</guid>
		<description><![CDATA[The PCP method produced some good results, but there is a problem. Just because harmonics of a note are multiples of the fundamental frequency, this does not mean that they have the same note value. For example, A3 (220Hz) has harmonics at A4 (440Hz), E5 (660Hz ish), A5 (880Hz), C#6 (1108Hz) etc.. This means that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=79&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The PCP method produced some good results, but there is a problem.  Just because harmonics of a note are multiples of the fundamental frequency, this does not mean that they have the same note value.  For example, A3 (220Hz) has harmonics at A4 (440Hz), E5 (660Hz ish), A5 (880Hz), C#6 (1108Hz) etc..  This means that I have to do a bit more manipulation, and find the most likely fundamental frequency for each peak before I assign a note value.  More later…</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jtnatsci.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jtnatsci.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jtnatsci.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jtnatsci.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jtnatsci.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jtnatsci.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jtnatsci.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jtnatsci.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jtnatsci.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jtnatsci.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jtnatsci.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jtnatsci.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jtnatsci.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jtnatsci.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=79&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jtnatsci.wordpress.com/2010/03/08/pitch-class-profile-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">jtnatsci</media:title>
		</media:content>
	</item>
		<item>
		<title>Pitch Class profile</title>
		<link>http://jtnatsci.wordpress.com/2010/03/05/pitch-class-profile/</link>
		<comments>http://jtnatsci.wordpress.com/2010/03/05/pitch-class-profile/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 10:31:13 +0000</pubDate>
		<dc:creator>jtnatsci</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://jtnatsci.wordpress.com/2010/03/05/pitch-class-profile/</guid>
		<description><![CDATA[The next method is a &#8216;pitch class profile&#8217; method. Using the new half-second sample window for the FFT, the FFT bucket size is small enough to uniquely identify the pitch to a specific semitone. This means that each FFT bucket can be labelled with its closest midi note equivalent (of course. in the higher frequencies, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=78&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The next method is a &#8216;pitch class profile&#8217; method.  Using the new half-second sample window for the FFT, the FFT bucket size is small enough to uniquely identify the pitch to a specific semitone.  This means that each FFT bucket can be labelled with its closest midi note equivalent (of course. in the higher frequencies, several buckets will share the same midi note as the scale is logarithmic).  Each of these midi notes can be translated into a musical note value, for example &#8216;C#&#8217;, &#8216;E&#8217; etc.  This can be thought of as a note number between 1 and 12 (ignoring the octave number).
</p>
<p>When the peak positions are translated into these note numbers, a histogram can be produced showing the frequencies of each note present.  The higher the frequency, the more likely it is that that note is present.  With the harmonic structure of guitars in general, I would expect at least three peak values to be present for each real note present.  This method should give an idea of how many different value notes are in the sample.
</p>
<p>Let&#8217;s say the sample returns a histogram telling us that there are 6 peaks that equate to a &#8216;G&#8217;, and 4 that equate to an &#8216;E&#8217;.  We then need to determine which octave numbers of these notes are present.  This will be explored in a further post.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jtnatsci.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jtnatsci.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jtnatsci.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jtnatsci.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jtnatsci.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jtnatsci.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jtnatsci.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jtnatsci.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jtnatsci.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jtnatsci.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jtnatsci.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jtnatsci.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jtnatsci.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jtnatsci.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=78&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jtnatsci.wordpress.com/2010/03/05/pitch-class-profile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">jtnatsci</media:title>
		</media:content>
	</item>
		<item>
		<title>Other methods explored</title>
		<link>http://jtnatsci.wordpress.com/2010/03/05/other-methods-explored/</link>
		<comments>http://jtnatsci.wordpress.com/2010/03/05/other-methods-explored/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 10:19:25 +0000</pubDate>
		<dc:creator>jtnatsci</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://jtnatsci.wordpress.com/2010/03/05/other-methods-explored/</guid>
		<description><![CDATA[Over the last couple of weeks I have investigated some further methods for detecting multiple pitches in a frequency spectrum. The first of these is a peak removal algorithm which does the following: Assume that the lowest &#8216;significant&#8217; peak is a fundamental frequency Using the &#8216;fine tuning&#8217; algorithm previously described, find the likely harmonic peaks [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=77&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Over the last couple of weeks I have investigated some further methods for detecting multiple pitches in a frequency spectrum.  The first of these is a peak removal algorithm which does the following:
</p>
<ol style="margin-left:54pt;">
<li>Assume that the lowest &#8216;significant&#8217; peak is a fundamental frequency
</li>
<li>Using the &#8216;fine tuning&#8217; algorithm previously described, find the likely harmonic peaks of this fundamental frequency
</li>
<li>Flatten the peaks of the fundamental and its harmonics
</li>
<li>Repeat steps i) to iii) until no more significant peaks are found
</li>
</ol>
<p>The down side to this method is that higher octave notes will not be found if a lower octave equivalent is present, as its harmonic will be destroyed when the lower note is detected and removed.  Formal results of this method will follow.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jtnatsci.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jtnatsci.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jtnatsci.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jtnatsci.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jtnatsci.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jtnatsci.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jtnatsci.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jtnatsci.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jtnatsci.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jtnatsci.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jtnatsci.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jtnatsci.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jtnatsci.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jtnatsci.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=77&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jtnatsci.wordpress.com/2010/03/05/other-methods-explored/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">jtnatsci</media:title>
		</media:content>
	</item>
		<item>
		<title>Fine tuning</title>
		<link>http://jtnatsci.wordpress.com/2010/02/17/fine-tuning/</link>
		<comments>http://jtnatsci.wordpress.com/2010/02/17/fine-tuning/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 12:55:13 +0000</pubDate>
		<dc:creator>jtnatsci</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://jtnatsci.wordpress.com/2010/02/17/fine-tuning/</guid>
		<description><![CDATA[To resolve the tuning issue, I have developed an algorithm for fine-tuning the frequency detector. The old version was only as accurate as the FFT bucket size, i.e. if there are 2205 buckets representing a frequency range of 0-22,050Hz then each bucket has a width of 10Hz. This limits the frequency resolution of the old [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=76&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To resolve the tuning issue, I have developed an algorithm for fine-tuning the frequency detector.  The old version was only as accurate as the FFT bucket size, i.e. if there are 2205 buckets representing a frequency range of 0-22,050Hz then each bucket has a width of 10Hz.  This limits the frequency resolution of the old algorithm.  The new one looks at the first seven harmonics of the detected fundamental, and tries some minute shifts (negative and positive) of f0 to see how it effects the harmonics.  It looks at the likelihood of these slightly shifted f0 values by summing the power of the newly calculated theoretical harmonics.  In the example below, the original f0 was calculated at 390Hz, but with the fine tuning, it recalculates it to 373Hz, as this f0 more closely matches the harmonics present.  The red circles are the harmonics of this new f0 (logarithmically decreasing).
</p>
<p><img src="http://jtnatsci.files.wordpress.com/2010/02/021710_1255_finetuning1.jpg?w=450">
	</p>
<p>The low-end peaks are noise on the recording, and are ignored by the algorithm.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jtnatsci.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jtnatsci.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jtnatsci.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jtnatsci.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jtnatsci.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jtnatsci.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jtnatsci.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jtnatsci.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jtnatsci.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jtnatsci.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jtnatsci.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jtnatsci.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jtnatsci.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jtnatsci.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=76&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jtnatsci.wordpress.com/2010/02/17/fine-tuning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">jtnatsci</media:title>
		</media:content>

		<media:content url="http://jtnatsci.files.wordpress.com/2010/02/021710_1255_finetuning1.jpg" medium="image" />
	</item>
		<item>
		<title>Harmonic responses</title>
		<link>http://jtnatsci.wordpress.com/2010/02/10/harmonic-responses/</link>
		<comments>http://jtnatsci.wordpress.com/2010/02/10/harmonic-responses/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 10:33:20 +0000</pubDate>
		<dc:creator>jtnatsci</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://jtnatsci.wordpress.com/2010/02/10/harmonic-responses/</guid>
		<description><![CDATA[To address the problem with harmonics, I have decided to do a study of the harmonics produced by the guitar. A sample note was recorded of every string, and every fret. These notes were then analysed by taking their Fourier transform, and the relative power of their fundamental frequency and first four harmonics was taken. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=74&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To address the problem with harmonics, I have decided to do a study of the harmonics produced by the guitar.  A sample note was recorded of every string, and every fret.  These notes were then analysed by taking their Fourier transform, and the relative power of their fundamental frequency and first four harmonics was taken.  This is shown on the following diagram:
</p>
<p><img src="http://jtnatsci.files.wordpress.com/2010/02/021010_1033_harmonicres1.jpg?w=450">
	</p>
<p>It can be seen that for several notes, the fundamental frequency is not the dominant frequency in the transform.  There are patterns in the results – the seventh fret (row 8 in the diagram, as row 1 is the open string) shows that the dominant frequency is the first harmonic on 4 of the 6 strings, rather than the fundamental.  This may mean I have to revise the method I use to detect the frequencies present.  At the moment I am thinking of modelling responses using the data from the harmonics, and comparing these &#8216;theoretical&#8217; responses to the test data.  By removing matching notes one at a time, I should be able to determine the notes that are playing.  I have investigated using HTK to produce a probabilistic result, but the time constraints of the project do not allow me to pursue this option.  It is something that I would look into further if I had the time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jtnatsci.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jtnatsci.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jtnatsci.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jtnatsci.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jtnatsci.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jtnatsci.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jtnatsci.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jtnatsci.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jtnatsci.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jtnatsci.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jtnatsci.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jtnatsci.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jtnatsci.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jtnatsci.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=74&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jtnatsci.wordpress.com/2010/02/10/harmonic-responses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">jtnatsci</media:title>
		</media:content>

		<media:content url="http://jtnatsci.files.wordpress.com/2010/02/021010_1033_harmonicres1.jpg" medium="image" />
	</item>
		<item>
		<title>For better, for worse</title>
		<link>http://jtnatsci.wordpress.com/2010/02/01/for-better-for-worse/</link>
		<comments>http://jtnatsci.wordpress.com/2010/02/01/for-better-for-worse/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 12:40:22 +0000</pubDate>
		<dc:creator>jtnatsci</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://jtnatsci.wordpress.com/2010/02/01/for-better-for-worse/</guid>
		<description><![CDATA[OK, I&#8217;ve amended the pitch detection algorithm in the following ways: The frames marked as the onset frames are the ones that have the highest increase in power across all frequencies. To detect which actual notes are &#8216;onsetting&#8217; however, I am now using the onset frame +1. This seems to give more consistent data. If [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=72&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>OK, I&#8217;ve amended the pitch detection algorithm in the following ways:
</p>
<ol>
<li>The frames marked as the onset frames are the ones that have the highest increase in power across all frequencies.  To detect which actual notes are &#8216;onsetting&#8217; however, I am now using the onset frame +1.  This seems to give more consistent data.  If I take the &#8216;delta&#8217; values of this &#8216;onset+1&#8242; frame, they are positive for all the new frequencies in the signal.  I then use this as a mask to clean up the power spectrum – this leaves only the new tonal data that we are looking for.
</li>
<li>In order to identify the actual note that is starting, I am using frame &#8216;onset+3&#8242;.  This gives a little time for the note to settle in after the initial strike.
</li>
<li>The Harmonic Product Spectrum (see earlier post) was giving strange octave results, because of noise across the frequency range, and the lack of certain harmonics in the guitar signals (this is typical).  Instead of using the product of f0 and the harmonics, I am now applying a weighting factor to the first and second harmonics, and summing f0 up to f4.
</li>
</ol>
<p>This has given mixed results.  The octave problem is now gone, but it has been replaced by one of tuning.  The song sounds recognisable, but in a &#8216;Les Dawson&#8217; kind of way.  Back to the grind.
</p>
<p>The results of this method are here:
</p>
<p><a href="http://www.jtuk.com/natsci/testout3.mid">http://www.jtuk.com/natsci/testout3.mid</a>
	</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jtnatsci.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jtnatsci.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jtnatsci.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jtnatsci.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jtnatsci.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jtnatsci.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jtnatsci.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jtnatsci.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jtnatsci.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jtnatsci.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jtnatsci.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jtnatsci.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jtnatsci.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jtnatsci.wordpress.com/72/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=72&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jtnatsci.wordpress.com/2010/02/01/for-better-for-worse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.jtuk.com/natsci/testout3.mid" length="331" type="audio/mid" />
	
		<media:content url="" medium="image">
			<media:title type="html">jtnatsci</media:title>
		</media:content>
	</item>
		<item>
		<title>Octave shift</title>
		<link>http://jtnatsci.wordpress.com/2010/01/29/octave-doubling/</link>
		<comments>http://jtnatsci.wordpress.com/2010/01/29/octave-doubling/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 13:44:31 +0000</pubDate>
		<dc:creator>jtnatsci</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Progress]]></category>

		<guid isPermaLink="false">http://jtnatsci.wordpress.com/2010/01/29/octave-doubling/</guid>
		<description><![CDATA[The first method I have used is the &#8216;Harmonic Product Spectrum&#8217;.   This method takes the windowed time domain signal, transforms it to the frequency domain, using FFT, then multiplies the resultant spectrum by compressed versions of itself (at 2x, 3x, 4x and 5x compression). The theory is that the harmonics of the fundamental will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=68&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="margin-left:18pt;">The first method I have used is the &#8216;Harmonic Product Spectrum&#8217;.<span style="font-family:Times New Roman;font-size:10pt;"><br />
</span></p>
<p><span style="font-family:Times New Roman;font-size:10pt;"> <img src="http://jtnatsci.files.wordpress.com/2010/01/012910_1344_octavedoubl1.png?w=450" alt="" /><br />
</span></p>
<p>This method takes the windowed time domain signal, transforms it to the frequency domain, using FFT, then multiplies the resultant spectrum by compressed versions of itself (at 2x, 3x, 4x and 5x compression). The theory is that the harmonics of the fundamental will &#8216;line up&#8217; with the fundamental as the spectrum is compressed. In practice however, this is giving me problems. The first problem is that there is some noise at multiples of (f0/2). This means that the largest peak is at (f0/2), which results in the note being shifted down an octave. The second problem is that the third harmonic on the guitar that I am currently using is almost absent. The effect of this is to include zero as one of the factors which is not good. To correct these problems I am working on a solution that uses the sum of the harmonics, with a weighting factor, instead of the product. More to follow.</p>
<p>Diagram ref:  Patricio de la Cuadra, <a href="https://ccrma.stanford.edu/~pdelac/154/m154paper.htm">https://ccrma.stanford.edu/~pdelac/154/m154paper.htm</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jtnatsci.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jtnatsci.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jtnatsci.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jtnatsci.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jtnatsci.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jtnatsci.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jtnatsci.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jtnatsci.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jtnatsci.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jtnatsci.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jtnatsci.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jtnatsci.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jtnatsci.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jtnatsci.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=68&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jtnatsci.wordpress.com/2010/01/29/octave-doubling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">jtnatsci</media:title>
		</media:content>

		<media:content url="http://jtnatsci.files.wordpress.com/2010/01/012910_1344_octavedoubl1.png" medium="image" />
	</item>
		<item>
		<title>Success, and my guitar playing</title>
		<link>http://jtnatsci.wordpress.com/2010/01/29/success-and-my-guitar-playing/</link>
		<comments>http://jtnatsci.wordpress.com/2010/01/29/success-and-my-guitar-playing/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 13:33:11 +0000</pubDate>
		<dc:creator>jtnatsci</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://jtnatsci.wordpress.com/2010/01/29/success-and-my-guitar-playing/</guid>
		<description><![CDATA[To complete stage one of the project, I had to get the system to correctly identify and convert to midi all of the notes in a monophonic tune, played on an electric guitar. The test tune that I have been using is my amazing rendition of &#8220;Frere Jaques&#8221;: http://www.jtuk.com/natsci/testwav.wav This file contains 32 notes, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=66&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To complete stage one of the project, I had to get the system to correctly identify and convert to midi all of the notes in a monophonic tune, played on an electric guitar.  The test tune that I have been using is my amazing rendition of &#8220;Frere Jaques&#8221;:
</p>
<p><a href="http://www.jtuk.com/natsci/testwav.wav">http://www.jtuk.com/natsci/testwav.wav</a>
	</p>
<p>This file contains 32 notes, and the initial results look quite good.  28 of the 32 notes have been recognised correctly, and the other 4 are &#8216;nearly&#8217; right.  They are out by an octave – a common problem with frequency detection algorithms.  The midi file sounds like this:
</p>
<p><a href="http://www.jtuk.com/natsci/testout1.mid">http://www.jtuk.com/natsci/testout1.mid</a>
	</p>
<p>The next post will explain the problems and possible solutions to the octave problems.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jtnatsci.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jtnatsci.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jtnatsci.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jtnatsci.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jtnatsci.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jtnatsci.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jtnatsci.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jtnatsci.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jtnatsci.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jtnatsci.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jtnatsci.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jtnatsci.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jtnatsci.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jtnatsci.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=66&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jtnatsci.wordpress.com/2010/01/29/success-and-my-guitar-playing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.jtuk.com/natsci/testwav.wav" length="3528044" type="audio/wav" />
<enclosure url="http://www.jtuk.com/natsci/testout1.mid" length="331" type="audio/mid" />
	
		<media:content url="" medium="image">
			<media:title type="html">jtnatsci</media:title>
		</media:content>
	</item>
		<item>
		<title>Apologies</title>
		<link>http://jtnatsci.wordpress.com/2010/01/26/apologies/</link>
		<comments>http://jtnatsci.wordpress.com/2010/01/26/apologies/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 12:33:59 +0000</pubDate>
		<dc:creator>jtnatsci</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://jtnatsci.wordpress.com/2010/01/26/apologies/</guid>
		<description><![CDATA[There has been a significant break in the updates to the blog recently. I had laser eye surgery at the end of last semester, and could not use a computer for 5 weeks. I&#8217;m back now though, and will be updating with the latest progess soon.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=65&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There has been a significant break in the updates to the blog recently.  I had laser eye surgery at the end of last semester, and could not use a computer for 5 weeks.  I&#8217;m back now though, and will be updating with the latest progess soon.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jtnatsci.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jtnatsci.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jtnatsci.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jtnatsci.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jtnatsci.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jtnatsci.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jtnatsci.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jtnatsci.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jtnatsci.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jtnatsci.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jtnatsci.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jtnatsci.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jtnatsci.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jtnatsci.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=65&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jtnatsci.wordpress.com/2010/01/26/apologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">jtnatsci</media:title>
		</media:content>
	</item>
		<item>
		<title>Onset detection</title>
		<link>http://jtnatsci.wordpress.com/2009/11/05/onset-detection/</link>
		<comments>http://jtnatsci.wordpress.com/2009/11/05/onset-detection/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 14:42:08 +0000</pubDate>
		<dc:creator>jtnatsci</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://jtnatsci.wordpress.com/2009/11/05/onset-detection/</guid>
		<description><![CDATA[To resolve the problem of the jumping octave (previous post), I have developed a method of finding the &#8216;onset&#8217; of a note. When this is found, the fundamental frequency just after that onset is determined, and any harmoncs that are present are &#8216;labelled&#8217; with that fundamental frequency. As long as any of these harmonics are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=64&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To resolve the problem of the jumping octave (previous post), I have developed a method of finding the &#8216;onset&#8217; of a note.  When this is found, the fundamental frequency just after that onset is determined, and any harmoncs that are present are &#8216;labelled&#8217; with that fundamental frequency.  As long as any of these harmonics are still playing, the fundamental is deemed to still be playing.  This first image shows the gradients of the harmonics (time is going upwards in this image).  The rise and fall of each peak is clearly visible, and it shows the fundamental dropping off before the first harmonic.<br /><img src="http://jtnatsci.files.wordpress.com/2009/11/110509_1441_onsetdetect1.jpg?w=450"><br />To determine the onset, however, we need to find where the gradient increases in the other dimension.  This is shown in the next image:<br /><img src="http://jtnatsci.files.wordpress.com/2009/11/110509_1441_onsetdetect2.jpg?w=450"><br />Here we can see that the notes begin to form in frame 3, continue their rise in frame 4, and the gradually tail off.  If we sum the values of the gradients for each time frame, we should get a peak at frames 3 and 4.  This is shown in  the next image:<br /><img src="http://jtnatsci.files.wordpress.com/2009/11/110509_1441_onsetdetect3.jpg?w=450"><br />There is a distinct &#8216;spike&#8217; at frame 4, which is easy to detect.  In order to allow the attack phase of the note to complete, I have arbitrarily chosen to wait 3 more frames before taking the FFT to determine the fundamental frequency of the note that appears at this point.  I then apply a method called &#8216;harmonic product spectrum&#8217; to determine the frequency of the note.  This gives the following result:<br /><img src="http://jtnatsci.files.wordpress.com/2009/11/110509_1441_onsetdetect4.jpg?w=450"><br />which shows a perfect spike at 150.98Hz.  The actual value for D3 is 146.33Hz, but as the notes either side are 138.59Hz and 155.56Hz, the closest semitone to our result is the correct one.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jtnatsci.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jtnatsci.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jtnatsci.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jtnatsci.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jtnatsci.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jtnatsci.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jtnatsci.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jtnatsci.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jtnatsci.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jtnatsci.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jtnatsci.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jtnatsci.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jtnatsci.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jtnatsci.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jtnatsci.wordpress.com&amp;blog=6735070&amp;post=64&amp;subd=jtnatsci&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jtnatsci.wordpress.com/2009/11/05/onset-detection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">jtnatsci</media:title>
		</media:content>

		<media:content url="http://jtnatsci.files.wordpress.com/2009/11/110509_1441_onsetdetect1.jpg" medium="image" />

		<media:content url="http://jtnatsci.files.wordpress.com/2009/11/110509_1441_onsetdetect2.jpg" medium="image" />

		<media:content url="http://jtnatsci.files.wordpress.com/2009/11/110509_1441_onsetdetect3.jpg" medium="image" />

		<media:content url="http://jtnatsci.files.wordpress.com/2009/11/110509_1441_onsetdetect4.jpg" medium="image" />
	</item>
	</channel>
</rss>
