Repository Public License
1<!--2ORIX Audio3File: docs/reports/dsp-validation.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->78# DSP Validation Report910**Date:** 2026-11-20 · **Suite:** `ORIXAudioCoreTests` · **Result:** 83 tests in 14 suites, all passed · **Platform:** macOS 27, Apple M5 Max · **Run with:** `Scripts/test.sh core`1112## Method1314Each measurement is compared with a synthetic signal whose correct answer is known from theory. Signals are generated deterministically (`SignalGenerator`, seeded noise), at 48 kHz unless stated. A tolerance is fixed in the test; the test passes only inside it. The tolerances below are the ones asserted, not observed errors — the suite reports pass or fail, not the residual.1516This validates the mathematics. It says nothing about microphones, rooms or devices.1718## Spectrum1920| Test | Signal | Expected | Tolerance |21|---|---|---|---|22| Window gains | six windows, 4096 points | mean and mean-square of the coefficients equal the declared coherent and noise power gains | 1e-6 |23| Equivalent noise bandwidth | — | rectangular 1.0, Hann 1.5, Hamming 1.3628, Blackman–Harris 2.0044, flat top 3.7702 | 1e-9 to 1e-2 |24| Amplitude scaling | bin-centred sine, A = 0.5, N = 256, 1024, 4096, 16 384, all six windows | peak at the right bin, reading 0.5 | 0.001 |25| Power scaling | bin-centred sine, A = 0.8 | 0.32 (A²/2) | 0.001 |26| DC and Nyquist | constant 0.25; alternating ±0.3 | 0.25; 0.3 (not doubled) | 1e-4 |27| Flat-top accuracy | sine 0, ¼ and ½ bin off centre | 0 dBFS | 0.02 dB |28| Hann scalloping | sine ½ bin off centre | 1.42 dB loss | 1.3–1.5 dB |29| Leakage | off-bin sine, 40 bins away | rectangular above −45 dB, Hann below −95 dB | — |30| Resolution | two tones 4 bins apart | both read ≥ 0.39 of 0.4, the bin between < 0.01 | — |31| PSD | white noise, σ = 0.1, 200 frames | integral equals σ²; level equals σ²/(fs/2) | 3 %; 5 % |32| Numerical safety | silence; constant full scale | finite values, floor ≤ −150 dB | — |3334## Spectrum analyser3536| Test | Signal | Expected | Tolerance |37|---|---|---|---|38| Dominant frequency | sines at 61.7, 440, 1234.5, 9876.5 Hz, N = 8192 | the frequency; level −10.46 dBFS | 0.5 Hz; 0.3 dB |39| Silence | zeros | no dominant frequency | — |40| Band power | sines at 40, 120, 350, 1000, 3000, 5000, 10 000 Hz, A = 0.5 | 0.125 in the expected band, < 0.002 elsewhere | 3 % |41| Peak hold | full-scale tone then silence, 10 dB/s | −5 dB after 0.5 s | 0.05 dB |42| Smoothing | tone then silence, factor 0.5 | −3.01 dB | 0.05 dB |43| Peaks | 500, 2000, 7000 Hz at 0.5, 0.25, 0.1 | three peaks at those frequencies and levels | 2 Hz; 0.3 dB |44| Log axis | single-bin peak | preserved after resampling to 200 columns | exact |4546## Spectrogram4748| Test | Signal | Expected | Tolerance |49|---|---|---|---|50| Timing | 1875 Hz burst from 1.0 to 1.5 s | onset and end at those times; level −6.02 dBFS inside | 2 hops; 0.3 dB |51| Chirp | 500 → 8000 Hz over 2 s | ridge follows the instantaneous frequency | 2 bins |52| Impulse | one sample | energy only in columns whose window contains it | exact |53| Streaming | pink noise pushed in uneven chunks | identical to one-shot | exact |54| Raster | 6 kHz tone, 64 rows, 0–24 kHz linear | brightest row at ¼ height | ±1 row |55| Palettes | five palettes | luminance non-decreasing; range > 150 | — |5657## Time domain5859| Test | Expected | Tolerance |60|---|---|---|61| Sine, A = 0.5, 1 kHz | peak 0.5; RMS 0.3536; crest 3.01 dB; 2000 crossings/s | 1e-4; 0.01 dB; 2 /s |62| White noise, σ = 0.1 | RMS −20 dBFS; crossings fs/2; crest 11–15 dB | 0.1 dB; 2 % |63| Clipped 100 Hz sine | 200 clipping events; a clean full-scale sine gives none | exact |64| Silence from 2 to 4 s | one silence at those times | 0.4 s |65| DC 0.2 | offset 0.2 | 1e-5 |66| Chunking | identical metrics however the signal is split | exact |67| One hour of a −20 dBFS sine | RMS −23.0103 dBFS | 0.001 dB |6869## Spectral descriptors7071| Signal | Expected | Tolerance |72|---|---|---|73| Pure tones at 250, 1000, 6000 Hz | centroid and rolloff at the tone; bandwidth < 40 Hz; flatness < 0.001 | 3 Hz; one bin |74| White noise | centroid fs/4; bandwidth 24 000/√12 Hz; rolloff 0.85 × 24 kHz; flatness e^(−γ) ≈ 0.561 | 300 Hz; 500 Hz; 0.03 |75| Pink noise | equal power in the 250–500 Hz and 2–4 kHz octaves | 1 dB |76| Two tones, 0.4 and 0.2 | band levels and an 80 / 20 power split | 0.2 dB; 1 % |7778## Loudness7980| Test | Signal | Expected | Tolerance |81|---|---|---|---|82| K-weighting | fs = 48 kHz | the coefficients tabulated in BS.1770 | 1e-8 |83| Reference tone | 0 dBFS, 997 Hz, mono, at 44.1, 48 and 96 kHz | −3.01 LKFS | 0.05 |84| EBU Tech 3341 case 1, 2 | stereo 1 kHz at −23 and −33 dBFS, 20 s | −23.0 and −33.0 LUFS | 0.1 LU |85| Case 3 (relative gate) | −36, −23, −36 dBFS for 10, 60, 10 s | −23.0 LUFS | 0.1 LU |86| Case 4 (both gates) | −72, −36, −23, −36, −72 dBFS | −23.0 LUFS | 0.1 LU |87| Case 5 | −26, −20, −26 dBFS for 20, 20.1, 20 s | −23.0 LUFS | 0.1 LU |88| EBU Tech 3342 cases 1, 2 | −20 then −30 dBFS; −20 then −15 dBFS | 10 LU; 5 LU | 1 LU |89| True peak | fs/4 sine at 45° (samples at ±0.707) | 0 dBTP | 0.3 dB |90| True peak | 440 Hz at −6 dBFS | −6 dBTP | 0.1 dB |91| No reading | silence; 0.2 s of signal | integrated loudness is absent | — |9293**Scope of the loudness claim.** The signals were synthesised to the published descriptions of the EBU test cases; the official EBU audio files were not used, and only the cases listed were run. Mono and stereo are implemented; surround channel weights are not. The correct statement is *implements ITU-R BS.1770-4 and EBU Tech 3342 loudness range, verified against synthesised reference signals*. It is not a certification of EBU R 128 compliance.9495## Waveform, voice activity, capture9697| Test | Expected |98|---|---|99| Bucket statistics | min, max and RMS of a sine within 0.005 |100| Colour band | tones at 45, 150, 350, 1000, 3000, 5000 and 9000 Hz land in bands 0–6 with more than 90 % of band power; silence has no band |101| Band follows content | 100 Hz then 8 kHz: dominant band changes from 1 to 6 |102| Pyramid and cache | extremes preserved to the top level; serialisation round-trips; junk data rejected |103| Voice activity | three 1 s bursts over a −60 dBFS floor are found within 80 ms of their starts; steady noise alone yields nothing |104| CAF master | 16-bit, 24-bit and float files read back by Core Audio within one quantisation step |105| Interrupted master | unclosed, with a torn byte: 96 000 frames reported and read back |106| Ring buffer | two million samples across threads in order; overflow counted |107108## Editing and effects109110| Test | Expected | Tolerance |111|---|---|---|112| Render equals the edit list | delete, insert silence and −6.02 dB on a range reproduce the source sample for sample | 2 LSB at 24 bits |113| Fades, normalise, channel modes | raised-cosine midpoints; peak lands on −1 dBFS; left, right and mono values | 1e-3; 0.01 dB |114| High-pass 200 Hz | −3.01 dB at 200 Hz; −24.1 dB at 100 Hz; 0 dB at 2 kHz | 0.15; 0.6; 0.05 dB |115| Low-pass 4 kHz | −3.01 dB at 4 kHz; below −22 dB at 8 kHz | 0.15 dB |116| Equaliser | +6 dB at 30 Hz, −4 dB at 1.5 kHz, +5 dB at 16 kHz | 0.3; 0.1; 0.3 dB |117| Compressor | static curve values; a steady tone 12 dB over a 3:1 threshold drops 8 dB | 1e-9; 0.3 dB |118| Denoiser, empty profile | output equals input after latency compensation | 2e-4 |119| Noise reduction at 70 % | noise floor falls more than 10 dB; a 1 kHz tone keeps its frequency and level; onset stays at 3.0 s | 1 Hz; 0.5 dB; 5 ms |120| Lossless encoders | WAV 16/24, AIFF 16, CAF 24, Apple Lossless round-trip | one quantisation step |121| AAC | every combination of 8–96 kHz, mono/stereo and 32–256 kbps requested encodes and decodes | duration within 0.15 s |122| Resampling 48 → 24 kHz | tone frequency and duration preserved | 2 Hz; 0.01 s |123124## What is not validated125126- Anything acoustic: microphone frequency response, noise, automatic gain.127- Absolute level. All figures are relative to digital full scale.128- Speech-activity accuracy on real speech; the detector was checked on noise bursts only.129- The usefulness of the findings on real recordings. One rule was reworded during development after it fired on dense music.130- Noise reduction on real recordings; it was verified on white noise with a tone.131