I applied Fourier transform on a sound (PCM generated digitally with sin function) and frequency detection is accurate. However, if I play the sound and record it, and then apply a Fourier transform to detect frequencies, my results are nowhere close to original results. The window size I have chosen for Fourier transform is 30 samples. ( Sampling frequency is 44100 Hz and 30 samples represent a symbol. Each symbol frequency is shifted by 1470 Hz.). Is my approach right ?
-
$\begingroup$ We need more information. How are you performing the fft (Matlab, Python)? Show us some code. What do the good and bad FFTs look like? $\endgroup$– David KMar 6, 2014 at 16:51
-
$\begingroup$ How are you synchronizing your 30 sample frames with the recorded data? $\endgroup$– hotpaw2Mar 6, 2014 at 18:24
-
$\begingroup$ I have fixed it. @hotpaw2 - Why do I need to synchronize the 30 sample frames ? Is it not sufficient if I check if the frequency exists (peak in its bin) ? $\endgroup$– user3388324Mar 7, 2014 at 14:58
1 Answer
That's to be expected. If the input of your FF transform is 30 (real) points, you also get 30 real amplitudes out, for 30 different frequency bins. Each bin is (44100/2)/30 Hz wide, or about 700 Hz. That is quite wide. Add to that the effect of spectral leakage, which may quite well extend for 5 bins in either direction. 10 out of 30 bins will contain the ground frequency. Any higher harmonics will add to that.
Normally, people use much longer FFT's. 256 is quite a common choice, and 1024 isn't unheard of either.