Sunteți pe pagina 1din 42

TT8303 Numerical Methods in Acoustics

Semester Project
Simulating room acoustics with the
Finite-Dierence Time-Domain method
by
Jakob Vennerd
Student, M.Sc. in Electronics
December 11, 2012
Abstract
Today, numerical simulation of room acoustics is widely used in the audio industry as well as
in architectural acoustics. Almost all commerical and non-commercial software restrict to using
geometrical methods such as ray-tracing for the simulations. These methods have a draw-back:
Low-frequency phenomena can not be simulated correctly. For many years, it has been known that
wave-based numerical methods can solve this problems, but computational issues has been a big
barrier for these. However, recent development in computing performance gives us the possibility
to do wave-based simulations on personal computers.
This project concerns the Finite-dierence Time-domain method, one of the simplest wave-based
methods. It is shown that this method behaves very well for low frequencies, but not that well for
higher frequencies. By knowing the advantages and limitations of the method, which this report
explores, it can very well be possible to use the method in practice for room acoustic simulations.
Contents
1 Introduction 1
1.1 Numerical methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Chosen method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Chosen simulation software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Theory 5
2.1 Room modes, reverberation time, absorption, reection . . . . . . . . . . . . . . . . 5
2.2 Discretizing the wave equation in three dimensions . . . . . . . . . . . . . . . . . . . 6
2.3 Stability and numerical dispersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Other FDTD schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5 Source representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5.1 Spatially distributed sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5.2 Time varying sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5.3 Signal type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.6 Boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.6.1 Hard (perfectly reecting) walls . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.6.2 Frequency independent boundary conditions (Locally Reacting Surfaces) . . . 10
2.6.3 Frequency dependent LRS boundaries . . . . . . . . . . . . . . . . . . . . . . 12
2.6.4 Modeling boundaries with Digital Impedance Filters . . . . . . . . . . . . . . 12
2.7 Designing digital impedance lters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 Matlab Implementation 15
3.1 FDTDscript.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 FDTDsimulation.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3 create2Dgrid.m and ndBoundaries.m . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4 createBoundaryConditions.m and createBoundaryConditionsLeastPth.m . . . . . . . 16
3.5 createSourceSignal.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 Numerical Results 17
4.1 Source implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Measurement of numerical dispersion . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3 Room modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.4 Angled walls - using FDTD to determine room resonances for complex shapes . . . . 22
4.5 Boundary conditions - specular reection . . . . . . . . . . . . . . . . . . . . . . . . 23
4.6 Reverberation time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5 Discussion 29
5.1 Problem and purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.2 Findings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.3 Implications and future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6 Concluding remarks 31
7 Nomenclature and Constants 33
1
CHAPTER 1
Introduction
This semester project is written for the PhD course TT8303 Numerical Methods in Acoustics at the
Norwegian University of Science and Technology. The main goal of the course is to give students an
introduction to solving acoustic problems with numerical mathematics, particularly with the use
of computers. Since computers were invented, scientists and engineers have tried to solve acoustic
problems with them. Major advancements in hardware, software and algorithm design make modern
computers capable of solving more and more complex acoustic systems. User-friendly development
software such as Matlab makes solving such problems much easier. This project deals with solving
room acoustic problems by approximating the three-dimensional wave equation.
1.1 Numerical methods
We can divide the eld of numerical acoustics in two: Geometrical methods and wave-based
methods.
In geometrical acoustics, sound is treated as rays, much like we perceive light. Ray-tracing and
image source methods are often used together to simulate sound waves which propagate through a
medium like a ray of light, or a sound particle. These particles bounce o surfaces with a specular
or random (diuse) direction, and some energy is absorbed. In general, geometrical acoustics are
the most computationally ecient methods, and they work well for high frequency sounds and
low-order reections[1]. Geometrical methods have a major drawback, though. Because real sound
waves do not behave as rays, and tend to bend around corners, geometrical methods give large
errors when the wavelength is comparable to the size of the surfaces and objects in the simulation.
By comparable one means wavelengths where the wave propagation is aected by the object size,
and not just reected. For room acoustics, Odeon and CATT are commercial software which work
well for mid to high frequencies. Ray acoustics are also used for marine acoustic applications, where
the wavelengths are small compared to the huge dimensions. In marine applications, one also have
to take into account ray bending resulting from dierent sound speeds at dierent water depths[2].
In wave-based numerical acoustics, one approach is to solve partial dierential equations (PDEs)
directly with numerical approximations. This is a more physical approach to problems, because
known equations such as the Wave equation and the Helmholtz equation describe exactly how
sound propagates, assuming low enough sound pressure levels so we can neglect nonlinearity. The
TT8303 Numerical Methods in Acoustics Semester Project
2 CHAPTER 1. INTRODUCTION
problems with wave-based methods are normally heavy computational power and memory require-
ments. Numerical approximation also results in numerical errors, which depend on the method,
the implementation and the machine number format. Popular wave-based methods are the Finite
Dierence Method (FDM), the Finite Element Method (FEM), the Boundary Element Method
(BEM), the Digital Waveguide Mesh method (DWM) and the Transmission Line Modeling method
(TLM). Most of these methods are presented in the course compendium [3]. The FDM solves the
PDEs with nite dierences approximations, divides the space into a uniform grid, and can be used
to nd solutions in both the time and frequency domain. The FEM is a more complex method
with divides the space into non-uniform elements where the sound pressure is calculated. BEM
discretizes only the surfaces and is more suitable for free-eld calculations, such as loudspeaker
modeling. The TLM and DWM are methods based on small pressure waves moving on rectangular
or triangular grids.
Few or none computer programs exists for accurate and easy modeling of wave-based room
acoustics. There are however a few general-purpose programs such as COMSOL[4] and Abec2[5]
which can solve these problems, but they are not very practical for room acoustic simulations.
1.2 Chosen method
In this project, the Finite-Dierence Time-Domain (FDTD) method is investigated. This is a
method which discretizes the wave equation and simulates waves propagating in time and space.
The method was chosen because of its simplicity and ease to implement, at least for simple geomet-
rical shapes such as a shoebox room. The Finite-Dierence Frequency-Domain (FDFD) method,
which discretizes the Helmholtz equation, was also considered. This equation gives a solution in
the frequency domain (i.e. the steady-state frequency response). However, the FDTD method has
a major advantage: It can simulate impulse responses at all discrete points in the room, and is thus
more applicable to both architectural (engineering) acoustics and virtual sound environments used
in the entertainment industry. As a consequence, other important room acoustics parameters such
as reverberation time can be derived, not just the steady-state frequency response.
Traditionally, the FDTD method has been used for solving electromagnetic problems. Most of
the literature concerns electromagnetics, but many of the principles also apply for acoustics since
the wave propagation properties are somewhat similar. In the electromagnetic domain, one has to
solve both the electric and the magnetic eld. A solution for this was rst presented by Kane Yee
in 1966, and is popularly called Yees staggered grid, describing how the electric and magnetic
elds were discretized and solved numerically. The term Finite-Dierence Time-Domain Method
was later applied by Allen Taove in 1980.
1.3 Chosen simulation software
The chosen software for programming is Matlab. This software is often used for prototyping and
simulations before implementing the program in a lower-level language such as C/C++. The main
advantages of Matlab with respect to this project are:
Matrix operations are handled very quickly, and are easy to program
Graphic representation and plotting is very easy
One does not have to worry about memory allocation and other low-level hardware operations
TT8303 Numerical Methods in Acoustics Semester Project
1.3. CHOSEN SIMULATION SOFTWARE 3
De-bugging is easy with useful warnings and errors
There are a few disadvantages too:
Performance optimization is dicult because one is restricted to using Matlabs functions and
algorithms. However, high performance implementations are possible through the Parallel
Computing Toolbox, but they will not be investigated in this project
Good 3D visualizations are a bit tricky to create
Creating stand-alone and user-friendly software can be a challenge.
Matlab is expensive and a stand-alone software developed in C/C++ would be much easier
and cheaper to use
For research and education purposes, Matlab is a good choice.
TT8303 Numerical Methods in Acoustics Semester Project
4 CHAPTER 1. INTRODUCTION
TT8303 Numerical Methods in Acoustics Semester Project
5
CHAPTER 2
Theory
2.1 Room modes, reverberation time, absorption, reection
In this section, some classical room acoustic theory will be presented.
For a rectangular room, the resonance frequencies (called room modes) can easily be determined
by the formula
f
ijk
=
c
2

