Skip to main content

Module transform

Module transform 

Source
Expand description

Fast Fourier Transform (FFT), Real FFT (RFFT), Discrete Cosine Transform (DCT-IV), and Bit Reversal functions.

Constants§

DAUBECHIES_4
The Daubechies-4 orthogonal wavelet low-pass filter taps (Ch. 27.1), verified to satisfy the wavelet conditions sum(h_j^2) = 1 and sum(h_j * h_{j+2}) = 0. Using [sqrt(0.5), sqrt(0.5)] instead recovers the Haar wavelet as a special case.

Functions§

bit_reversal
Bit reversal function for interleaved complex array of size 2 * n.
cfft_bfp_q15
In-place Block Floating-Point (BFP) Complex FFT for Q15.
cfft_bfp_q31
In-place Block Floating-Point (BFP) Complex FFT for Q31.
cfft_f32
In-place Complex FFT for floating point 32-bit (f32). data is interleaved complex array of size 2 * n ([re0, im0, re1, im1, ...]). ifft_flag: 0 for forward FFT, 1 for inverse FFT (IFFT). bit_reverse_flag: 1 to enable bit reversal, 0 to disable.
cfft_q15
In-place radix-2 DIT Complex FFT for Q15.
cfft_q31
In-place radix-2 DIT Complex FFT for Q31.
dct4_f32
Discrete Cosine Transform Type IV (DCT-IV) for f32.
fwht_f32
In-place Fast Walsh-Hadamard Transform (FWHT) for floating point f32.
fwht_i32
In-place Fast Walsh-Hadamard Transform (FWHT) for 32-bit integers (i32).
haar_transform_f32
In-place, orthogonal Haar Transform for f32: an O(n) multiresolution transform using only additions, subtractions, and a sqrt(0.5) scale factor per stage, with no trigonometric factors at all (unlike the Fourier/Hartley transforms).
haar_transform_i32
In-place, non-normalized Haar Transform for i32: a forward-only, integer-exact decomposition using only wrapping add/subtract (no scaling), analogous to fwht_i32. Because the transform is non-normalized, an exact-integer inverse does not exist in general (undoing it requires dividing by powers of 2 that may not evenly divide intermediate sums); use haar_transform_f32 / inverse_haar_transform_f32 when an invertible round trip is required.
hartley_transform_f32
In-place Discrete Hartley Transform for f32.
ifwht_f32
In-place Inverse Fast Walsh-Hadamard Transform (IFWHT) for floating point f32 (normalized by $1/N$).
inverse_haar_transform_f32
In-place Inverse Haar Transform for f32, undoing haar_transform_f32.
inverse_wavelet_step_f32
Performs the exact inverse of one wavelet_step_f32 level.
inverse_wavelet_transform_f32
Performs the exact inverse of wavelet_transform_f32.
irfft_q15
Inverse packed real FFT. src is 2 * n interleaved bins from rfft_q15; dst receives n real samples. Combined with a forward transform, irfft(rfft(x)) ≈ x / n (same convention as cfft_q15).
irfft_q31
Inverse packed real FFT. src is 2 * n interleaved bins from rfft_q31; dst receives n real samples. Combined with a forward transform, irfft(rfft(x)) ≈ x / n (same convention as cfft_q31).
real_cepstrum_f32
Real Cepstrum: c(n) = IFFT(ln |FFT(x)|).
rfft_f32
Real FFT for floating point 32-bit (f32). src has n real samples. dst receives 2 * n complex outputs.
rfft_q15
Real FFT for Q15 fixed-point.
rfft_q31
Real FFT for Q31 fixed-point.
wavelet_step_f32
Performs one level of a fast wavelet transform step on the first m elements of data, using wavelet filter h (low-pass) and its derived high-pass filter. Writes the low-pass (“scaling”) coefficients to data[0..m/2] and the high-pass (“wavelet”) coefficients to data[m/2..m]; the underlying convolution wraps around cyclically at the block boundary.
wavelet_transform_f32
Performs a full multi-level fast wavelet transform (Ch. 27): repeatedly applies wavelet_step_f32 to the lower half of the array, halving the active block length each time, stopping once the block would be smaller than the filter itself (mirroring the Haar transform’s pyramid structure).