feat(binaural): fit the PRTF model's tracks to the embedded KEMAR set (S2-17) - #352
Merged
Conversation
mgth
force-pushed
the
feat/binaural-prtf-kemar-fit
branch
2 times, most recently
from
September 2, 2026 17:37
f020f5c to
f8e0ca4
Compare
S2-17. The Spagnol PRTF model's parameters — two concha resonances and three elevation notches — were a population average read off the SITIS 2011 paper's figures, as linear ramps in elevation. Measured against the embedded KEMAR set in the median plane they were further from it than no pinna colouration at all (9.86 dB mean absolute error over 3–16 kHz against 8.35 dB for the bare head shadow). The parameters are now a table fitted to that set: per 10° of elevation from −50° to +90°, the resonance envelope's first peak and its level around 12 kHz, and three notch tracks (centre, depth, width) of the ear-averaged KEMAR response over the analytic head shadow — what the PRTF multiplies. The extraction lives in this file's tests as the `print_kemar_prtf_tracks` instrumentation (twelfth-octave magnitude, an upper envelope by three passes of clamped half-octave smoothing, the residual's minima assigned to the tracks by continuity, a jump past 2 kHz starting a track that was absent instead of sweeping one), and its output is pasted as `KEMAR_TRACKS`. Rows interpolate linearly; a notch absent on one side of a gap fades in place. The filters, `depth` and `freq_scale` are unchanged; the model is now "KEMAR average" rather than "figures average". Mean absolute error against KEMAR: 2.44 dB. `MeasuredHrirData::nearest_measurement` exposes a measurement and its direction to the module for that analysis. Tests: the fit beats the ramps and the bare head by the margins above (`kemar_fit_tracks_the_median_plane`, prints the figures); one degree of elevation never changes the response by more than 2 % of its energy (`prtf_varies_smoothly_with_elevation`). Golden unchanged (KEMAR). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
mgth
force-pushed
the
feat/binaural-prtf-kemar-fit
branch
from
September 2, 2026 17:43
f8e0ca4 to
8b09c47
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Series 2, lot 3, S2-17 — PRTF fitted on the embedded KEMAR.
The Spagnol PRTF model's parameters (two concha resonances, three elevation notches) were a population average read off the SITIS 2011 figures, as linear ramps in elevation. Against the embedded KEMAR set in the median plane they were further from it than no pinna colouration at all.
KEMAR_TRACKS: per 10° of elevation (−50°…+90°), the resonance envelope's first peak and its level around 12 kHz, and three notch tracks (centre, depth, width) of the ear-averaged KEMAR response over the analytic head shadow — what the PRTF multiplies. Rows interpolate linearly; a notch absent on one side of a gap fades in place instead of sweeping.print_kemar_prtf_tracks(ignored test,-- --ignored --nocapture) prints the table from the embedded set — twelfth-octave magnitude, an upper envelope by three passes of clamped half-octave smoothing, the residual's minima assigned to the tracks by continuity (a jump past 2 kHz starts a track that was absent).depth,freq_scale, the per-ear shading and the runtime cost are unchanged.MeasuredHrirData::nearest_measurement(module-private) exposes a measurement for the analysis.Measurement
Mean absolute error of the model's pinna response against KEMAR's, 3–16 kHz, over the 15 rows:
Tests
kemar_fit_tracks_the_median_plane(fit < 0.6 × ramps and < 0.5 × flat, prints[measure]),prtf_varies_smoothly_with_elevation(a 1° step moves < 2 % of the response's energy). Existing PRTF tests unchanged and green.cargo test -p renderer --lib: 383 passed, 3 ignored. Golden unchanged (KEMAR).Listening
prtfsource: elevation of height objects, and the timbre againstsaf— the fit is KEMAR's own pinna, soprtfat 100 % should now sit close tosafin the median plane while staying individualisable with the notch frequency scale.🤖 Generated with Claude Code