Mirror Image Method or MIM is one of many types of room simulation an acoustician can apply to estimate the impulse of a room. The theory behind the Mirror Image Method is quite simple but applying it is a little bit more tricky. I took a look in my own toolbox and I wanted to share my implementation in Python code with you! So how to calculate Mirror Image Method
Mirror Image Method is a acoustic simulation method to approximate an Echogram of a room. The method for how to calculate Mirror Image Method was shown by J. B. Allen and D. A. Berkley, in the article Image method for efficiently simulating small-room acoustics back in 1979. Today there are more advanced room simulation methods but for simple rooms Mirror Image Method can still be quite usefull.
If you do not want to read my explanation of how Mirror Image Method works, but just want the Python code to design and use Mirror Image Method, then skip to the bottom!
Mirror Image Model is based on mirroring a source relative to a receiver (e.g a microphone) when a rigid wall or walls are present, until all reflections within a given time has been simulated.
What this means is that if a source is placed 1 m from a wall and played an impulse, and the receiver was placed 2 m from a wall as seen below
The impulse would hit a t = 1m * 343 m/s = 2.9 ms and at t = 3 m * 343 m/s = 8.7 ms as seen on the echogram below. This is how to calculate Mirror Image method in its simples form.
As we increase the time we want to simulate, we get an increase in the number of images that are within our simulation time which can be illustrated with our source and receiver, all the images and a purple ring which is how far the sources impulse would travel within our simulation time.
So each time the source (red x) hits a image (blue dot) we get an impulse on the resulting echogram. I will not go through the math as I think the article in the top of this blog post does a great job describing it.
A wall is just not a wall. A wall can have very good or very bad acoustic properties, it can have very good or very bad frequency dependent properties. Therefore our Mirror Image Method should also support different walls with different frequency dependent acoustic properties.
Some examples of wall with different acoustic properties comes from the book Fundamentals of Acoustics:
|Description||Absorption [.] pr Frequency [Hz]|
|Wooden walls, 2 in||0.14||0.10||0.07||0.05||0.05||0.05|
|Acoustic plaster (approximate)||0.07||0.17||0.40||0.55||0.65||0.65|
|Concrete (poured, unpainted)||0.01||0.01||0.02||0.02||0.02||0.02|
|Fiberglass 4in. (on rigid backing)||0.45||0.90||0.95||1.00||0.95||0.85|
The wall with its properties is then modelled approximate into a minimum-phase FIR filter. This filter can then be used each time the sources impulse is hitting the wall.
Here is an example of two different wall impulses namely, “concrete (poured, unpainted)” and “Fiberglass 4in. (on rigid backing)”.
As you can see the Fiberglass act much more as a filter than the concrete which is almost just an impulse with only a reducement in amplitude. These modelled walls combined with the image theory gives us a good approximation of a rooms echogram.
Lets make an example. We have room which is 4m x 8m x 3m in size. Our source is placed at (2m, 3m, 1.5m) and the receiver is placed at (3m, 6m, 2m). Our walls are Fiberglass and the ceiling and floor is concrete. We simulate for a max time of 60 ms with an sample rate of 24,000 Hz. The 2D echogram can be seen below
As it is 2D only the fiberglass walls are used and we can clearly see that a sound will quickly decrease in strength and become quiet within 60 ms. If we compare with the 3D example below the room is much more reverberant because of the concrete ceiling and floor.
There is a minor error as the impulse loops around to the start. But thereare still many more impulses because we now include the ceiling and floor. We can also illustrate the images in a 3D space as seen below.
To conclude then we have gone through how to calculate Mirror Image Method which is relative easy. But as shown it can quickly become very complex if we want a more true model of walls with frequency variable absorption. Below you can get the code so you yourself can calculate Mirror Image Method. I hope you enjoy!
The code contains a 2D and 3D mirror Image method function, a wall modeling function and an example of how to use the functions to simulate a room.
Echogram2D: calculates the echogram of a 2D room.
Echogram3D: calculates the echogram of a 3D room.
ModelWall: calculates a minimum-phase filter based on reflection parameters.
MaterialSelector: return the reflection coeffients for different materials.
The algorithms can contain errors. To download the Python code to design and use the FIR filters, insert your contact information below and you will receive an email with the code.
If you liked this blog post you might wanna take a look at some of our other blog posts below.