Skip to main content

Module analyze

Module analyze 

Source
Expand description

Waveforms, spectral analysis and K-weighted integrated loudness.

Structs§

BoundaryMeasurement
BoundarySamples
ChannelStep
Signed step in input-sample amplitude units, preserving headroom outside +/-1.
DeterministicMeasurements
Non-mutating deterministic measurements of the supplied PCM, without gain or quantization. These unrounded f64 values may drive repeatable delivery checks. Numerical accuracy is separate from cross-host identity; see Audio::measure_deterministic for the estimator and no-result policies.
LoudnessResult
Spectrogram
Spectrum
One-sided Hann-windowed tone-amplitude spectrum; not a power spectral density or calibrated band RMS measurement. Uses platform math, with report-only numerical accuracy rather than an exact rendering guarantee.
StereoMeasurements
Unweighted stereo statistics. Power units are squared input-sample amplitude. Empty input has no power result; silence has Some(0). No width/quality verdict.
ThresholdSilence
Frame-exact leading/trailing silence under a caller’s linear amplitude threshold.
Waveform

Enums§

MeasurementBoundary
An explicitly requested adjacent-sample join; no automatic transient search.

Constants§

MAX_MEASUREMENT_BOUNDARIES
Maximum requests in one Audio::measure_boundaries call.

Functions§

dc_mean
Arithmetic DC mean of one channel, in signed input-sample amplitude units. Empty input returns None; silence returns Some(0). All samples must be finite. Compensated f64 summation, O(samples) time and O(1) storage; no allocation. This is numerical reporting, not an extension of the rendered-PCM bit contract.
from_db
spectrogram
Spectra of samples every hop samples, each as spectrum of the samples from that point on. Every sample must be finite.
spectrum
One-sided tone-amplitude magnitudes of the first fft_size samples.
stereo_measurements
Statistics of equal-length stereo channels; no allocation or PCM modification. Requires finite samples, including constant/silent inputs. A two-pass, compensated f64 scan avoids raw-moment variance cancellation under large DC. Power is the same unweighted mean-square concept as Audio::mean_square; accumulation order/compensation can change last bits. Pearson uses platform sqrt and is report-only; compare results numerically, not as portable bytes.
to_db