Digital low-pass filter coefficients

dsp
Author

TychoJ

Published

December 8, 2024

The bilinear transform (BLT) maps poles and zero’s of an analog system to the digital domain. This makes it possible to implement an analog system such as a filter on a digital system, for example on a microcontroller or an fpga.

Pole locations of an nth order analog filter

Using the BLT it is possible to design digital filters that have the same characteristic’s as “standard” analog filters. To make use of the BLT the poles and zero’s of the analog filter must be calculated (it is also possible to look them up in a filter book).

The poles of an analog low-pass Chebyshev filter can be calculated based on three specifications:

  • \omega_c is 2\pi f_c where f_c is the cutoff frequency;
  • n, is the order of the filter;
  • R_{dB}, is the allowed ripple in the passband in dB.

With equation 1 the ripple factor \epsilon of the Chebyshev filter can be calculated. The ripple factor \epsilon can then be used to calculate the intermediate value of variable A with equation 2. \epsilon=\sqrt{10^{\frac{R_{dB}}{10}}-1} \tag{1} A=\frac{1}{n}\sinh^{-1}\left(\frac{1}{\epsilon}\right) \tag{2} To finally calculate the pole locations equation equation 3 can be used where k is the kth pole of the system. p_k=\omega_c\left[-\sinh\left(A\right)\sin\left(\frac{\left(2k-1\right)\pi}{2n}\right)+j\cosh\left(A\right)\cos\left(\frac{\left(2k-1\right)\pi}{2n}\right)\right] \tag{3}

The transfer function of an nth order low-pass filter can be calculated with equation equation 4. Incase of a third order low-pass filter this will result in equation equation 5. H_A\left(s\right)=\prod^n_{k=1}\frac{1}{\left(1-\frac{s}{p_k}\right)} \tag{4} H_A\left(s\right)=\frac{p_1p_2p_3}{-s^3+\left(p_1+p_2+p_3\right)s^2-\left(p_1p_2+p_1p_3+p_2p_3\right)s+p_1p_2p_3} \tag{5}

The bilinear transfer

The BLT maps the analog poles and zero’s to the digital domain using the approximation as shown in equation equation 6. The digital transfer function can thus be calculated with equation equation 7. s\approx\frac{2}{T}\frac{z-1}{z+1} \tag{6} H_D\left(z\right)=H_A\left(\frac{2}{T}\frac{z-1}{z+1}\right)=\prod^n_{k=1}\frac{1}{\left(1-\frac{2z-2}{Tp_kz+Tp_k}\right)} \tag{7}

Equation 7 can be rewritten to make it easier to find all the poles and zero’s of the digital transfer function, this is shown in equation 8. From equation 8 it follows that the poles of the digital transfer function are all located at 1+0j while the pole locations can be calculated with equation 9. H_D\left(z\right)=\prod^n_{k=1}\frac{Tp_k\left(z+1\right)}{\left(Tp_k-2\right)z+Tp_k+2} \tag{8} p_{D_k}=\frac{-Tp_k-2}{Tp_k-2} \tag{9}

The filter coefficients needed to implement the digital filter can be found by expanding equation 9, the resulting equation will have the form of equation 10. H_D(z)=\frac{b_nz^n+b_{n-1}z^{n-1}+\cdots+b_0z^0}{a_nz^n+a_{n-1}z^{n-1}+\cdots+a_0z^0} \tag{10}

It is possible to show algebraically that the filter coefficients of a third order low-pass filter can be calculated with equations equation 11. For filters that have a higher order then 2, it is recommended to use a cas program such as wxMaxima. \begin{align} b_0{}&=b_3=T^3p_1p_2p_3\\ b_1{}&=b_2=3T^3p_1p_2p_3\\ a_0{}&= T(p_1+2)(p_2+2)(p_3+2)\\ a_1{}&=3T^3p_1p_2p_3+2T^2\left(p_1p_2+p_2p_3+p_1p_3\right)-4T\left(p_1+p_2+p_3\right)-24\\ a_2{}&=3T^3p_1p_2p_3-2T^2\left(p_1p_2+p_2p_3+p_1p_3\right)-4T\left(p_1+p_2+p_3\right)+24\\ a_3{}&= T(p_1-2)(p_2-2)(p_3-2) \end{align} \tag{11}