Code covered by the BSD License  

Highlights from
Impulse response acoustic information calculator

5.0

5.0 | 1 rating Rate this file 59 Downloads (last 30 days) File Size: 10.7 KB File ID: #42566
image thumbnail

Impulse response acoustic information calculator

by

 

10 Jul 2013 (Updated )

Calculate RT, DRR, Cte, and EDT for impulse response file

| Watch this File

File Information
Description

rt60 = IR_stats(filename)
[rt60,drr] = IR_stats(filename)
[rt60,drr,cte] = IR_stats(filename)
[rt60,drr,cte,cfs] = IR_stats(filename)
[rt60,drr,cte,cfs,edt] = IR_stats(filename)
... = IR_stats(...,'parameter',value)
rt60 = IR_stats(filename) returns the reverberation time
(to -60 dB) using a method based on ISO 3382-1:2009.
The function uses reverse cumulative trapezoidal
integration to estimate the decay curve, and a linear
least-square fit to estimate the slope between 0 dB and
-60 dB. Estimates are taken in octave bands and the
overall figure is an average of the 500 Hz and 1 kHz
bands.

The function attempts to identify the direct impulse as
the peak of the squared impulse response.

filename should be the full path to a wave file or the
name of a wave file on the Matlab search path. The file
can have any number of channels, estimates (and plots)
will be returned for each channel.

[rt60,drr] = IR_stats(filename) returns the DRR for the
impulse. This is calculated in the following way:

DRR = 10 * log10( x(t0-c:t0+c)^2 / x(t0+c+1:end)^2 )

where x is the approximated integral of the impulse, t0
is the time of the direct impulse, and c=2.5ms [1].

[rt60,drr,cte] = IR_stats(filename) returns the
early-to-late index Cte for the impulse. This is
calculated in the following way:

Cte = 10 * log10( x(t0-c:t0+te)^2 / x(t0+te+1:end)^2 )

where x is the approximated integral of the impulse and
te is a point 50 ms after the direct impulse.

[rt60,drr,cte,cfs] = IR_stats(filename) returns the
octave-band centre frequencies used in the calculations.

[rt60,drr,cte,cfs,edt] = IR_stats(filename) returns the
early decay time (EDT). The slope of the decay curve is
determined from the fit between 0 and -10 dB. The decay
time is calculated from the slope as the time required
for a 60 dB decay.

... = IR_stats(...,'parameter',value) allows numerous
parameters to be specified. These parameters are:
  'graph' : {true} | false
      Controls whether decay curves are plotted.
      Specifically, graphs are plotted of the impulse
      response, decay curves, and linear least-square
      fit(s) for each octave band and channel of the
      wave file.
  'te' : {0.05} | scalar
      Specifies the early time limit (in seconds).
  'spec' : {'mean'} | 'full'
      Determines the nature of RT60 output. With
      spec='mean' (default) the reported RT60 is the
      mean of the 500 Hz and 1 kHz bands. With
      spec='full', the function returns the RT60 as
      calculated for each octave band returned in cfs.
  'y_fit' : {[0 60]} | two-element vector
      Specifies the decibel range over which the decay
      curve should be evaluated. For example, 'y_fit'
      may be [-5 -25] or [-5 -35] corresponding to the
      RT20 and RT30 respectively.
  'correction' : {0.0025} | scalar
      Specifies the correction parameter c (in
      seconds) given above for DRR and Cte
      calculations. Values of up to 10 ms have been
      suggested in the literature.

Octave-band filters are calculated according to ANSI
S1.1-1986 and IEC standards. Note that the OCTDSGN
function recommends centre frequencies fc in the range
fs/200 < fc < fs/5.

The author would like to thank Feifei Xiong for his
input on the correction parameter.

References

[1] Zahorik, P., 2002: 'Direct-to-reverberant energy
  ratio sensitivity', The Journal of the Acoustical
  Society of America, 112, 2110-2117.

Acknowledgements

Octave inspired this file.

Required Products Signal Processing Toolbox
MATLAB release MATLAB 8.1 (R2013a)
Other requirements This function requires the Octave toolbox available on the FX: http://www.mathworks.co.uk/matlabcentral/fileexchange/69-octave
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
14 Nov 2014 Christopher Hummersone

Hi Clay. I need a bit more information in order to help. Firstly, did you download the Octave toolbox per the requirements above (and add the files to your MATLAB search path)?

13 Nov 2014 Clay Pipkin

An error comes up:

Error in IR_stats (line 164)
[b(f,:),a(f,:)] = octdsgn(cfs(f),fs,N);

Any thoughts?

27 Jul 2013 Jose Ercolino  
Updates
15 Jul 2013

Minor to tweak to handling out-of-range te values.

19 Jul 2013

Minor tweak to file and updated screenshot.

10 Dec 2013

Made a number of tweaks: added more comments, added EDT output, and made slight modification to RT calculation so that y range can be specified and is [0 -60] by default.

11 Dec 2013

Corrected t0 estimation and H1 line.

03 Sep 2014

Changed inputs to accept parameter/value pairs, including new 'correction' parameter. Changed default correction.

Contact us