computing SNR in matlab

조회 수: 1 (최근 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