Site menu:

Signal Generator for MATLAB

Abstract

The signal generator is a mex-function for MATLAB. It can be used to generated 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.

References

  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 Mr Daniel Jarrett (Imperial College London, UK) for integrating the latest RIR Generator version into the Signal Generator.

** Special thanks go to Mr. Adham Al-Husseiny Mostafa for his contributions to this version.

Download

Latest version (including source code)

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.

Copyright

Copyright (C) 2008-2011 E.A.P. Habets.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA