Thursday 3 December 2015

matlab - How can I calculate Reverberation Time (RT60) from the Room Impulse Response using Python?


I have the following Room Impulse Response(RIR) in wave format here. I wanted to calculate Reverberation Time (RT60) of it by plotting its Energy Decay Curve using this Python code.


The RIR is mostly zeros after the first 120ms. Plotting the Energy Decay Curve of the whole signal gives the graph below.



enter image description here


From this graph it looks like after 120ms the signal is decaying very slowly and looks like never going to come down below -60dB, which is confusing to me. If I truncate the signal after 120ms, I am getting different curves for different truncation. It seems like we will get different RT60, depending on how many trailing zeros the RIR has. I went through the MATLAB example here but needs to do the same with Python.




  1. How can I properly calculate RT60 from the RIR using Python code?




  2. What is wrong with my approach here?



  3. How can few trailing zeros can make difference in the RT60 of an RIR?



enter image description here enter image description here enter image description here



Answer



You have a noisy measurement and the Schroeder reverse integration method is fairly sensitive to this. In order to see a decay down to -60 dB you need to have a low enough noise floor, which you don't.


You need to model your measured impulse response as $h'(t) = h(t) + n(t)$, where h(t) is the true impulse response and n(t) some stationary noise of constant amplitude. You need to find the delay where the power in h(t) is similar to $\sigma_{nn}$, the noise power. A simple method to do this would be just plot the log magnitude of the measured impulse response with a little bit of time smoothing. In the early part of there should be a clearly visible decay (impulse response dominated), the later part of the plot should be flat (noise dominated). Intersect the two lines, and use that as as the truncation point.


This should be done in relatively narrow frequency bands (octaves or third octaves): Both reverb time and noise floor vary significantly with frequency, so doing this for a broad band signal doesn't make a lot of sense. There is no such thing as a single "reverb time of a room".


No comments:

Post a Comment

readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...