From: chengnoon on
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
From: Greg Heath on
On Jan 26, 1:31 am, "chengnoon" <chengn...(a)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
From: Dilip Warrier on
On Jan 26, 1:31 am, "chengnoon" <chengn...(a)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,
> chengnoon

The 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.
From: chengnoon on
>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.




From: bharat pathak on
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