A simple Python toolkit for designing, visualizing, and applying digital FIR/IIR filters.
- FIR/IIR filter design
- Signal filtering
- Frequency response visualization
- Time-domain signal plotting
pip install pyfilterlab
from pyfilterlab import design_fir, apply_filter, plot_response, plot_signal
---
Function | Description | Parameters | Returns |
---|---|---|---|
design_fir(num_taps, cutoff, fs, window='hamming') |
Designs a FIR low-pass filter using the window method. |
|
numpy.ndarray : FIR filter coefficients |
design_iir(order, cutoff, fs, ftype='butter') |
Designs an IIR low-pass filter. |
|
Tuple (b, a) : Numerator and denominator coefficients |
apply_filter(b, a, signal) |
Applies a filter to a signal using the filter coefficients. |
|
numpy.ndarray : Filtered signal |
plot_response(b, a=1, fs=1.0, title='Frequency Response') |
Plots the frequency response (gain vs frequency) of the filter. |
|
Displays a Matplotlib plot |
plot_signal(signal, fs=1.0, title='Signal') |
Plots a time-domain signal. |
|
Displays a Matplotlib plot |