/** * Fourier analysis. * * An iterative radix-2 Cooley-Tukey FFT. Recursive implementations read more * clearly but allocate two arrays per level and blow the call stack on large * inputs; this one works in place on preallocated buffers, which is what makes * a spectrogram over a whole track practical. * * Twiddle factors are cached per size, since a spectrogram calls the same * transform size thousands of times in a row. */ /** * In-place complex FFT. `real` and `imag` must both have a power-of-two length. * * For real input, leave `imag` zeroed; the output's second half mirrors the * first, so only bins `0 .. size/2` carry independent information. */ export declare function fft(real: Float64Array, imag: Float64Array): void; export interface SpectrumOptions { /** Transform size; must be a power of two. Defaults to 2048. */ fftSize?: number; /** * Analysis window. Defaults to `'hann'`. * * Windowing is not optional in practice: a rectangular window on a signal * whose period does not divide the frame length smears energy across every * bin ("spectral leakage"), which buries real detail under an artefact. */ window?: 'hann' | 'hamming' | 'blackman' | 'none'; } /** * Magnitude spectrum of one frame, in linear units. * * Returns `fftSize / 2 + 1` bins. Bin `k` is centred on * `k * sampleRate / fftSize` Hz. */ export declare function spectrum(samples: Float32Array, options?: SpectrumOptions): Float64Array; /** * Magnitude spectra over successive overlapping frames. * * @param hopSize Frames advanced between windows. Defaults to `fftSize / 4`. */ export declare function spectrogram(samples: Float32Array, options?: SpectrumOptions & { hopSize?: number; }): Float64Array[]; //# sourceMappingURL=fft.d.ts.map