Hello everybody this is my first post, I thank everyone in advance for an
I am trying to calculate the SNR and THD of an MP3 player that is playin
a 1KHz tone.
I am using a digitizer card (A to D) to capture 70000 samples at 700,00
Hertz. I then use the FFTW C library to find the DFT. To calculate the TH
I am using the following formula:
THD = SQRT(FFT^2 + FFT^2 + FFT^2 + FFT^2)/FFT
My bin spacing is 10 hertz (samplerate divided by samplenumber), so inde
100 in the array corresponds to the 1000hertz signal and so on.
I then take the 20*Log10(THD) to get the value in dB.
For calculating the SNR I am finding the Root Sum Square of all the nois
bins by doing:
for(i=1; i<=2000; i++)
if(i!=100 && (i mod 100) != 0) //Find squared sum of all no
Noise = Noise + FFT[i]^2;
Noise = SQRT(Noise);
Noise = Noise/y //Should I be dividing to average?
SNR = FFT/Noise;
SNR = 20*log10(SNR);
This is the psuedo code of what I'm doing, does this seem right?
Are these the correct methods to find THD and SNR? For the SNR calculatio
should I divide the summation by the total number of noise bins (variabl
y) added together in the for loop?
||8/18/2007 2:58:16 AM