How to apply a FIR filter¶
Filter initialization (window method)¶
1 2 3 4 5 6 7 8 9 |
|
You can pass your own coefficients to filter_fir
constructor or use another method to calculate coefficients for the filter.
Use apply
function to apply the filter to audio.
All the internal state (delay line etc) is preserved between calls to apply. Use reset
to reset filter internal state.
Note
Note that for high pass FIR filter the number of taps must be odd. FIR filters with even number of taps (Type II filters) always have a zero at z=−1 (Nyquist frequency) and can't be used as high pass filters which require 1 at the Nyquist frequency.
How to apply a FIR filter to a plain array (inplace)¶
1 2 |
|
... to a plain array¶
1 2 3 4 |
|
... using a pointer and size (inplace)¶
1 2 3 |
|
... using two pointers and size¶
1 2 3 4 5 |
|
... to univector
(inplace)¶
1 2 |
|
... to univector
¶
1 2 3 |
|
.. to expression¶
1 2 3 |
|
convolve_filter is numerically equal to FIR filter but uses DFT internally for better performance.
See also Filter class definition
See also a gallery with results of applying various FIR filters