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) = 1andsum(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).datais interleaved complex array of size2 * 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: anO(n)multiresolution transform using only additions, subtractions, and asqrt(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 tofwht_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); usehaar_transform_f32/inverse_haar_transform_f32when 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, undoinghaar_transform_f32. - inverse_
wavelet_ step_ f32 - Performs the exact inverse of one
wavelet_step_f32level. - inverse_
wavelet_ transform_ f32 - Performs the exact inverse of
wavelet_transform_f32. - irfft_
q15 - Inverse packed real FFT.
srcis2 * ninterleaved bins fromrfft_q15;dstreceivesnreal samples. Combined with a forward transform,irfft(rfft(x)) ≈ x / n(same convention ascfft_q15). - irfft_
q31 - Inverse packed real FFT.
srcis2 * ninterleaved bins fromrfft_q31;dstreceivesnreal samples. Combined with a forward transform,irfft(rfft(x)) ≈ x / n(same convention ascfft_q31). - real_
cepstrum_ f32 - Real Cepstrum:
c(n) = IFFT(ln |FFT(x)|). - rfft_
f32 - Real FFT for floating point 32-bit (
f32).srchasnreal samples.dstreceives2 * ncomplex 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
melements ofdata, using wavelet filterh(low-pass) and its derived high-pass filter. Writes the low-pass (“scaling”) coefficients todata[0..m/2]and the high-pass (“wavelet”) coefficients todata[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_f32to 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).