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(...,graph)
... = IR_stats(...,te)
... = IR_stats(...,spec)
... = IR_stats(...,y_fit)
rt60 = IR_stats(filename) returns the reverberation time (to 60 dB) using a method based on ISO 33821:2009. The function uses reverse cumulative trapezoidal integration to estimate the decay curve, and a linear leastsquare 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(t0c: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=0.25ms.
[rt60,drr,cte] = IR_stats(filename) returns the earlytolate index Cte for the impulse. This is calculated in the following way:
Cte = 10 * log10( x(t0c: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 octaveband 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(...,graph), by setting graph=true, allows graphs of the impulse response, decay curves, and linear leastsquare fits, to be plotted for each octave band and channel of the wave file.
... = IR_stats(...,te) allows the early time limit to be specified (in seconds). The default is 0.05.
... = IR_stats(...,spec) determines the RT60 output by the function. 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.
... = IR_stats(...,y_fit) evaluates the decay curve between the values specified in the twoelement vector y_fit. The default is [0 60] corresponding to the true RT60. Alternatively y_fit may be [5 25] or [5 35] corresponding to the RT20 and RT30 respectively.
Octaveband filters are calculated according to ANSI S1.11986 and IEC standards. Note that the OCTDSGN function recommends centre frequencies fc in the range fs/200 < fc < fs/5.
See also OCTDSGN.