_
i
L
_
2
+
_
j
W
_
2
+
_
k
H
_
2
(2.1)
where L, W, H are the dimensions of the room and c is the sound speed. However, for more complex
shapes such as rooms with angled walls, the resonance frequencies cannot be analytically calculated,
and have to be numerically predicted. In a steady-state situation, the rectangular room modes will
be distributed as
p(x, y, z) =

l,m,n
A
l,m,n
_
_
cos
_
lx
L
_
cos
_
my
W
_
cos
_
nz
H
_
_
_
cos
_
lx
s
L
_
cos
_
my
s
W
_
cos
_
nz
s
H
_
_
_
(2.2)
given a source position (x
s
, y
s
, z
s
), a receiver position (x, y, z) and mode amplitudes A
l,m,n
. Thus,
for a certain mode, if the source position is such that one of the cosine terms is zero, no sound will
be excited in theory.
The reverberation time is another important property of the room. Sabines classical equation,
T =
0.161V
A
, A =

i
S
i

i
(2.3)
where
i
is the random-incidence absorption coecient of surface S
i
, predicts the reverberation
time assuming a diuse eld. M. Schroeder found that a generalized requirement for a diuse eld
is f f
S
= 2000
_
T/V [10], called the Schroeder frequency, where T is the measured broadband
reverberation time and V is the room volume.
TT8303 Numerical Methods in Acoustics Semester Project
6 CHAPTER 2. THEORY
For absorption coecients close to one, we see that Sabines equation does not give close to
zero reverberation time as expected. C. F. Eyring[10] reformulated the equation with
A = S ln(1 ), =

i
S
i

i
/S
tot
(2.4)
which should be used for average absorption coecients greater than 0.2-0.3. The absorption and
reection coecients are dened as
() = 1 |R()|
2
, R() =
p
r
p
i
(2.5)
i.e. the relationship between the reected and incident pressure waves, assuming a plane wave
incident at an angle .
2.2 Discretizing the wave equation in three dimensions
The FDTD method is used for solving the linear wave equation, given by

2
p
x
2
+

2
p
y
2
+

2
p
z
2

1
c
2

2
p
t
2
= 0 (2.6)
where p is the pressure eld and c is the speed of sound. The equation can be approximated by
nite dierences. The central dierence for a second-order derivative is given by

i
x
2


i+1
2
i
+
i1
x
2
(2.7)
Equation (2.7) is derived from Taylors theorem[3], and it can be shown that the error is of order
O(x
2
). Approximating all the second derivatives in the wave equation gives
p
k
l+1,m,n
2p
k
l,m,n
+ p
k
l1,m,n
x
2
+
p
k
l,m+1,n
2p
k
l,m,n
+ p
k
l,m1,n
y
2
+
p
k
l,m,n+1
2p
k
l,m,n
+ p
k
l,m,n1
z
2

1
c
2
p
k+1
l,m,n
2p
k
l,m,n
+ p
k1
l1,m,n
t
2
= 0 (2.8)
where p
k
l,m,n
denotes the pressure node p(lx, my, nz, kt) in a three-dimensional grid. If we
assume the grid is uniformly spaced (i.e. x = y = z = h), we can rearrange and obtain the
update equation for p
k+1
l,m,n
:
p
k+1
l,m,n
= 2(1 3
2
)p
k
l,m,n
(2.9)
+
2
(p
k
l+1,m,n
+ p
k
l1,m,n
+ p
k
l,m+1,n
+ p
k
l,m1,n
+ p
k
l,m,n+1
+ p
k
l,m,n1
)
p
k1
l,m,n
where we dene as the Courant number:

ct
h
(2.10)
TT8303 Numerical Methods in Acoustics Semester Project
2.3. STABILITY AND NUMERICAL DISPERSION 7
2.3 Stability and numerical dispersion
Two numerical issues with the FDTD method have to be discussed: Stability and dispersion.
Stability means that under certain circumstances it is possible that the solution diverges and goes
to innity. The Courant number has to be positive, and it can be shown by von Neumann stability
or the CFL condition that a criterion for numerical stability is 1/

3 for the three-dimensional


case[3]. For the one dimensional case, the upper bound of is 1.
Numerical dispersion is the result of approximating the wave equation. The theoretical and
numerical phase velocity diers, and thus high frequency waves tend to travel slower than the real
sound speed. In 2D and 3D simulations, dispersion is also dependent on the propagation direction of
the wave, i.e. the axial, side-diagonal or diagonal direction. Actually, setting the Courant number
to its maximum, 1, in the 1D case, removes all numerical dispersion. It can also be shown that
1/

3 is the Courant number minimizing the numerical dispersion in the 3D case[6]. Observing
that the rst term in the left side of Equation (2.9) vanishes when = 1/

3, we can write
p
k+1
l,m,n
=
2
(p
k
l+1,m,n
+ p
k
l1,m,n
+ p
k
l,m+1,n
+ p
k
l,m1,n
+ p
k
l,m,n+1
+ p
k
l,m,n1
) p
k1
l,m,n
(2.11)
When using the FDTD method, the numerical dispersion will increase with frequency, up to a
certain cut-o frequency where the waves essentially travel with zero phase velocity. The calculation
of this cut-o frequency is out of the scope of this project, but for the update equation above, it can
be shown that the cut-o frequencies are 0.5f
s
, 0.304f
s
and 0.196f
s
for the diagonal( = 45

, =
35.3

), side-diagonal( = 45

, = 0

) and axial wave propagation directions, respectively. Thus we


cannot simulate sound waves with frequencies higher than 0.196f
s
with this particular numerical
scheme. However, in the diagonal propagation direction, with = 1/

3 no numerical dispersion
will occur (like the 1D case), and we can theoretically simulate up to 0.5f
s
with no error.
2.4 Other FDTD schemes
The update equation (2.9) is based on the Standard Leapfrog scheme (SLF). Other FDTD approx-
imations which use more points in the space and time domain exist, and compact explicit schemes
can be regarded as
p
k+1
l,m,n
= f(p
k
a,b,c
) p
k1
l,m,n
, a = l 1..l + 1, b = m1..m + 1, c = n 1..n + 1 (2.12)
where it is possible to approximate from up to 26 points around the center. Implicit schemes
also exist, but are likely to need much more computational power. More advanced methods than
the SLF method will not be discussed in detail here, however they are thoroughly investigated in
Kowalczyks PhD[6].
Yees original approach from 1966 to solve electromagnetic problems can also be used in acous-
tics. Instead of discretizing the wave equation, the conservation of mass and momentum equations
are approximated, and we can solve for the pressure and velocity elds alternately. Yees method
shows the same stability and dispersion characteristics as the SLF scheme, and it is essentially
mathematically equivalent.
2.5 Source representations
We have now obtained equations for solving the wave equation in three dimensions inside a volume.
We can nd the pressure in node (l, m, n) for the time step k +1 if we know the previous pressure
TT8303 Numerical Methods in Acoustics Semester Project
8 CHAPTER 2. THEORY
values in the node and neighboring nodes. To obtain the values needed for the temporal boundaries
(i.e. t = 0), we need initial conditions. The easiest way to deal with the initial conditions is to set
all pressure values to zero. A source signal can then be input to the simulation in the next time
steps. It is also possible to start with an initial wave eld.
2.5.1 Spatially distributed sources
Sakamoto, Nagatomo and Asakura [7] suggests an initial gaussian pulse
p(x, y, z) = exp
_

x
2
+ y
2
+ z
2
(Ah)
2
_
(2.13)
where A decides the pulse width. The main spectral components will lie below 0.5c/(Ax). The
gaussian pulse will then represent a source, and a wavelet will propagate outwards as the next time
steps are computed.
2.5.2 Time varying sources
While the initial wave eld pulse may be a good choice for some applications, it is dicult to
identify the original signal[8]. Thus it is often more convenient to start with a clean grid with
zero pressure values, and input the source signal to a point in the grid (i.e. p
s
(t) = s(t)). This is
known as the hard source method, and can in some situations create substantial numerical artifacts
because of a dierence in the source and surrounding nodes update equations. By simply adding
the source signal to the already present signal in the source node (called the soft source method),
we avoid the numerical artifacts, but the resulting source signal will be dierent. We then have
to measure the input signal in the source node. A third way to represent a source is to convolve
the source signal with the grid impulse response and subtract this from the source node, called a
transparent source. A true transparent source is the best source type [8], but very computationally
heavy, and thus unpractical. However, by using an excitation signal with some benecial properties,
it is possible to obtain something almost as good as a true transparent source.
2.5.3 Signal type
Several signal types (also called excitation functions) have been proposed for the FDTD method.
A popular one is the Gaussian pulse given by
s
1
(t) = exp
_

(t t
0
)
2
2
2
_
(2.14)
where decides the pulse width and t
0
the peak position. This signal has a frequency spectrum
similar to a low-pass lter, which removes high frequency components from the signal, but has some
disadvantages. Jeong et al.[8] found that a sine modulated Gaussian signal behaves much better
than the Gaussian pulse when using a hard source, giving much less low frequency artifacts. The
sine modulated version is given as
s
2
(t) = exp
_

(t t
0
)
2
2
2
_
sin(
0
(t t
0
)) (2.15)
where
0
is the centre frequency of the passband spectrum that this signal represents. A third
signal widely used in seismic applications is the Ricker wavelet (or Mexican hat). This is the
TT8303 Numerical Methods in Acoustics Semester Project
2.6. BOUNDARY CONDITIONS 9
second derivative of the Gaussian function, given as
s
3
(t) =
_
1 2
_
f
0
_
t
1
f
0
__
2
_
exp
_

_
f
0
_
t
1
f
0
__
2
_
(2.16)
where f
0
is the peak frequency in the signal spectrum.
There are thus dierent approaches on how to represent the source. One of the aims for this
project turned out to be how to implement the source in the best way. Jeong et al.[8] have found
that a Time-Limited Sine-modulated Gaussian Hard source (TLSGH) behaves good when used in
the correct way, i.e. not too close to a wall or another source. This type of source avoids the
low-frequency artifacts resulting from the Gaussian method, as well as releasing the source node
by time-limiting the source signal. Dierent source types and excitation functions will be briey
investigated later in this report, but for a detailed discussion of source methods, see Jeongs paper.
2.6 Boundary conditions
The update Equation (2.9) shows how to update the nodes inside the volume and we now know
how to do it from the time step t = 0. However, we need dierent equations at the boundary nodes
to model spatial boundary conditions such as reection, diusion, absorption, and, in general,
impedance. There are dierent methods to do this, a brief description of them will be given here.
The methods for hard, frequency independent and frequency dependent boundaries are in general
acquired from Kowalczyks work on FDTD methods [6].
Figure 2.1 show how we need to eliminate the ctional nodes outside the grid. We do not know,
and do not want to know, the pressure values outside the boundaries. Thus, for the surface, edge
and corner boundary nodes we need to solve the wave equation in a dierent way. By introducing
various boundary conditions relating to pressure and particle velocity, we can eliminate the ctional
nodes. Observe also that we can treat boundary nodes at edges and corners pointing into the room
just as normal nodes inside the volume, using Equation (2.9).
In a room acoustic simulation, a combination of hard reecting, absorbing and diusing walls
will have to be used to model the correct materials.
2.6.1 Hard (perfectly reecting) walls
The simplest case is the hard wall boundary condition. At a hard wall, we know that the particle
velocity normal to the wall is zero. The linear Eulers equation in one dimension is given by:
u
x
t
=
1

0
p
x
(2.17)
u = 0 in the x-direction so the derivative is 0. In the nite dierence form we obtain:
u
k+1
u
k1
2t
=
1

p
L+1
p
L1
2x
= 0 (2.18)
and thus p
L+1
= p
L1
. For the (L,m,n) surface node we get can set p
k
L+1,m,n
= p
k
L1,m,n
(we do
not have any information about the ctional L+1 node) and obtain:
p
k+1
L,m,n
= 2(1 3
2
)p
k
L,m,n
+
2
(2p
k
L1,m,n
+ p
k
L,m+1,n
+ p
k
L,m1,n
+ p
k
L,m,n+1
+ p
k
L,m,n1
) p
k1
L,m,n
(2.19)
TT8303 Numerical Methods in Acoustics Semester Project
10 CHAPTER 2. THEORY
i,j,k
i+1,j,k
i,j+1,k
i,j,k+1
i-1,j,k
i,j-1,k
i,j,k-1
X
Y
Z
(a) Standard leapfrog scheme node coor-
dinates
i,j,k
i+1,j,k
i,j+1,k
i,j,k+1
i-1,j,k
i,j-1,k
i,j,k-1
(b) A surface node
i,j,k
i+1,j,k
i,j+1,k
i,j,k+1
i-1,j,k
i,j-1,k
i,j,k-1
(c) A node at the intersection be-
tween to surfaces (edge)
i,j,k
i+1,j,k
i,j+1,k
i,j,k+1
i-1,j,k
i,j-1,k
i,j,k-1
(d) A corner node
i,j,k
i+1,j,k
i,j+1,k
i,j,k+1
i-1,j,k
i,j-1,k
i,j,k-1
(e) A node at an edge pointing into
the room
i,j,k
i+1,j,k
i,j+1,k
i,j,k+1
i-1,j,k
i,j-1,k
i,j,k-1
(f) A node at a corner pointing into
the room
Figure 2.1: Boundary nodes in our grid. Filled circles are nodes inside the grid, while transparent circles
are ctional nodes outside the grid.
For an intersection between two surfaces (an edge) and for a corner we get, respectively:
p
k+1
L,M,n
= 2(1 3
2
)p
k
L,M,n
+
2
(2p
k
L1,M,n
+ 2p
k
L,M1,n
+ p
k
L,M,n1
+ p
k
L,M,n+1
) p
k1
L,M,n
(2.20)
p
k+1
L,M,N
= 2(1 3
2
)p
k
L,M,N
+
2
(2p
k
L1,M,N
+ 2p
k
L,M1,N
+ 2p
k
L,M,N1
) p
k1
L,M,N
(2.21)
2.6.2 Frequency independent boundary conditions (Locally Reacting Surfaces)
To model absorption or transmission we can introduce a wall impedance at the boundary. For the
Lth node in the x-direction, we can describe the wall with an impedance Z
w
, which describes the
ratio between pressure and particle velocity:
Z
w
=
p
L,m,n
u
L,m,n
(2.22)
The assumption that the particle velocity at a surface point is only dependent on the sound pressure
at the point, and not on other points, is called a Locally Reacting Surface (LRS)[6], which in general
TT8303 Numerical Methods in Acoustics Semester Project
2.6. BOUNDARY CONDITIONS 11
can be used to model planar surfaces that are unable to propagate vibrations in parallel with the
surface. The reection factor from a surface with impedance Z
w
can be expressed as:
R() =

w
cos() 1

w
cos() + 1
,
w
= Z
w
/Z
0
(2.23)
The LRS model is good for specularly reecting surfaces, but as Z
w
approaches the characteristic
impedance of air, the reection coecient R() is only zero for normal incidence. Thus anechoic
conditions will not work that well with locally reacting surfaces. Other methods such as the
Perfectly Matched Layer (PML) method need to be used in such situations. We can rearrange and
derivate Equation (2.22) with respect to time (generalizing and skipping the node indices):
p
t
= Z
w
u
x
t
(2.24)
Combining this with Eulers linear Equation (2.17) we obtain
p
t
=
Z
w

