Content uploaded by Stefano Tubaro

Author content

All content in this area was uploaded by Stefano Tubaro

Content may be subject to copyright.

Proc. of the 6th Int. Conference on Digital Audio Effects (DAFx-03), London, UK, September 8-11, 2003

SOUND SPATIALIZATION BASED ON FAST BEAM TRACING IN THE DUAL SPACE

Marco Foco, Pietro Polotti, Augusto Sarti, Stefano Tubaro

Dipartimento di Elettronica e Informazione

Politecnico di Milano

Piazza L. Da Vinci 32, 20133 Milano, Italy

marco.foco@fastwebnet.it polotti/sarti/tubaro@elet.polimi.it

ABSTRACT

This paper addresses the problem of geometry-based sound rever-

beration for applications of virtual acoustics. In particular, we

propose a novel method that allows us to signiﬁcantly speed-up

the construction of the beam tree in beam tracing applications, by

avoiding space subdivision. This allows us to dynamically recom-

pute the beam tree as the sound source moves. In order to speed-

up the construction of the beam tree, we determine what portion of

which reﬂectors the beam “illuminates” by performing visibility

checks in the “dual” of the geometric space.

1. INTRODUCTION

Advanced sound rendering techniques are often based on the phys-

ical modeling of the acoustic reﬂections and scattering in the en-

vironment. This can be modeled using either numerical methods

(ﬁnite elements, boundary elements and ﬁnite differences) or geo-

metrical methods (image source, path tracing, beam tracing and

radiosity). With all such techniques, however, computational com-

plexity may easily become an issue. One approach that enables an

efﬁcient auralization of all reﬂected paths is based on beam trac-

ing [1]. This method is based on a geometric pre-computation of

a tree-like topological representation of the reﬂections in the envi-

ronment (beam tree) through spatial subdivision techniques. The

beam tree is then used for real-time auralization through a sim-

ple look-up of which beams pass through the auditory points. It

is important to notice, however, that the tree-like structure of the

beam reﬂections makes the approach suitable for early reverbera-

tions only, as it prevents us from looping beams and implementing

the corresponding IIR structures. In order to overcome this difﬁ-

culty, we recently proposed an approach [2] that models both early

and late reverberation by cascading a tapped delay line (a FIR)

with a Waveguide Digital Network (WDN) [3] (an IIR). In this ap-

proach, the beam tree is looked-up to generate the coefﬁcients of

a tapped delay line for the auralization of early reverberation. In

order to account for late reverberation as well, we feed the out-

puts of the tapped delay lines into WDN, whose parameters are

determined through path tracing [2].

One problem of the beam tracing approach is that it assumes

that sound sources are ﬁxed and only listeners are allowed to move

around.Infact,everytimethesourcemoves,thebeamtreeneeds

to be re-computed. This may easily become a costly operation,

particularly with environments of complex topology, as it is based

on spatial subdivision algorithms.

In this paper we propose a novel method that allows us to sig-

niﬁcantly speed-up the construction of the beam tree, by avoiding

space subdivision. This allows us to dynamically recompute the

beam tree as the source moves. In order to speed-up the construc-

tion of the beam tree, we determine what portion of which reﬂec-

tors the beam “illuminates” by performing visibility checks in the

“dual” of the world space. In order to illustrate the approach, we

will assume that the world space be 2-dimensional.

2. TRACING BEAMS IN THE DUAL SPACE

The world space that we consider is made of sources and reﬂec-

tors. Sources are assumed as point-like, and reﬂectors are linear

segments. We call “active” that region of a reﬂector that is directly

“illuminated” by a source. The active portion of a reﬂector can be

made of one or more active segments (connected sets), due to oc-

clusions. Each one of the active segments generates a beam, which

is deﬁned as that bundle of acoustic rays that connect the source

with points of the active segment. Each acoustic ray wcan be de-

scribed by an equation of the form y=ax +b,whereais the

angular coefﬁcient and bis the offset on the yaxis, all referred to

a world coordinate system (x, y).Thedualˆwof that ray is thus

apoint(a, b)in parameter space. The dual of a point pof coor-

dinates (x, y), on the other hand, is a line ˆpin parameter space,

givenbyallpairs(a, b)that correspond to rays passing through p.

This means that the dual of a source is a ray.

Figure 1: The duals of a set of physical reﬂector is a collection of

