Industrial Experiences

Professional Services


Spherical Microphone array Impulse Response for Directional source generator (SMIRDgen)

by Sina Hafezi, Alastair H. Moore, and Patrick A. Naylor

Microphone Type: Spherical array

Coding Language: MATLAB


To appear.


In this work we present a new room impulse response simulation for spherical microphone arrays taking into account source directivity. We calculate the emission angle of the sound ray leaving the source based on the location of the image and the receiver using Allen and Berkley's image method [1]. We provide an implementation of a room impulse response simulator for a spherical microphone array which follows the same structure explained in [2,3] but includes a directional source with arbitrary directivity. We validate our implementation considering the zeroth and the first-order reflections. Our results show a worst-case directional gain error of 7% in comparison with theoretical predictions.


  [1] J. B. Allen and D. A. Berkley

  Image method for efficiently simulating small-room acoustics, Journal of the Acoustical Society of America, Volume 65, Issue 4, pp. 943-950, April 1979.

  [2] D. P. Jarrett, E. A. P. Habets, M. R. P. Thomas and P. A. Naylor

  Rigid sphere room impulse response simulation: algorithm and applications, Journal of the Acoustical Society of America, Volume 132, Issue 3, pp. 1462-1472, 2012.

  [3] D. P. Jarrett, E. A. P. Habets, M. R. P. Thomas and P. A. Naylor

  Simulating room impulse responses for spherical microphone arrays, Proc. of the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP 2011), Prague, Czech Republic, May 22-27, 2011.


Download Code


- 09-Sep-2015: Bug fixed by Sina Hafezi.


%% Setup
procFs = 8000;                      % Sampling frequency (Hz)
c = 343;                            % Sound velocity (m/s)
nsample = 300;                      % Length of desired RIR
N_harm = 20;                        % Maximum order of harmonics to use in SHD
K = 2;                              % Oversampling factor

L = [8 4 8];                        % Room dimensions (x,y,z) in m
sphLocation = [5+0.042 2 4];            % Receiver location (x,y,z) in m
s = [2 2 4];               % Source location(s) (x,y,z) in m
beta=repmat([.8 .4 .2],2,1);       % Room reflection coefficients [\beta_x_1 \beta_y_1 \beta_z_1 ; \beta_x_2 \beta_y_2  \beta_z_2]

order = 1;                         % Maximum reflection order (-1 is all possible reflection order)

sphRadius = 0.042;                  % Radius of the sphere (m)
sphType = 'rigid';                  % Type of sphere (open/rigid)

mic = [pi 0];            % Microphone positions [azimuth, elevation] (radian)
orient=[0 0];        
% Source orientation [azimuth elevation] (radian)
source_directivity_pattern='omni';  % source directivity pattern
interp_method='linear';             % interpolation method used in directivity pattern in case of customised pattern

%% Run spherical array simulation
[h, H, beta_hat] = smir_generator(c, procFs, sphLocation, s,orient, L, beta, sphType, sphRadius, mic, N_harm, nsample, K, order,source_directivity_pattern,interp_method);

Impulse Response


Sina Hafezi, 2015