Rank: 68399 based on 0 downloads (last 30 days) and 0 file submitted
photo

Matthias Geier

E-mail
Company/University
Universitaet Rostock

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Matthias Geier View all
Updated File Comments Rating
21 Jul 2011 t60.m Returns an estimate of t60, a measure of reverberation time. Author: Christopher Brown

It's me again ...

Finally, I found the problem in your code!

First, I was wrong with my speculation that the r-squared formula would be off by a division by "n".
The formula is OK (it's just the squared version of Pearson's product-moment correlation coefficient).
The following regression is also correct.

However, there is an error when calculating the intersection between the regression line with the -60 dB line.

Your code is:

rt = round(abs(60/slope(1))-yintercept);

This works if yintercept is (very close to) zero (as it is in the nice picture above. But in the general case (and in my case), yintercept is a non-negligible negative value and the resulting reverberation time is wrong.

The correct line would be:

rt = -(yintercept + 60)/slope;

As I said, the regression is correct, however it could be written a little more compactly like this:

xx = xtime(1:stop);
yy = y(1:stop);
slope = (mean(xx.*yy) - mean(xx)*mean(yy))/(mean(xx.^2) - mean(xx)^2);
yintercept = mean(yy) - slope * mean(xx);

That's it about my first point, I'm still searching for an answer regarding my second question.

cheers,
Matthias

18 Jul 2011 t60.m Returns an estimate of t60, a measure of reverberation time. Author: Christopher Brown

Hi Christopher.

Thanks for this really useful function!

I have 2 questions:

1) Can you please provide the original formula for the "r-squared" you used?
It seems to be related to the squared "sample Pearson correlation coefficient" but I think it could be off by a division by "n".
I searched in some statistics books and on the web and the problem is there are many different definitions of "r-squared".

2) By default, your function discards the first 50 ms of the result of the "cumulative r-squared". Is this a value you found by experience? In which situations would you suggest different values?

TIA,
Matthias

18 Nov 2009 TCP/IP Communications in Matlab Sends/receives TCP packets using Matlab's Java interface. Now handles matrices and cell arrays, etc. Author: Kevin Bartlett

@Kevin: Thanks for your response and for the adaptation of your code!
Just for the records: I was also running Matlab on Linux and I did have problems sending binary zeros.
I didn't try it on other operating systems.
I didn't try other strange characters either, just binary zeros and plain ASCII letters and punctuation.

15 Nov 2009 TCP/IP Communications in Matlab Sends/receives TCP packets using Matlab's Java interface. Now handles matrices and cell arrays, etc. Author: Kevin Bartlett

Hi Kevin and others.

I had a similar problem when I wanted to send strings which contained binary zeros (\0) as separators.
This didn't work with writeBytes() because the binary zero was interpreted as end-of-string.
Also, when I analyzed the IP traffic with wireshark, I saw that sometimes (strangely not always) an IP packet was sent for every single character of my message-string, which seemed quite inefficient to me.

So I changed line 351 from

jTcpObj.dataOutputStream.writeBytes(char(mssg));

to

jTcpObj.dataOutputStream.write(uint8(mssg), 0, length(mssg));

... where the second argument is an offset (which I chose to be 0).

This worked perfectly for me, I think it could also work for others, but of course I'm not sure about any side-effects or pitfalls ...

BTW, I didn't didn't care about receiving data, because I used another application for that.

Thanks for the this great m-file, it was very useful!

Contact us