dplug.dsp.iir

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

Members

Aliases

BiquadCoeff
alias BiquadCoeff = double[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

biquadBesselLowPass
BiquadCoeff biquadBesselLowPass(double frequency, double sampleRate)

Bessel 2-pole lowpass.

biquadBypass
BiquadCoeff biquadBypass()

Identity biquad, pass signal unchanged.

biquadOnePoleHighPass
BiquadCoeff biquadOnePoleHighPass(double frequency, double sampleRate)

1-pole high-pass filter. Note: Like the corresponding one-pole lowpass, this is normalized for DC. The cutoff frequency can be <= 0 Hz, in which case it is a bypass. Going in very high frequency does NOT give zero. You always have -3 dB at cutoff in the valid range.

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.

biquadOnePoleLowPass
BiquadCoeff biquadOnePoleLowPass(double frequency, double sampleRate)

1-pole low-pass filter. Note: the cutoff frequency can be >= nyquist, in which case it asymptotically approaches a bypass. the cutoff frequency can be below 0 Hz, in which case it is equal to zero. This filter is normalized on DC. You always have -3 dB at cutoff in the valid range.

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.

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

2nd order All-pass filter as described by Robert Bristow-Johnson. This is helpful to introduce the exact same phase response as the RBJ low-pass, but doesn't affect magnitude.

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. A biquad is a realization that can model two poles and two zeros.

Meta