Closed dipterix closed 1 month ago
Hi,
Thanks. I am hesitant about this request because both the Octave and Matlab functions use filter
not fftfilt
. The function filtfilt
is is used for forward and reverse filtering, and although it supports FIR filters, it is actually not necessary in that case. Because FIR filters have a constant delay at each frequency (inspect via grpdelay
), you can easily do only forward filtering and correct for the delay. No reverse filtering is needed in that case. And of course you can either use filter
or fftfilt
as it suits you.
A simple example of correcting for the phase delay is shown in the vignette. You might want to extend that procedure by prepending the signal by the reflected initial number of samples equal to the filter order, and by computing the initial conditions to remove the DC offset.
Best, Geert
FIR
filter is super slow when used in filtfilt because it's calculated in time-domain. I wonder if it's possible to call fftfilter whenlength(a)==1
to speed up this process?