computing SNR in matlab

3 次查看(过去 30 天)
Bahareh
Bahareh 2012-1-7
Hello all,
I have a noisy sinisoid signal and would like to compute its SNR in MATLAB. Can anybody help me? Thanks.

回答(1 个)

Rick Rosson
Rick Rosson 2012-1-7
  1. What is the amplitude of the sine wave?
  2. Is the noise additive white Gaussian or some other type? If Gaussian, what is the mean and standard deviation?
  1 个评论
Bahareh
Bahareh 2012-1-7
Here is my code. I actually want to find the SNR of my output filter 'yf'. I was wondering if you could please help me.
{
dt = 1/5e4;fs=1/dt;
t1=cos(2*pi*1e3*(0:dt:6e-3));
t2=cos(2*pi*2e3*(0:dt:6e-3));
t3=cos(2*pi*3.5e3*(0:dt:6e-3));
t4=3*cos(2*pi*20e3*(linspace(2e-3,2.1e-3,length(t3))));
x=t1+t2+t3+t4;
y=awgn(x,10,'measured');
wpass=2*1e4/fs; wstop=2*2e4/fs; %normalized passband & stopband frequencies
[N,wn]=buttord(wpass,wstop,1,50); %Rpass=1dB & Rstop=50dB
[B A]=butter(N,wn); % use butter to obtain an IIR filter of Butterworth type
yf=filtfilt(B,A,y);}

请先登录,再进行评论。

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by