|
arduino-audio-tools
|
A Base class for filter based effects including methods for simple high, low and band pass filtering. More...
#include <AudioEffectsSuite.h>
Public Member Functions | |
| FilterEffectBase () | |
| FilterEffectBase (FilterEffectBase ©)=default | |
| ~FilterEffectBase ()=default | |
| virtual bool | active () |
| determines if the effect is active | |
| virtual effectsuite_t | applyFilter (effectsuite_t sampVal) |
| virtual AudioEffect * | clone ()=0 |
| effectsuite_t | envelope (effectsuite_t sample) |
| int | id () |
| Allows to identify an effect. | |
| virtual effect_t | process (effect_t inputSample) override |
| see applyFilter | |
| virtual effectsuite_t | processDouble (effectsuite_t inputSample) override |
| Main process block for applying audio effect. | |
| virtual void | setActive (bool value) |
| sets the effect active/inactive | |
| bool | setChebyICoefficients (effectsuite_t cutFreq, bool shelfType, effectsuite_t ripple) |
| void | setId (int id) |
| Allows to identify an effect. | |
Protected Member Functions | |
| void | allocateBufferMemory () |
| bool | changeChebyICoefficients (effectsuite_t cutFreq, bool shelfType, effectsuite_t ripple, int poles) |
| void | clearMemory () |
| int16_t | clip (int32_t in, int16_t clipLimit=32767, int16_t resultLimit=32767) |
| generic clipping method | |
| void | copyParent (AudioEffect *copy) |
| void | incBufferIndex () |
| effectsuite_t | rms (effectsuite_t sample) |
| bool | setSimpleLpf (int order) |
Protected Attributes | |
| bool | active_flag = true |
| int | bufferIndex = 0 |
| int | filterOrder = 0 |
| effectsuite_t * | firBuffer = 0 |
| effectsuite_t * | firCoefficients = 0 |
| effectsuite_t * | firTemp = 0 |
| int | id_value = -1 |
| effectsuite_t * | iirBuffer = 0 |
| effectsuite_t * | iirCoefficients = 0 |
| effectsuite_t * | iirTemp = 0 |
| effectsuite_t * | rmsBuffer = new effectsuite_t[rmsWindowSize] |
| int | rmsBufferIndex = 0 |
| const int | rmsWindowSize = 128 |
| int | samplingRate = 0 |
A Base class for filter based effects including methods for simple high, low and band pass filtering.
|
inline |
Constructor.
|
default |
|
default |
Destructor.
|
inlineprotected |
will allocate memory to a buffer given the current filter order and set all values == 0.00
|
inlinevirtual |
with the current filter coefficients this method filters a sample then stores it the sample Buffer and increments the index
| sampVal | is the sample to be processed |
|
inlineprotected |
set firCoefficients and iirCoefficients for required chebyshev type I filter sampleBuffer memory is also set @params cutFreq normalised cutoff frequency (0 < x < .5) @params shelfType bool filter shelf type, false = low pass, true = high pass @params ripple percentage ripple (<.2929) @params poles number of poles
|
inlineprotected |
checks internal memory storage of filter coeffcients and deletes if required
|
inlineprotectedinherited |
generic clipping method
|
pure virtualinherited |
Implemented in SimpleLPF, Boost, Distortion, Fuzz, Tremolo, Delay, ADSRGain, PitchShift, Compressor, SimpleChorus, FilteredDelay, SimpleDelay, SimpleFlanger, STKChorus, STKEcho, STKFreeVerb, STKChowningReverb, STKNReverb, STKPerryReverb, STKLentPitShift, and STKPitShift.
|
inlineprotectedinherited |
|
inline |
detect the envelop of an incoming signal
| sample | the incoming signal sample value |
|
inlineinherited |
Allows to identify an effect.
|
inlineprotected |
increment the buffer index and wrap it to the filter order
|
inlineoverridevirtual |
Main process block for applying audio effect.
| inputSample | The input audio sample for the effect to be applied to |
Implements EffectSuiteBase.
Reimplemented in SimpleChorus, FilteredDelay, and EnvelopeFilter.
|
inlineprotected |
root mean square of signal over a specific sample window
|
inline |
changes the current Chebyshev type 1 coefficients without altering the filter order. This allows for use in an audio process thread as it avoids dynamic allocation of memory. Filter sample and coefficient buffers are unaltered for initialising a chebyshev type 1 filter
a simple normalised fir low pass filter @params order number of delay coefficients
|
protected |
current buffer index
|
protected |
order of delay filter including the zero delay coefficients
|
protected |
buffer to hold forward delay sample data
|
protected |
Numerator coefficients in delay filter firCoefficients[0] z^0 coeffcieint firCoefficients[1] z^-1 coefficient
|
protected |
hold temporary values for fir coeffcient buffer
|
protectedinherited |
|
protected |
buffer to hold backward delay sample data
|
protected |
Denomiator coefficients in delay filter
|
protected |
hold temporary values for iir coeffcient buffer
|
protected |
RMS window buffer
|
protected |
current write index of rmsBuffer
|
protected |