dplug.dsp.iir

Basic IIR 1-pole and 2-pole filters through biquads.

Members

Aliases

BiquadCoeff
alias BiquadCoeff = float[5]

Type which hold the biquad coefficients. Important: Coefficients are considered always normalized by a0. Note: coeff[0] is b0, coeff[1] is b1, coeff[2] is b2, coeff[3] is a1, coeff[4] is a2 in the litterature.

Functions

allpassThiran1stOrder
BiquadCoeff allpassThiran1stOrder(double fractionalDelay)

Allpass interpolator. https://ccrma.stanford.edu/~jos/pasp/First_Order_Allpass_Interpolation.html http://users.spa.aalto.fi/vpv/publications/vesan_vaitos/ch3_pt3_allpass.pdf

It is recommended to use the range [0.5 .. 1.5] for best phase results. Also known as Thiran filter.

allpassThiran2ndOrder
BiquadCoeff allpassThiran2ndOrder(double fractionalDelay)

Same but 2nd order. http://users.spa.aalto.fi/vpv/publications/vesan_vaitos/ch3_pt3_allpass.pdf

biquadBypass
BiquadCoeff biquadBypass()

Identity biquad, pass signal unchanged.

biquadOnePoleHighPassImprecise
BiquadCoeff biquadOnePoleHighPassImprecise(double frequency, double samplerate)

1-pole high-pass filter, frequency mapping is not precise. Not accurate across sample rates, but coefficient computation is cheap. Not advised.

biquadOnePoleLowPassImprecise
BiquadCoeff biquadOnePoleLowPassImprecise(double frequency, double samplerate)

1-pole low-pass filter, frequency mapping is not precise. Not accurate across sample rates, but coefficient computation is cheap. Not advised.

biquadRBJBandPass
BiquadCoeff biquadRBJBandPass(double frequency, double samplerate, double Q)

Band-pass filter as described by Robert Bristow-Johnson.

biquadRBJHighPass
BiquadCoeff biquadRBJHighPass(double frequency, double samplerate, double Q)

High-pass filter 12 dB/oct as described by Robert Bristow-Johnson.

biquadRBJHighShelf
BiquadCoeff biquadRBJHighShelf(double frequency, double samplerate, double gain, double Q)

High-shelf filter as described by Robert Bristow-Johnson.

biquadRBJLowPass
BiquadCoeff biquadRBJLowPass(double frequency, double samplerate, double Q)

Low-pass filter 12 dB/oct as described by Robert Bristow-Johnson.

biquadRBJLowShelf
BiquadCoeff biquadRBJLowShelf(double frequency, double samplerate, double gain, double Q)

Low-shelf filter as described by Robert Bristow-Johnson.

biquadRBJNotch
BiquadCoeff biquadRBJNotch(double frequency, double samplerate, double Q)

Notch filter as described by Robert Bristow-Johnson.

biquadRBJPeak
BiquadCoeff biquadRBJPeak(double frequency, double samplerate, double gain, double Q)

Peak filter as described by Robert Bristow-Johnson.

biquadZero
BiquadCoeff biquadZero()

Zero biquad, gives zero output.

Structs

BiquadDelay
struct BiquadDelay

Maintain state for a biquad state. To use an IIR filter you need an IIRDelay + one IIRCoeff.

Meta

Authors

Guillaume Piolat