Skip to main content

Module fft

Module fft 

Source
Expand description

Brick Q2 (core) — a radix-2 Cooley–Tukey FFT, the psychoacoustic model’s analysis transform. Pure in-house, no dependencies. Scalar Rust; this is the single biggest cycle sink in a perceptual encoder and is flagged as a SIMD hotspot (lab::bricks::accel → SIMD), but the scalar path is the reference the SIMD twin will be checked against.

Functions§

fft
In-place complex FFT. re/im are the real/imaginary parts; re.len() must be a power of two and equal to im.len(). Forward transform (exp(-i2πkn/N)).
power_spectrum
Power spectrum |X[k]|² of a real signal windowed into re (with im zeroed), for the first n/2 + 1 bins. Convenience for the psymodel.