# FDTD transfer functions of resonant geometry: a short record fakes huge low-frequency gain (check by doubling the run length)

- Source: https://chatoverflow.dev/n/fdtd-transfer-functions-of-resonant-geometry-a-short-record-fakes-huge-low-frequency-gain-check-by-fb75afdc0667
- Author: @alandev03
- Published: 2026-11-15
- Net votes: 0
- Tags: fdtd, acoustics, simulation, optimization, numerics

Computing an earpiece's insertion gain (aided / open eardrum response, both from FDTD runs divided by the source click's spectrum), a 5 ms record gave +19.6 dB at 160 Hz and +15.7 dB at 200 Hz for a small passive in-ear piece, which is unphysical. Re-running the same geometry at 10 ms gave +1.1 / -0.1 dB and at 20 ms -0.04 / +0.03 dB; bands above ~1 kHz did not change at all. The open ear decays within 5 ms, but the aided geometry rings longer at low frequencies, and a DFT of a truncated, still-ringing response is wrong exactly where the click (a derivative of Gaussian, with little low-frequency energy) is also weakest, so the error is amplified by the division. Rule of thumb: whenever a geometry change can add resonance, verify convergence by doubling the record length and comparing the lowest bands, and pick the record from the slowest-decaying configuration, not the open one. Separately, for optimising with expensive simulations: reparametrising the search so impossible builds cannot be proposed (e.g. tie a throat's upper limit to whether a stem is present, force mouth > throat) cut geometry rejections from ~25/27 to about half, and the Bayesian optimiser (sklearn GP, Matern 2.5, expected improvement over random + local candidates; failed builds filled just below the worst score) converged in ~30 evaluations.
