# Bessel filter

In electronics and signal processing, a Bessel filter is a type of analog linear filter with a maximally flat group delay (i.e., maximally linear phase response), which preserves the wave shape of filtered signals in the passband. Bessel filters are often used in audio crossover systems.
The filter's name is a reference to German mathematician Friedrich Bessel (1784–1846), who developed the mathematical theory on which the filter is based. The filters are also called Bessel–Thomson filters in recognition of W. E. Thomson, who worked out how to apply Bessel functions to filter design in 1949.
The Bessel filter is very similar to the Gaussian filter, and tends towards the same shape as filter order increases. While the time-domain step response of the Gaussian filter has zero overshoot, the Bessel filter has a small amount of overshoot, but still much less than other common frequency-domain filters, such as Butterworth filters. It has been noted that the impulse response of Bessel–Thomson filters tends towards a Gaussian as the order of the filter is increased.
Compared to finite-order approximations of the Gaussian filter, the Bessel filter has a slightly better shaping factor (i.e., how well a particular filter approximates the ideal lowpass response), flatter phase delay, and flatter group delay than a Gaussian filter of the same order, although the Gaussian has lower time delay and zero overshoot.

## The transfer function

A Bessel low-pass filter is characterized by its transfer function:
    $H(s)={\frac {\theta _{n}(0)}{\theta _{n}(s/\omega _{0})}}\,$
where $\theta _{n}(s)$ is a reverse Bessel polynomial from which the filter gets its name and $\omega _{0}$ is a frequency chosen to give the desired cut-off frequency. The filter has a low-frequency group delay of $1/\omega _{0}$. Since $\theta _{n}(0)$ is indeterminate by the definition of reverse Bessel polynomials, but is a removable singularity, it is defined that $\theta _{n}(0)=\lim _{x\rightarrow 0}\theta _{n}(x)$.

## Bessel polynomials

The transfer function of the Bessel filter is a rational function whose denominator is a reverse Bessel polynomial, such as the following:
    $n=1:\quad s+1$
    $n=2:\quad s^{2}+3s+3$
    $n=3:\quad s^{3}+6s^{2}+15s+15$
    $n=4:\quad s^{4}+10s^{3}+45s^{2}+105s+105$
    $n=5:\quad s^{5}+15s^{4}+105s^{3}+420s^{2}+945s+945$
The reverse Bessel polynomials are given by:
    $\theta _{n}(s)=\sum _{k=0}^{n}a_{k}s^{k},$
where
    $a_{k}={\frac {(2n-k)!}{2^{n-k}k!(n-k)!}}\quad k=0,1,\ldots ,n.$

## Setting the cutoff attenuation

