Step-by-Step Derivation of IIR Butterworth Low-Pass Filter
- reference:
scipy.signal.butter
,Mathnet.Filtering.Butterworth
- reading: https://blog.csdn.net/zengxy3407/article/details/132035202
- reading: https://blog.csdn.net/u013600306/article/details/142703250
How to design a Butterworth filter?
You can design 5 types of Butterworth filters, that are, high-pass, low-pass, band-pass, band-stop, and notch filters, with pass-band frequency and stop-band frequency , pass-band ripple (maximum loss in the pass-band) and stop-band attenuation (minimum attenuation in the stop-band) .
Given these parameters, you can then obtain the order of the filter and the critical frequency .
Higher order filters have sharper cutoffs. Critical frequency is the frequency at which the gain of the filter drops to (-3 dB).
How to obtain the numerator and denominator coefficients of the transfer function?
(Note that and are different from major resources, where is the denominator and is the numerator.)
Let's assume is the numerator and is the denominator, the transfer function of the filter is given by:
where is the complex frequency variable.
What is a transfer function?
A transfer function is a mathematical representation of the relationship between the input and output of a linear time-invariant (LTI) system in the frequency domain.
For example, the differential equation of a first-order low-pass Butterworth filter is given by:
where is the input signal, is the output signal.
What is a differential equation?
A differential equation is an equation that describes the relationship between the input and output of a system in the time domain.
The poles is the set of values of that make the denominator equal to zero, and the zeros is the set of values of that make the numerator equal to zero.
Given the order of the filter , the poles can be calculated as follows:
The transfer function can then be expressed as:
The relationship between the analog signal and the digital signal can be established using the bilinear transform, which maps the analog frequency to the digital frequency :
where is the sampling period.
The bilinear transform introduces frequency warping. Prewarping is often applied to correct the cutoff frequency:
The transfer function in the digital domain can then be expressed as:
Example: First-Order Butterworth Filter
First compute analog Transfer Function:
Given bilinear Transform (with prewarping):
Then compute digital Transfer Function:
But results do not match the scipy.signal.butter
's.