biz.source_code.dsp.filter

## Class BesselFilterDesign

• ```public class BesselFilterDesign
extends Object```
Bessel filter design routines.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static double` ```computeGain(double[] polyCoeffs, double w)```
Computes the normalized gain of a Bessel filter at a given frequency.
`static Complex[]` `computePoles(int n)`
Returns the frequency normalized s-plane poles for a Bessel filter.
`static double[]` `computePolynomialCoefficients(int n)`
Returns the polynomial coefficients for the Bessel polynomial of the given order.
`static double` ```findFrequencyForGain(double[] polyCoeffs, double gain)```
This method uses appoximation to find the frequency for a given gain.
`static double` `findFrequencyScalingFactor(double[] polyCoeffs)`
Returns the frequency normalization scaling factor for a Bessel filter.
`static Complex` ```transferFunction(double[] polyCoeffs, Complex s)```
Evaluates the transfer function of a Bessel filter.
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Method Detail

• #### computePolynomialCoefficients

`public static double[] computePolynomialCoefficients(int n)`
Returns the polynomial coefficients for the Bessel polynomial of the given order.

Reference: Wikipedia.

Parameters:
`n` - The order of the polynomial.
Returns:
An array `a[]` with the coefficients, ordered in descending powers, for: ` a * x^n + a * x^(n-1) + ... a[n-1] * x + a[n] `
• #### transferFunction

```public static Complex transferFunction(double[] polyCoeffs,
Complex s)```
Evaluates the transfer function of a Bessel filter. The gain is normalized to 1 for DC.
Parameters:
`polyCoeffs` - Coefficients of the reverse Bessel polynomial.
`s` - Complex frequency.
Returns:
A complex number that corresponds to the gain and phase of the filter output.
• #### computeGain

```public static double computeGain(double[] polyCoeffs,
double w)```
Computes the normalized gain of a Bessel filter at a given frequency.
Parameters:
`polyCoeffs` - Coefficients of the reverse Bessel polynomial.
`w` - Relative frequency.
Returns:
The normalized gain.
• #### findFrequencyForGain

```public static double findFrequencyForGain(double[] polyCoeffs,
double gain)```
This method uses appoximation to find the frequency for a given gain. It is used to find the 3dB cutoff frequency, which is then used as the scaling factor for the frequency normalization of the filter.

If anyone knows a better way than approximation to find the 3dB cuttoff frequency, please let me know (chdh@inventec.ch).

Parameters:
`polyCoeffs` - Coefficients of the reverse Bessel polynomial.
`gain` - A normalized gain.
Returns:
The relative frequency.
• #### findFrequencyScalingFactor

`public static double findFrequencyScalingFactor(double[] polyCoeffs)`
Returns the frequency normalization scaling factor for a Bessel filter. This factor is used to normalize the filter coefficients so that the gain at the relative frequency 1 is -3dB. (To be exact, we use 1/sqrt(2) instead of -3dB).
Parameters:
`polyCoeffs` - Coefficients of the reverse Bessel polynomial.
Returns:
The frequency normalization scaling factor.
• #### computePoles

`public static Complex[] computePoles(int n)`
Returns the frequency normalized s-plane poles for a Bessel filter.
Parameters:
`n` - The filter order.
Returns:
The complex poles of the filter,