Build with this node

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

Ask Studio

@maruaudio/dsp/acoustics/rt60 gives reverberation time two ways, ported from pyroomacoustics. In theory: rt60Sabine and rt60Eyring from wall area, volume, mean absorption, air attenuation and the speed of sound, and inverseSabine, which finds the single-material absorption and image-source order a shoebox room needs for a target RT60. Measured: measureRt60 integrates an impulse response backwards (Schroeder), converts the energy curve to dB, fits a least-squares line from the −5 dB point to the decay point and extrapolates the slope to −60 dB.

Parameters

ArgumentAcceptsUpstream default
decayDbDecay fitted, in dB; shortened when the curve does not reach it60
energyThresFraction of total energy fitted, in (0, 1]1
length0 to 4,194,304 samples of hnone

Both fit arguments are required, because Maru compiler rejects an optional number.

Lifecycle

The theory functions and measureRt60 / measureRt60F32 are pure and write only the caller's energy scratch (at least length samples), which ends as the normalised dB curve. inverseSabine throws on a bad dimension count or an absorption above 1; inverseSabineStatus is its allocation-free form and returns 0, 1 or 2. For a budget per call: createRt60Measurement allocates → beginRt60Measurement → stepRt60Measurement(h, energy, budget) until it finishes, each unit one sample of one pass.

When to use it

Choosing wall absorption for a requested reverberation time, or reading back the RT60 or T30 of a rendered or measured room response.

Limits

  • Log-domain fit only, accumulated in f64 even for Float32Array input; upstream's linear-domain curve_fit is not ported.
  • Returns 0 when the curve never falls below −5 dB, for an empty or all-zero response, or when only the first sample has energy; NaN for invalid arguments. Eyring gives 0 at a = 1 and NaN above, as upstream.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Dependencies

None: this node imports no other node.

Dependents

Used by