use filtfilt with error of Not enough input arguments
이전 댓글 표시
Hi all: I used fdatool designed a bandpass filter 'bp521',to filter my signal 'SINGAL', the main contents of the filter are below:
function Hd = bp521
% All frequency values are in kHz.
Fs = 90; % Sampling Frequency
Fstop1 = 3.5; % First Stopband Frequency
Fpass1 = 5.5; % First Passband Frequency
Fpass2 = 21; % Second Passband Frequency
Fstop2 = 23; % Second Stopband Frequency
Dstop1 = 0.001; % First Stopband Attenuation
Dpass = 0.057501127785; % Passband Ripple
Dstop2 = 0.0001; % Second Stopband Attenuation
flag = 'scale'; % Sampling Flag
% Calculate the order from the parameters using KAISERORD.
[N,Wn,BETA,TYPE] = kaiserord([Fstop1 Fpass1 Fpass2 Fstop2]/(Fs/2), [0 ...
1 0], [Dstop1 Dpass Dstop2]);
% Calculate the coefficients using the FIR1 function.
b = fir1(N, Wn, TYPE, kaiser(N+1, BETA), flag);
Hd = dfilt.dffir(b);
I can use filter(bp521,SIGNAL), but when I want to use it by filtfilt, it always gave error: 'Not enough input arguments.', so I wonder why?? could there anyone help me with this?
Thank you in advance!
댓글 수: 1
Star Strider
2014년 7월 30일
Include your call to filtfilt in the code you post.
답변 (1개)
Honglei Chen
2014년 7월 30일
You can do the following:
bp521Coeff = coeffs(bp521);
filtfilt(bp521Coeff.Numerator,bp521Coeff.Denominator,SIGNAL)
댓글 수: 2
Miao
2014년 7월 30일
Honglei Chen
2014년 7월 30일
oh, it's an FIR, so you just do
filtfilt(bp521Coeff.Numerator,1,SIGNAL)
카테고리
도움말 센터 및 File Exchange에서 Digital Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!