From help-octave-request at che dot utexas dot edu Thu Apr 27 15:55:44 1995 Subject: Re: autocorrelation From: vdp at us0 dot mayo dot EDU (Vinayak Dutt) To: help-octave at che dot utexas dot edu Date: Thu, 27 Apr 95 10:54:10 CDT Ted Harding wrote: #There's nothing wrong with the answer from fftconv. This computes #a CONVOLUTION, which is defined as # # Sum[over s] x(s) * x(t-s) # #i.e. one of the factors is taken in the reverse order. #The CORRELATION [at lag t = -(N-1), .. 2, 1, 0, 1, 2, .. , (N-1)] #which you want is defined by # # Sum[over s] x(s) * x(s-t) = R(t) = R(-t) # #You can get it the right way roud by reversing one of the arguments #to fftconv, if you wish. This gives the result you expected. # Yup. This is the correct explaination for the problem. I checked fftconv() and found that it does padd to length(Vector1) + length(Vector1) - 1. So there is no need to pad as I had earlier suggested :-( --vinayak- /* * vinayak dutt * graduate student, ultrasound research * mayo graduate school, rochester mn * * e-mail: vdp at mayo dot edu * dutt dot vinayak at mayo dot edu * vdp at us0 dot mayo dot edu * */ #include "disclaimer.h"