strip-like regions in the dual space.

Let us now consider a reﬂector, which is a segment in world

DAFX -1

Proc. of the 6th Int. Conference on Digital Audio Effects (DAFx-03), London, UK, September 8-11, 2003

space. In order to determine its dual, we can consider the duals ˆp

and ˆqof its two extremes p and q, respectively. Such points will

correspond to two lines ˆpand ˆqin the dual space. As the reﬂector

r is made of all points in between p and q, its dual ˆrwill be made

of all the lines in between ˆpand ˆq. In other words, the dual of a

reﬂector is a beam-like region. We recall, however, that an active

segment of a reﬂector, together with a virtual source s, completely

speciﬁes a beam. The dual of this beam can be determined as the

intersection between the dual ˆrof the active segment (a beam-like

region) and the dual ˆsof the virtual source (a line). In conclusion,

the dual of a beam is a segment, just like the dual of a segment

(reﬂector) is a beam.

Pushing this formalism even further, we can deﬁne active re-

ﬂecting segments at inﬁnity (just like in projective geometry) and

beams at inﬁnity, which are those beams that are not reﬂected by

any surface. If we have a collection of reﬂectors in world space,

their duals will form a collection of beam-like regions (see Fig. 1).

We would now be tempted to say that the intersection between

the dual of a source and the dual of the reﬂectors is the dual of the

branching beams, therefore it can be used to determine the beam

tree. This would be true if there were no occlusions between re-

ﬂectors (i.e. if all points of the reﬂectors were active). In fact, mu-

tual occlusions cause the duals of reﬂectors to overlap each other,

therefore in order to determine the branching of the beams we need

ﬁrst to ﬁgure out the layering order of such regions, according to

mutual occlusions (i.e. “which region eats which”).

The layering order is not the only problem, as we need to con-

struct the tree of all possible reﬂections in the environment while

keeping track of the occlusions. In order to do so, we propose an

iterative approach that starts from the source (root) and tracks the

branching of all beams in dual space. At each iteration we con-

sider a beam at a time and we determine how this beam is split

into various sub-beams as it encounters reﬂectors on its way. This

splitting characterizes the branching of the beam tree.

Figure 2: Beam tracing in world-space. a. The source silluminates

the reﬂector r3and partially the reﬂector r4. b. The beam that

describes the reﬂection from r4(s0is the virtual source for this

reﬂection). In this ﬁgure sub-beams illuminating r3,r1and r2are

shown.

At the ﬁrst iteration we consider the source and the physical

reﬂectors (Fig. 2a). From this source a number of beams will

depart, each corresponding to an active segment of the various re-

ﬂectors. Such active segments can be determined quite straightfor-

wardly by tracing all rays that depart from the source. At this point

we consider all the beams one by one and ﬁgure out how each of

them branches out as it encounters the reﬂectors (Fig. 2b). Each

beam will keep branching out until its cumulative attenuation or

its aperture angle falls beneath some pre-assigned threshold. Let

us consider a beam originating from a virtual source s.Ifwewant

to characterize how this beam branches out, start from the active

reﬂector segment r0(Fig. 3a) that deﬁnes that beam (aperture) and

we perform a change of reference frame in order for its extremes

p0and q0to fall in the coordinates (0,1) and (0,−1), respectively

(Fig. 3b).

Figure 3: A reﬂective segment: a. in the world space, b. after

normalization relative to ri, c. in the dual space

This way, the dual of the considered aperture will be the ref-

erence strip −1≤b≤1in parameter space (see Fig. 3c). The

intersection in the dual space between the refence strip and the rep-

resentation oof the othe considered reﬂection is the area named ˆr1

that represents the visibility of r0

1from r0

0.

In Fig. 4 and 5 we can see some other examples of a reﬂector

visibility from a reference segment.

Figure 4: The visibility of r0

1with respect of r0

0. The visibility is

limited to the right half-plane of the reference reﬂector.

Let us now consider again Fig. 1, which has four physical re-

ﬂectors. Let us assume that, as the iterations go alone, r4is found

to be an active reﬂector, and we want to show how to determine the

DAFX -2

Proc. of the 6th Int. Conference on Digital Audio Effects (DAFx-03), London, UK, September 8-11, 2003

Figure 5: Another particular case of visibility. Varying the obser-

vation point on the reference segment, the two different sides of

the reﬂector r0

