| Mozzi version v1.1.0 sound synthesis library for Arduino |

Public Member Functions | List of all members
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

  in | the 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

  cutoff | use 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

  cutoff | range 0-255 represents 0-8191 Hz (AUDIO_RATE/2). Be careful of distortion at the lower end, especially with high resonance.
  resonance | range 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

  resonance | in 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.