pub struct Welch {
pub resolution: f64,
pub overlap: f64,
pub taper: Taper,
}Expand description
Welch’s method: what resolution to estimate at, and how hard to average.
Averaging the periodograms of overlapping segments trades frequency
resolution for a quieter estimate, which is the trade a noisy measurement
wants and a phase-sensitive one does not. Welch::estimate is the run.
Fields§
§resolution: f64The frequency resolution to aim for, in Hz.
One segment is rate / resolution samples long, so a finer resolution
buys more bins out of fewer averages.
overlap: f64How much of each segment the next one repeats, 0.0..1.0.
taper: TaperThe taper applied to every segment.
Implementations§
Source§impl Welch
impl Welch
Sourcepub fn new(resolution: f64) -> Self
pub fn new(resolution: f64) -> Self
A default estimate at a stated resolution: half overlap, Hann taper.
Sourcepub fn estimate(&self, samples: &[f64], rate: f64) -> Estimate
pub fn estimate(&self, samples: &[f64], rate: f64) -> Estimate
Estimates the amplitude spectrum of samples sampled at rate Hz.
Segments shorter than 64 samples are not worth averaging and the segment length is clamped there; a signal too short to divide is transformed once instead, so an estimate is always answered on the same terms.
Phase is not part of the answer, and that is the method rather than an omission: averaging periodograms discards it.