use filtfilt with error of Not enough input arguments
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Risposte (1)
Honglei Chen
il 30 Lug 2014
You can do the following:
bp521Coeff = coeffs(bp521);
filtfilt(bp521Coeff.Numerator,bp521Coeff.Denominator,SIGNAL)
2 Commenti
Honglei Chen
il 30 Lug 2014
oh, it's an FIR, so you just do
filtfilt(bp521Coeff.Numerator,1,SIGNAL)
Vedere anche
Categorie
Scopri di più su Digital Filtering in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!