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

The AudioFilter object implements all filters in Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle. More...

#include <fxobjects.h>

Inheritance diagram for AudioFilter:
IAudioSignalProcessor

Public Member Functions

virtual bool reset (double _sampleRate)
 
virtual bool canProcessAudioFrame ()
 
virtual double processAudioSample (double xn)
 process one sample through the audio filter
 
virtual void setSampleRate (double _sampleRate)
 
AudioFilterParameters getParameters ()
 
void setParameters (const AudioFilterParameters &parameters)
 
double getG_value ()
 
double getS_value ()
 
- 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 Member Functions

bool calculateFilterCoeffs ()
 

Protected Attributes

Biquad biquad
 the biquad object
 
double coeffArray [numCoeffs] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
 our local copy of biquad coeffs
 
AudioFilterParameters audioFilterParameters
 parameters
 
double sampleRate = 44100.0
 current sample rate
 

Detailed Description

The AudioFilter object implements all filters in Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle.

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

◆ calculateFilterCoeffs()

bool AudioFilter::calculateFilterCoeffs ( )
protected

— function to recalculate coefficients due to a change in filter parameters

◆ canProcessAudioFrame()

virtual bool AudioFilter::canProcessAudioFrame ( )
inlinevirtual

return false: this object only processes samples

Implements IAudioSignalProcessor.

◆ getG_value()

double AudioFilter::getG_value ( )
inline

— helper for Harma filters (phaser)

◆ getParameters()

AudioFilterParameters AudioFilter::getParameters ( )
inline

— get parameters

◆ getS_value()

double AudioFilter::getS_value ( )
inline

— helper for Harma filters (phaser)

◆ processAudioSample()

double AudioFilter::processAudioSample ( double  xn)
virtual

process one sample through the audio filter

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

Parameters
xninput
Returns
the processed sample
  • NOTES:
    Uses the modified biquaqd structure that includes the wet and dry signal coefficients c and d.
    Here the biquad object does all of the work and we simply combine the wet and dry signals.
    return (dry) + (processed): x(n)*d0 + y(n)*c0
    Parameters
    xnthe input sample x(n)
    Returns
    the biquad processed output y(n)

Implements IAudioSignalProcessor.

◆ reset()

virtual bool AudioFilter::reset ( double  _sampleRate)
inlinevirtual

— set sample rate, then update coeffs

Implements IAudioSignalProcessor.

◆ setParameters()

void AudioFilter::setParameters ( const AudioFilterParameters parameters)
inline

— set parameters

◆ setSampleRate()

virtual void AudioFilter::setSampleRate ( double  _sampleRate)
inlinevirtual

— sample rate change necessarily requires recalculation

Reimplemented from IAudioSignalProcessor.


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