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.
- Model
Fit - A fitted parameter set with standard errors.
- Peak
- One detected peak: index and height.
- 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 leastmin_distancesamples 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
lensamples. - rolling_
baseline - A rolling-minimum baseline.
windowis 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.
- spectrum
- A one-sided magnitude spectrum:
[frequency, magnitude]up to Nyquist.