A generic filter for audio signals that can produce lowpass, highpass, bandpass and notch outputs at runtime. More...
#include <ResonantFilter.h>
A generic filter for audio signals that can produce lowpass, highpass, bandpass and notch outputs at runtime.
Behaves like ResonantFilter for setting the resonance and cutoff frequency. Like ResonantFilter, it can be used on different sample sizes: MultiResonantFilter<uint8_t> and MultiResonantFilter<uint16_t> have been tested. For the former, both cutoff and resonance are uint8_t, hence between 0-255. For the later, both cutoff and resonance are uint16_t, hence between 0-65535.
Definition at line 184 of file ResonantFilter.h.
Public Member Functions | |
void | next (AudioOutputStorage_t in) |
Compute the filters, given an input signal. More... | |
AudioOutputStorage_t | low () |
Return the input filtered with a lowpass filter. More... | |
AudioOutputStorage_t | high () |
Return the input filtered with a highpass filter. More... | |
AudioOutputStorage_t | band () |
Return the input filtered with a bandpass filter. More... | |
AudioOutputStorage_t | notch () |
Return the input filtered with a notch filter. More... | |
void | setCutoffFreq (uint8_t cutoff) |
deprecated. More... | |
void | setResonance (uint8_t resonance) |
deprecated. More... | |
void | setCutoffFreqAndResonance (uint8_t cutoff, uint8_t resonance) |
Set the cut off frequency and resonance. More... | |
Protected Member Functions | |
void | advanceBuffers (AudioOutputStorage_t in) |
AudioOutputStorage_t | current (AudioOutputStorage_t in, Int2Type< LOWPASS >) |
AudioOutputStorage_t | current (AudioOutputStorage_t in, Int2Type< HIGHPASS >) |
AudioOutputStorage_t | current (AudioOutputStorage_t in, Int2Type< BANDPASS >) |
AudioOutputStorage_t | current (AudioOutputStorage_t in, Int2Type< NOTCH >) |
IntegerType< sizeof(uint8_t)+sizeof(uint8_t)>::unsigned_type | ucfxmul (uint8_t a, typename IntegerType< sizeof(uint8_t)+sizeof(uint8_t)>::unsigned_type b) |
IntegerType< sizeof(AudioOutputStorage_t)+sizeof(uint8_t) -1 >::signed_type | ifxmul (typename IntegerType< sizeof(AudioOutputStorage_t)+sizeof(uint8_t) -1 >::signed_type a, uint8_t b) |
IntegerType< sizeof(AudioOutputStorage_t)+sizeof(AudioOutputStorage_t)>::signed_type | fxmul (typename IntegerType< sizeof(AudioOutputStorage_t)+sizeof(AudioOutputStorage_t)>::signed_type a, typename IntegerType< sizeof(AudioOutputStorage_t)+sizeof(uint8_t) -1 >::signed_type b) |
Protected Attributes | |
uint8_t | q |
uint8_t | f |
IntegerType< sizeof(uint8_t)+sizeof(uint8_t)>::unsigned_type | fb |
AudioOutputStorage_t | buf0 |
AudioOutputStorage_t | buf1 |
const uint8_t | FX_SHIFT |
const uint8_t | FX_SHIFT_M_1 |
const uint8_t | SHIFTED_1 |
|
inline |
Return the input filtered with a bandpass filter.
Definition at line 206 of file ResonantFilter.h.
|
inline |
Return the input filtered with a highpass filter.
Definition at line 202 of file ResonantFilter.h.
|
inline |
Return the input filtered with a lowpass filter.
Definition at line 198 of file ResonantFilter.h.
|
inline |
Compute the filters, given an input signal.
in | the signal input. Should not be more than 8bits on 8bits platforms (Arduino) if using the 8bits version and not 16bits version. |
Definition at line 190 of file ResonantFilter.h.
|
inline |
Return the input filtered with a notch filter.
Definition at line 210 of file ResonantFilter.h.
|
inlineinherited |
deprecated.
Use setCutoffFreqAndResonance(su cutoff, su resonance).
Set the cut off frequency,
cutoff | use the range 0-255 to represent 0-8191 Hz (MOZZI_AUDIO_RATE/2) for ResonantFilter, cutoff use the range 0-65535 to represent 0-MOZZI_AUDIO_RATE/2. Be careful of distortion at the lower end, especially with high resonance. |
Definition at line 91 of file ResonantFilter.h.
|
inlineinherited |
Set the cut off frequency and resonance.
Replaces setCutoffFreq() and setResonance(). (Because the internal calculations need to be done whenever either parameter changes.)
cutoff | range 0-255 represents 0-8191 Hz (MOZZI_AUDIO_RATE/2) for ResonantFilter, range 0-65535 for ResonantFilter16 Be careful of distortion at the lower end, especially with high resonance. |
resonance | range 0-255 for ResonantFilter, 0-65535 for ResonantFilter<FILTER_TYPE, uint16_t>, 255/65535 is most resonant. |
Definition at line 114 of file ResonantFilter.h.
|
inlineinherited |
deprecated.
Use setCutoffFreqAndResonance(su cutoff, su resonance).
Set the resonance. If you hear unwanted distortion, back off the resonance. After setting resonance, you need to call setCuttoffFreq() to hear the change!
resonance | in the range 0-255 for ResonantFilter, 0-65535 for ResonantFilter<FILTER_TYPE, uint16_t>, with 255/65535 being most resonant |
Definition at line 105 of file ResonantFilter.h.