COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### How to find SNR to a sine tone of single frequency after filtering?

• Email
• Follow

```Hi to all.
This is bhaskar and it is my first post. I did the following.

I generated a 20kHz signal using sin function with 1sec duration sampled at 44.1kHz. I up sampled  the signal to 13 times and use pi/13 filter to remove the unwanted images in the signal using a low pass filter of pi/13 cutoff , 0.1pt  transition width and 120 db Astop, Finally I down sampled it to 12 times.

So now I want to measure the SNR in the output . Because it is a single tone signal(but critically sampled), I think we can calculate the signal power and rest of it we can treat it as noise and calculate the SNR.

But if I apply an N points fft,

how many points around 20kHz my signal got spread ?
how would I know  what is noise and what is signal?
whether I took average over signal or peak frame of N-points?
Is there any chance to  SNR got changed when I change my N- in fft?

Any suggestions on what I did or any methods or matlab code , any comments , anything all are welcome.

Regards

```
 0

See related articles to this posting

```"Bhaskar " <bhaskar.nallani@soctronics.com> wrote in message <hq6ta1\$a6o\$1@fred.mathworks.com>...
> Hi to all.
>             This is bhaskar and it is my first post. I did the following.
>
> I generated a 20kHz signal using sin function with 1sec duration sampled at 44.1kHz. I up sampled  the signal to 13 times and use pi/13 filter to remove the unwanted images in the signal using a low pass filter of pi/13 cutoff , 0.1pt  transition width and 120 db Astop, Finally I down sampled it to 12 times.
>
> So now I want to measure the SNR in the output . Because it is a single tone signal(but critically sampled), I think we can calculate the signal power and rest of it we can treat it as noise and calculate the SNR.
>
> But if I apply an N points fft,
>
> how many points around 20kHz my signal got spread ?
> how would I know  what is noise and what is signal?
> whether I took average over signal or peak frame of N-points?
> Is there any chance to  SNR got changed when I change my N- in fft?
>
> Any suggestions on what I did or any methods or matlab code , any comments , anything all are welcome.
>
>
> Regards
>
>

Hi Bhaskar,  It's always possible to give the appearance that you've affected the SNR by having your signal energy fall between DFT bins, I'm guessing that's your concern? Obviously that is just an artifact. I think the bigger concern in your situation is the impact of your filtering process in the sample rate conversion. I think if that is done correctly, you won't see any impact on the SNR. Here is an example (requires Signal Processing Toolbox):

Fs = 1000;
t = 0:1/Fs:1;
H = spectrum.periodogram('Hamming');
y = sin(2*pi*350*t);
y1 = resample(y,13,12);
HmssOrig = msspectrum(H,y,'NFFT',2048,'SpectrumType','onesided','Fs',Fs);
HmssResamp = msspectrum(H,y1, 'NFFT',2048,'SpectrumType','onesided',...
'Fs', (13/12)*Fs);

plot(HmssOrig)
hold on;
hp = plot(HmssResamp); set(hp,'color',[0 0 0])
axis([340 360 -10 5])
legend('Original','Resampled');

Hope that helps,
Wayne
```
 0
Reply Wayne 4/15/2010 1:05:08 PM

```Hi  Wayne King,
Thanking you for your quick reply. I will tryout this code.

But the multirate tool box (in fdatool) didn't have stop band attenuation option, as it takes  only L and M. As  for my observation the stopband attenuation is fixed to 60 db in that multirate filter tool box case. So how can I get more SNR in that case when L is going bigger and bigger, because the distributed power in stop band growing along L
(power in stopban pi/13>pi/3) . I mean the noise (signal in stopband I am calling it as noise)
power is going to be more and more, so I want the stopband attenuation more and more to achieve same SNR in case of pi/13 also as like pi/3.

Regards
```
 0
Reply Nallani 4/16/2010 4:00:22 AM

2 Replies
457 Views

Similar Articles

12/2/2013 4:10:41 PM
page loaded in 570297 ms -1