Expand description
FFT and spectral analysis for Numra.
Provides Fast Fourier Transform, power spectral density, windowing,
convolution, and short-time Fourier transform. Built on rustfft.
All public functions are generic over S: Scalar (f32/f64), with
the FFT computation internally performed in f64 via rustfft.
§Example
use numra_fft::{fft, ifft, Complex};
let signal: Vec<Complex<f64>> = vec![
Complex::new(1.0_f64, 0.0),
Complex::new(0.0, 0.0),
Complex::new(0.0, 0.0),
Complex::new(0.0, 0.0),
];
let spectrum = fft(&signal);
let recovered = ifft(&spectrum);
for (a, b) in signal.iter().zip(recovered.iter()) {
assert!((a.re - b.re).abs() < 1e-12);
}Author: Moussa Leblouba Date: 9 February 2026 Modified: 2 May 2026
Re-exports§
pub use complex::Complex;pub use complex::ComplexF64;pub use convolution::fftconvolve;pub use convolution::fftcorrelate;pub use fft_core::fft;pub use fft_core::fft2;pub use fft_core::ifft;pub use real::irfft;pub use real::rfft;pub use spectral::psd;pub use spectral::stft;pub use spectral::welch;pub use spectral::StftResult;pub use utils::fftfreq;pub use utils::fftshift;pub use utils::ifftshift;pub use utils::window_func;pub use utils::Window;
Modules§
- complex
- Minimal complex number type for FFT interfaces.
- convolution
- FFT-based convolution and correlation.
- fft_
core - Core FFT and IFFT using rustfft backend.
- real
- Real-valued FFT: efficient transforms for real input signals.
- spectral
- Power spectral density, Welch’s method, and STFT.
- utils
- FFT utility functions: frequencies, shifting, windowing.