Physics Electrodynamics Metamaterials Audio DSP WebGL

Negative-Index Metamaterials & Talkbox Waveguides: Solving Yee-Grid FDTD & Formant Tubes at 60 FPS


ε_eff(ω₀) = −1.00 | n_eff = −1.00 (Veselago Double-Negative) | Click anywhere to inject dipole pulse
Live 2D Yee-Grid FDTD Metamaterial & Acoustic Waveguide Solver. Watch a point source on the left focus through a flat $n = -1$ Drude metamaterial slab into a sub-wavelength double focus, or switch to 1984 Talkbox Formant Tube to see standing-wave formant resonances across a vocal tract constriction.

In Quantum Tunneling in Your Browser and Superfluid Vortices in Your Browser, we saw how staggering real and imaginary wavefunction components $(\psi_R^n, \psi_I^{n+1/2})$ in time makes explicit leapfrog integration strictly unitary. Twenty-five years before Visscher's quantum leapfrog, Kane Yee (1966) discovered the exact same symplectic staggering in both space and time for Maxwell's curl equations – giving birth to the Finite-Difference Time-Domain (FDTD) algorithm.

What makes 2D transverse-magnetic ($\mathrm{TM}_z$) FDTD doubly fascinating is its mathematical isomorphism to 2D linear acoustics: mapping $(E_z, H_x, H_y)$ to acoustic pressure and particle velocity $(-p, v_y, -v_x)$ means the exact same GPU shader can simulate Pendry's negative-index metamaterial superlens (Veselago / LHM, arXiv:cond-mat/0410560; Ziemkiewicz et al., arXiv:2210.10376) AND a 1984 11-band talkbox vocal tract waveguide shaping a sawtooth synth carrier across a baritone A2–E4 chest register!


0. Why You Cannot Just Set $\epsilon = -1$ in Time-Domain FDTD

A common beginner mistake when coding a negative-index metamaterial ($n = -\sqrt{\epsilon\mu} = -1$) in FDTD is setting a static constant $\epsilon = -1$ in $\partial_t E_z = \frac{1}{\epsilon}(\partial_x H_y - \partial_y H_x)$. That immediately violates causality and explodes within 10 timesteps because a passive lossless medium with $\epsilon(\omega) \lt 0$ must be temporally dispersive ($\frac{\partial(\omega\epsilon)}{\partial\omega} \gt 0$) so electromagnetic energy density $W = \frac{1}{2}\frac{\partial(\omega\epsilon)}{\partial\omega}|\vec{E}|^2$ stays positive!

Drude Dispersive Permittivity & Auxiliary Differential Equation (ADE) FDTD Scheme
$$\epsilon(\omega) = 1 - \frac{\omega_p^2}{\omega(\omega + i\gamma)} \;\xrightarrow{\omega_p = \sqrt{2}\omega_0,\, \gamma \to 0}\; \epsilon(\omega_0) = -1$$ $$\frac{\partial \vec{J}_p}{\partial t} + \gamma \vec{J}_p = \epsilon_0 \omega_p^2 \vec{E}, \qquad \epsilon_0 \frac{\partial E_z}{\partial t} = \left(\frac{\partial H_y}{\partial x} - \frac{\partial H_x}{\partial y}\right) - J_{p,z}$$

By evolving an auxiliary polarization current density $J_{p,z}$ alongside $(E_z, H_x, H_y)$ inside the metamaterial slab, the wave experiences a genuine negative refractive index $n(\omega_0) = -1$ at carrier frequency $\omega_0$, bending rays to negative Snell angles and amplifying evanescent surface plasmons to focus below the $\lambda/2$ diffraction limit.

💻 GLSL: Staggered Yee-Grid FDTD Pass with Auxiliary Drude Current $J_p$GLSL
// RGBA16F state texel stores: R = Ez^n, G = Hx^(n+1/2), B = Hy^(n+1/2), A = Jp^(n+1/2)
vec4 C = texture2D(uState, vUv);
vec4 E = texture2D(uState, vUv + vec2(uTexel.x, 0.0));
vec4 N = texture2D(uState, vUv + vec2(0.0, uTexel.y));
vec4 W = texture2D(uState, vUv - vec2(uTexel.x, 0.0));
vec4 S = texture2D(uState, vUv - vec2(0.0, uTexel.y));

// Pass 1: Staggered Magnetic Curl Update H^(n+1/2) from Ez^n
float Hx = C.g - uDt * (N.r - C.r);
float Hy = C.b + uDt * (E.r - C.r);

// Pass 2: Staggered Electric Curl Update Ez^(n+1) + Auxiliary Drude Polarization Current Jp
float curlH = (Hy - W.b) - (Hx - S.g);
float Jp = C.a + uDt * (uOmegaP2 * C.r - uGamma * C.a) * uIsDrudeSlab;
float Ez = C.r + uDt * (curlH - Jp * uIsDrudeSlab);
gl_FragColor = vec4(Ez, Hx, Hy, Jp);

1. Electromagnetic-to-Acoustic Duality: From Superlenses to 1984 Talkbox Vocoders

When you switch the live simulator above to 1984 Talkbox Formant Tube, the exact same Yee-grid equations solve the Webster–Euler acoustic wave equations inside a variable-area vocal tract tube $A(x)$ driven at the glottis/mouthpiece by a harmonically rich sawtooth synth carrier ($f_0 \in [110\,\text{Hz}, 330\,\text{Hz}]$, baritone A2–E4):

2D $\mathrm{TM}_z$ Maxwell Quantity Acoustic Talkbox Waveguide Equivalent Physical / Musical Role
Transverse Electric Field $E_z(x, y, t)$ Acoustic Pressure $p(x, y, t)$ Radiated pressure wave picked up by the microphone outside the lips
Magnetic Field $(-H_y, H_x)$ Volume Velocity $(u_x, u_y)$ Airflow sloshing across pharyngeal ($F_1 \approx 500\,\text{Hz}$) and palatal ($F_2 \approx 1500\,\text{Hz}$) constrictions
Drude Dispersion $(\omega_p, \gamma)$ Helmholtz Wall Compliance & Viscous Damping Shapes the signature 1984 11-band talkbox formant Q-factor and nasal anti-resonances