signal::spectral
Spectral estimation: periodograms averaged over segments (Welch), the
short-time Fourier transform and its inverse, spectrograms, and the
analytic signal. Defaults follow SciPy's scipy.signal.
Modules
analyticThe analytic signal by the FFT (Marple 1999, "Computing the discrete-time analytic signal via FFT"): keep DC and Nyquist, double the positive frequencies, drop the negative ones.framesThe short-time Fourier transform, its inverse by weighted overlap-add (Griffin and Lim 1984), and the spectrogram, with SciPy's framing.psdPower spectral density by averaged modified periodograms (Welch 1967): windowed, detrended, overlapping segments, each a real FFT, their squared magnitudes averaged.
Re-exports
analytic::{hilbert, envelope}Source
pub use analytic::{hilbert, envelope}frames::{stft, istft, spectrogram, Stft, Spectrogram}Source
pub use frames::{stft, istft, spectrogram, Stft, Spectrogram}stftThe STFT ofx(as SciPy'sstft):nperseg / 2zeros added at each end and zeros at the end to fill the last segment, so every sample is covered; segments ofnperseg(256) overlapping bynoverlap(half), windowed by a periodic Hann window, each a real FFT ofnfftpoints scaled by1 / sum(window).istftThe signal back from its STFT (as SciPy'sistft): each column is inverse-transformed, windowed and overlap-added, divided by the summed squared window, and thenperseg / 2boundary samples are dropped.spectrogramThe spectrogram ofx(as SciPy'sspectrogram): power spectral density of each segment, by defaultnperseg256 samples of a Tukey(0.25) window overlapping by an eighth, each detrended.StftAn STFT:z[k, m]is frequencyf[k]in the segment centred at timet[m].SpectrogramA spectrogram:s[k, m]is the power atf[k]in the segment centred att[m].
psd::{welch, periodogram, Spectrum, Scaling}Source
pub use psd::{welch, periodogram, Spectrum, Scaling}welchWelch's power spectral density estimate ofxsampled atfs: segments ofnpersegsamples (256 by default, at most the signal length), overlapping bynoverlap(half by default), each detrended (Detrend::Constantby default,nonefor no detrending), windowed (periodic Hann by default) and zero-padded tonfft.periodogramThe periodogram ofx: one segment, the whole signal, no window by default.SpectrumA one-sided spectrum:p[k]is the power at frequencyf[k].ScalingWhat the estimate is scaled to.