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

FunctionReturnsDescription
fft(signal)ComplexVectorForward FFT. Accepts Vector or list[float].
ifft(cv)VectorInverse FFT from ComplexVector back to real signal.
fft_styled(signal)(mags, phases)FFT returning magnitude and phase vectors directly.
rfft(signal)VectorReal-valued FFT (magnitude spectrum only).
convolve(signal, kernel, mode)VectorConvolution. mode: "full" (default), "same", or "valid".