1are seen. This is clear from the observation of the

dual space.

branching of the beams. Therefore we will consider r4as an active

aperture, and a coordinate change is used to normalize its repre-

sentation in the space domain. We will name the new coordinate

system (x4,y

4)(superscript denotes which reﬂector is currently

the reference for the normalization), and the new representation of

the other reﬂectors will become r4

1,r4

2and r4

3. In the dual space

we obtain the set of regions of Fig. 6. Notice that r4

3partially oc-

cludes r4

1. In the dual space, when the areas that represents two

reﬂectors overlap, ther is an occlusion. By analyzing the slopes of

the dual representation of the reﬂector endpoints, it is possible to

deﬁne in the correct way the relative visibility.

Figure 6: Beam tracing in the dual space. The intersection between

ˆsand the colored regions generates a collection of segments, which

are duals of the branching beams.

A particular ordering situation between reﬂectors occurs when

the sorting between two (or more) reﬂectors is ambiguous with re-

spect to a third reﬂector (see Fig. ??). This happens when the

reﬂector’s order changes with respect to a moving point on the ref-

erence reﬂector. This could be a problem when working in metric

space, but it becomes easy to solve in the dual space. In fact, in

the dual space the visibility information is obtained by partitioning

the reference strip (−1≤b≤1), by looking at the intersections

of the segments that deﬁne the reﬂector’s endpoints.

As a last foremark it is important to notice that, without loss

of generality, the source can always be placed on the left of the

normalized aperture, as we can always replace a (virtual) source

with its specular with respect to the aperture. As we can see in

Fig. 6, the scan of the rays that deﬁne a source beam corresponds

to the scan of the points of its dual along its extension.

Figure 7: The sorting problem: a.world-space sorting is ambigu-

ous; b. solution in dual-space.

3. IMPLEMENTATION

In order to test the method that we propose, we implemented a

software application that includes a 2D CAD for creating test en-

vironments, and an auralization system based on both a traditional

beam tracer and a dual-space beam tracer. Auralization is based on

tapped delay lines, and includes HRTF and cross-fading between

beam conﬁgurations.

The geometries considered by this application are only two-

dimensional, but the method can be extended to the 3D space. The

basic structure of our auralization system is shown in Fig. 8.

Figure 8: A schematic view of the auralization algorithm embed-

ded in the beam tracing application.

In a ﬁrst step, the algorithm analyses the geometric descrip-

tion of the reﬂectors of the environment, and it extracts all the

necessary information on visibility by working in the dual of the

DAFX -3

geometric space. As this step depends only on the geometry of the

reﬂectors,as long as the environment is ﬁxed, this operation can

be performed beforehand, as a preprocessing step.

The location of the sound source and the visibility information

can now be used to construct the beam tree, or to update it every

time the source moves.

Figure 9: Building a tree level

Fig. 9 refers to the construction of one level of the beam

tree (a reﬂectiononther4reﬂector, as already shown in Fig. 6).

In this portion of the beam tree, we describe the splitting of the

generating beam (the one that is incident to reﬂector r4)intoﬁve

sub-beams (numbered from 1 to 5). Sub-beams 1 and 3 are “un-

bounded” beams (they keep propagating undisturbed), while sub-

beams 2, 3 and 5 are “bounded”, as they end up onto reﬂectors r2,

r1and r3, respectively. The process is repeated for each one of

the “bounded” sub-beams, until the number of reﬂections reaches

apre-ﬁxed maximum or until the energy associated to the beam

becomes negligible.

The beam-tree lookup block of Fig. 8 generates the ﬁlter taps

according to what beams reach the listener’s location. This update

operation is fast and can be performed frequently [1]. Through

this lookup process we obtain the direction of arrival (DOA), the

path length and the list of the reﬂectors encountered so far. This

phase requires all of the tree nodes and leaves to be visited, and the

relative beam to be tested for listener’s inclusion. If the listener’s

location falls within the beam area, the DOA and the path length

are computed. From there we can go down the beam tree towards

the root, in order to obtain the list of reﬂectors encountered along

the propagation of the wavefront.

Since it is impossible to produce one stream for every DOA,

we grouped together angular intervals in order to generate a limited

number of audio streams, one per interval. Each one of these an-

gular intervals will be attributed a separate delay line (a FIR ﬁlter).

The taps are computed considering all path lengths and relative

attenuations.

