Implements a simple one pole filter with differential equation \(y(n) = b_0x(n) - a_1y(n-1)\).
More...
#include <filter.h>
|
|
| OnePoleFilter (float b0=1.f, float a1=0.f) |
| | Constructs a one pole filter.
|
| |
| void | SetPole (float pole) |
| | Set the pole of the filter.
|
| |
| void | SetCoefficients (float b0, float a1) |
| | Set the coefficients of the filter.
|
| |
| void | SetDecayFilter (float decay_db, float time_ms, float sample_rate) |
| | Set the pole of the filter to obtain an exponential decay filter.
|
| |
| void | SetLowpass (float cutoff) |
| | Set the pole of the filter to obtain a lowpass filter with a 3dB cutoff frequency.
|
| |
| float | Tick (float in) |
| | Input a sample in the filter and return the next output.
|
| |
| void | Process (const AudioBuffer &input, AudioBuffer &output) noexcept override |
| | Processes a block of input samples through the filter.
|
| |
| uint32_t | InputChannelCount () const override |
| | Returns the number of input channels supported by this processor.
|
| |
| uint32_t | OutputChannelCount () const override |
| | Returns the number of output channels produced by this processor.
|
| |
| void | Clear () override |
| | Clears the internal state of the processor.
|
| |
| std::unique_ptr< AudioProcessor > | Clone () const override |
| | Creates a copy of the filter.
|
| |
Implements a simple one pole filter with differential equation \(y(n) = b_0x(n) - a_1y(n-1)\).
◆ Clear()
| void sfFDN::OnePoleFilter::Clear |
( |
| ) |
|
|
overridevirtual |
Clears the internal state of the processor.
This function resets the internal state of the filter to zero.
Implements sfFDN::AudioProcessor.
◆ Clone()
| std::unique_ptr< AudioProcessor > sfFDN::OnePoleFilter::Clone |
( |
| ) |
const |
|
overridevirtual |
Creates a copy of the filter.
- Returns
- A unique pointer to the cloned filter.
Implements sfFDN::AudioProcessor.
◆ InputChannelCount()
| uint32_t sfFDN::OnePoleFilter::InputChannelCount |
( |
| ) |
const |
|
overridevirtual |
Returns the number of input channels supported by this processor.
- Returns
- The number of input channels.
Implements sfFDN::AudioProcessor.
◆ OutputChannelCount()
| uint32_t sfFDN::OnePoleFilter::OutputChannelCount |
( |
| ) |
const |
|
overridevirtual |
Returns the number of output channels produced by this processor.
- Returns
- The number of output channels.
Implements sfFDN::AudioProcessor.
◆ Process()
Processes a block of input samples through the filter.
- Parameters
-
| input | The input audio buffer. |
| output | The output audio buffer. The input and output buffers must have the same number of channels and sample count. |
Implements sfFDN::AudioProcessor.
◆ SetCoefficients()
| void sfFDN::OnePoleFilter::SetCoefficients |
( |
float | b0, |
|
|
float | a1 ) |
Set the coefficients of the filter.
- Parameters
-
| b0 | The feedforward coefficient. |
| a1 | The feedback coefficient. |
◆ SetDecayFilter()
| void sfFDN::OnePoleFilter::SetDecayFilter |
( |
float | decay_db, |
|
|
float | time_ms, |
|
|
float | sample_rate ) |
Set the pole of the filter to obtain an exponential decay filter.
- Parameters
-
| decay_db | The decay in decibels. |
| time_ms | The time in milliseconds. |
| sample_rate | The sample rate. |
◆ SetLowpass()
| void sfFDN::OnePoleFilter::SetLowpass |
( |
float | cutoff | ) |
|
Set the pole of the filter to obtain a lowpass filter with a 3dB cutoff frequency.
- Parameters
-
| cutoff | The cutoff frequency, normalized between 0 and 1. |
◆ SetPole()
| void sfFDN::OnePoleFilter::SetPole |
( |
float | pole | ) |
|
Set the pole of the filter.
- Parameters
-
| pole | The pole of the filter. |
◆ Tick()
| float sfFDN::OnePoleFilter::Tick |
( |
float | in | ) |
|
Input a sample in the filter and return the next output.
- Parameters
-
- Returns
- The next output sample
The documentation for this class was generated from the following file: