function [y, basis, dinfo] = woodblock_render(P) % WOODBLOCK_RENDER Full render: solve -> radiate -> output. % Convenience composition of the stage functions; the web app calls the % stages separately so it can cache intermediates. basis = woodblock_basis(P); fsHi = P.sample_rate * P.oversample; [Qdd, Xdd, force, helmholtzHz, contactMs, peakForceN, maxRealLam] = ... woodblock_solve(P, basis, P.oversample); [p, spacingNeed, listenerInside] = ... woodblock_radiate(P, basis, Qdd, Xdd, fsHi, P.radiating_elements); [y, peakPa] = woodblock_output(P, p, P.oversample); dinfo.helmholtzHz = helmholtzHz; dinfo.contactMs = contactMs; dinfo.peakForceN = peakForceN; dinfo.maxRealLam = maxRealLam; dinfo.peakPa = peakPa; dinfo.peakSplDb = 20 * log10(peakPa / 20e-6 + 1e-30); dinfo.spacingNeed = spacingNeed; dinfo.listenerInside = listenerInside; dinfo.force = force; end