0
p
x
= c
w
p
x
(2.25)
Now we can approximate this with nite dierences, re-arrange and obtain
p
k+1
l
p
k1
l
2t
= c
w
p
k
l+1
p
k
l1
2x
(2.26)
p
k
l+1
=
1
c
w
x
t
(p
k+1
l
p
k1
l
) + p
k
l1
=
1

w
(p
k+1
l
p
k1
l
) + p
k
l1
, Z
0
=
0
c (2.27)
By inserting this into Equation (2.9) for the Lth node, we nally get
p
k+1
L,m,n
=
_
2(1 3
2
)p
k
L,m,n
+
2
(2p
k
L1,m,n
+ p
k
L,m+1,n
+ ...)
+
_

w
1
_
p
k1
L,m,n
_
/
_
1 +

w
_
(2.28)
Which means: To obtain the next node value, we only have to multiply the node with time index k-1
with

w
1 and divide the result by 1 +

w
to model frequency independent absorption. Note that
for walls with dierent impedance we simply have to replace the following parts of the equation:

w
(
1

x
+
1

y
) (2.29)
for an edge and

w
(
1

x
+
1

y
+
1

z
) (2.30)
for a corner. We also have to multiply the pressure values at the opposite sides of the ctional
nodes with 2, just as in equations (2.19) - (2.20)
TT8303 Numerical Methods in Acoustics Semester Project
12 CHAPTER 2. THEORY
2.6.3 Frequency dependent LRS boundaries
The ultimate goal of boundary modeling is to simulate walls with frequency-dependent reection
and absorption, which means we need to introduce boundaries with memory. A simple way to model
a wall is to assume it contains resistance, spring and mass elements R, K and M. The impedance
can then be expressed as:
Z
w
(s) = R + Ms + K/s (2.31)
where s is the Laplacian variable. By transforming this to the z-domain and inserting it into
Equation (2.25) we can obtain a new update equation which can be used for these boundary
types, needing only to store a few variables in the simulation. However, modeling walls as simple
mass-spring-resistance systems is not a sucient way to model real walls, which can have a much
more complex frequency response than a simple mechanical system. Thus we need to extend the
impedance formulation to a more generalized one.
2.6.4 Modeling boundaries with Digital Impedance Filters
Kowalczyk[6] proposes using a Digital Impedance Filter (DIF) model to simulate the wall behavior.
The boundary can be simulated with a digital IIR lter of any order. Assume we have a reection
coecient R at a wall. A reectance lter R
0
(z) can be designed for normal-incidence reection
data. This data could be acquired from the measured absorption coecient = 1 |R|
2
. Note
that the phase information is not measured, and the reection factor will not necessarily be phase
correct. We can express the reectance lter as
R
0
(z) =
N

i=0
d
i
z
i
N

i=0
c
i
z
i
(2.32)
and the normalized wall impedance lter becomes

w
(z) =
1 + R
0
(z)
1 R
0
(z)
=
N

i=0
(c
i
+ d
i
)z
i
N

i=0
(c
i
d
i
)z
i
=
N

i=0
b
i
z
i
N

i=0
a
i
z
i
, b
i
= c
i
+ d
i
, a
i
= c
i
d
i
(2.33)
Equation 2.26 now becomes
p
k+1
l
p
k1
l
2t
= c
w
(z)
p
k
l+1
p
k
l1
2x
(2.34)
By transforming the pressure p
k
l
to the z-domain, doing some rearranging and transforming back
to the time domain, it is possible to obtain update equations for the dimensional boundaries. The
derivation of these equations can be found in [6]. The nal equation becomes:
p
k+1
L,m,n
=
_
2(1 3
2
)p
k
L,m,n
+
2
(2p
k
L1,m,n
+ p
k
L,m+1,n
+ ...) +

2
b
0
g
k
+
_
a
0
b
0
1
_
p
k1
L,m,n
_
/
_
1 +
a
0
b
0
_
(2.35)
TT8303 Numerical Methods in Acoustics Semester Project
2.7. DESIGNING DIGITAL IMPEDANCE FILTERS 13
For edges and corners, we can simply follow the same procedure as in chapter 2.6.2, and for the
corner we end up with
p
k+1
L,M,N
=
_
2(1 3
2
)p
k
L,M,N
+ 2
2
(p
k
L1,M,N
+ p
k
L,M1,N
+ p
k
L,M,N1
)
+
2
_
g
k
x
b
0,x
+
g
k
y
b
0,y
+
g
k
z
b
0,z
_
+
_
a
0,x
b
0,x
+
a
0,y
b
0,y
+
a
0,z
b
0,z
1
_
p
k1
L,m,n
_
/
_
1 +
a
0,x
b
0,x
+
a
0,y
b
0,y
+
a
0,z
b
0,z
_
(2.36)
We have introduced a new variable g
k
for each coordinate direction, given by
g
k
=
N

i=1
_
b
i
x
ki
a
i
y
ki
_
(2.37)
x
k
=
a
0
b
0
(p
k+1
l,m,n
p
k1
l,m,n
)
g
k
b
0
(2.38)
y
k
=
1
a
0
(b
0
x
k
+ g
k
) (2.39)
It can easily be seen that we can nd the values of g
k
explicitly, by assuming g
0
= 0. This boundary
is not valid for b
0
= 0 or b
0
= 1, which implies a reection factor of -1 or no immediate reection[6].
Note also that the equations for x
k
and y
k
need to be updated after the equations for g
k
and p
k+1
.
2.7 Designing digital impedance lters
Obtaining suitable impedance lters is not a straight-forward task. One has to take two things
into consideration: Firstly, the lter must be stable, i.e. the poles must lie inside the unit circle
in the z-plane. This can be done either by manually entering the zeros and poles of the lter, and
adjusting it to t a desired reection lter response, or by using an optimization algorithm such
as the Least Pth-Norm Optimization algorithm. Secondly, the physical properties of the reection
lter must satisfy |R
0
(z)| 1, which implies a passive boundary, that does not reect more energy
than the incident wave energy. This results in the impedance lter
w
(z) being positive real, i.e.
the real part of the impedance is positive over the whole frequency range.
To obtain the reection lter, one can use Equation (2.23). The digital lter can then be t
to the frequency response of R(f, )|
=0
, and the impedance lter can be derived as shown in the
previous chapter. However, the absorption coecient obtained from
n
= 1 |R(f, 0)|
2
is the
normal-incidence absorption coecient. To predict reverberation times through Sabines equation
T = 0.161V/A, the random-incidence absorption coecient is needed. This can be obtained by the
integral

r
=
_
/2
0
() sin(2)d (2.40)
assuming a locally reacting surface [9]. The expression for the absorption coecient can be found
from
() = 1 |R()|
2
= 1

w
cos() 1

w
cos() + 1

2
(2.41)
TT8303 Numerical Methods in Acoustics Semester Project
14 CHAPTER 2. THEORY
and the result of the integration becomes

r
=
8
|
w
|
cos
_
1 +
cos 2
|
w
| sin
tan
1
_
|
w
| sin
1 +|
w
| cos
_

cos
|
w
|
ln(1 + 2|
w
| cos +|
w
|
2
)
_
, = tan
1
_
(
w
)
(
w
)
_
(2.42)
It is also possible to design absorbers from theoretical formulas, resulting in frequency-dependent
impedances, and from these approximate impedance lters. Such absorber models can be used when
the phase information of the reection coecient is crucial. The normal-incidence impedances of a
membrane absorber and a porous absorber can be written like
Z
g
= R
m
+ jmj
0
c
0
coth(kl) (2.43)
Z
g
=
rd
3
+ j
_

0
d
3


0
c
2
0
d
_
(2.44)
where R
m
is the system resistance, m is the mass-per-area and l is the cavity depth for the membrane
absorber, d the thickness of the porous material which is assumed much smaller than the wavelength.
r is the ow resistance and is the porosity of the material. These formulas were taken from Vigran
[10].
TT8303 Numerical Methods in Acoustics Semester Project
15
CHAPTER 3
Matlab Implementation
This chapter briey describes how the FDTD method has been implemented in Matlab. In addition
to the main script FDTDscript, several other scripts were made for the dierent numerical exper-
iments. However, they are not described in detail here, but comments can be found in the code
itself. Table 3.1 shows an overview of the dierent scripts and functions. Each m-le is explained
more detailed in the following.
Function Name Description
FDTDscript.m Script for running 3D simulations. Denes constants
and room properties.
FDTDsimulation.m Runs a 3D FDTD simulation (run from FDTDscript)
create2Dgrid.m Takes in (x,y) corner coordinates, and creates a 2D
node grid
createBoundaryConditions.m Creates an impedance lter with invfreqz
createBoundaryConditionsLeastPth.m Creates an impedance lter with iirlpnormc
createSourceSignal.m Creates a source signal (Impulse, Gaussian, Ricker or
TLSGH)
ndBoundaries.m Makes a 3D grid (with parallel oor/ceiling) and nds
properties of all boundary nodes
Table 3.1: Matlab scripts and functions
3.1 FDTDscript.m
This is the script that runs the whole simulation. It denes the following input parameters to
FDTDsimulation: The length, width and height of the simulation space, the (x,y)-coordinates
of the two-dimensional corners (making it possible to angle the vertical walls), the simulation
sampling rate, the positions of the source and receiver(s), source amplitude, bools which control
plotting during simulations, boundary type, boundary data for both frequency-independent and
frequency-dependent walls and the simulation duration.
TT8303 Numerical Methods in Acoustics Semester Project
16 CHAPTER 3. MATLAB IMPLEMENTATION
Note that the digital impedance lter is made in this script, because the stability of this lter
has to be checked before a simulation can be run. Note also that all lengths are given in metres.
3.2 FDTDsimulation.m
This is the whole simulation procedure. It receives the constants dened in FDTDscript and then
executes the following: It denes internal constants, converts from metres to node indices, creates
the 2D oor grid, creates the 3D grid and identies boundary nodes and their properties, initializes
arrays, creates a source signal and nally runs the simulation loop. The loop itself consists of
updating the interior and boundary nodes, adding source input, plotting and recording receiver
outputs.
3.3 create2Dgrid.m and ndBoundaries.m
These two functions work together to identify the boundary nodes of the room. create2Dgrid takes
in the corner coordinates of the side walls, and makes a 2D grid of ones and zeros, where the zeros
are interior nodes. Then, ndBoundaries adds a oor and a ceiling, identies all boundaries, and
returns an array containing information about all the boundary nodes. This array contains location
and whether it is a surface, edge or corner node, and which neighbouring nodes are not ctional
nodes.
3.4 createBoundaryConditions.m and createBoundaryCondition-
sLeastPth.m
The createBoundaryConditions function uses the Matlab function invfreqz to approximate a re-
ection lter from a given complex frequency response. This method has some high frequency
instability issues, so in general it should not be used. createBoundaryConditionsLeastPth uses the
Matlab function iirlpnormc which ts a reection lter to an arbitrary magnitude response ob-
tained from absorption coecients. Both methods create the impedance lter coecients to be
used in the simulations, and plots the resulting reection lter.
3.5 createSourceSignal.m
This function simply creates the source signal, either Impulse, Gaussian, Ricker or TLSGH
(Time-Limited Sine-modulated Gaussian Hard source). It also plots the source signal and frequency
spectrum.
TT8303 Numerical Methods in Acoustics Semester Project
17
CHAPTER 4
Numerical Results
In this chapter, dierent properties of the FDTD method will be investigated with numerical
experiments. Focus will be on room acoustic simulations. For realistic simulations, we need the
source, medium, boundary and receiver representation to be accurate. We will look at source
implementations, numerical dispersion and dierent types of boundary conditions. The receiver
representation will not be experimented with in this project, only the recorded pressure at a node
will be used, simulating an omnidirectional microphone. Directive sources such as loudspeakers will
not be implemented, however this would be important for simulating loudspeaker systems in room
acoustics. For all the simulations, the Courant number, , was set to the upper limit of 1/

3.
4.1 Source implementations
Four dierent source implementations were implemented and tested in a simple environment: The
delta pulse, the Gaussian function, the Ricker wavelet and the Time-Limited Sine-modulated Gaus-
sian Hard source (TLSGH). Firstly, a free-eld response was measured at a distance of 3.33 metres
from the source with a sampling rate of 8 kHz. The simulated room was 10x10x10 metres, which
prevented any reections arriving before the direct sound had passed. Secondly, the impulse re-
sponse of the room with hard walls was synthesized, investigating the long-term eects of using the
dierent sources. The sampling rate was set to 5kHz to reduce computational cost in this case.
Figure 4.1 shows the time and frequency responses of the Gaussian wavelet, Ricker wavelet and
TLSGH wavelet. The delta pulse is not shown because of its well known at frequency response.
We can observe that the three signals have low-pass characteristics which contain almost no energy
above the axial cut-o frequency of 0.196f
s
. In addition, the Ricker wavelet and TLSGH wavelet
has a high-pass characteristic that removes the DC content of the signals. The TLSGH wavelet
also has much lower ripples in the frequency response, around -120dBFS compared to -80dBFS for
the Ricker wavelet.
TT8303 Numerical Methods in Acoustics Semester Project
18 CHAPTER 4. NUMERICAL RESULTS
0 1 2 3 4 5
x 10
3
0
0.5
1
Time[s]
A
m
p
l
i
t
u
d
e
Source signal
0 500 1000 1500 2000
80
60
40
20
0
Source signal spectrum, fs = 8000 Hz
f[Hz]
M
a
g
n
i
t
u
d
e
[
d
B
]
(a) Gaussian wavelet
0 1 2 3 4 5
x 10
3
0.5
0
0.5
1
Time[s]
A
m
p
l
i
t
u
d
e
Source signal
0 500 1000 1500 2000
80
60
40
20
0
Source signal spectrum, fs = 8000 Hz
f[Hz]
M
a
g
n
i
t
u
d
e
[
d
B
]
(b) Ricker wavelet
0 1 2 3 4 5
x 10
3
1
0.5
0
0.5
1
Time[s]
A
m
p
l
i
t
u
d
e
Source signal
0 500 1000 1500 2000
80
60
40
20
0
Source signal spectrum, fs = 8000 Hz
f[Hz]
M
a
g
n
i
t
u
d
e
[
d
B
]
(c) TLSGH wavelet
Figure 4.1: Time and frequency responses of the dierent source types
The direct sound from all four source types are plotted in Figure 4.2 (linear amplitude) and
Figure 4.3 (logarithmic amplitude). We can immediately see that the numerical dispersion messes
up the delta pulse signal. Theoretically the pulse could maybe be used for some kinds of simulations,
but it contains frequencies above the FDTD cut-o frequency, which implies high-frequency waves
moving with low or no speed at all. Thus we do not get a zero pressure zone at the source position
shortly after the pulse, as would be expected in a physical situation. Figure 4.4 shows the sound
eld in a section plane in the room, shortly after the the source input.
In the logarithmic plot of the direct sound signals, we can see that the Ricker wavelet has a
somewhat larger dispersive tail than the two other signals. This is most likely due to more high-
frequency content as can be seen in the frequency spectrum in Figure 4.1. Whether to choose the
Ricker or TLSGH wavelet is not obvious, but the weaker high frequency ripples in the latter may
be an advantage. There are however important reasons for not choosing the Gaussian wavelet, as
discussed in chapter 2.5.3. The Gaussian source creates an articial constant velocity which lasts
until the source is freed (i.e. when the update equation is applied for the source node). Figure 4.5
shows the disastrous low-frequency behavior (or rather DC drifting) of the Gaussian source when
simulating an impulse response in a hard-walled room.
TT8303 Numerical Methods in Acoustics Semester Project
4.1. SOURCE IMPLEMENTATIONS 19
0 50 100 150 200 250
1
0
1
Delta pulse
0 50 100 150 200 250
1
0
1
Gaussian wavelet
0 50 100 150 200 250
1
0
1
Ricker wavelet
0 50 100 150 200 250
1
0
1
TLSGH wavelet
Figure 4.2: Source signal (dashed) and direct sound from dierent source types. Note that the received
signals are up-scaled.
0 50 100 150 200 250
100
50
0
Gaussian wavelet
d
B
0 50 100 150 200 250
100
50
0
Ricker wavelet
d
B
0 50 100 150 200 250
100
50
0
TLSGH wavelet
d
B
Figure 4.3: Source signal (dashed) and direct sound from dierent source types (log scale). The signals are
normalized to 0dB peak.
TT8303 Numerical Methods in Acoustics Semester Project
20 CHAPTER 4. NUMERICAL RESULTS
Figure 4.4: Sound eld shortly after an impulse has been injected into a room
0 500 1000 1500 2000 2500 3000
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
Samples
A
m
p
l
i
t
u
d
e
Impulse response of different source signals


Gaussian
Ricker
TLSGH
Figure 4.5: Recorded impulse responses with hard walls for dierent source types
For this project, the TLSGH wavelet was chosen as the preferred source, since it shows similar
behavior to the Ricker wavelet, and is recommended by Jeong [8].
4.2 Measurement of numerical dispersion
To illustrate the eects of the numerical dispersion caused by the SLF scheme, the time response of
the direct sound was simulated in the axial, side-diagonal and diagonal direction. In Figure 4.6 we
can see that the dispersive tail is longest in the axial direction, implying more dispersion than in
the other directions. This coheres with theory. However, it is a little dicult to tell the dierence
between the side-diagonal and diagonal measurements. This could be due to the shorter dispersive
tail being hidden in the low frequency content of the time response (the excitation signal has very
little high frequency content).
We can also compute the relative sound speed by measuring the transfer function between the
source and receiver positions. The transfer function can be calculated as the Fourier transform of
TT8303 Numerical Methods in Acoustics Semester Project
4.2. MEASUREMENT OF NUMERICAL DISPERSION 21
0 50 100 150 200
150
100
50
0
Axial direction
d
B
0 50 100 150 200
150
100
50
0
Sidediagonal direction
d
B
0 50 100 150 200
150
100
50
0
Diagonal direction
d
B
Figure 4.6: Time-domain dispersion for dierent propagation directions
the received signal divided by the Fourier transform of the source signal. By using the relations

t =

, ct = c

t (4.1)
we can nd the relative sound speed c/c by knowing the phase angle of the transfer function.
Figure 4.7 shows the measured relative sound speed for the three propagation directions. These
measurements conrm that the sound speed is slowest and the numerical dispersion is largest in
the axial direction. Note that the diagonal direction has a constant sound speed, implying no
dispersion at all. This is in accordance with the theory from Kowalczyk [6]. Since the dispersion
is lower for decreasing frequencies, the FDTD method is suitable for simulating low-frequency
phenomena which cannot be accurately modeled in geometrical acoustics approaches.
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
0.7
0.8
0.9
1
1.1
Relative sound speed
c
/
c
0
f/fs


Axial
SideDiagonal
Diagonal
Figure 4.7: Relative sound speed for dierent propagation directions
TT8303 Numerical Methods in Acoustics Semester Project
22 CHAPTER 4. NUMERICAL RESULTS
4.3 Room modes
To investigate the modal properties of the FDTD method, modes in a hard-walled cubic room with
10 metre sides was measured. A wavelet was excited in two positions; in the centre of the room
and in the corner, 1 metre from the walls. The receiver was placed in the centre and the opposite
corner, respectively. To reduce computation time the sampling rate was set to 4kHz and 1 second
of sound propagation was simulated.
0 20 40 60 80 100 120 140 160 180 200
10
0
10
20
30
40
f[Hz]
A
m
p
l
i
t
u
d
e
[
d
B
]
Figure 4.8: Room modes, centre source
Figure 4.8 shows the room frequency response below 200Hz for the centre source and receiver
positions, in addition to the theoretical room modes from Equation (2.1), shown as vertical dashed
lines. Since the source and receiver are located at the centre, only even modes (i, j, k even) are
excited, and the theoretical odd modes are omitted from the plot. For low frequencies, the modes
(which can be identied as peaks in the frequency response) coincide well with the theoretical
values. However, for higher frequencies, the simulated modes tend to drop in frequency. This is
because the numerical sound speed decreases with frequency and the resonant frequencies which
are proportional to the sound speed will decrease. Note also that the theoretical lowest resonance
frequency of 17.15Hz is completely absent because of the centred source and receiver placement.
Figure 4.9 shows the sub-100Hz modes for the corner source/opposite corner receiver. The
mode density is much larger as expected, and we clearly see the lowest resonance of 17.15Hz.
0 10 20 30 40 50 60 70 80 90 100
10
0
10
20
30
40
f[Hz]
A
m
p
l
i
t
u
d
e
[
d
B
]
Figure 4.9: Room modes, corner source
4.4 Angled walls - using FDTD to determine room resonances for
complex shapes
One application of the FDTD method in room acoustics is to determine the resonance frequencies
of complex shapes, such as small recording studios. These types of problems are solvable with
TT8303 Numerical Methods in Acoustics Semester Project
4.5. BOUNDARY CONDITIONS - SPECULAR REFLECTION 23
frequency methods, such as FEM, but annoying phenomena such as utter echo needs geometrical
methods or other time-domain methods like the FDTD method. The simple cubic room from
chapter 4.3 was again simulated, but now with an angled wall as shown in Figure 4.10.
Source,
Receiver
10m
10m
6m
10m
Source,
Receiver
Figure 4.10: Cubic and complex-shaped test rooms
The measured frequency responses in Figure 4.11 show that the resonance frequencies tend to
be less pronounced when the wall is angled. The modes also seem a bit denser. However, this is
just an example of how the method can be used to determine resonance frequencies, and possibly
avoid boominess of small rooms.
0 10 20 30 40 50 60 70 80 90 100
0
20
40
f[Hz]
A
m
p
l
i
t
u
d
e
[
d
B
]
0 10 20 30 40 50 60 70 80 90 100
0
20
40
f[Hz]
A
m
p
l
i
t
u
d
e
[
d
B
]
Figure 4.11: Frequency responses of the cubic room (above) and complex-shaped room (below)
4.5 Boundary conditions - specular reection
We now move over to the boundary conditions. Implementing correct boundary conditions is
crucial for the stability and accuracy of the simulation. To simulate specular reections, a simple
measurement setup shown in Figure 4.12 was used. First, the direct sound (1) was recorded in
the source node, as well as the response of an image receiver (2) located at the opposite side
of the wall. Next, the dashed line was replaced with a wall, and the reection response (3) was
then recorded in the source node. To obtain a correct reection signal, the direct sound (1) was
subtracted from the reection (3). By applying the Fourier transforms to the resulting signals, it is
possible to calculate the reection coecient as function of frequency. Note that the signals were
truncated to eliminate other reections, which creates some diculties.
TT8303 Numerical Methods in Acoustics Semester Project
24 CHAPTER 4. NUMERICAL RESULTS
L
s
/2
(1),(3)
L
L
x
y
z
Figure 4.12: Reection measurement setup
For the hard wall reection, we get perfect results, i.e. the reection coecient is equal to one
over the whole frequency range (even above the FDTD cut-o frequency). Figure 4.13 shows the
reection factor up to the Nyquist frequency.
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
0.8
0.9
1
1.1
Reflection factor
f/fs
A
m
p
l
i
t
u
d
e
Figure 4.13: Reection from hard wall, L
s
= 3 m, L = 7 m, f
s
= 8kHz
The reectance of frequency-independent boundaries was tested with dierent reection coef-
cients of 0.9, 0.5 and 0.2. Figure 4.14 shows that the reection coecient is no longer constant,
because the numerical dispersion changes the reection properties of the wall. For low reection
coecients, the frequency dependency seems to be stronger, and actually the reection is zero at a
point. This twisting of the reection curve shows that the FDTD method in general, and the SLF
scheme in particular, cannot reproduce frequency-independent reection correctly for high frequen-
cies compared to the cut-o frequency, at least not with the simple formulation in Equations (2.19)
- (2.20). For frequencies just below the FDTD cut-o frequency, the reectance has ripples. This is
due to truncating the impulse responses because simulating signicantly longer impulse responses
without unwanted reections would require very long computation time. Note also that the rise for
very low frequencies is a result of the pressure wave not being plane [6].
TT8303 Numerical Methods in Acoustics Semester Project
4.6. REVERBERATION TIME 25
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
0
0.5
1
Reflection factor
f/fs
A
m
p
l
i
t
u
d
e


R = 0.9 R = 0.5 R = 0.2
Figure 4.14: Frequency independent reection, R(0) = 0.5, L
s
= 3 m, L = 7 m, f
s
= 8kHz
Finally, the reectance of frequency-dependent boundaries was tested. Four dierent impedance
lters were tested, all of order 4. Dierent octave-band absorption coecients were given to t a
reectance lter R(z). The values of these coecient are not important, it is the dierence between
theoretical and simulated reection coecients that matter. Three of the reectance lters was
designed to decrease with frequency, while the fourth was designed to have a low-frequency dip
simulating a resonant absorber. Figure 4.15 shows the simulated and theoretical reectances,
and it is clear that the reectance error is larger for higher frequencies, just as in the frequency-
independent case. However, for high reectance values (which are present in reverberant rooms) the
absolute error is smaller, but it remains to show if the relative error is the same. The high frequency
ripples are also a result of truncating the impulse responses. Low-frequency performance is rather
good, which strengthens the FDTD methods ability to simulate low frequency phenomena.
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
0
0.2
0.4
0.6
0.8
1
1.2
Reflection factor
f/fs
A
m
p
l
i
t
u
d
e


Simulated Theoretical
Figure 4.15: Frequency dependent reection, L
s
= 3 m, L = 9 m, f
s
= 8kHz
4.6 Reverberation time
The most important of all room acoustic parametres is the reverberation time. Therefore, the
reverberation time was simulated in rooms with dierent absorption and compared with the pre-
dicted reverberation time from Sabines and Eyrings equations. Both frequency-independent and
frequency-dependent boundaries were tested. In the frequency-independent situation, a reection
coecient was dened and the normal and random incidence absorption coecient was found with
Equations (2.40) and (2.42). In the frequency-dependent situation, third-octave band reection
TT8303 Numerical Methods in Acoustics Semester Project
26 CHAPTER 4. NUMERICAL RESULTS
coecients were tted with a digital reectance lter, and the normal-incidence absorption coef-
cients were obtained by sampling the reectance lter. Finally the random-incidence absorption
coecients were calculated with Equation (2.42).
The simulated room measured 10x7x4 metres, as shown in Fig. 4.16. The source was placed at
(2,2,2) metres and seven receivers were positioned randomly in the room. For all cases, the rever-
beration time was predicted with Sabines formula (for low absorption coecients) and Eyrings
formula (for high absorption coecients). The sampling frequency was set to 12kHz and the simula-
tion time to 75% of the maximum predicted reverberation time. This allows calculation of both T
20
and T
30
. To calculate these values, the integrated impulse response method was used, as described
in ISO 3382[11].
Figure 4.16: Simulated room, with source and seven receivers
Figure 4.17 shows simulated and predicted reverberation times in the room with frequency-
independent boundaries. Here, R = 0.97,
n
= 0.06 and
r
= 0.11, with which we can predict the
reverberation time to be 1.51 seconds by Sabines formula. The results show quite good correlation
with predicted values above 250Hz. Remember that we cannot assume a diuse eld under the
Schroeder frequency (about 170Hz for this particular room), and thus Sabines formula is inaccurate
for frequencies lower than this. For the higher frequencies, we see a slightly shorter reverberation
time than predicted. This could have several reasons, but one of the reasons could very well be the
frequency-dependency introduced by dispersion, as shown in chapter 4.5. This indicates a lower
reection coecient, giving a shorter reverberation time. In addition, high-frequency waves travel
slower due to the numerical errors, which will actually give a longer reverberation time (Sabines
and Eyrings equations are inverse proportional to c). The resulting eect of these phenomena are
not known, but the results indicate that they outweigh each other to a certain degree.
TT8303 Numerical Methods in Acoustics Semester Project
4.6. REVERBERATION TIME 27
62.5 125 250 500 1000 2000 4000
0
0.5
1
1.5
2
2.5
3
Reverberation time
F[Hz]
R
T
(
s
)


Simulated, T20
Simulated, T30
Predicted, random incidence
Predicted, normal incidence
Figure 4.17: Simulated and predicted reverberation times, constant absorption
In gure 4.18 and 4.19 frequency-dependent boundaries were tested. A chosen set of absorption
coecients were t with a 9th order impedance lter, giving the predicted reverberation times. Two
situations with low and high absorption, respectively, were tested. For both cases we see the same
low-frequency trend, which is a result of the sound eld not being diuse (the Schroeder frequency
is around 120Hz for the high absorption case and 200Hz for the low absorption case). However, the
measured reverberation times dier more at low frequencies in the high absorption case. The reason
for this is not known, but it is possible that the sound eld behaves more like plane normal-incidence
waves because of the rectangular room shape, thus giving reverberation times which looks more
like the predicted curve for normal-incidence absorption. In the high frequency region, we also see
quite a large error (up to 50%). This is likely due to dispersion eects. Despite the discrepancies in
the high absorption room, the low absorption case gives fairly accurate results above the Schroeder
frequency. This looks promising for the FDTD method, but larger rooms and higher sampling
rates, giving diuse eld conditions over a broader frequency range, should be simulated to verify
correct behavior.
62.5 125 250 500 1000 2000 4000
0
0.2
0.4
0.6
0.8
1
1.2
Reverberation time
F[Hz]
R
T
(
s
)


Predicted, random incidence
Predicted, normal incidence
Simulated, T20
Simulated, T30
Figure 4.18: Simulated and predicted reverberation times, much absorption
TT8303 Numerical Methods in Acoustics Semester Project
28 CHAPTER 4. NUMERICAL RESULTS
62.5 125 250 500 1000 2000 4000
0
0.5
1
1.5
2
2.5
3
3.5
4
Reverberation time
F[Hz]
R
T
(
s
)


Predicted, random incidence
Predicted, normal incidence
Simulated, T20
Simulated, T30
Figure 4.19: Simulated and predicted reverberation times, little absorption
TT8303 Numerical Methods in Acoustics Semester Project
29
CHAPTER 5
Discussion
5.1 Problem and purpose
This project has concerned simulation of room acoustic problems with the Finite-dierence Time-
domain method. Geometrical methods such as ray-tracing can simulate high-frequency acoustics
quite accurately and eciently, but for low-frequency simulations we need wave-based methods.
Commercially available software mainly use geometrical approaches, because of the heavy compu-
tational cost and memory load needed for wave-based simulations. This problem will however soon
be history, because of the rapid increase in computational eciency and new parallel program-
ming possibilities. Thus, much research has gone into wave-based methods over the last ten years,
preparing them for use on future hardware.
Even though it would be possible to run simulations quickly, most wave-based methods have dis-
advantages. The FDTD method suers from numerical dispersion, and representations of sources,
boundaries and receivers need thorough mathematical and physical foundations to be usable. For
example, a source which does not behave as a real point source will create wrong impulse and fre-
quency responses, even though the reverberation time and modal distribution will be quite accurate.
This project investigates some of the FDTD methods basic properties and challenges.
5.2 Findings
For the source implementations, dierent approaches exist in the literature ([7], [8]). It is possible
to initiate the grid with a certain wave eld. However, a time-domain signal input to a node is a
more preferred option, since it is possible to predict the behaviour of such methods. Four dierent
source signals were tried out. A simple impulse does not work because of the high-frequency content
which becomes heavily dispersed. The Gaussian wavelet creates low-frequency artifacts as a result
of the lack of a rarefaction. The Ricker and TLSGH wavelets show good behaviour, both being
free of DC content and time-limited. Time-limiting is essential because we do not want the source
node to aect the wave eld after the wavelet has been excited. The TLSGH source behaves much
like a true transparent source [8], and the Ricker wavelet has similar properties. However, more
research should be put into sources close to walls and multiple sources such as loudspeaker arrays.
Simple experiments showed that the numerical dispersion introduced in the grid is most promi-
TT8303 Numerical Methods in Acoustics Semester Project
30 CHAPTER 5. DISCUSSION
nent in the axial directions, while it vanishes in the diagonal directions. This is only true for the
SLF scheme, and better performance can be obtained with other numerical schemes [6], though
this is not discussed here. As a result of the dispersion, simulated room modes are only correct
for low frequencies. This is not a big issue, because room modes only occur at low frequencies in
most ordinary rooms. Thus we can combine geometrical ray-tracing methods with low-frequency
wave-based methods in a complete room acoustic simulation.
Three types of boundary conditions were experimentally tested for normal-incidence reection.
Hard walls seems to work perfectly, giving a constant reection factor equal to one for the whole
frequency range. Frequency-independent and -dependent boundary conditions cause the reectance
to decrease with frequency, giving close to correct behaviour only for low frequencies. The reason
for this is the numerical dispersion. However, simulations show that the obtained reverberation
times correlate very well with predicted Sabine/Eyring reverberation times obtained from random-
incidence absorption coecients, at least for rooms with little absorption.
5.3 Implications and future work
From the results found above, we see that the FDTD method behaves very well at low frequencies.
This solves the fundamental problem of geometrical acoustics approaches: Simulating low-frequency
diraction eects. Applying more advanced numerical schemes can increase the frequency range
in which we can simulate with acceptable results, without needing signicantly more computation
power. Previous studies ([12], [13]) show that this is possible with the use of GPU programming,
giving real-time auralization of frequencies up to 1.5kHz with a maximum dispersion of 10%.
Future work includes studying directive sources, more advanced receivers such as human heads,
more advanced numerical schemes and surface diusion. Some work has been done on diusion
[6], but this still seems like a relatively new research eld. In addition, programming issues such
as GPU computing and user-friendly interfaces needs more work. No practical commercial or free
software for FDTD simulations exist, to the authors knowledge. Integrating ray-tracing, image
source and wave-based methods can be a good approach to create a full room acoustic simulation.
However, for simpler problems such as small recording studios, the FDTD method could very well
be good enough itself when performance optimized. Finally, the eect of numerical dispersion and
boundary models on auralization should be investigated. How does it sound?
TT8303 Numerical Methods in Acoustics Semester Project
31
CHAPTER 6
Concluding remarks
The course TT8303 Numerical Methods in Acoustics is aimed to give students a basic introduction
to numerical acoustics, in addition to a project which gives deeper insight to a certain method or
problem. The author chose the FDTD method because of it seemed like a quite simple method to
implement in practice, along with a general interest of room acoustics. After working a few weeks
with the method, a lot of dierent topics appeared, but all of these could not be covered in such a
small project. However, the basics as well as selected numerical experiments were covered.
Advantages with the FDTD method showed to be the low-frequency accuracy, the ease to
implement the method for certain normal room shapes such as shoeboxes, as well as the theoretical
correctness of the method since it approximates the wave equation. Parallel implementation is
possible, giving the opportunity to make realistic models up to quite high frequencies on a single
computer.
Disadvantages include heavy computational cost and memory load on a single CPU/RAM
conguration, numerical dispersion and challenges implementing realistic boundaries. In addition,
a usable implementation for architectural acoustics would need models to be created with a 3D
modeling program such as Sketchup, and then voxelized.
Working with this method has given the author much insight into numerical methods, especially
volume-based methods. This is a research eld I would like to work more on in the future.
TT8303 Numerical Methods in Acoustics Semester Project
32 CHAPTER 6. CONCLUDING REMARKS
TT8303 Numerical Methods in Acoustics Semester Project
33
CHAPTER 7
Nomenclature and Constants
Nomenclature
BEM Boundary Element Method, a numerical method for solving PDEs
CFL Courant-Friedrich-Lewy condition for solving PDEs with nite dierences
dBFS deciBel relative to Full Scale, a way of measuring digital signal amplitude
DC Direct Current, i.e. the 0 Hz component of a signal
DIF Digital Impedance Filter
DWM Digital Waveguide Mesh, a numerical method mathematically equivalent
to the FDTD method with its maximum Courant number
FDM Finite Dierence Method, a numerical method for solving PDEs
FDFD Finite-Dierence Frequency-Domain method, a variant of the FDM,
used for numerically solving the Helmholtz equation
FDTD Finite-Dierence Time-Domain method, a variant of the FDM,
used for solving the wave equation
FEM Finite Element Method, a numerical method for solving PDEs
GPU Graphics Processing Unit
IIR Innite Impulse Response, a digital lter type
LRS Locally Reacting Surface, a boundary model
PDE Partial Dierential Equation
PML Perfectly Matched Layer, a method to implement perfect absorption
SLF Standard Leap-Frog, the Finite Dierence scheme implemented in this project
TLM Transmission Line Modeling, a numerical method for simulating wave elds
TLSGH Time-Limited Sine-modulated Gaussian Hard source
TT8303 Numerical Methods in Acoustics Semester Project
34 CHAPTER 7. NOMENCLATURE AND CONSTANTS
Constants
c The speed of sound in air, set to 343 m/s in the simulations.

0
The density of air, normally 1.21 kg/m
3
.
Z
0
The specic impedance of air,
0
c.
Courant Number, ct/x, can be interpreted as the travel.
distance of sound between two time steps, divided by the node distance.
TT8303 Numerical Methods in Acoustics Semester Project
35
Bibliography
[1] Jens H Rindel. The use of computer modeling in room acoustics. Journal of Vibroengineering,
3(4), 2000.
[2] Jens M. Hovem. Marine Acoustics. NTNU, 2000.
[3] Ulf R. Kristiansen and Erlend M. Viggen. Computational methods in Acoustics. NTNU, 2011.
[4] http://www.comsol.com/.
[5] http://www.randteam.de/abec2/index.html.
[6] Konrad Kowalczyk. Boundary and medium modelling using compact nite dierence schemes
in simulations of room acoustics for audio and architectural design applications. PhD thesis,
Sonic Arts Research Centre, Queens University Belfast, 2008.
[7] S Sakamoto, H Nagatomo, and T Asakura. Treatment of absorbing boundary conditions for
FDTD analysis on room acoustics. 19th International Congress on Acoustics, Madrid 2007.
[8] Hyok Jeong and Yiu Wai Lam. Source implementation to eliminate low-frequency artifacts in
nite dierence time domain room acoustic simulation. The Journal of the Acoustical Socitey
of America, 131, January 2012.
[9] Dr. Yiu Wai Lam. Sabine and random incidence absorption coecients. Acoustics of Enclosed
Spaces, 1995.
[10] Tor Erik Vigran. Bygningsakustikk - et grunnlag. Tapir akademisk forlag, 2002.
[11] International Organization for Standardization. ISO 3382 Part 1 - Measurement of room
acoustic parameters in perforamance rooms, 2007.
[12] Lauri Savioja. Real-time 3D nite-dierence time-domain simulation of low- and mid-frequency
room acoustics. Proc. of the 13th Int. Conference on Digital Audio Eects (DAFx-10), Graz,
Austria , September 6-10, 2010.
TT8303 Numerical Methods in Acoustics Semester Project
36 BIBLIOGRAPHY
[13] J Scheaer and B Fazenda. FDTD/K-DWM Simulation of 3D room acoustics on general
purpose graphics hardware using compute unied device architecture (CUDA). Proceedings of
the Institute of Acoustics, School of Computing, Science and Engineering, the University of
Salford, UK, 2010.
TT8303 Numerical Methods in Acoustics Semester Project