How can I use the function fir1 and filtfilt together?
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I need to use function fir1 for a bandpass filter and then I need to add a Zero-phase digital filtering with filtfilt.
I write:
d= fir1(20, [0.42 0.64]) %It's a 20-th order FIR bandpass filter and 0.42 and 0.64 my cut-off frequencies
y2= filtfilt(d,y); %y is my signal
It not works for filtfilt and the error is: Not enough input arguments.
Probably I need to use also the sample rate fz but I don't know where.
NB I don't want to use the function designfilt.
Thank you for help
0 Commenti
Risposte (1)
Walter Roberson
il 20 Mar 2019
[b, a] = fir1(20, [0.42 0.64]);
y2 = filtfilt(B, A, y);
The two-output form of fir1 is not well documented. It turns out to always return 1 for a, so you could also use
d = fir1(20, [0.42 0.64]);
y2 = filtfilt(d, 1, y);
0 Commenti
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!