Build with this node

Start with a prompt in Studio, or copy it into your own coding agent.

Ask Studio

@maruaudio/dsp/filters/partitioned-convolution convolves one channel with an impulse response of up to 2^20 frames by uniformly partitioned overlap-save: every B samples the last 2B inputs enter a frequency-domain delay line and the output is IFFT(Σ H_j·X_{p−j}), the linear convolution of Web Audio ConvolverNode. Input is f32, taps fround(tap·gain), the rest f64. Two IR slots share the delay line, so a new IR is prepared in steps and crossfaded in.

const state = initPartitionedConvolution(144000, 256, true)
loadPartitionedConvolutionIr(state, ir, 0, ir.length, 1)
const y = partitionedConvolutionTick(state, x)

Parameters

There are no setters; layout is passed to init and the IR to the load calls.

ArgumentRange as codedUnit
partitionSizeRounded up to a power of two, 16 to 16384; at most 256 with zeroLatencyframes
zeroLatencytrue: a direct head (@maru/filters-convolution) covers the first B taps, latency 0; false: latency Bflag
tailPartitionSize (two-stage init)Power of two, 2B to 16384; ≤ 0 gives the single-stage layoutframes
irFrames, gainFrames clamped to maxIrFrames (at most 2^20); gain is a scalar, no normalizationframes, linear
crossfadeFrames, law≤ 0 swaps at once; CROSSFADE_LINEAR or CROSSFADE_EQUAL_POWERframes

Lifecycle

initPartitionedConvolution or initPartitionedConvolutionTwoStage allocates both slots and the delay lines; nothing allocates afterwards. Load an IR with loadPartitionedConvolutionIr, or beginPartitionedConvolutionIr → preparePartitionedConvolutionIr (budgeted, returns partitions left) → commitPartitionedConvolutionIr. Render with partitionedConvolutionTick or processPartitionedConvolutionBlock (f32 output). resetPartitionedConvolution clears history and keeps loaded IRs; clearPartitionedConvolution empties both slots. Begin and commit refuse during a crossfade or an armed swap.

When to use it

Reverb and room impulses, or cabinet IRs longer than 256 taps.

Limits

  • Mono: stereo IRs are two states. Normalization is the caller's.
  • Single stage: one forward FFT, the full delay-line multiply-accumulate and one inverse FFT on the sample completing a partition; both slots run only while crossfading. A two-stage commit is heard at the second tail boundary.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Ports

  • In ininput · audio · mono
  • Out outoutput · audio · mono

One sample per partitionedConvolutionTick call.

Dependencies

Dependents

Used by