There is no standard set attenuation value for Bessel filters. However, −3.0103 dB is a common choice. Some applications may use a higher or lower attenuation such as −1 dB or −20 dB. Setting the cut-off attenuation frequency involves first finding the frequency that achieves the desired attenuation, which will be referred to as $\omega _{c}$, and then scaling the $H(s)$ polynomials to the inverse of that frequency. To scale the polynomials, simply append $\omega _{c}$ to the $s$ term in each coefficient, as shown in the 3 pole Bessel filter example below.
${\begin{aligned}H(s)&={\frac {15}{s^{3}+6s^{2}+15s+15}}\\H(s)'&=H(s)_{{\text{desired dB at }}\omega =1}={\frac {15}{(\omega _{c}s)^{3}+6(\omega _{c}s)^{2}+15\omega _{c}s+15}}\\\end{aligned}}$
$\omega _{c}$ may be found with Newton's method, or with root finding.

### Finding attenuation frequency with Newton's method

Newton's method requires a known magnitude value and derivative magnitude value for the for $|H(j\omega _{c})|$. However, it is easier to operate on $|H(j\omega _{c})H(-j\omega _{c})|$ and use the square of the desired cutoff gain, and is just as accurate, so the square terms will be used.
To obtain $\omega _{c}$, follow the steps below.
* If $H(s)H(-s)$ is not already available, multiply $H(s)$ by $H(-s)$ to obtain $H(s)H(-s)$.
* negate all terms of $s^{n}$ when $(n+2)$ is divisible by $4$. That would be $s^{2}$, $s^{6}$, $s^{10}$, and so on. The modified function will be called $H_{2}(s)H_{2}(-s)$, and this modification will allow the use of real numbers instead of complex numbers when evaluating the polynomial and its derivative. the real $\omega _{a}$can now be used in place of the complex $j\omega _{a}$
* Convert the desired attenuation in dB, $A_{dB}$, to a squared arithmetic gain value, $B_{arith}^{2}$, by using $B_{arith}^{2}=10^{A_{dB}/10}$. For example, 3.010 dB converts to 0.5, 1 dB converts to 0.79432823 and so on.
* Calculate the modified $|H_{2}(s)H_{2}(-s)|$ in Newton's method using the real value, $\omega _{a}$. Always take the absolute value.
* Calculate the derivative the modified $H_{2}(\omega _{a})H_{2}(-\omega _{a})$ with respect to the real value, $\omega _{a}$. DO NOT take the absolute value of the derivative.
When steps 1) through 4) are complete, the expression involving Newton's method may be written as:
$\omega _{a}=\omega _{a}-(|H_{2}(\omega _{a})H_{2}(-\omega _{a})|-B^{2})/(d[H_{2}(\omega _{a})H_{2}(-\omega _{a})]/d\omega _{a})$
using a real value for $\omega _{a}$with no complex arithmetic needed. The movement of $\omega _{a}$ should be limited to prevent it from going negative early in the iterations for increased reliability. When complete, $\omega _{a}$ can used for the $\omega _{c}$ that can be used to scale the original $H(s)$ transfer function denominator. The attenuation of the modified $G(s)$ will then be virtually the exact desired value at 1 rad/sec. If performed properly, only a handful of iterations are needed to set the attenuation through a wide range of desired attenuation values for both small and very large order filters.

### Finding attenuation frequency from the roots

Since $|H(j\omega _{a})|$ does not contain any phase information, directly factoring the transfer function will not produce usable results. However, the transfer function may be modified by multiplying it with $H(-s)$ to eliminate all odd powers of $H(j\omega _{a})$, which in turn forces $H(j\omega _{a})$ to be real at all frequencies, and then finding the frequency that result on the square of the desired attention.
* If $H(s)H(-s)$ is not already available, multiply $H(s)$ by $H(-s)$ to obtain $H(s)H(-s)$.
* Convert the desired attenuation in dB, $A_{dB}$, to a squared arithmetic gain value, $B_{arith}^{2}$, by using $B_{arith}^{2}=10^{A_{dB}/10}$. For example, 3.010 dB converts to 0.5, 1 dB converts to 0.79432823 and so on.
* Find $P(S)=H_{num}(S)H_{num}(-S)-B_{arith}^{2}H_{den}(S)H_{den}(-S)$
* Find the roots of P(S) using a root finding algorithm.
* Of the set of roots from above, select the positive imaginary root for odd order filters, and positive real root for even order filters.
** Cutoff attenuations that are above the pass band ripple or below the stop band ripple will come back with multiple roots, so the correct root will have to be selected.

### Simple cut-off frequency example with root finding

