Skip to main content

Module analysis

Module analysis 

Source
Expand description

Signal analysis helpers used by the plot UI and by applications directly.

Every function is a pure transform over slices: peak detection, baseline removal, Savitzky–Golay smoothing/derivatives, integration, an FFT spectrum, resampling, a Gauss–Newton fit with confidence bands, and selection statistics.

Structs§

Complex
A complex sample for the FFT.
ModelFit
A fitted parameter set with standard errors.
Peak
One detected peak: index and height.
Spectrogram
A short-time Fourier transform: one magnitude spectrum per window.
Statistics
Summary statistics of a selection.

Functions§

derivative
Central-difference derivative; the ends use one-sided differences.
fft
In-place radix-2 FFT. The length must be a power of two.
find_peaks
Detect local maxima above min_height, at least min_distance samples apart.
fit_model
Gauss–Newton fit with numerical Jacobians and Levenberg damping.
integral
Trapezoidal integral, with the running area at every sample.
remove_baseline
Subtract a rolling baseline in place.
resample
Linear resampling to len samples.
rolling_baseline
A rolling-minimum baseline. window is clamped to an odd number of samples.
savgol
Savitzky–Golay smoothing. Returns the same length; the edges are clamped.
savgol_derivative
Savitzky–Golay first derivative, per sample step.
spectrogram
Short-time Fourier transform with a Hann window.
spectrum
A one-sided magnitude spectrum: [frequency, magnitude] up to Nyquist.

Type Aliases§

Model
A nonlinear model f(x, params) for fit_model.