I'm trying to make a realtime(ish) monophonic guitar to midi program. I want a latency of <=6 milli secs. To find what note was played i aim to sample 256 points (should take approx 6 millis) , run an fft and analyze mag plot to determine pitch of note played.
When i do this in matlab, it gives me back very unstable/inaccurate results with peaks appearing in random places etc.
The note being inputted is 110Hz sampled @ 44.1khz. I've applied a high pass filter at 500hz with a roll off of 48db/octave.. so only the higher harmonics of signal should remain. The audio last for 1 second ( filled with zeros after 256 samples)
Code:
%fft work
guitar = wavread('C:\Users\Donnacha\Desktop\Astring110hz.wav');
guitar(1:44100);
X = fft(guitar);
Xmag = abs(X);
plot(Xmag);
I was hoping to see all the harmonics of 110Hz (A note on guitar) starting at >500hz..
How would i achieve accurate results from an FFT with such little data?