|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
Implementation of Butterworth filter design in the discrete domain. More...
#include <butterworth.hpp>
Implementation of Butterworth filter design in the discrete domain.
This header file provides a comprehensive implementation of Butterworth filters, including low-pass, high-pass, band-pass, and band-stop filters. The Butterworth filter is known for its maximally flat frequency response in the passband, making it ideal for applications requiring minimal signal distortion.
The implementation includes:
The design process includes pre-warping of frequencies for the bilinear transform, generation of prototype poles, and scaling of coefficients.
The following transforms map a lowpass prototype into other filter types (s-domain):




Where: 
After analog transformation, apply the bilinear transform:
constexpr, enabling compile-time computation of filter configurations.If results are suspicious, verify filter coefficients using external tools such as MATLAB or Python (e.g., SciPy).
To use this implementation, include this header file and instantiate the Butterworth class with the desired filter order, type, and parameters. Then, pass those coefficients into a DiscreteFilter.