5#include "sffdn/audio_processor.h"
6#include "sffdn/delay.h"
7#include "sffdn/types.h"
60 float Tick(
float in)
noexcept SFFDN_NONBLOCKING;
93 std::array<
float, 2> state_;
127 void WarpState(
float last_in,
float coeff)
noexcept SFFDN_NONBLOCKING
138 float Tick(
float in)
noexcept SFFDN_NONBLOCKING;
193 float Tick(
float in)
noexcept SFFDN_NONBLOCKING;
233 std::vector<IIRState> states_;
234 std::vector<FilterCoefficients> coeffs_;
275 float Tick(
float in)
noexcept SFFDN_NONBLOCKING;
294 uint32_t OutputChannelCount() const noexcept SFFDN_NONBLOCKING override;
299 void Clear() override;
308 std::unique_ptr<FirImpl> impl_;
339 float Tick(
float in)
noexcept SFFDN_NONBLOCKING;
358 uint32_t OutputChannelCount() const noexcept SFFDN_NONBLOCKING override;
363 void Clear() override;
372 std::unique_ptr<SparseFirImpl> impl_;
Implements a simple allpass filter with differential equation .
Definition filter.h:100
void WarpState(float last_in, float coeff) noexcept SFFDN_NONBLOCKING
Re-seeds the filter state and sets a new coefficient in one step.
Definition filter.h:127
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept SFFDN_NONBLOCKING override
Processes a block of input samples through the filter.
float Tick(float in) noexcept SFFDN_NONBLOCKING
Input a sample in the filter and return the next output.
uint32_t InputChannelCount() const noexcept SFFDN_NONBLOCKING override
Returns the number of input channels supported by this processor.
AllpassFilter(const AllpassFilterOptions &config={})
Constructs an allpass filter.
void SetCoefficients(float coeff) noexcept SFFDN_NONBLOCKING
Sets the allpass coefficient.
Definition filter.h:108
A class representing an audio buffer with multiple channels of non-interleaved audio data.
Definition audio_buffer.h:20
Base class for audio processors.
Definition audio_processor.h:24
Implements a cascade of biquad IIR filters.
Definition filter.h:179
CascadedBiquads(const CascadedBiquadsOptions &config={})
Constructs a cascaded biquad filter.
uint32_t InputChannelCount() const noexcept SFFDN_NONBLOCKING override
Returns the number of input channels supported by this processor.
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept SFFDN_NONBLOCKING override
Processes a block of input samples through the filter.
float Tick(float in) noexcept SFFDN_NONBLOCKING
Processes a single input sample through the filter.
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:227
Implements an FIR filter with arbitrary coefficients.
Definition filter.h:241
Fir(const FirOptions &config={})
Constructs a FIR filter.
float Tick(float in) noexcept SFFDN_NONBLOCKING
Input a sample in the filter and return the next output.
Fir & operator=(Fir &&other) noexcept
Move assignment operator for the FIR filter.
Fir(const Fir &other)
Copy constructor for the FIR filter.
void SetCoefficients(std::span< const float > coeffs)
Sets the FIR coefficients.
Fir(Fir &&other) noexcept
Move constructor for the FIR filter.
uint32_t InputChannelCount() const noexcept SFFDN_NONBLOCKING override
Returns the number of input channels supported by this processor.
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept SFFDN_NONBLOCKING override
Processes a block of input samples through the filter.
Fir & operator=(const Fir &other)
Copy assignment operator for the FIR filter.
Implements a simple one pole filter with differential equation .
Definition filter.h:24
float Tick(float in) noexcept SFFDN_NONBLOCKING
Input a sample in the filter and return the next output.
OnePoleFilter(float b0=1.f, float a1=0.f)
Constructs a one pole filter.
uint32_t InputChannelCount() const noexcept SFFDN_NONBLOCKING override
Returns the number of input channels supported by this processor.
void SetPole(float pole)
Set the pole of the filter.
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 OutputChannelCount() const noexcept SFFDN_NONBLOCKING override
Returns the number of output channels produced 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.
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept SFFDN_NONBLOCKING override
Processes a block of input samples through the filter.
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:315
void SetCoefficients(const SparseFirOptions &config={})
Sets the FIR coefficients.
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept SFFDN_NONBLOCKING override
Processes a block of input samples through the filter.
uint32_t InputChannelCount() const noexcept SFFDN_NONBLOCKING override
Returns the number of input channels supported by this processor.
SparseFir(const SparseFirOptions &config={})
Constructs a sparse FIR filter.
float Tick(float in) noexcept SFFDN_NONBLOCKING
Input a sample in the filter and return the next output.
Options for configuring an allpass filter.
Definition types.h:285
Options for configuring cascaded biquad filters.
Definition types.h:298
Options for configuring a FIR filter.
Definition types.h:304
Options for configuring a sparse FIR filter.
Definition types.h:292