Signal Generator

Abstract

The signal generator is a mex-function for MATLAB. It can be used to generate the response of a moving sound source and receiver in a reverberant environment. The user can specify the position of the source and the receiver at each discrete time instance. The generated output signal is computed by convolving the (anechoic) source signal with the time-varying room impulse response. Multiple receiver positions can be specified to generate multiple responses simultaneously. The room impulse responses are generated using the image method, proposed by Allen and Berkley in 1979 [1]. The user can control the reverberation time (or reflection coefficients), reflection order, room dimension and microphone directivity in a way similar to the RIR generator. This package includes a MATLAB example, the mex-function, and the source code.

  1. J.B. Allen and D.A. Berkley, "Image method for efficiently simulating small-room acoustics," Journal Acoustic Society of America, 65(4), April 1979, p 943.

History

1.0.20080713 Initial version
1.0.20080209 Added myPrintf
1.1.20080211 Added progress bar
1.2.20080713 Minor improvements
1.3.20100915 * Now uses RIR Generator Version 1.9.20090822
1.4.20100920 Now uses RIR Generator Version 2.0.20100920
1.5.20110914 ** Bug fixes and added support for time-varying receiver positions

* Special thanks to Daniel Jarrett (Imperial College London, UK) for integrating the latest RIR Generator version into the Signal Generator.
** Special thanks to Adham Al-Husseiny Mostafa for his contributions to this version.

Download

How to build the MEX-function

You will need to build the MEX-function using MATLAB. MATLAB supports the use of a variety of compilers for building MEX-files. MathWorks also maintains a list of supported and compatible compilers. Once you have verified that you are using a supported C++ compiler, you are ready to configure your system to build the rir_generator using the following steps:

  1. Start MATLAB
  2. Run the following command from the MATLAB command prompt and select a C++ compiler: mex -setup
  3. Now build the MEX-function using: mex signal_generator.cpp

Please do not hesitate to contact me if you experience any problems while building the MEX-function.