hn.today

How I reverse engineering a commercial spatial audio effect

epestr.com81 points28 comments
Screenshot of How I reverse engineering a commercial spatial audio effect

A developer set out to recreate a commercial real-time spatial audio effect on Linux after remembering a program that made playback sound more distant and less “on the ear.” Initial experiments used HRTFs (MIT KEMAR then SADIE II) and standard psychoacoustic ideas guided by an LLM, but those leads did not yield the desired sound. The successful strategy instead measured the behavior of the closed commercial filter directly: generate test files, play them through the original on another machine, and record the outputs. Tests included impulses at multiple amplitudes and polarities, logarithmic sine sweeps with regularized inversion, steady tones that change level, multitone signals, repetitions for time-invariance checks, and reserved noise to validate reconstruction.

Analysis assumed linear time-invariant stereo processing when appropriate and recovered a 2×2 impulse-response matrix (h_LL, h_LR, h_RL, h_RR) by synchronizing via clicks and aligning recordings. The main surround mode behaved nearly as a fixed convolutional filter and was reproduced with low model error comparable to recording variation; other modes exhibited level-dependent gain and slow recovery and could not be captured by a single FIR. The reconstructed filters showed delayed, quieter cross-channel tails that create the intended out-of-head effect, were loaded into Saq for playback, and the code and interactive demo are provided.

Read on epestr.com28 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Hardware

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.