Adds null test to artifact.

This commit is contained in:
2026-04-24 08:39:03 +02:00
parent 8f44cf56d4
commit 530d58440f
3 changed files with 516 additions and 15 deletions

View File

@@ -38,6 +38,27 @@ artifact_detection:
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