Filters and EQ
Choose and configure tone filters, EQ, DC removal and convolution.
Filters change the spectrum of a signal. Start with a biquad for a familiar low-pass, high-pass, band-pass, notch, bell or shelf; choose the TPT state-variable filter for its alternative resonant response. EQ combines several filter sections. Convolution applies a prepared impulse response.
Biquad controls and lifecycle
initBiquadNode(sampleRate) creates one channel’s history.
setBiquadNodeFrequency takes Hz (10 to 0.45 × sample rate),
setBiquadNodeQ takes Q (0.0001 to 40), and
setBiquadNodeGainDb takes −24 to +24 dB for bell/shelf gain.
Call updateBiquadNodeCoefficients after setters and before rendering;
biquadNodeTick(state, input) produces one output sample.
resetBiquadNode clears signal history while retaining the configuration.
The DSP introduction shows the code.
A stereo filter needs independent left/right histories, even when the controls are linked. Sharing the same state between channels feeds one channel’s history into the other. Use a stereo adapter or prepare two mono states.
Select the appropriate filter
| Goal | Start with | Controls to understand |
|---|---|---|
| Cut bass or treble | filters/biquad, filters/stereo-high-lowpass | Cutoff Hz, Q/resonance and response type. |
| Shape an EQ curve | filters/parametric-eq, filters/eq3 | Per-band frequency, gain, Q and cut slopes where provided. |
| Follow playing intensity | filters/envelope-filter | Detector sensitivity and cutoff response. |
| Animate tone | filters/lfo-lowpass | LFO rate/depth and cutoff range. |
| Apply an IR | filters/convolution, filters/partitioned-convolution | Tap count, partition layout, storage and latency. |
The direct FIR supports up to 256 mono taps without partition delay. The partitioned convolver supports long responses and prepared IR swaps; its chosen mode determines whether a direct head or a partition delay is used. Declare that latency and align any parallel dry path. The room acoustics guide explains response preparation.
Cook coefficients at the leaf’s documented update point and use its smoothing or transition facility where provided. Bound resonance and test rapid control changes with loud input, rather than assuming every parameter step is benign.
Toolkit reference
Import paths below are suffixes of maruaudio/dsp/. Use the exported types
and setters in your installed version for complete signatures and defaults.
Filters
| Import suffix | Purpose | Selected API |
|---|---|---|
filters/string-readout | Prepared piano/string radiation readout with low cut, attenuating band and high shelf; neutral settings preserve exact PCM. | createStringReadout, stringReadoutTick |
filters/biquad | Seven RBJ responses: low/high/band-pass, notch, peaking and low/high shelf, with explicit coefficient updates. | initBiquadNode, biquadNodeTick |
filters/parametric-eq | Up to eight EQ bands, cascaded cut slopes, coefficient smoothing and transitions. | initParametricEqNode, parametricEqBandTick |
filters/state-variable | TPT state-variable filter with bypass, low/high/band-pass, notch, peak and allpass modes. | initStateVariableFilterNode, stateVariableFilterNodeTick |
filters/eq3 | Three-band low-shelf/peaking-mid/high-shelf EQ composed from the biquad unit with a fixed 0.7071 shelf Q. | initEq3Node, eq3NodeTick |
filters/convolution | Bounded zero-latency direct FIR convolver capped at 256 mono taps with impulse loading. | initConvolutionNode, convolutionNodeTick |
filters/one-pole | Cutoff-to-coefficient and sample update helpers for a one-pole low-pass. | onePoleLowpassTick, toneFilterCoefficient |
filters/tone | Stateful one-pole tone control with a double-precision accumulator. | initToneFilterNode, toneFilterNodeTick |
filters/envelope-filter | Envelope-driven SVF composed from low-pass and detector primitives. | initEnvelopeFilterNode, envelopeFilterNodeTick |
filters/lfo-lowpass | Wet-only stereo sine LFO low-pass composed from one LFO clock and independent RBJ Biquad histories, using the documented Auto Filter exponential cutoff law. | initStereoLfoLowpassNode, stereoLfoLowpassNodeTick |
filters/stereo-high-lowpass | Neutral wet-only stereo high-pass and low-pass sections composed from RBJ Biquads, with independent lane histories and explicit zero-cutoff Off states. | initStereoHighLowpassNode, stereoHighLowpassNodeTick |
filters/multimode-cascade | Firmware-derived resonant multimode cascade with low/high/band-pass taps; raw per-sample coefficient requires caller validation. | initMultimodeCascadeNode, multimodeCascadeNodeTick |
filters/dj-filter | Firmware-derived one-knob low-pass/high-pass DJ filter with control smoothing and variant-specific clamp ranges. | initDjFilterNode, djFilterNodeTickStereo |
filters/dc-block | Fixed-pole DC-blocking high-pass with float32 arithmetic; its 0.99 pole is per sample. | initDcBlockNode, dcBlockNodeTick |
filters/partitioned-convolution | Long-IR FFT convolution up to 2^20 frames, direct-head or partition-latency modes, spread tail work and prepared crossfaded IR swaps. | initPartitionedConvolution, partitionedConvolutionTick |
Return to DSP fundamentals for I/O, lifecycle, units and the category map.