/** * Frequency-to-time reconstruction: alias reduction, IMDCT, and the synthesis * polyphase filterbank. * * Layer III encodes in two nested transforms. A 32-band polyphase filterbank * splits the signal into sub-bands, then an MDCT gives each sub-band 18 finer * frequency lines. Decoding runs both in reverse, and three corrections are * needed along the way: * * - **Alias reduction** undoes the overlap between neighbouring polyphase bands. * The filterbank is not perfectly band-limited, so each band leaks into its * neighbours; eight butterflies across every boundary cancel it. Skipped for * short blocks, where the encoder does not apply the matching step. * - **Overlap-add** stitches successive IMDCT outputs together. Each transform * produces 36 samples for 18 new ones; the second half is carried into the * next granule. This is what makes the transform critically sampled. * - **Frequency inversion** negates alternate samples in odd sub-bands, undoing * the modulation the analysis filterbank applied. */ import type { GranuleInfo } from './sideinfo.js'; /** * Cancels aliasing between adjacent sub-bands. * * Operates on the boundary between each pair of the 32 sub-bands, mixing the * last 8 lines of one with the first 8 of the next. */ export declare function reduceAlias(spectrum: Float32Array, granule: GranuleInfo): void; /** * Inverse MDCT with windowing and overlap-add. * * @param spectrum 576 requantized lines, sub-band major. * @param overlap 576 carried-over samples from the previous granule, updated in place. * @param out 576 time-domain samples, sub-band major (18 per sub-band). */ export declare function imdct(spectrum: Float32Array, granule: GranuleInfo, overlap: Float32Array, out: Float32Array): void; /** * Negates every other sample in odd sub-bands. * * The analysis filterbank modulates alternate bands; this undoes it. Omitting it * produces audio that is recognisable but harsh, because half the sub-bands come * out phase-inverted. */ export declare function invertFrequency(samples: Float32Array): void; /** * The synthesis polyphase filterbank. * * Turns 32 sub-band samples into 32 PCM samples, using a 1024-sample history so * the reconstruction filter has the past it needs. One instance per channel — * the history is stateful and must not be shared. */ export declare class SynthesisFilterbank { #private; /** Discards history, e.g. after a seek. */ reset(): void; /** * Produces 32 PCM samples from 32 sub-band samples. * * @param subbands 32 sub-band values for one time slot. * @param out Destination for 32 PCM samples. * @param outOffset Where to write in `out`. */ process(subbands: Float32Array, out: Float32Array, outOffset: number): void; }