Mozzi  version v1.1.0
sound synthesis library for Arduino
LowPassFilter Class Reference

A resonant low pass filter for audio signals. More...

#include <LowPassFilter.h>

Public Member Functions

 LowPassFilter ()
 Constructor.
 
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...
 
int next (int in)
 Calculate the next sample, given an input signal. More...
 

Detailed Description

A resonant low pass filter for audio signals.

Definition at line 38 of file LowPassFilter.h.

Member Function Documentation

◆ next()

int LowPassFilter::next ( int  in)
inline

Calculate the next sample, given an input signal.

Parameters
inthe signal input.
Returns
the signal output.
Note
Timing: about 11us.

Definition at line 90 of file LowPassFilter.h.

◆ setCutoffFreq()

void LowPassFilter::setCutoffFreq ( uint8_t  cutoff)
inline

deprecated.

Use setCutoffFreqAndResonance(uint8_t cutoff, uint8_t resonance).

Set the cut off frequency,

Parameters
cutoffuse the range 0-255 to represent 0-8191 Hz (AUDIO_RATE/2). Be careful of distortion at the lower end, especially with high resonance.

Definition at line 53 of file LowPassFilter.h.

◆ setCutoffFreqAndResonance()

void LowPassFilter::setCutoffFreqAndResonance ( uint8_t  cutoff,
uint8_t  resonance 
)
inline


Set the cut off frequency and resonance.

Replaces setCutoffFreq() and setResonance(). (Because the internal calculations need to be done whenever either parameter changes.)

Parameters
cutoffrange 0-255 represents 0-8191 Hz (AUDIO_RATE/2). Be careful of distortion at the lower end, especially with high resonance.
resonancerange 0-255, 255 is most resonant.

Definition at line 76 of file LowPassFilter.h.

◆ setResonance()

void LowPassFilter::setResonance ( uint8_t  resonance)
inline

deprecated.

Use setCutoffFreqAndResonance(uint8_t cutoff, uint8_t 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!

Parameters
resonancein the range 0-255, with 255 being most resonant.
Note
Remember to call setCuttoffFreq() after resonance is changed!

Definition at line 67 of file LowPassFilter.h.