MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
marvin::dsp::filters::rbj Namespace Reference

Implementations of Robert Brinstow Johnson's RBJ Cookbook formulae. More...

Functions

template<FloatType SampleType>
BiquadCoefficients< SampleType > lowpass (double sampleRate, SampleType cutoff, SampleType q) noexcept
 
template<FloatType SampleType>
BiquadCoefficients< SampleType > highpass (double sampleRate, SampleType cutoff, SampleType q) noexcept
 
template<FloatType SampleType>
BiquadCoefficients< SampleType > bandpass (double sampleRate, SampleType centreFrequency, SampleType bandwidth, SampleType peakGain) noexcept
 
template<FloatType SampleType>
BiquadCoefficients< SampleType > bandpass (double sampleRate, SampleType centreFrequency, SampleType bandwidth) noexcept
 
template<FloatType SampleType>
BiquadCoefficients< SampleType > notch (double sampleRate, SampleType centreFrequency, SampleType bandwidth) noexcept
 
template<FloatType SampleType>
BiquadCoefficients< SampleType > allpass (double sampleRate, SampleType cutoff, SampleType q) noexcept
 
template<FloatType SampleType>
BiquadCoefficients< SampleType > peak (double sampleRate, SampleType centreFrequency, SampleType bandwidth, SampleType dbGain) noexcept
 
template<FloatType SampleType>
BiquadCoefficients< SampleType > lowShelf (double sampleRate, SampleType centreFrequency, SampleType slope, SampleType dbGain) noexcept
 
template<FloatType SampleType>
BiquadCoefficients< SampleType > highShelf (double sampleRate, SampleType centreFrequency, SampleType slope, SampleType dbGain) noexcept
 

Detailed Description

Implementations of Robert Brinstow Johnson's RBJ Cookbook formulae.

Function Documentation

◆ allpass()

template<FloatType SampleType>
BiquadCoefficients< SampleType > marvin::dsp::filters::rbj::allpass ( double sampleRate,
SampleType cutoff,
SampleType q )
nodiscardnoexcept

An RBJ allpass implementation for use with the Biquad class, based on the formulae from the RBJ Cookbook (https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html)

Parameters
sampleRateThe sample rate to base the calculations off.
cutoffThe centre frequency of the allpass.
qThe resonance of the allpass (0 to 1).
Returns
An instance of BiquadCoefficients populated with the resulting coefficients.

◆ bandpass() [1/2]

template<FloatType SampleType>
BiquadCoefficients< SampleType > marvin::dsp::filters::rbj::bandpass ( double sampleRate,
SampleType centreFrequency,
SampleType bandwidth )
nodiscardnoexcept

A constant 0db peak-gain RBJ bandpass implementation for use with the Biquad class, based on the formulae from the RBJ Cookbook (https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html)

Parameters
sampleRateThe sample rate to base the calculations off.
centreFrequencyThe centre frequency of the bandpass.
bandwidthThe bandwidth of the bandpass in octaves.
Returns
An instance of BiquadCoefficients populated with the resulting coefficients.

◆ bandpass() [2/2]

template<FloatType SampleType>
BiquadCoefficients< SampleType > marvin::dsp::filters::rbj::bandpass ( double sampleRate,
SampleType centreFrequency,
SampleType bandwidth,
SampleType peakGain )
nodiscardnoexcept

A constant skirt-gain RBJ bandpass implementation for use with the Biquad class, based on the formulae from the RBJ Cookbook (https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html)

Parameters
sampleRateThe sample rate to base the calculations off.
centreFrequencyThe centre frequency of the bandpass.
peakGainThe peak gain of the bandpass (between 0 and 1)
Returns
An instance of BiquadCoefficients populated with the resulting coefficients.

◆ highpass()

template<FloatType SampleType>
BiquadCoefficients< SampleType > marvin::dsp::filters::rbj::highpass ( double sampleRate,
SampleType cutoff,
SampleType q )
nodiscardnoexcept

An RBJ highpass implementation for use with the Biquad class, based on the formulae from the RBJ Cookbook (https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html)

Parameters
sampleRateThe sample rate to base the calculations off.
cutoffThe frequency of the highpass
qThe resonance of the highpass (between 0 and 1)
Returns
An instance of BiquadCoefficients populated with the resulting coefficients.

◆ highShelf()

template<FloatType SampleType>
BiquadCoefficients< SampleType > marvin::dsp::filters::rbj::highShelf ( double sampleRate,
SampleType centreFrequency,
SampleType slope,
SampleType dbGain )
nodiscardnoexcept

An RBJ high shelf implementation for use with the Biquad class, based on the formulae from the RBJ Cookbook (https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html)

Parameters
sampleRateThe sample rate to base the calculations off.
centreFrequencyThe centre frequency of the shelf.
slopeThe slope of the shelf in db/octave. At slope=1, the shelf is as steep as it can be. Should be between std::numeric_limits<SampleType>::min(), and 1`.
dbGainThe gain of the shelf, in decibels.
Returns
An instance of BiquadCoefficients populated with the resulting coefficients.

◆ lowpass()

template<FloatType SampleType>
BiquadCoefficients< SampleType > marvin::dsp::filters::rbj::lowpass ( double sampleRate,
SampleType cutoff,
SampleType q )
nodiscardnoexcept

An RBJ lowpass implementation for use with the Biquad class, with formulae from the RBJ Cookbook

Parameters
sampleRateThe sample rate to base the calculations off.
cutoffThe frequency of the lowpass
qThe resonance of the lowpass(between 0 and 1)
Returns
An instance of BiquadCoefficients populated with the resulting coefficients.* /

◆ lowShelf()

template<FloatType SampleType>
BiquadCoefficients< SampleType > marvin::dsp::filters::rbj::lowShelf ( double sampleRate,
SampleType centreFrequency,
SampleType slope,
SampleType dbGain )
nodiscardnoexcept

An RBJ low shelf implementation for use with the Biquad class, based on the formulae from the RBJ Cookbook (https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html)

Parameters
sampleRateThe sample rate to base the calculations off.
centreFrequencyThe centre frequency of the shelf.
slopeThe slope of the shelf in db/octave. At slope=1, the shelf is as steep as it can be. Should be between std::numeric_limits<SampleType>::min(), and 1`.
dbGainThe gain of the shelf, in decibels.
Returns
An instance of BiquadCoefficients populated with the resulting coefficients.

◆ notch()

template<FloatType SampleType>
BiquadCoefficients< SampleType > marvin::dsp::filters::rbj::notch ( double sampleRate,
SampleType centreFrequency,
SampleType bandwidth )
nodiscardnoexcept

An RBJ notch implementation for use with the Biquad class, based on the formulae from the RBJ Cookbook (https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html)

Parameters
sampleRateThe sample rate to base the calculations off.
centreFrequencyThe centre frequency of the notch.
bandwidthThe bandwidth of the notch in octaves.
Returns
An instance of BiquadCoefficients populated with the resulting coefficients.

◆ peak()

template<FloatType SampleType>
BiquadCoefficients< SampleType > marvin::dsp::filters::rbj::peak ( double sampleRate,
SampleType centreFrequency,
SampleType bandwidth,
SampleType dbGain )
nodiscardnoexcept

An RBJ bell implementation for use with the Biquad class, based on the formulae from the RBJ Cookbook (https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html)

Parameters
sampleRateThe sample rate to base the calculations off.
centreFrequencyThe centre frequency of the bell.
bandwidthThe bandwidth of the bell in octaves.
dbGainThe gain of the bell, in decibels.
Returns
An instance of BiquadCoefficients populated with the resulting coefficients.