Room Acoustics Modeling
by: Philip Edelbrock
Project Goal:
The goal of this project is to understand how to model the acoustics of a room using DSP methods given such parameters as: room size, room composition, room shape, and the location of the sound source and listener. FIR and IIR implementations will be discussed and compared. All discussed implementations are attempts at realizing the following system:
Diagram 1 - The conceptual system we are aiming to implement.
FIR Implementation:
Probably the most obvious and easiest implementation is the brute force method of applying the transfer function ( h(t) ), also known as the impulse response, directly to the input signal via a convolution.
Diagram 2 - Typical acoustic impulse response of a room.
This method has the benefit of using either an artificially composed impulse response, or one which was sampled directly from the actual room. Sampling from the actual room involves the recording of a simulated impulse, such as from an electrical arc, fire-cracker explosion, clapping of the hands, etc.
Diagram 3 - The impulse response of my living room. X-axis is labeled in seconds and the Y-axis is labeled in 16-bit magnitude. 48kHz sampling.
If the simulated impulse used is too much unlike an ideal impulse, the resulting signal can be refined by deconvolving it with a recording of the simulated impulse which was recorded from a location with no reverberations (at an anechoic location). The result, in theory, should be the response of the room with an ideal impulse.
An artificial composition of the impulse response can also be realized. This, however, will be discussed in the next section in this paper.
Once a viable h(t) has been acquired, a FIR implementation of the system can be realized using a simple convolution. However, the impulse response of a room (especially a large one) can be quite long. A typical reverberation response to an impulse of a large room is about 4 seconds. With a modest sampling rate of 8kHz, a FIR filter of order 32,000 will be required. This is quite unpractical, especially if multiple channels are being processed or if a higher sampling rate is being used. Therefore, a more efficient implementation is needed.
IIR Implementation:
Before the technical description of the IIR filter is given, a detailed decomposition of a room's impulse response should be given.
Diagram 4 - A visual example of how sound propagates through a room and its corresponding impulse response.
When a sound is generated in a room, the listener will first hear the sound via the direct path from the source. Shortly after, the listener will hear the reflections of the sound off the walls which will be attenuated. Each reflection will then in turn be further delayed and attenuated as the sound is reflected again and again off the walls. This results in the total reverberation of the sound.
Further examination of the impulse response of a room yields the observation that the sound decays at an exponential rate which can be mathematically predicted via the following relation:
Equation 1 - Sabine's Equation for reverberation time.
Where V is the volume of the room in cubic meters and A is the room's imaginary 'absorption window' (in square meters) which is calculated by a sum of the surface areas of the room times its corresponding absorption coefficient. The equation returns a value in seconds that it takes for the sound in the room to decay 60dB. Some example absorption coefficients are shown in the table below:
Frequency (Hz) Material 125 250 500 1000 2000 4000 Concrete block, unpainted 0.36 0.44 0.31 0.29 0.39 0.25 Concrete block, painted 0.10 0.05 0.06 0.07 0.09 0.08 Glass, window 0.35 0.25 0.18 0.12 0.07 0.04 Plaster on lath 0.14 0.10 0.06 0.05 0.04 0.03 Plywood paneling 0.28 0.22 0.17 0.09 0.10 0.11 Carpet on pad 0.08 0.24 0.57 0.69 0.71 0.73 Gypsum board, one-half inch 0.29 0.10 0.05 0.04 0.07 0.09 Drapery, lightweight 0.03 0.04 0.11 0.17 0.24 0.35 Table 1 - A brief list of absorption coefficients from [7] in meters squared. |
Adjustments can also be made for furniture in the room, people, and temperature of the air. See [7] for more information..
Now, let's examine an example implementation of the IIR filter. The heart of the IIR filter is its ability to properly model the reflections of the sound with a controllable delay and which decays exponentially. To do this, a comb filter can be used.
Diagram 5 - The comb filter, impulse response, and spectral response.
An examination of the spectral response shows that the minimum response of the comb filter is:
Equation 2 - Minimum response of the comb filter as a function of the loop gain 'g'.
And, the maximum is:
Equation 3 - Maximum response of the comb filter as a function of the loop gain 'g'.
From [1], it is suggested that the ratio of these two should not exceed 22dB or the signal will take on an undesired 'colored' quality. Therefore the loop gain should not exceed 0.85 to stay within these limits.
To produce a comb filter which produces the desired decay time (time to decay 60dB), the following can be shown to be true:
Equation 4 - Equation for the decay time as a function of the loop gain and delay.
This can be directly equated to equation 1 above to design a comb filter which decays at a rate consistent with the room being modeled.
For added realism of sound interference, the gains could be made negative to simulate "hard" bounces of the sound off the walls of the simulated room. This effect is common in rooms with hard walls such as concrete. Special dipole speakers used for rear channels in some surround sound systems use this effect to hard bounce the sound off a rear wall. (Thanks goes to Kevin T. Kilty kkilty@ix.netcom.com for pointing this out.)
In the final implementation, the design of multiple comb filters (usually 4 or more) in parallel with slightly varying loop gains and delays will produce a filter which simulates the random-like number and frequency of sound reflections that would be heard in an actual room.
To simulate the result of the distance between the listener and the sound source, the output of the IIR filter can be mixed in the desired proportion to the original input signal to control the amount of reverb.
Diagram 6 - Comb filters section of the IIR filter.
To further increase the density of the modeled reflections, the filter is then followed by two all-pass filters in series with the comb filters. In actuality, the number of reflections is not actually increased but spread from the phase delay properties of the all pass filters.
Diagram 7 - All-pass filters section of the IIR filter.
This results in a density of reflections at any time t after an impulse response of:
Equation 5 - Equation of the increased reflection density as a result of the all-pass filters.
To realize the all-pass filters, the gains should be equal to the inverse of the square root of two. This ensures stability of the all pass filters and provides the correct ammount of phase delay for the data from the comb filters.
Diagram 8 - Complete IIR room acoustics model filter.
This completes the simple design of the IIR filter to model a room. This filter is called a 'reverberator' filter. More complicated models can be constructed which can more closely model the resonant frequencies present in a room by altering the all-pass filters to reflect the different resonances.
Conclusions and Lab Results:
For the most accuracy, the FIR implementation is the choice solution. However, the very high order of the filter required makes it unfeasible. Therefore, the IIR implementation must be explored.
After implementing the discussed IIR filter and properly configuring the delays and gains, the results were surprisingly accurate (in a purely qualitative sense). Some 'tinkering' of the comb filters was done to produce a staggered delay of simulated reflections, but the results were quite satisfactory. The resulting filter models the shape and size of the room, surface composition, and distance from listener to source. Further implementation of multiple channels (left, right, center, and rear) is quite feasible, but beyond the scope of this project.
Postword to Web Browsers:
This project report was written for the Winter term of '96 ECE-464 "DSP" class. The original report didn't cover the details on implementing the different frequency characteristics of a room implied by Table 1, but I would like touch lightly on the subject here.
Ideally, a frequency responsive filter placed inside the feedback path of each comb filter would give a realistic response. However, this would take a considerable amount of computation power, particularly if the filter were realized in a real-time environment. A simpler approximation which would require less computational power/time would be to put the filter either before or just after the all-pass filters shown in the realization in Diagram 8. Or, perhaps the all-pass filters could be completely replaced by the frequency responsive filter.
Much of this topic was new to me, and I am still making new discoveries and observations. I am, as always, open to comments, enlightenments, and/or questions. I am also interested in the potential for publishment/reprint of this paper. Contact me via email at edelbrp@ece.orst.edu.
In the process of working on this project I have written a bit of Matlab code which implements a IIR version of room acoustics simulation:
Click here to view an example Matlab script that implements this filter.
Resources:
1. Ando, Y. Concert Hall Acoustics. New York: Springer-Velag, 1985.
2. Anonymous. ODEON:Room Acoustics Modelling Software. Web site: "http://www.dat.dtu.dk/~odeon/"
3. Bank, Knud. The application of Digital Signal Processing to Large-Scale Simulation of Room Acoustics: Frequency Response Modelling and Optimization Software for a Multichannel DSP Engine. Journal of the Audio Engineering Society. v40 p260-76 April 1992.
4. Botteldooren, D. Finite-Difference Time-Domain Simulation of Low-Frequency Room Acoustic Problmes. The Journal of the Acoustical Society of America. v98 p3302-8 December 1995.
5. Kinster, L. E. and Frey, A. R. Fundamentals of Acoustics. 2nd Edition. New York: John Wiley & Sons, Inc. 1962.
6. Peterson, Patrick M. Simulating the Response of Multiple Microphones to a Single Acoustic Source in a Reverberant Room. The Journal of the Acoustical Society of America. v80 p1527-9 November 1986.
7. Rossing, Thomas D. The Science of Sound. Menlo Park, California: Addison-Wesly, 1982.