Fast image-source method: Matlab code
Summary and disclaimer
The Matlab files on this page provide an implementation of the fast image-source method (ISM) described in  for the purpose of simulating reverberant audio data in small-room acoustics. Refer to  or see the explanations given further below on this page for more detailed information on how this fast ISM algorithm is implementated. A typical example of audio samples generated with this method (compared with those obtained using a standard ISM implementation) can also be found here. The next section provides a typical example of how to use the Matlab functions provided on this page. Note that these files can also be downloaded from the MathWorks website.
As per usual, simply download and use these files as you like, but remember that all material available on this page is subject to the GNU general public license and comes with NO WARRANTY whatsoever! Please don't hesitate to contact me if you find any bug or if you have interesting suggestions to make.
Also, the method implemented in the Matlab code below effectively represents an approximation of the reverberant tail in room impulse responses. This in turn leads to some limitations in practice (see  or further below for more information on this). For a majority of applications however, the code below should allow users to generate proper ISM-based results in a very efficient manner. I am particularly interested to hear from you if you happen to make use of this code, so please feel free to drop me a line and let me know about your results. Thanks!
Fast image-source code
The Matlab functions provided on this page contain the implementation of the fast ISM algorithm. They can be used in the same manner as the files made available previously on this website (see the standard ISM page, for instance).
The first command fast_ISM_RIR_bank(...) will create and save a bank of RIRs into the file fastISM_RIRs.mat. The second command ISM_AudioData(...) takes the .mat file and the source signal vector as inputs, and computes the sensor data AuData by convolution (overlap-add). This function also offers the possibility to write the resulting audio into a .wav or .mat file. The resulting audio data is a matrix where each column contains the signal generated for the corresponding microphone. Of course, the same process can also be used if the source remains stationary and/or in environments containing only one sensor: simply define the simulation parameters accordingly in the setup file my_ISM_setup.m!
The Matlab functions required by the above process are listed in the following table. Several other functions are necessary for a proper execution; these additional files are described in more detail on the standard ISM page.
List of changes
Check the table below to see which of the files above have been updated and to make sure that you have the latest version available.
The details of the fast ISM method implemented in the code provided above can be found in . In short, this approach relies on the fact that the diffuse tail of typical RIRs have a distinctive noise-like character. The early reflections in the RIR are thus simulated according to the standard ISM algorithm , and the late (diffuse) reflections are generated using a decaying random noise model.
The exact decay of energy in the RIR typically depends on the considered environmental setup, and is computed here according to the EDC prediction formula described in . Furthermore, it was found that the RIR values in the diffuse (late) section of ISM-simulated RIRs are typically distributed according to the logistic distribution. The Matlab code provided above takes all these observations into account, and thus produces RIRs with a proper energy decay (for the considered setup) and a correct statistical distribution of the diffuse RIR values.
A significant advantage of the decaying random noise model used here is that the image-source simulations are only carried out for the early section of the RIR. This drastically reduces the required computational effort and the RIR simulation times can be decreased by up to two orders of magnitude (compared to a full-ISM simulation).
The figure below provides a typical RIR example obtained with the fast_ISM_RoomResp.m code. It also provides the result obtained using the standard ISM simulation algorithm (ISM_RoomResp.m) for comparison purpose. Both RIRs were obtained for the same simulation setup (sensor and source positions, room dimensions, reflection coefficients, etc.) defined as an environment with T60≈0.5s. It can be seen that both RIRs are virtually identical; this observation is also validated when considering the energy decay curves, which only differ by a very small amount.
Note however that the diffuse field model used here is only an approximation based on the predicted average tail decay. Therefore, some particular RIRs cannot be properly modeled with the above technique, such as when the energy decay pattern is rather irregular (non-smooth). This is typically the case in environments exhibiting a very uneven distribution of the sound absorption among the walls. In such cases, a full-ISM simulation is therefore necessary in order to obtain accurate results (i.e., the Matlab function ISM_RoomResp.m must be used instead). Note also that the above Matlab functions will automatically check the environmental parameters provided as input in order to detect whether such an irregular decay pattern is likely to occur. In such cases, the user will be warned with an appropriate message on screen and/or a warning flag will be set accordingly.
A comparison of typical audio samples generated with the standard ISM and the above algorithm can also be found here.