Hi all, Currently, I use FFT to calculate the input single tone signal SNR and have a question about it posting below: SNR = 10*log10(|disired single bin magnitude|^2/sum(|all bins magnitude other than desired|^2)) 1. if I set N1 as the fft number at 1st time, so the number of elements in sum() @ denominator is N1; 2. if I set N2 as the fft number at 2nd time, and the number of elementsin sum() @ denominator is N2; and in every calculation, the ratio (|disired single bin magnitude|^2/|any bin magnitude other than desired| is roughtly a constant. So, through this dedection, we got the conclusion that: the larger FFT number, the worse SNR we get. And, this is contradict with the theory!!! What's wrong with my SNR calculation? Thanks, chengnoon
SNR calculation using FFT
Started by ●January 26, 2010
Reply by ●January 26, 20102010-01-26
On Jan 26, 1:31 am, "chengnoon" <chengn...@gmail.com> wrote:> Hi all, > > Currently, I use FFT to calculate the input single tone signal SNR and > have a question about it posting below: > > SNR = 10*log10(|disired single bin magnitude|^2/sum(|all bins magnitude > other than desired|^2)) > > 1. if I set N1 as the fft number at 1st time, so the number of elements in > sum() @ denominator is N1; > 2. if I set N2 as the fft number at 2nd time, and the number of elementsin > sum() @ denominator is N2; > > and in every calculation, the ratio (|disired single bin magnitude|^2/|any > bin magnitude other than desired| is roughtly a constant. So, through this > dedection, we got the conclusion that: the larger FFT number, the worse SNR > we get. And, this is contradict with the theory!!! > > What's wrong with my SNR calculation?1. You don't specify if you know the tone frequency or have to estimate it 2. The tone frequency has both positive and negative freqency fft components 3. What if the tone frequency is between fft bin frequencies? 4. SNR corresponds to the ratio of AVERAGE powers, not total power. Hope this helps. Greg
Reply by ●January 26, 20102010-01-26
On Jan 26, 1:31�am, "chengnoon" <chengn...@gmail.com> wrote:> Hi all, > > Currently, I use FFT to calculate the input single tone signal SNR and > have a question about it posting below: > > SNR = 10*log10(|disired single bin magnitude|^2/sum(|all bins magnitude > other than desired|^2)) > > 1. if I set N1 as the fft number at 1st time, so the number of elements in > sum() @ denominator is N1; > 2. if I set N2 as the fft number at 2nd time, and the number of elementsin > sum() @ denominator is N2; > > and in every calculation, the ratio (|disired single bin magnitude|^2/|any > bin magnitude other than desired| is roughtly a constant. So, through this > dedection, we got the conclusion that: the larger FFT number, the worse SNR > we get. And, this is contradict with the theory!!! > > What's wrong with my SNR calculation? > > Thanks, > chengnoonThe correct expression for SNR would normalize the denominator by the number of bins. So, SNR = 10*log10((N_FFT-1)*|disired single bin magnitude|^2/sum(|all bins magnitude other than desired|^2)) Regards, Dilip.
Reply by ●January 26, 20102010-01-26
>The correct expression for SNR would normalize the denominator by the >number of bins. > >So, >SNR =3D 10*log10((N_FFT-1)*|disired single bin magnitude|^2/sum(|all >bins magnitude other than desired|^2)) > >Regards, >Dilip. >May be I am not present the question clearly. Regardless of the fft lenght difference, the ratio |desired signal single bin magnitude|/|any other signal single bin magnitude| is a constant. So, the SNR calculation should be like this: SNR = 10*log10(A) where, A = M_sig/(M_1+M_2+M_3+...+M_N) and N is the fft length. As the fact that M_sig/M_n is a constant regardless of the fft length N. So, we get the SNR which depends on the fft length N, i.e., the longer fft length, the worse SNR. This is question. Thanks a lot.
Reply by ●January 26, 20102010-01-26
Cheng, The SNR calculation using FFT method does not depend on the number of points (assuming it to be large to begin with). Couple of things that needs to be considered while computing FSNR (I call it Frequency domain SNR Calc, time domain would be called TSNR). 1. Windowing of data prior to feeding it to FFT. This helps in reducing spectral leakage to a large extent. I have used blackman-harris window in my routine. 2. Due to windowing effect, the peak of sinetone will not be seen at -6dB, hence a small correction is needed if you wish to see the peak of sine-tone at -6db. This is just like applying a scaling factor. This is just for visual purpose. 3. Due to windowing and the input sine wave not being integral multiple, there will be spread in peak, (it will not be available at single point in FFT spectrum). Hence to compute signal power we need to use couple of bins adjacent to the peak point to consider signal power. This spread is completely dependent on the type of window used and to be more precise on the main lobe width of the window. 4. I have tested my routine for quite few cases and it seems to give consistent results. Regards Bharat Pathak
Reply by ●January 27, 20102010-01-27
On Jan 26, 8:50�pm, "chengnoon" <chengn...@gmail.com> wrote:> >The correct expression for SNR would normalize the denominator by the > >number of bins. > > >So, > >SNR =3D 10*log10((N_FFT-1)*|disired single bin magnitude|^2/sum(|all > >bins magnitude other than desired|^2)) > > >Regards, > >Dilip. > > May be I am not present the question clearly. > Regardless of the fft lenght difference, the ratio > |desired signal single bin magnitude|/|any other signal single bin > magnitude| > is a constant. > > So, the SNR calculation should be like this: > SNR = 10*log10(A) > > where, A = M_sig/(M_1+M_2+M_3+...+M_N) > and N is the fft length. > > As the fact that M_sig/M_n is a constant regardless of the fft length N. > > So, we get the SNR which depends on the fft length N, i.e., the longer fft > length, the worse SNR. > > This is question. > > Thanks a lot.No. You have to use the ratio of the average signal power to the average noise power. The average noise power is relatively independent of N. Hope this helps. Greg
Reply by ●January 27, 20102010-01-27
> >No. > >You have to use the ratio of the average signal power to the average >noise power. The average noise power is relatively independent of N. > >Hope this helps. > >Greg >I donot think so. SNR is defined as the ratio of a signal power to the noise power corrupting the signal. And, the noise power is refer to the total noise power, not the average noise power, in desired bandwidth.
Reply by ●January 27, 20102010-01-27
chengnoon wrote:>> No. >> >> You have to use the ratio of the average signal power to the average >> noise power. The average noise power is relatively independent of N. >> >> Hope this helps. >> >> Greg >> > > I donot think so. SNR is defined as the ratio of a signal power to the > noise power corrupting the signal. And, the noise power is refer to the > total noise power, not the average noise power, in desired bandwidth.I think you misunderstand, probably because the explanation wasn't complete enough. The bins have dimension. The area is amplitude times bandwidth. As more FFT points are added, the bandwidth of a bin decreases. The bin power is bin amplitude times bin bandwidth. The total noise power is noise amplitude times total bandwidth. The total bandwidth is independent of number of bins. Can you take it from here? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●January 27, 20102010-01-27
>chengnoon wrote: >>> No. >>> >>> You have to use the ratio of the average signal power to the average >>> noise power. The average noise power is relatively independent of N. >>> >>> Hope this helps. >>> >>> Greg >>> >> >> I donot think so. SNR is defined as the ratio of a signal power to the >> noise power corrupting the signal. And, the noise power is refer tothe>> total noise power, not the average noise power, in desired bandwidth. > >I think you misunderstand, probably because the explanation wasn't >complete enough. The bins have dimension. The area is amplitude times >bandwidth. As more FFT points are added, the bandwidth of a bin >decreases. The bin power is bin amplitude times bin bandwidth. The total>noise power is noise amplitude times total bandwidth. The total >bandwidth is independent of number of bins. Can you take it from here? > >JerryBut the signal considered here is the ideal single tone frequency, for example single frequency signal A*cos(2*pi*fc), and it only have one single bin regardless the fft length. Thanks.
Reply by ●January 27, 20102010-01-27
Jerry Avins <jya@ieee.org> wrote: (snip)> I think you misunderstand, probably because the explanation wasn't > complete enough. The bins have dimension. The area is amplitude times > bandwidth. As more FFT points are added, the bandwidth of a bin > decreases. The bin power is bin amplitude times bin bandwidth. The total > noise power is noise amplitude times total bandwidth. The total > bandwidth is independent of number of bins. Can you take it from here?Well, for a truly periodic signal (unlikely in this case) the bins are delta functions. They still have area, though. (Zero width and finite area.) For non-periodic signals you approximate the bins as a histogram would come out. -- glen