필터 지우기
필터 지우기

problem with filtering a signal

조회 수: 3 (최근 30일)
hossein
hossein 2013년 7월 8일
I wanna filter a signal by band-pass filter and the problem is when I exert the filter on my signal the output is so wrong.I try to exert the filter on a easy signal to test it: for example when I exert a band pass filter with 8-12 frequency range to the x=sin(2*pi*10*t)+sin(2*pi*20*t) the output must similar to sin(2*pi*10*t).but its not. I dont know where I am wrong?

답변 (2개)

Wayne King
Wayne King 2013년 7월 8일
Fs = 250;
t = 0:1/Fs:10-1/Fs;
x = sin(2*pi*10*t)+sin(2*pi*20*t)+0.25*randn(size(t));
y = sosfilt(SOS,x);
I used the following parameters in fdatool:
Fs = 250 fstop1 = 7 fpass1 = 9 fpass2 = 12 fstop2 = 14
60 dB of attenuation in both stopbands and 1 db of passband ripple.
  댓글 수: 1
hossein
hossein 2013년 7월 9일
so what about the gain of filter. the y has the amplitude by 10^4 times bigger than x here. you didn't use the filter's gain

댓글을 달려면 로그인하십시오.


Wayne King
Wayne King 2013년 7월 8일
편집: Wayne King 2013년 7월 8일
You need to post the code you have used to design your filter. Also, include the sampling rate for your data.
For example:
Fs = 100;
t = 0:1/Fs:10-1/Fs;
x = sin(2*pi*10*t)+sin(2*pi*20*t)+0.25*randn(size(t));
d = fdesign.bandpass('Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2',4,8,12,16,50,1,50,100);
Hd = design(d);
y = filter(Hd,x);
periodogram(y,[],length(y),100)
  댓글 수: 1
hossein
hossein 2013년 7월 8일
편집: hossein 2013년 7월 8일
I design the filter by fdatool by these specification:
chebyshef type 2; fs=250; fstop1=7;fpass1=9;fpass2=12;fstop2=13;
then I get the SOS and G matrixes then
[a,b]= sos2tf(SOS,G)
x= sin(2*pi*10*t)+sin(2*pi*20*t)
y=filtfilt(a,b,x) or y=filter(a,b,x)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by