Files
closed_loop_audio_test_suite/config.yaml
2026-04-24 08:39:03 +02:00

71 lines
3.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Hardware Test Configuration
audio:
sample_rate: 44100
channels: 2
device_name: "Scarlett" # Will auto-detect Focusrite Scarlett
test_tones:
frequencies: [100, 250, 500, 1000, 2000, 4000, 8000] # Hz
duration: 10.0 # seconds per frequency
amplitude: 0.5 # 0.0 to 1.0
latency_runs: 5 # Number of latency measurements to average
output:
results_dir: "test_results"
save_plots: true
save_raw_audio: false
artifact_detection:
test_frequency: 1000 # Hz - Test tone frequency (for sine wave mode)
duration: 60.0 # seconds - Recording duration
amplitude: 0.5 # 0.0 to 1.0
startup_delay: 0 # seconds - Wait before starting recording to let system settle
# Chirp signal parameters (used when --signal-type chirp is specified)
chirp_f0: 100 # Hz - Chirp start frequency
chirp_f1: 8000 # Hz - Chirp end frequency
# NOTE: All detectors skip the first and last 1 second of recording to avoid startup/shutdown transients
detectors:
spectral_anomaly:
enabled: false # DISABLED - generates too many false positives, needs better algorithm
threshold_db: -60 # Detect unexpected frequencies above noise floor + this threshold (more negative = less sensitive)
amplitude_spikes:
enabled: true
threshold_factor: 10.0 # MAD-based outlier detection on envelope (detects clicks, pops, dropouts). Lower = more sensitive.
zero_crossing:
enabled: false
threshold_factor: 2.0 # Number of standard deviations for zero-crossing anomalies (detects distortion)
energy_variation:
enabled: true
threshold_db: 6.0 # Energy change threshold in dB between consecutive windows (detects level changes)
null_test:
enabled: true
# Align Ch2 (DUT) to Ch1 (Loopback), subtract, detect bursts in residual
max_lag_ms: 500.0 # Maximum expected delay between channels for alignment search
window_ms: 5.0 # Short-time RMS window length for burst detection
threshold_factor: 6.0 # Flag windows where residual RMS exceeds baseline × this factor
min_burst_ms: 0.5 # Minimum burst duration to report (filters out single-sample spikes)
sample_slip_detection: true
sample_slip_window_ms: 50.0 # Correlation window for xcorr-based lag tracking (fallback only)
# Sync marker: one chirp burst at the start and one at the end of the played signal.
# Marker-based alignment is immune to periodic-signal ambiguity (e.g. pure sine).
# Sample slip detection compares the lag at the start marker vs. the end marker.
marker_duration_sec: 0.05 # Length of each chirp marker burst
marker_first_offset_sec: 0.5 # Offset from signal start (and from signal end) for markers
marker_f0: 200.0 # Marker chirp start frequency (Hz)
marker_f1: 16000.0 # Marker chirp end frequency (Hz) — wider BW = sharper correlation peak
marker_amplitude: 0.7 # Marker amplitude (mixed on top of test tone)
# Sample slip threshold: only report if inter-marker lag deviates from median by >= this many samples.
# Rule of thumb: peak timing precision ≈ 1 / (marker_f1 - marker_f0) * sample_rate
# With 200-16000 Hz BW at 44100 Hz: precision ≈ 3 samples → min_slip_samples = 5 gives good margin.
min_slip_samples: 5
latency:
max_std_dev_ms: 1.0 # Maximum allowed std deviation; test fails if exceeded
min_avg_ms: 1.0 # Minimum expected average latency; near-zero indicates bad loopback
latency_buildup:
measurement_interval: 10 # seconds between latency measurements
max_duration: null # maximum test duration in seconds (null = run until canceled)
buildup_threshold_percent: 5.0 # percentage change threshold for buildup detection