The image method of Chapter 8 needs a rectangular room with walls that reflect specularly, and it cannot represent anything that scatters, diffracts or absorbs differently at different frequencies. A grid can represent all of those, and in rooms of arbitrary shape, which is why finite-difference time-domain (FDTD) methods are used for room acoustics at all. This chapter measures the leapfrog scheme in three dimensions against the one room for which the exact answer is available, and then does the arithmetic that decides where such a method can be used. ### The scheme and the reference The scheme is Chapter 4's with the seven-point Laplacian, stable for $\lambda \le 1/\sqrt{3}$; we run it at $\lambda = 0.55$. The walls are rigid, imposed by mirroring the node inside each wall into a ghost node outside it. That mirror is the discrete method of images: the grid's solution in the room is exactly its free-space solution for the source and all its mirror images, so the only error is the scheme's own dispersion and the representation of the source. The source is a point source of strength $f(t)$, the derivative of a Gaussian with a width of 0.5 ms, injected at one node as $\Delta t^2 f(t_n)/h^3$ per step. A derivative of a Gaussian integrates to zero, so it puts no net volume of air into the box, and there is no permanent pressure offset of the kind Chapter 8 warned of. For rigid walls the exact pressure at the receiver is then the image sum $$u(t) = \sum_{\text{images}} \frac{f(t - d/c)}{4\pi c^2 d},$$ which the driver evaluates directly. With $\beta = 1$ this is the same formula as Chapter 8's, and here it is not a model but the solution. The room is $3.2 \times 2.4 \times 2$ m, the source and receiver are 1.8 m apart, and the recording lasts 30 ms, long enough for several dozen reflections. Most of the pulse's energy is below about 1.1 kHz, where its spectrum is 40 dB below its peak, and we count resolution in points per wavelength at that frequency. | nodes along 3.2 m | 16 | 24 | 32 | 48 | 64 | |---|---|---|---|---|---| | points per wavelength at 1.1 kHz | 1.5 | 2.3 | 3.0 | 4.5 | 6.0 | | relative rms error | 1.29 | 0.92 | 0.48 | 0.21 | 0.11 | | observed order | | 0.84 | 2.26 | 2.06 | 2.15 | The scheme converges at second order once it resolves the pulse at all, from about three points per wavelength. At six points per wavelength the error is 11 per cent of the signal, and by the observed order it would take about 20 points per wavelength to bring it to 1 per cent. The waveform panel shows where the error is: the direct sound and the first few reflections are nearly right on the finest grid, and the error grows with time, as each reflection arrives slightly later and slightly more smeared than it should. ### The arithmetic The time per node per step settles at about 38 ns in the command-line version of numbl and about twice that in a browser, once the grid is large enough that fixed costs no longer matter. From that rate the driver works out what the same method would cost for the room of Chapter 8, $81$ m$^3$, for one second of sound, at 10 points per wavelength, which by the three-dimensional version of Chapter 4's formula is a pitch error of about 20 cents for waves along the grid's axes and is not generous. Up to 20 kHz the shortest wavelength is 17 mm, the spacing is 1.7 mm, and the room holds about $1.6\times10^{10}$ nodes. One second is about 370,000 steps. At the command-line rate this is about seven years of computation, and in a browser about twice that; the lab prints its own figure, from the rate it measured. Up to 2 kHz, the spacing is ten times larger, the number of nodes a thousand times smaller and the number of steps ten times smaller, and the same second of sound takes about six hours at the command-line rate. The scaling behind those two numbers is the whole story. The work of a three-dimensional explicit scheme grows as the fourth power of the highest frequency it must resolve: the cube for the nodes and one more power for the time step. Every octave costs a factor of sixteen. A factor of $10^4$ between 2 kHz and 20 kHz is what separates an afternoon from a decade. Practice follows the arithmetic. Room acoustics simulations commonly split the band: a wave-based method such as FDTD below a crossover frequency, often a few hundred hertz to a couple of kilohertz, where the room's individual modes and diffraction matter, and a geometric method such as image sources or ray tracing above it, where the sound field is dense enough to be treated statistically and the wavelengths are small compared with the room. A useful landmark for the crossover is the **Schroeder frequency**, $2000\sqrt{T_{60}/V}$ Hz, above which the room's modes overlap so densely that no single one can be heard; for Chapter 8's room at $\alpha = 0.2$ it is about 170 Hz. Large FDTD simulations of full rooms are run, on graphics processors and at considerable cost, and the methods of Chapter 5 help: a fourth-order scheme needs fewer points per wavelength, and since the work goes as the cube of the resolution and one more power, every factor saved in points per wavelength is saved four times over. ### Listening The same pulse, in the same rigid room, for 0.3 s, exactly and on the grids of 16 and 32 nodes, which run at 3.1 and 6.2 kHz. The exact response rings, because the walls absorb nothing, and its timbre is set by the room's lowest modes. The coarse grid reproduces the character of that ring, a low, boxy resonance, but not its detail: its higher frequencies are missing, and those that remain have drifted in time, so the texture of the reverberation is audibly different. The finer grid is closer. Neither is close enough to pass for the exact response over the whole band, and the arithmetic above says what closing the gap would cost. ### What this chapter establishes The leapfrog scheme in three dimensions converges at second order to the exact response of a rigid room, and with rigid walls imposed by mirrors its only error is its own dispersion. It is also the most expensive method in the tutorial by a wide margin, with a cost that grows as the fourth power of the frequency, and at the full audio bandwidth it is out of reach of a browser, and of most computers, for any room one might want to hear. That is not a failure of the method so much as a statement about where it belongs: at low frequencies, in rooms of any shape, alongside geometric methods that take over where the wavelengths become small. This is where the tutorial ends. Across nine chapters the same pattern has held: an exact answer, a method measured against it, and an error that is best judged by ear. The magic time step made one-dimensional strings exact and cheap; two dimensions took the magic away and made the order of accuracy and the treatment of the boundary decide the cost; three dimensions made the cost itself the limiting factor, and the choice of method a choice of which frequencies to compute at all.