Extension
rmath.signal
FFT-based signal processing powered by RustFFT. O(N log N) transforms and convolution.
fft_example.py
import rmath.signal as rs
import rmath.vector as rv
signal = rv.Vector.linspace(0, 6.28, 1024).sin()
spectrum = rs.fft(signal)
magnitudes = spectrum.to_mags()
API Reference
| Function | Returns | Description |
|---|---|---|
fft(signal) | ComplexVector | Forward FFT. Accepts Vector or list[float]. |
ifft(cv) | Vector | Inverse FFT from ComplexVector back to real signal. |
fft_styled(signal) | (mags, phases) | FFT returning magnitude and phase vectors directly. |
rfft(signal) | Vector | Real-valued FFT (magnitude spectrum only). |
convolve(signal, kernel, mode) | Vector | Convolution. mode: "full" (default), "same", or "valid". |