TSP (libtsp/SP) - SPautoc

## SPautoc

#### Routine

void SPautoc (const float x[], int Nx, float cor[], int Nt)

#### Purpose

Calculate the autocorrelation for a data sequence

#### Description

This routine calculate the autocorrelation for a given data vector.

               Nx-1-i
      cor[i] =  SUM  x[k] * x[k+i] , for 0 <= i < Nt.
                k=0

This routine requires

      (Nt+1)*(Nx+Nt/2) multiplies and
      (Nt+1)*(Nx+Nt/2) adds.

#### Parameters

-> const float x[]
  Input data vector with Nx elements
-> int Nx
  Number of data points
<- float cor[]
  Autocorrelation vector with Nt elements. The element cor[i] is the autocorrelation with lag i.
-> int Nt
  Number of autocorrelation terms

#### Author / revision

P. Kabal Copyright (C) 1996 / Revision 1.5 1996/05/06

#### See Also

SPcorXpc, SPcovar

Main Index libtsp