SPRDSenior Physics Research DatabaseDickinson College

All projectsDirectional speaker

Simulation

Solving KZK numerically

March the KZK equation with operator splitting, validate it, then drive it with a 60 kHz carrier modulated by 1 kHz and watch the air turn it into an audible, distorted tone.

Weeks 2–3 of 4; the paper is due at the end of week 4

Goals

  • Explain operator splitting and why each sub-step can be solved exactly.
  • Pass all four validation checks and explain what each one tests.
  • Run the AM mode in air and read off the audible level and distortion against distance.

Why this matters

The simulation is how you predict what the speaker should sound like before you measure it, and later how you explain what you measured. A solver you have not validated is just a plot generator, so a good part of this step is proving the code right.

The physics

Split each step hh in zz into pieces that are each easy to solve exactly (Strang splitting: half nonlinear, full linear, half nonlinear):

  • Diffraction and absorption. In the frequency domain each harmonic and transverse wavenumber kxk_x evolves independently, so the linear step is just a phase and a decay, P^→P^ e (ikx2/2kn−αn) h\hat{P} \to \hat{P}\, e^{\,(i k_x^2/2k_n - \alpha_n)\,h}. In air αn\alpha_n comes from ISO 9613-1 for every harmonic separately, so the molecular-relaxation absorption is right at every frequency.
  • Nonlinearity. ∂p/∂z=βρ0c03 p ∂p/∂τ\partial p/\partial z = \frac{\beta}{\rho_0 c_0^3}\, p\,\partial p/\partial \tau has the implicit exact solution p(z+h,τ)=p(z, τ+b h p(z+h,τ))p(z{+}h,\tau) = p(z,\ \tau + b\,h\,p(z{+}h,\tau)): every point of the waveform slides in τ\tau in proportion to its pressure.

AM mode. The source is p0 [1+mcos⁡(2πfmτ)]sin⁡(2πfcτ)p_0\,[1 + m\cos(2\pi f_m \tau)]\sin(2\pi f_c\tau) with fc=60f_c = 60 kHz and fm=1f_m = 1 kHz. The time window is one period of the audio, 1 ms, so “harmonic nn” means n×1n \times 1 kHz: the carrier is harmonic 60, and harmonics 1, 2, 3 are the audible tone and its distortion. The code low-passes the on-axis waveform below 20 kHz to get what a listener hears, and reports the total harmonic distortion THD=A22+A32+…/A1\mathrm{THD} = \sqrt{A_2^2 + A_3^2 + \dots}/A_1.

Four analytic solutions check the code:

  1. A linear Gaussian beam, whose on-axis amplitude in 2D falls as (1+z2/zR2)−1/4e−αz(1+z^2/z_R^2)^{-1/4}e^{-\alpha z}.
  2. The Fubini solution for a lossless plane wave before shock formation, Bn=2Jn(nσ)/(nσ)B_n = 2J_n(n\sigma)/(n\sigma).
  3. The Fay solution for an old-age sawtooth, Bn=(2/Γ)/sinh⁡ ⁣(n(1+σ)/Γ)B_n = (2/\Gamma)/\sinh\!\bigl(n(1+\sigma)/\Gamma\bigr).
  4. An AM plane wave in air at short range, from second-order theory. For equal absorption α\alpha of the carrier and sidebands it reduces to
paudio(z,τ)=βp024ρ0c03 1−e−2αz2α ∂E2∂τ.p_\text{audio}(z,\tau) = \frac{\beta p_0^2}{4\rho_0 c_0^3}\,\frac{1-e^{-2\alpha z}}{2\alpha}\,\frac{\partial E^2}{\partial \tau}.

In a plane wave the audio follows the first derivative of E2E^2. Berktay’s second derivative only appears in the far field of a beam.

AM simulation in air at 3 m: the modulated carrier, its spectrum with the audible lines in red, the audible waveform against a pure 1 kHz tone, and the audible spectrum

Audible level of the 1, 2 and 3 kHz lines and the total harmonic distortion against distance on the beam axis

Hints

Hint 1Run the validation before anything else

python kzk_sim.py --validate should print ALL CHECKS PASSED. If you change the solver, run it again. The validation table belongs in your Methods section: it is the evidence that the later plots mean something.

Hint 2Watch it build up with distance

python kzk_gui.py --am opens the viewer in AM mode. Set the carrier, the tone and how far to go, then drag the distance slider to watch the audible tone appear, grow and distort, step by step. The other parameters (carrier amplitude, modulation index, source size, air temperature and humidity) are fixed in the viewer; change them with kzk_sim.py --am options if you need to.

Hint 3Turn the nonlinearity off

Run python kzk_sim.py --am 3 --linear. Where did the audible lines go? That one comparison shows the paper’s main idea: the air, not the speaker, makes the sound.

Hint 4Is that distortion real?

Plain AM with m=1m = 1 is expected to distort a lot. Second-order plane-wave theory gives A2/A1=m/2A_2/A_1 = m/2, and Berktay’s far field gives A2/A1=mA_2/A_1 = m. Where does your distance sit compared with the carrier’s Rayleigh distance zRz_R, and does the THD land between the two?

Hint 5Try square-root AM

source_waveform() builds the envelope 1+mcos⁡(2πfmτ)1 + m\cos(2\pi f_m\tau). Change it to 1+mcos⁡(2πfmτ)\sqrt{1 + m\cos(2\pi f_m\tau)} and rerun. How much does the THD drop? Compare with what you measure from the department speaker.

Hint 62D is not the department’s speaker

The code models a strip source, so its beam spreads as z−1/2z^{-1/2} while a real panel spreads as z−1z^{-1}. Shapes and trends are meaningful; absolute levels need the axisymmetric version of the diffraction step.

What past teams did

2026–27 team

We wrote kzk_sim.py following Lee & Hamilton: FFTs in xx and τ\tau for the linear step, a Newton-solved implicit shift for the nonlinear step, and an absorbing sponge at the transverse edges. Then we added the AM mode (--am), with ISO 9613-1 absorption for every harmonic and figures of the audible waveform, its spectrum and its THD. Two numerical lessons from that:

  • The nonlinear step originally used linear interpolation, which smooths the waveform a little every step. That is harmless with ~1000 samples per period (the pure tone) but not with the ~64 samples per carrier cycle that the AM window allows, so AM mode uses cubic interpolation.
  • The audible tone spreads much faster than the 60 kHz beam, so the transverse box has to be sized for the audio, not the carrier. Otherwise the audio reflects off the box edges and corrupts the result after a metre or two.

kzk_gui.py has both modes too: it imports the solver pieces from kzk_sim.py, so the two programs always use the same validated physics.