filtfilt for filter.m ?

1 回表示 (過去 30 日間)
Abdul Rauf Anwar
Abdul Rauf Anwar 2012 年 3 月 6 日
Hi I am trying to implement a bandpass filter for EEG data like given below
H = fdesign.bandpass ('Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2',0.05,0.1,200,220,50,0.5,50,1000);
D = design(H,'kaiserwin'); % filter
fvtool(D) % filter's magnitude response
x=randn(1,100000);
y = filter(D,x);
xdft = fft(x);
ydft = fft(y);
subplot(221);semilogy(abs(xdft(1:length(x)/2+1)));
subplot(222);semilogy(abs(ydft(1:length(x)/2+1)));
subplot(223);plot(x);
subplot(224);plot(y);
It seems to work fine as i can see only my desired band of frequences in power spectrum but filtered time domain signal (y) seems to be overdamped for some startup time. I have looked for this problem and it looks like i should use filtfilt instead of filter, can someone guide me how to use filtfilt in above code. Thanks in Anticipation Regards

回答 (1 件)

Malcolm Lidierth
Malcolm Lidierth 2012 年 3 月 30 日
If you have R2011b+ (or a+?), using the standard filtfilt. If not, see http://www.mathworks.com/matlabcentral/fileexchange/17061-filtfilthd

カテゴリ

Help Center および File ExchangeEEG/MEG/ECoG についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by