use filtfilt with error of Not enough input arguments

13 vues (au cours des 30 derniers jours)
Miao
Miao le 30 Juil 2014
Commenté : Honglei Chen le 30 Juil 2014
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 commentaire
Star Strider
Star Strider le 30 Juil 2014
Include your call to filtfilt in the code you post.

Connectez-vous pour commenter.

Réponses (1)

Honglei Chen
Honglei Chen le 30 Juil 2014
You can do the following:
bp521Coeff = coeffs(bp521);
filtfilt(bp521Coeff.Numerator,bp521Coeff.Denominator,SIGNAL)
  2 commentaires
Miao
Miao le 30 Juil 2014
Thank you very much for your help, I tried, the bp521Coeff is a 1*1 struct, but there are nothing in bp521Coeff.Denominator?
Honglei Chen
Honglei Chen le 30 Juil 2014
oh, it's an FIR, so you just do
filtfilt(bp521Coeff.Numerator,1,SIGNAL)

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by