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

GoalStart withControls to understand
Cut bass or treblefilters/biquad, filters/stereo-high-lowpassCutoff Hz, Q/resonance and response type.
Shape an EQ curvefilters/parametric-eq, filters/eq3Per-band frequency, gain, Q and cut slopes where provided.
Follow playing intensityfilters/envelope-filterDetector sensitivity and cutoff response.
Animate tonefilters/lfo-lowpassLFO rate/depth and cutoff range.
Apply an IRfilters/convolution, filters/partitioned-convolutionTap 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 suffixPurposeSelected API
filters/string-readoutPrepared piano/string radiation readout with low cut, attenuating band and high shelf; neutral settings preserve exact PCM.createStringReadout, stringReadoutTick
filters/biquadSeven RBJ responses: low/high/band-pass, notch, peaking and low/high shelf, with explicit coefficient updates.initBiquadNode, biquadNodeTick
filters/parametric-eqUp to eight EQ bands, cascaded cut slopes, coefficient smoothing and transitions.initParametricEqNode, parametricEqBandTick
filters/state-variableTPT state-variable filter with bypass, low/high/band-pass, notch, peak and allpass modes.initStateVariableFilterNode, stateVariableFilterNodeTick
filters/eq3Three-band low-shelf/peaking-mid/high-shelf EQ composed from the biquad unit with a fixed 0.7071 shelf Q.initEq3Node, eq3NodeTick
filters/convolutionBounded zero-latency direct FIR convolver capped at 256 mono taps with impulse loading.initConvolutionNode, convolutionNodeTick
filters/one-poleCutoff-to-coefficient and sample update helpers for a one-pole low-pass.onePoleLowpassTick, toneFilterCoefficient
filters/toneStateful one-pole tone control with a double-precision accumulator.initToneFilterNode, toneFilterNodeTick
filters/envelope-filterEnvelope-driven SVF composed from low-pass and detector primitives.initEnvelopeFilterNode, envelopeFilterNodeTick
filters/lfo-lowpassWet-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-lowpassNeutral 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-cascadeFirmware-derived resonant multimode cascade with low/high/band-pass taps; raw per-sample coefficient requires caller validation.initMultimodeCascadeNode, multimodeCascadeNodeTick
filters/dj-filterFirmware-derived one-knob low-pass/high-pass DJ filter with control smoothing and variant-specific clamp ranges.initDjFilterNode, djFilterNodeTickStereo
filters/dc-blockFixed-pole DC-blocking high-pass with float32 arithmetic; its 0.99 pole is per sample.initDcBlockNode, dcBlockNodeTick
filters/partitioned-convolutionLong-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.