Tuner Research and Matlab Implementation

We started seriously looking at the tuner again today. We want to have a moving needle that moves in as close to real time as possible. The hard part here is that Matlab needs a longish (when we are talking in real time) sample to analyse. We need to find a balance between the length of the sample Matlab needs and what is an acceptable time delay for th euser to experience. For the minute, we’ve settled on a 2 second sample, but it may prove that this is too long.

We read this into Matlab using audiorecorder, pausing every 2 seconds.

The method we wrote in Matlab finds the fundemental frequency (which, for the tuner, will usually be the first note encountered in the sample, or else the highest peak) of the note and outputs it back to Java. This is quite easy to accomplish as all that is needed is to FFT the sample, find the highest peak, divide this by the length of the sample and multiply it byt the sample rate (divide by 2, mulitply by 1 in our case as the sample is 2 seconds long). This method works, in that it returned the correct note to us during testing. It remains to be seen if the 2 second sample is too long once we get a graphical representation of the tuner into the GUI. ..

~ by brendanbambury on March 12, 2008.

Leave a Reply