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);}

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDigital Filter Design についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by