ASPiK SDK
Loading...
Searching...
No Matches
Biquad Class Reference

The Biquad object implements a first or second order H(z) transfer function using one of four standard structures: Direct, Canonical, Transpose Direct, Transpose Canonical. More...

#include <fxobjects.h>

Inheritance diagram for Biquad:
IAudioSignalProcessor

Public Member Functions

virtual bool reset (double _sampleRate)
 
virtual bool canProcessAudioFrame ()
 
virtual double processAudioSample (double xn)
 process one sample through the biquad
 
BiquadParameters getParameters ()
 
void setParameters (const BiquadParameters &_parameters)
 
void setCoefficients (double *coeffs)
 
double * getCoefficients ()
 
double * getStateArray ()
 
double getG_value ()
 
double getS_value ()
 returns the storage component S(n) for delay-free loop solutions
 
- Public Member Functions inherited from IAudioSignalProcessor
virtual bool reset (double _sampleRate)=0
 
virtual double processAudioSample (double xn)=0
 
virtual bool canProcessAudioFrame ()=0
 
virtual void setSampleRate (double _sampleRate)
 
virtual void enableAuxInput (bool enableAuxInput)
 
virtual double processAuxInputAudioSample (double xn)
 
virtual bool processAudioFrame (const float *inputFrame, float *outputFrame, uint32_t inputChannels, uint32_t outputChannels)
 

Protected Attributes

double coeffArray [numCoeffs] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
 
double stateArray [numStates] = { 0.0, 0.0, 0.0, 0.0 }
 
BiquadParameters parameters
 
double storageComponent = 0.0
 

Detailed Description

The Biquad object implements a first or second order H(z) transfer function using one of four standard structures: Direct, Canonical, Transpose Direct, Transpose Canonical.

Audio I/O:

  • Processes mono input to mono output.

Control I/F:

Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included in Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2018 / 09 / 7

Member Function Documentation

◆ canProcessAudioFrame()

virtual bool Biquad::canProcessAudioFrame ( )
inlinevirtual

return false: this object only processes samples

Implements IAudioSignalProcessor.

◆ getCoefficients()

double * Biquad::getCoefficients ( )
inline

get the coefficient array for read/write access to the array (not used in current objects)

◆ getG_value()

double Biquad::getG_value ( )
inline

get the structure G (gain) value for Harma filters; see 2nd Ed FX book

◆ getParameters()

BiquadParameters Biquad::getParameters ( )
inline

get parameters: note use of custom structure for passing param data

Returns
BiquadParameters custom data structure

◆ getS_value()

double Biquad::getS_value ( )

returns the storage component S(n) for delay-free loop solutions

get the structure S (storage) value for Harma filters; see 2nd Ed FX book

  • NOTES:
    the storageComponent or "S" value is used for Zavalishin's VA filters as well as the phaser APFs (Biquad) and is only available on two of the forms: direct and transposed canonical
    Returns
    the storage component of the filter

◆ getStateArray()

double * Biquad::getStateArray ( )
inline

get the state array for read/write access to the array (used only in direct form oscillator)

◆ processAudioSample()

double Biquad::processAudioSample ( double  xn)
virtual

process one sample through the biquad

process input x(n) through biquad to produce return value y(n)

Parameters
xninput
Returns
the processed sample
  • RULES:
    1) do all math required to form the output y(n), reading registers as required - do NOT write registers
    2) check for underflow, which can happen with feedback structures
    3) lastly, update the states of the z^-1 registers in the state array just before returning
  • NOTES:
    the storageComponent or "S" value is used for Zavalishin's VA filters and is only available on two of the forms: direct and transposed canonical
    Parameters
    xnthe input sample x(n)
    Returns
    the biquad processed output y(n)

Implements IAudioSignalProcessor.

◆ reset()

virtual bool Biquad::reset ( double  _sampleRate)
inlinevirtual

reset: clear out the state array (flush delays); can safely ignore sampleRate argument - we don't need/use it

Implements IAudioSignalProcessor.

◆ setCoefficients()

void Biquad::setCoefficients ( double *  coeffs)
inline

set the coefficient array NOTE: passing by pointer to array; allows us to use "array notation" with pointers i.e. [ ]

◆ setParameters()

void Biquad::setParameters ( const BiquadParameters _parameters)
inline

set parameters: note use of custom structure for passing param data

Parameters
BiquadParameterscustom data structure

Member Data Documentation

◆ coeffArray

double Biquad::coeffArray[numCoeffs] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
protected

array of coefficients

◆ parameters

BiquadParameters Biquad::parameters
protected

type of calculation (algorithm structure)

◆ stateArray

double Biquad::stateArray[numStates] = { 0.0, 0.0, 0.0, 0.0 }
protected

array of state (z^-1) registers

◆ storageComponent

double Biquad::storageComponent = 0.0
protected

for Harma loop resolution


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