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!

Respuestas (1)

You can do the following:
bp521Coeff = coeffs(bp521);
filtfilt(bp521Coeff.Numerator,bp521Coeff.Denominator,SIGNAL)

2 comentarios

Miao
Miao el 30 de Jul. de 2014
Thank you very much for your help, I tried, the bp521Coeff is a 1*1 struct, but there are nothing in bp521Coeff.Denominator?
oh, it's an FIR, so you just do
filtfilt(bp521Coeff.Numerator,1,SIGNAL)

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 30 de Jul. de 2014

Comentada:

el 30 de Jul. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by