5#include "sffdn/audio_processor.h"
6#include "sffdn/delay.h"
7#include "sffdn/types.h"
89 std::unique_ptr<AudioProcessor>
Clone()
const override;
93 std::array<float, 2> state_;
147 std::unique_ptr<AudioProcessor>
Clone()
const override;
203 std::unique_ptr<AudioProcessor>
Clone()
const override;
214 std::vector<IIRState> states_;
215 std::vector<FilterCoefficients> coeffs_;
289 std::unique_ptr<FirImpl> impl_;
341 std::unique_ptr<AudioProcessor>
Clone()
const override;
345 std::unique_ptr<SparseFirImpl> impl_;
357std::unique_ptr<AudioProcessor> MakeFirFilter(
const FirOptions& config,
float sparse_threshold = 0.25f);
Implements a simple allpass filter with differential equation .
Definition filter.h:100
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.
std::unique_ptr< AudioProcessor > Clone() const override
Creates a copy of the filter.
void SetCoefficients(float coeff)
Sets the allpass coefficient.
Definition filter.h:108
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.
AllpassFilter(const AllpassFilterOptions &config={})
Constructs an allpass filter.
void Clear() override
Clears the internal state of the processor.
A class representing an audio buffer with multiple channels of non-interleaved audio data.
Definition audio_buffer.h:18
Base class for audio processors.
Definition audio_processor.h:23
Implements a cascade of biquad IIR filters.
Definition filter.h:159
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept override
Processes a block of input samples through the filter.
float Tick(float in)
Processes a single input sample through the filter.
std::unique_ptr< AudioProcessor > Clone() const override
Creates a copy of the filter.
CascadedBiquads(const CascadedBiquadsOptions &config={})
Constructs a cascaded biquad filter.
void Clear() override
Clears the internal state of the processor.
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 SetCoefficients(std::span< const FilterCoefficients > coeffs)
Sets the biquad coefficients for each stage.
Represents the internal state of the IIR filter.
Definition filter.h:208
Implements an FIR filter with arbitrary coefficients.
Definition filter.h:222
Fir(const FirOptions &config={})
Constructs a FIR filter.
Fir & operator=(const Fir &)
Copy assignment operator for the FIR filter.
void Clear() override
Clears the internal state of the processor.
float Tick(float in)
Input a sample in the filter and return the next output.
void SetCoefficients(std::span< const float > coeffs)
Sets the FIR coefficients.
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept override
Processes a block of input samples through the filter.
std::unique_ptr< AudioProcessor > Clone() const override
Creates a copy of the filter.
Fir(const Fir &)
Copy constructor for the FIR 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.
Fir(Fir &&) noexcept
Move constructor for the FIR filter.
Implements a simple one pole filter with differential equation .
Definition filter.h:24
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 Process(const AudioBuffer &input, AudioBuffer &output) noexcept override
Processes a block of input samples through the filter.
float Tick(float in)
Input a sample in the filter and return the next output.
std::unique_ptr< AudioProcessor > Clone() const override
Creates a copy 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.
uint32_t InputChannelCount() const override
Returns the number of input channels supported by this processor.
void Clear() override
Clears the internal state of the processor.
void SetCoefficients(float b0, float a1)
Set the coefficients of the filter.
uint32_t OutputChannelCount() const override
Returns the number of output channels produced by this processor.
void SetLowpass(float cutoff)
Set the pole of the filter to obtain a lowpass filter with a 3dB cutoff frequency.
Implements a sparse FIR filter.
Definition filter.h:296
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept override
Processes a block of input samples through the filter.
void SetCoefficients(const SparseFirOptions &config={})
Sets the FIR coefficients.
void Clear() override
Clears the internal state of the processor.
uint32_t OutputChannelCount() const override
Returns the number of output channels produced by this processor.
uint32_t InputChannelCount() const override
Returns the number of input channels supported by this processor.
float Tick(float in)
Input a sample in the filter and return the next output.
SparseFir(const SparseFirOptions &config={})
Constructs a sparse FIR filter.
std::unique_ptr< AudioProcessor > Clone() const override
Creates a copy of the filter.
Options for configuring an allpass filter.
Definition types.h:250
Options for configuring cascaded biquad filters.
Definition types.h:263
Options for configuring a FIR filter.
Definition types.h:269
Options for configuring a sparse FIR filter.
Definition types.h:257