Introduction
openseize.filtering.fir
A collection of callable Finite Impulse Response filters.
This module contains three distint types of FIR Filters.
General Cosine window (GCW) FIRs
A filter design that allows for the specification of pass and stop bands but not attenuations. The amplitude response of the filter is determined by the window shape alone. The following table list the GCWs available:
- Rectangular
- Bartlett
- Hann
- Hamming
- Blackman
Kaiser Parameterized window FIR
A filter design with an additional parameter that specifies the window shape. These filters can be designed to meet to the strictest criteria in the pass and stop bands. This filter design is the recommended FIR type in Openseize.
Remez (Parks-McClellan) Optimal FIRs
A filter design that minimizes the difference between the amplitude response of a approximating Chebyshev filter from the desired amplitude response using the Chebyshev approximation. This filter is optimal in the sense that it yields the lowest number of coeffecients at the cost of instability. It supports multiple pass and stop bands.
Examples:
>>> # Design a lowpass Kaiser FIR with a passband edge at 500 Hz and
... # transition width of 100 Hz. It should have no more than 0.5 dB
... # ripple in the pass band and reach 40 dB attenuation in the stop
... # band
>>> kaiser = Kaiser(fpass=500, fstop=600, fs=5000, gpass=0.5, gstop=40)
>>> # print the filter to see its attributes
>>> print(kaiser)
>>> # plot the filter to see its design
>>> kaiser.plot()
>>> # apply the filter to a producer of ndarrays
>>> result = kaiser(pro, chunksize=10000, axis=-1, mode='same')