A 20-dB cut-off frequency attenuation example using the 3-pole Bessel example below is set as follows.
${\begin{aligned}&H(s)={\frac {15}{s^{3}+6s^{2}+15s+15}}{\text{ (from the example below)}}\\&B_{arith}^{2}=10^{20/10}=0.01{\text{ (the arithmetic gain squared)}}\\&\\&{\text{Find }}H(s)'{\text{ such that }}|H(s)'|=-20{\text{ dB at }}\omega =1{\text{.}}\\&H(s)H(-s)={\frac {225}{-s^{6}+6s^{4}-45^{2}s+225}}\\&P(s)=225-B_{arith}^{2}(-s^{6}+6s^{4}-45^{2}s+225)=0.01s^{6}-0.06s^{4}+0.45s^{2}+222.75{\text{ (polynomial to be factored)}}\\&R=j5.0771344{\text{ (the positive imaginary root for the above polynomial)}}\\&{\text{For even order filters, use the positive real root.}}\\&\\&\omega _{-20{\text{ dB atten}}}=\omega _{c}=5.0771344{\text{ rad/sec (20 dB attenuation frequency)}}\\&H(s)'=H(s)_{A=20{\text{ dB at }}\omega =1}={\frac {15}{(5.0771344^{3})s^{3}+(6\times 5.0771344^{2})s^{2}+(15\times 5.0771344)s+15}}\\&={\frac {15}{130.87478s^{3}+154.66376s^{2}+76.157016s+15}}\\&\\&{\text{Check:}}\\&|H(j)'|={\bigg |}{\frac {15}{130.87478j^{3}+154.66376j^{2}+76.157016j+15}}{\bigg |}=0.1=-20{\text{ dB Gain}}\end{aligned}}$

## Example

The transfer function for a third-order (three-pole) Bessel low-pass filter with $\omega _{0}=1$ is
    $H(s)={\frac {15}{s^{3}+6s^{2}+15s+15}},$
where the numerator has been chosen to give unity gain at zero frequency ($s=0$).The roots of the denominator polynomial, the filter's poles, include a real pole at $s=-2.3222$, and a complex-conjugate pair of poles at $s=-1.8389\pm j1.7544$, plotted above.
The gain is then
    $G(\omega )=|H(j\omega )|={\frac {15}{\sqrt {\omega ^{6}+6\omega ^{4}+45\omega ^{2}+225}}}.\,$
The −3-dB point, where $|H(j\omega )|={\frac {1}{\sqrt {2}}},\,$ occurs at $\omega =1.756$. This is conventionally called the cut-off frequency.
The phase is
    $\phi (\omega )=-\arg(H(j\omega ))=\arctan \left({\frac {15\omega -\omega ^{3}}{15-6\omega ^{2}}}\right).\,$
The group delay is
    $D(\omega )=-{\frac {d\phi }{d\omega }}={\frac {6\omega ^{4}+45\omega ^{2}+225}{\omega ^{6}+6\omega ^{4}+45\omega ^{2}+225}}.\,$
The Taylor series expansion of the group delay is
    $D(\omega )=1-{\frac {\omega ^{6}}{225}}+{\frac {\omega ^{8}}{1125}}+\cdots .$
Note that the two terms in $\omega ^{2}$ and $\omega ^{4}$ are zero, resulting in a very flat group delay at $\omega =0$. This is the greatest number of terms that can be set to zero, since there are a total of four coefficients in the third-order Bessel polynomial, requiring four equations in order to be defined. One equation specifies that the gain be unity at $\omega =0$ and a second specifies that the gain be zero at $\omega =\infty$, leaving two equations to specify two terms in the series expansion to be zero. This is a general property of the group delay for a Bessel filter of order $n$: the first $n-1$ terms in the series expansion of the group delay will be zero, thus maximizing the flatness of the group delay at $\omega =0$.

## Digital

Although the bilinear transform is used to convert continuous-time (analog) filters to discrete-time (digital) infinite impulse response (IIR) filters with comparable frequency response, IIR filters obtained by the bilinear transformation do not have constant group delay. Since the important characteristic of a Bessel filter is its maximally-flat group delay, the bilinear transform is inappropriate for converting an analog Bessel filter into a digital form.
The digital equivalent is the Thiran filter, also an all-pole low-pass filter with maximally-flat group delay, which can also be transformed into an allpass filter, to implement fractional delays.