The ﬁlter bank whose parameters are generated at the previous

step, constitutes the auralization algorithm, which generates the

directional streams from an anechoic (dry) source. These streams

are then mixed for stereo headphone auralization using a HRTF. In

our implementation we used OpenAL [7] to mix 16 virtual “equiv-

alent sources” placed in circle around the listener (to simulate 16

discretized DOAs). The listener’s head orientation is accounted

foronlyinthislaststep.

In the following table we summarise what kind of computation

is required for source-listener geometry changes.

Type of motion Recomputation required

Source beam tree re-computation

Listener’s location beam tree lookup, ﬁlter bank update

Listener’s orientation no re-computation required

Every time a re-computation is required, the taps in the de-

lay lines are changed, and this can cause some clicking sounds to

be produced in the output. This can be avoided by smoothly in-

terpolating parameters in place of just switching them. A simple

method to avoid clicks is a linear interpolation in the audio streams

generated by using the “old” and “new” ﬁlters (see Fig. 10).

Figure 10: Mixing audio streams to avoid clicks.

4. PERFORMANCE EVALUATION

In order to test the effectiveness of the proposed solution, we com-

pared our implementation (dual space approach) with an optimized

one that we developed, which works in geometry space but does

not require space subdivision. In spite of the computational ef-

ﬁciency of the approach based working in metric space, the per-

formance improvement of our approach in the dual space is quite

apparent.

In the geometry space, the complexity of tracing a beam tree

level without space subdivisions depends on n, the number of re-

ﬂectors. In the dual space, the complexity depends on m(<n), the

number of “visible” reﬂectors from the reference. In most cases,

such as a typical ofﬁce conﬁguration, mdepends only on the local

geometry, and it is independent from n. For example, in a system

of square rooms the average visible faces is 6-7, but in a structure

characterized by long corridors the number of visible faces can be

higher.

In the test we performed with the geometry space approach,

the time used to rebuild the beam tree depends quadratically on

thenumberofreﬂector in the world, while our method (dual space

analysis) grows almost in a linear way (Fig. 11).

These tests have been executed on a modular set of rooms

connected by not aligned doorways: an example of this model (5

rooms, 20 reﬂectors) is shown in the program’s screenshot in Fig.

12.

5. CONCLUSIONS AND FUTURE WORK

In this paper we showed a novel, very effective algorithm to trace

beams in the 2-dimensional space to be used for virtual acoustics.

The computational efﬁciency has been achieved by exploiting par-

ticular properties of the representation in the dual space.

We also showed that the above procedure, implemented on a

standard PC platform, turns out to be very effective, and the com-

DAFX -4

Figure 11: Execution time vs. number of reﬂectors in the scene for

the standard beam tracing (diamonds), proposed method (squares).

Figure 12: Test application screenshot. The room’s model is the

5-rooms test model (20 reﬂectors).

putational saving compared with standard beam tree methods in-

creases as the complexity of the environment grows.

We are currently working on a 3-dimensional version of this

algorithm, to be used with more complex environments.

6. REFERENCES

[1] T. Funkhouser, I. Carlbom, G. Elko, G. Pingali, M. Sondhi,

J.West,“BeamTracingApproachtoAcousticModelingfor

Interactive Virtual Environments”. Computer Graphics (SIG-

GRAPH ’98), Orlando, FL, July 1998, pp. 21–32.

[2] Augusto Sarti and Stefano Tubaro: “Efﬁcient geometry-based

sound reverberation”, XEUSIPCO, Toulouse, France, 2002.

[3] J.O. Smith, “Principles of digital waveguide models of musi-

cal instruments”, in Applications of digital signal processing

to audio and acoustics,editedbyM.KahrsandK.Branden-

burg, Kluwer, 1998, pp. 417–466.

[4] S. Teller and P. Hanrahan, “Global visibility algorithms for

illumination computations”, in Computer Graphics (SIG-

GRAPH ’93 Proceedings), pp. 239–246.

[5] P.S. Heckbert and P. Hanrahan, “Beam Tracing Polygonal Ob-

jects”, in Computer Graphics (SIGGRAPH ’84 Proceedings),

pp. 119–127.

[6] L.Savioja, “Modeling Techniques for Virtual Acoustics”, PhD

dissertation, .Espoo 1999.

[7] OpenAL Documentation, available via

http://www.openal.org/.

DAFX -5