.. _iirdes-butter: Butterworth IIR Filter Design ============================= :api:`LIQUID_IIRDES_BUTTER` is a Butterworth filter. This is an all-pole analog design that has a maximally flat magnitude response in the pass-band. The analog prototype interface is :api:`butter_azpkf()` which computes the :math:`n` complex roots :math:`p_{a0},p_{a1},\ldots,p_{an-1}` of the :math:`n^{th}`-order Butterworth polynomial, .. math:: p_{ak} = \omega_c \exp\left\{ j \frac{\left(2k+n+1\right)\pi}{2n} \right\} :label: eqn-filter-iirdes-butter for :math:`k=0,1,\ldots,n-1`. Note that this results in a set of complex conjugate pairs such that :math:`(-1)^n s_0 s_1 \cdots s_{n-1} = 1`. An example Butterworth design can be seen in the code listing here: .. code-block:: c #include int main() { return 0; } An example of a digital Butterworth filter response can be found in the figure, below for an order 3: .. qplot:: iirdes iirdes/iirdes.c :args: -t butter -n 7 :width: 100% :name: fig-iirdes-butter-0 :caption: Butterworth filter design, :math:`n=7`, :math:`f_c=0.2 F_s` Notice how the performance changes as the order increases to 15: .. qplot:: iirdes iirdes/iirdes.c :args: -t butter -n 15 :width: 100% :name: fig-iirdes-butter-1 :caption: Butterworth filter design, :math:`n=15`, :math:`f_c=0.1 F_s` Notice how the poles change when the cutoff frequency drops to :math:`0.1 F_s`: .. qplot:: iirdes iirdes/iirdes.c :args: -t butter -n 15 -f 0.1 :width: 100% :name: fig-iirdes-butter-2 :caption: Butterworth filter design, :math:`n=15`, :math:`f_c=0.1 F_s`