pub struct GlobalConfig {
pub sample_rate: u32,
pub oversample: u32,
pub fft_size: usize,
pub warmup_trim_ms: f64,
pub settle_ms: f64,
}Expand description
Global settings for all tests.
Fields§
§sample_rate: u32§oversample: u32§fft_size: usize§warmup_trim_ms: f64Steady-state warmup trim: milliseconds to discard from the start of BOTH the WDF and golden signals before computing any metric (RMS, peak, THD, spectral). Trimming happens at metric time; stored goldens are unaffected.
Default: 10 ms. Per-test overrides via TestCase::warmup_trim_ms.
Window math (default settings: 96 kHz × 4× = 384 kHz internal):
- 10 ms trim = 3840 samples removed.
- Shortest signal = 50 ms = 19200 samples → 15360 remain (40 ms).
- 1 kHz fundamental: 40 cycles in remaining window — adequate for both THD (Blackman window needs ~5 cycles) and spectral resolution (25 Hz/bin).
settle_ms: f64Steady-state SETTLE window in milliseconds: how long a coupling-cap /
bias network must charge before its output reaches steady state. Goldens
(and the WDF side) are generated long enough to settle, and settle_ms of
the head is discarded so EVERY metric is computed on the settled tail.
Why this is distinct from warmup_trim_ms: a 10 ms trim only skips a
fast turn-on transient. An AC-coupled output with a 10 µF cap into a 10 k
load has RC ≈ 100 ms, so it needs ~5–10 τ (0.5–1 s) to settle — measuring
before that captures the DC charge-up ramp, not the gain. Default 500 ms
(= 5 τ for a 100 ms-RC coupling cap). Slow circuits (e.g. the BA283 with
two 10 µF caps) override per-test via TestCase::warmup_trim_ms.
The conservative default does not shorten any existing window: when the settle exceeds the signal length the trim clamps to the full slice, so short fast-settling tests are unaffected.
Trait Implementations§
Source§impl Clone for GlobalConfig
impl Clone for GlobalConfig
Source§fn clone(&self) -> GlobalConfig
fn clone(&self) -> GlobalConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more