On Thu, May 31, 2012 at 4:42 PM, Juan Pablo Carbajal <carba...@ifi.uzh.ch> wrote: > Hi, > > I have a question concerning xcorr for the case of vector input. > > The results of xcorr do not match with the ones suing the straight formula > http://en.wikipedia.org/wiki/Autocorrelation#Estimation > > In particular taking the vector > x = rand(4069,1); > > xcorr with option 'coeff' and 'biased' show a linear trend that the > mentioned formula doesn't show. I guess this comes from the fact that > the data has nonzero mean value and the formula removes it, while > xcorr doesn't. > > Is this the expected behavior?
Yes. In fact rewind a little bit on the page you cite: http://en.wikipedia.org/wiki/Autocorrelation#Signal_processing In signal processing, the above definition is often used without the normalization, that is, without subtracting the mean and dividing by the variance. When the autocorrelation function is normalized by mean and variance, it is sometimes referred to as the autocorrelation coefficient. "Normalization" here is referring to the data samples, as opposed to the "scale" options that xcorr accepts. > If it is, we should improve the help text to mention this fact explicitly. I think this is typical of different interpretations of some terminology between statistics and signal processing. If you want to propose some clarifying text, keep in mind that for signal processing oriented users this is naturally the correct behavior. See for example "help autocov" in Octave core. -- mike ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev