Ray_acoustics_using_computer_graphics_technology
Ray_acoustics_using_computer_graphics_technology
net/publication/228703247
Article
CITATIONS READS
50 2,163
3 authors, including:
All content following this page was uploaded by Niklas Röber on 10 December 2014.
ABSTRACT very well suited for the computation of parallel problems and was
The modeling of room acoustics and simulation of sound wave also more recently employed as DSP for sound signal processing
propagation remain a difficult and computationally expensive task. [2, 3]. In the area of sound simulations, the GPU was used to solve
Two main techniques have evolved, with one focusing on a real basic geometric room acoustics [4], as well as wave-based sound
physical - wave-oriented - sound propagation, while the other ap- propagation using waveguide meshes [5]. Besides some physi-
proximates sound waves as rays using raytracing techniques. Due cal differences, the propagation of sound and light share several
to many advances in computer science, and especially computer similarities that make existing graphics rendering techniques ex-
graphics over the last decade, interactive 3D sound simulations for ploitable to accommodate an acoustic energy propagation model.
complex and dynamic environments are within reach. The goal of this work is to build a foundation for ray-based
In this paper we analyze sound propagation in terms of acoustic sound simulations using an acoustic energy propagation model,
energy and explore the possibilities to map these concepts to ra- and furthermore, to demonstrate its applicability and efficiency
diometry and graphics rendering equations. Although we concen- using modern graphics hardware and rendering techniques. We
trate on ray-based techniques, we also partially consider wave- derive the acoustic rendering equations from global illumination
based sound propagation effects. The implemented system ex- models and radiometry used in computer graphics [6], and extend
ploits modern graphics hardware and rendering techniques and is the existing model by time- and frequency dependencies. This par-
able to efficiently simulate 3D room acoustics, as well as to mea- adigm is later employed in a GPU-based implementation to per-
sure simplified personal HRTFs through acoustic raytracing. form realtime sound simulations using ray-based techniques for
the applications of room acoustics and personalized HRTF simu-
lations. The audible spectrum is divided into 10 frequency bands,
1. INTRODUCTION
which are interpreted individually with respect to their wavelength
and energy. The local energy contribution of each surface patch is
Physically correct sound simulations of larger and more complex
evaluated separately per frequency band using functions of reflec-
environments remain a difficult, if not impossible task. This is
tion, transmission/refraction, absorption and diffraction. Finally,
mainly due to the extensive nature of sound wave propagation,
the acoustic energy at the observers position is accumulated and
along its complex interaction with scene objects. Unlike light,
filtered regarding direction and distance using HRTFs. The sys-
the audible spectrum covers a large area of frequency bands (oc-
tem allows us to simulate realtime interactive and dynamic envi-
taves), and is additionally, due to a slow propagation, highly time-
ronments with varying acoustic materials, but also to approximate
dependent. Although, this introduces several complications, it also
individual HRTFs through ray-acoustic simulations.
allows, in certain situations, to discard some of the wave phenom-
The paper is organized as follows: After this introduction, we
ena, especially for the higher frequency bands. As a result, two
review in Section 2 the existing approaches for sound simulations
main approaches have evolved for the simulation of sound wave
and compare their advantages and drawbacks. Section 3 follows
propagation: The wave-based and the ray-oriented techniques, with
up on the ray-based approach and develops a model for the prop-
the first one concentrating on the lower and the last one on the mid-
agation of acoustic energy in enclosures. This model studies the
dle and higher frequency ranges. Here Section 2 has a closer look
flow of acoustic energy from sound sources, its local interaction
on both techniques and compares them in terms of efficiency and
with objects and materials, as well as the measurement using a
applicability. Although several improvements have been reported
scene mounted listener. The following Section 4 maps the here
for both techniques, sound simulations are in general performed
developed concepts onto graphics primitives and rendering tech-
offline and are valid only for certain frequency ranges. Due to ad-
niques, and discusses its implementation using modern program-
vances in computational power, as well as in computer graphics
mable graphics hardware. Section 5 presents and discusses results
and acoustics, interactive and dynamic ray-based sound simula-
using examples from room acoustic simulations and personalized
tions are feasible also for complex and more difficult scenes.
HRTF measurements. The closing Section 6 summarizes the work
Accelerated and driven by computer games and the demand
and discusses several ideas for future improvements.
for an even higher visual realism, computer graphics hardware
has evolved tremendously over the last decade and nowadays out-
performs the CPU in terms of computational capacity by several 2. ACOUSTIC SIMULATION TECHNIQUES
magnitudes. As of the easy availability of this processing power,
graphics hardware has been exploited in a number of non-graphics Auralization is defined as the simulation and reproduction of the
calculations, such as solving differential equations, as well as for acoustic properties describing a virtual scene, which has applica-
simulations and numerical analyses [1]. The GPU is, in general, tions in many areas, including architectural design, sound and mu-
DAFX-1
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
sic production and even audio-based computer games [7]. An ac- Although, the simulations using waveguide meshes are very
curate and efficient simulation is thereby still a difficult and com- accurate, there are some drawbacks as well. The two major prob-
putationally extensive task. lems are a direction dependent dispersion error, and a finite mesh
The most often employed approaches are waveguide meshes resolution to model a more complex boundary behavior [8]. Sev-
and raytracing techniques, see also Figure 1. Figure 1(a) displays eral approaches have been discussed to overcome these limitations
here a visualization of the waveguide technique, a more physi- and include higher tesselated meshes, different mesh topologies
cally correct wave-based sound propagation model, based on time- and frequency warping techniques [12, 13]. Additionally, the sam-
domain finite difference meshes. The acoustic energy, eg. pres- pling frequency of the rooms impulse response needs to be over-
sure, is distributed along sampling points using difference equa- sampled, with previous research showing that a typical waveguide
tions. Figure 1(b) shows a visualization of the ray-based approach mesh gives a valid bandwidth only as far as fupdate /4 [8]. There-
that approximates sound waves through particles and acoustic en- fore, this technique is only practical to the very lower frequency
ergy, and were raytracing techniques are used to determine the vir- end. However, recent research has shown that waveguide meshes
tual soundfield. As both techniques have their own advantages and can easily and efficiently be implemented using graphics hardware.
limitations, the wave-oriented techniques are usually employed for Combined with a new sampling lattice, the performance increase
the lower frequency end, while the ray-based techniques are used was measured by a factor of 25, and even more for finer mesh
for the middle and higher frequency parts. resolutions [5].
DAFX-2
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
fj frangej (Hz) fcenterj (Hz) λcenterj (m) ume element per unit time. The quantity for describing and mea-
suring acoustic energy is radiant power Φ, or flux, and measured
f0 22 – 44 31.5 10.88
in W att or Joule/sec [6]. The intensity is thereby described as
f1 44 – 88 63 5.44
the amount of acoustic energy flowing from/to/through a surface
f2 88 – 177 125 2.74
element per unit time:
f3 177 – 354 250 1.37
f4 354 – 707 500 0.68 dΦ
f5 707 – 1,414 1,000 0.343 I(t) = dt. (2)
dA
f6 1,414 – 2,828 2,000 0.172
The transfer of acoustic energy using a participating media
f7 2,828 – 5,657 4,000 0.086
(air) is characterized by the energy transport theory. The energy
f8 5,657 – 11,314 8,000 0.043
density in the medium of propagation is hereby the sum of the
f9 11,314 – 22,627 16,000 0.021
kinetic and potential energy per unit volume dV and time E(t) =
Ekin (t) + Epot (t) [25]. The kinetic energy density is defined as
Table 1: Frequency Bands fj . the pressure of a sound wave as:
1 M v2 1
energy and its interaction with objects can be measured and de- Ekin (t) = dt = ρ0 v 2 dt, (3)
2 V0 2
scribed by using techniques of radiometry, from which global il- with v being the average velocity of air particles, ρ0 the av-
lumination models used in computer graphics are derived [6]. The erage media density and VM0 its mass per unit volume V0 . The
concepts of radiometry, along its properties and equations, can be potential energy density can be derived from the gas law as:
mapped to the propagation of acoustic energy as well. This as-
R
sumes that the propagation of sound waves can be simplified to pdp 1 p2
a ray-based approach by largely neglecting characteristics such as Epot (t) = 2 dt = dt, (4)
c ρ0 2 c2 ρ 0
wavelength, diffraction and interference. For middle- and higher
frequencies, and depending on the rooms and enclosed objects with p as the pressure of the sound wave and c as the speed
size, this assumption is true to a certain degree. Especially at the of sound in this medium, and therefore defines the total amount of
lower frequency end wave-based effects become such prominent acoustic energy density [25] as:
that they prevail. Therefore, the here discussed model also ad-
dresses these issues and incorporates the wavelength to approxi-
1 p2
mate diffraction and interference effects. The following sections E(t) = Ekin (t) + Epot (t) = (ρ0 v 2 + 2 )dt. (5)
discuss the theories behind, and extend the concepts of radiometry 2 c ρ0
towards a ray/energy-based acoustic propagation model suitable Equation 5 is valid at any position and time within the virtual
for sound wave simulations. auditory environment and serves as basis to describe an acoustic
energy propagation model. In order to quantitatively measure flux
3.1. Emission and Radiation per unit projected surface area and per unit angle, radiance is in-
troduced with:
In order to study and describe the propagation of sound waves us-
ing raytracing techniques, an adequate propagation model that in- d2 Φ
corporates time- and frequency dependencies needs to be defined. L(x, Θ) = , (6)
dωdAcosθ
This can be realized in analogy to the physics of light transporta-
which varies with position x and the ray’s direction Θ. By
tion and global illumination models [6], which now have to be
incorporating the wavelength λj of the frequency bands used (ref.
extended and adopted towards acoustic properties and an acoustic
Table 1), Equation 6 is redefined to:
energy propagation [25].
Whereas the wavelength of the visible spectrum ranges only Z
between 380 nm to 780 nm, the wavelength in acoustics spreads L(x, Θ, fj ) = L(x, Θ, fj )dλ. (7)
As
from 17 mm at 20 kHz up to 17 m at a frequency of 20 Hz. The
frequencies in the audible spectrum are classified and described by The acoustic energy interacting with a surface element can
frequency bands (octaves) according to human psychoacoustics. be further differentiated in incident Ei (incoming) and exitant Ee
In the following sections fj describes a certain frequency band, (outgoing) energy, and is also measured in W att/m2 :
with j being the index number and j+1 the next higher octave. Ta-
ble 1 provides an overview of the different frequency bands, along dΦ
Ei = , Ee = kEi . (8)
their index number, frequency range frangej , center frequency dA
fcenterj and center wavelength λcenterj . The audible spectrum The scalar k is herby defined over [0, 1] and describes the re-
Aspectrum is therefore defined as the sum of these 10 frequency flectivity of the surface with Esurf ace = Ei − Ee and is affected
bands: by the surface material definition. Using a lossless participating
media, the exitant radiance at one point L(x1 → Θ) is exactly
X
9
the same as the incident radiance at another point receiving this
Aspectrum = As = fj . (1) amount of energy L(x2 ← Θ) [6]. Using a density function and
j=0 volume elements, p(x)dV defines the physical number of sound
Similar to light, acoustic energy can be described as the amount particles carrying an acoustic energy quant. If moved in time dt
of pressure variations per unit volume and time, or more accu- across a differential surface area dA, and by using the direction
rately, by the changes in velocity of air particles contained in a vol- ω and speed of propagation c; N = p(x, ω, fj )cdtdAcosθdωdλ
DAFX-3
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
describes the number of particles flowing through this surface ele- Transmission is defined as the energy that passes through an
ment. The radiance per unit volume is accordingly redefined to: object. We redefine this term to describe the frequency-weighted
Z Z amount of energy that passes through an object unaltered and with-
c out refraction. In acoustics, objects smaller than the wavelength of
L(x, Θ, fj ) = p(x, ω, fj )h dλ. (9)
As λ j an incoming sound wave do not interfere, instead the wave simply
An energy/sound source emits acoustic energy that is propa- diffracts around the object and continues unchanged. An according
gated through and by the participating media. The energy radiates frequency dependent modeling of energy transmission can be real-
through an emittance pattern, which can be homogenous in any di- ized using an objects bounding box or sphere that simply transmits
rection, eg. spherically, or direction dependent, such as a cone. As all acoustic energy whose wavelength is equal or above the objects
with light, also acoustic energy attenuates with distance using the size:
familiar inverse square law. Furthermore, atmospheric absorption
occurs, at which certain frequencies are absorbed by the propagat- X
9
ing media. However, this factor is very small and can safely be Letransmitted (x → (π + Θ)) = Eij τfj . (11)
ignored for smaller enclosures, but becomes more prominent with j=0
section. Every ray that is cast into the scene contains, depending Leref lected (x ← Θi ) = Eij υfj , (14)
on the sound source emittance of course, the energy of all fre- j=0
quency bands. The energy contribution of each ray is evaluated in which υfj is a weighting factor per frequency band fj . The
at the point of intersection with the surface patch using the ray’s majority of materials, however, exhibit a sort of glossy surface, a
length, as well as the surface material properties defined. combination of specular reflection and diffuse scattering.
Some of the incident acoustic energy is thereby usually ab- Refraction occurs at the crossing of two different isotropic me-
sorbed, converted into heat and dissipated back into the system. dia and can be computed similar to the reflection term in Equa-
The absorption is frequency dependent and characterized by a fre- tion 12, except that the outgoing angle Φ of the refracted ray is
quency band coefficient αfj : determined using Snell’s Law: sinΦ = ηη22 . Here η1 and η2 are
the refraction indices of their respective media. A frequency band
X
9
Leabsorbed (x ← Θ) = Eij αfj . (10) weighted refraction can be defined similar to Equation 14 by using
j=0 νfj as weighting coefficient per frequency band.
DAFX-4
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
3.3. Diffraction and Interference Interference describes the superposition of two or more sound
waves and the resulting changes in amplitude. Using a ray-acoustic
Edge diffraction and interference are acoustic phenomena that can sound simulation, interference effects can only be approximated
be modeled accurately using wave-based techniques, but do not fit roughly using the ray’s length and the center wavelength λcenterj
well into the concept of ray-acoustic simulations. However, both of the current frequency band fj . By using an additional scalar as-
are very important and prevail especially in the lower frequency sociated with each ray, also the modeling of phase-preserving and
ranges. Therefore, and in order to obtain a more realistic simu- phase-reversing reflections are possible. The next section focusses
lation, these effects have to be included, or at least approximated. after these theoretical discussions on the implementation of the
Generally, this is done by combining wave-based and ray-based here described acoustic energy propagation model using efficient
approaches and by choosing a certain threshold as boundary fre- computer graphics hardware.
quency. But to a certain degree, these effects can also be approxi-
mated within ray-acoustics.
4. GRAPHICS-BASED RAY ACOUSTIC SIMULATIONS
Sound waves with larger wavelength simply bend around edges, 4.1. Auralization Pipeline
such as if an additional sound source was placed at the diffraction
edge. Diffraction effects are in ray/energy acoustics simply mod- The auralization pipeline employed in our system stretches over
eled through ray-bending, according to the ray’s length and its as- the CPU and GPU systems, but the majority of computations is
sociated frequency band fj . As diffraction is dependent on the carried out in graphics hardware. Figure 4 shows an overview of
objects size and the ray’s wavelength, the amount of energy that is the pipeline, along its partition in CPU and GPU related tasks. As
diffracted is determined individually per frequency band fj . The initialization, 3D scene data, as well as sounds and frequency band
maximum possible diffraction angle was herby determined exper- decomposed HRTFs are loaded into texture memory. The sound
imentally using a wave-based sound propagation system [5]. Fig- data is also decomposed into 10 bands and assigned a position and
ure 3 visualizes the concept of the implemented diffraction sys- emittance pattern within the virtual room. Rays are now cast into
tem. It shows a virtual scene from the listener’s perspective (Fig- the scene starting at the listeners position, and the per frequency
ure 3(a)), the constructed edge map (Figure 3(b)) and the by angle band received acoustic energy is accumulated and stored within so
α diffracted ray from a listener to a sound source (Figure 3(c)). For called cubemaps. This cubemap is later evaluated and the sound
each edge in Figure 3(b), additional rays are cast into the scene for data is filtered and delayed using HRTFs according to their po-
diffraction simulation. sition and the ray’s length. The binaural mixdown is performed
DAFX-5
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
DAFX-6
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
this with a highly parallel design. Combined with a fast and op-
timized memory architecture for accessing and storing the data,
this makes this hardware very interesting for any computationally
intensive and parallelizable task.
All convolutions and sound synthesis are carried out using
fragment shaders on graphics hardware, with a single shader for
each task. The data, eg. sounds, geometry and material definitions
are stored within textures and accessed during the rendering task
from within the shaders. The results of the simulation are again
stored as textures, from which they are read back to the CPU for (a) Church. (b) Living Room.
sound playback.
1 1
Intensity
Intensity
5. RESULTS AND DISCUSSION
DAFX-7
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
DAFX-8