Constructs a mutable filter object that carries its delay-line state across
successive $apply() calls, so a signal fed in arbitrary chunks
produces exactly the same output as filtering it whole. The identical math is
used offline and online, which lets a real-time streaming backend reuse this
object without re-deriving coefficients.
Arguments
- sos
SOS matrix (
n_sectionsx 6), e.g. fromsosDesign. Provide eithersosor bothbanda.- b, a
Transfer-function coefficients (converted to a single SOS section only when they describe a biquad; otherwise supply
sos).- warmup
Logical; if
TRUE(default) the first$apply()after construction or$reset()initialises the state to steady state scaled by the first sample, suppressing the start-up transient. IfFALSE, the state starts at zero.
Details
The returned object is an environment (reference semantics) with methods:
$apply(x)Filter numeric vector
x, advancing and storing the internal state; returns the filtered vector.$reset()Clear the carried state so the next
$apply()starts fresh (cold or warm start perwarmup).$state()Return the current internal state matrix.