Iir::Biquad Class Reference
Inheritance diagram for Iir::Biquad:

## Public Member Functions

complex_t | response (double normalizedFrequency) const
std::vector< PoleZeroPair > | getPoleZeros () const
double | getA0 () const
double | getA1 () const
double | getA2 () const
double | getB0 () const
double | getB1 () const
double | getB2 () const
template<class StateType >
double | filter (double s, StateType &state) const
void | setCoefficients (double a0, double a1, double a2, double b0, double b1, double b2)
void | setOnePole (complex_t pole, complex_t zero)
void | setTwoPole (complex_t pole1, complex_t zero1, complex_t pole2, complex_t zero2)
void | setPoleZeroPair (const PoleZeroPair &pair)
void | setIdentity ()
void | applyScale (double scale)

## Member Function Documentation

## applyScale()

void Iir::Biquad::applyScale | ( | double | scale | ) |

Performs scaling operation on the FIR coefficients

Parameters

  scale | Mulitplies the coefficients b0,b1,b2 with the scaling factor scale.

## filter()

template<class StateType >

double Iir::Biquad::filter | ( | double | s,
|  | StateType & | state
| ) |  | const

inline

Filter a sample with the coefficients provided here and the State provided as an argument.

Parameters

  s | The sample to be filtered.
  state | The Delay lines (instance of a state from State.h)

Returns
  The filtered sample.

## getA0()

double Iir::Biquad::getA0 | ( |  | ) | const

inline

Returns 1st IIR coefficient (usually one)

## getA1()

double Iir::Biquad::getA1 | ( |  | ) | const

inline

Returns 2nd IIR coefficient

## getA2()

double Iir::Biquad::getA2 | ( |  | ) | const

inline

Returns 3rd IIR coefficient

## getB0()

double Iir::Biquad::getB0 | ( |  | ) | const

inline

Returns 1st FIR coefficient

## getB1()

double Iir::Biquad::getB1 | ( |  | ) | const

inline

Returns 2nd FIR coefficient

## getB2()

double Iir::Biquad::getB2 | ( |  | ) | const

inline

Returns 3rd FIR coefficient

## getPoleZeros()

std::vector< PoleZeroPair > Iir::Biquad::getPoleZeros | ( |  | ) | const

Returns the pole / zero Pairs as a vector.

## response()

complex_t Iir::Biquad::response | ( | double | normalizedFrequency | ) | const

Calculate filter response at the given normalized frequency and return the complex response.

Gets the frequency response of the Biquad

Parameters

  normalizedFrequency | Normalised frequency (0 to 0.5)

## setCoefficients()

void Iir::Biquad::setCoefficients | ( | double | a0,
|  | double | a1,
|  | double | a2,
|  | double | b0,
|  | double | b1,
|  | double | b2
| ) |  |

Sets all coefficients

Parameters

  a0 | 1st IIR coefficient
  a1 | 2nd IIR coefficient
  a2 | 3rd IIR coefficient
  b0 | 1st FIR coefficient
  b1 | 2nd FIR coefficient
  b2 | 3rd FIR coefficient

## setIdentity()

void Iir::Biquad::setIdentity | ( |  | ) |

Sets the coefficiens as pass through. (b0=1,a0=1, rest zero)

## setOnePole()

void Iir::Biquad::setOnePole | ( | complex_t | pole,
|  | complex_t | zero
| ) |  |

Sets one (real) pole and zero. Throws exception if imaginary components.

## setPoleZeroPair()

void Iir::Biquad::setPoleZeroPair | ( | const PoleZeroPair & | pair | ) |

inline

Sets a complex conjugate pair

## setTwoPole()

void Iir::Biquad::setTwoPole | ( | complex_t | pole1,
|  | complex_t | zero1,
|  | complex_t | pole2,
|  | complex_t | zero2
| ) |  |

Sets two poles/zoes as a pair. Needs to be complex conjugate.

The documentation for this class was generated from the following files:

- iir/Biquad.h
- iir/Biquad.cpp