sfFDN
Loading...
Searching...
No Matches
sfFDN::TimeVaryingSchroederAllpass Class Reference

An energy-preserving Schroeder allpass with a fixed delay and optionally modulated gain. More...

#include <schroeder_allpass.h>

Public Member Functions

 TimeVaryingSchroederAllpass (uint32_t delay, float gain, const ModulationOptions &modulation)
 Constructs an allpass with sinusoidal gain modulation.
 
void SetDelay (uint32_t delay)
 Sets the fixed integer delay in samples.
 
uint32_t GetDelay () const noexcept SFFDN_NONBLOCKING
 Returns the delay in samples.
 
float GetG () const noexcept SFFDN_NONBLOCKING
 Returns the base gain.
 
float Tick (float input) noexcept SFFDN_NONBLOCKING
 Processes one sample using the configured sinusoidally modulated gain.
 
float Tick (float input, float gain) noexcept SFFDN_NONBLOCKING
 Processes one sample with an explicit valid gain in the open interval (-1, 1).
 
void ProcessBlock (std::span< const float > in, std::span< float > out) noexcept SFFDN_NONBLOCKING
 Processes a block using the configured sinusoidally modulated gain.
 
void ProcessBlockAccumulate (std::span< const float > in, std::span< float > out) noexcept SFFDN_NONBLOCKING
 Processes a block and accumulates the result in out.
 
void Clear ()
 Clears the delay state and restores the configured modulation phase.
 

Detailed Description

An energy-preserving Schroeder allpass with a fixed delay and optionally modulated gain.

The gain-varying path uses the normalized Type V recurrence:

\[ y = c w - g x,\quad u = c x + g w,\quad c = \sqrt{1 - g^2}. \]

The delay remains an integer number of samples, so every valid instantaneous gain applies an orthogonal transformation to the input and delayed sample.

Constructor & Destructor Documentation

◆ TimeVaryingSchroederAllpass()

sfFDN::TimeVaryingSchroederAllpass::TimeVaryingSchroederAllpass ( uint32_t delay,
float gain,
const ModulationOptions & modulation )

Constructs an allpass with sinusoidal gain modulation.

Note
The modulation frequency and amplitude must be non-zero, and abs(gain) + abs(modulation.amplitude) must be strictly less than one.

Member Function Documentation

◆ SetDelay()

void sfFDN::TimeVaryingSchroederAllpass::SetDelay ( uint32_t delay)

Sets the fixed integer delay in samples.

Exceptions
std::invalid_argumentif delay is zero.

◆ Tick()

float sfFDN::TimeVaryingSchroederAllpass::Tick ( float input,
float gain )
noexcept

Processes one sample with an explicit valid gain in the open interval (-1, 1).

This overload is useful for externally scheduled gain trajectories. It does not alter the configured modulation state.


The documentation for this class was generated from the following file: