Skip to content

Signal processing

Nautilus.Signal exports seven functions. fftfreq computes frequency bins using real arithmetic. The other six names end in _stub and return NaN tensors; Nautilus does not provide FFT, STFT, or these filters.

FunctionResultNotes
fft_magnitude_stubStub (NaN)No Fourier transform
ifft_magnitude_stubStub (NaN)No inverse Fourier transform
stft_magnitude_stubStub (NaN)No short-time Fourier transform
lowpass_stubStub (NaN)No low-pass filter
highpass_stubStub (NaN)No high-pass filter
bandpass_stubStub (NaN)No band-pass filter
fftfreqFrequency binsComputes FFT frequency bins (real arithmetic only)

fftfreq computes the frequency bin centers for a discrete Fourier transform, matching NumPy's fft.fftfreq convention.

import Nautilus.Signal (fftfreq)
-- For an 8-sample signal at 100 Hz sample rate:
freqs = fftfreq(signal, cast(100.0, f32))
-- Returns: [0, 12.5, 25, 37.5, -50, -37.5, -25, -12.5]

Signature: [n](x: &tensor[n, f32], sample_rate: f32) -> tensor[n, f32]

The input tensor's values are ignored; only its length n is used.