DSP_autocor
[Correlation]

Collaboration diagram for DSP_autocor:


Detailed Description

void DSP_autocor (short *restrict r, const short *restrict x, int nx, int nr)


Function Documentation

void DSP_autocor ( short *restrict  r,
const short *restrict  x,
int  nx,
int  nr 
)

This routine performs an autocorrelation of an input vector x. The length of the autocorrelation is nx samples. Since nr such autocorrelations are performed, input vector x needs to be of length nx + nr. This produces nr output results which are stored in an output array r.

The following diagram illustrates how the correlations are obtained.

Example for nr=8, nx=24:
0 nr nx+nr-1
|-------|----------------------| <- x[]
| |----------------------| -> r[0]
| |----------------------| -> r[1]
| |----------------------| -> r[2]
| |----------------------| -> r[3]
| |----------------------| -> r[4]
| |----------------------| -> r[5]
| |----------------------| -> r[6]

Note that x[0] is never used, but is required for padding to make x[nr] double-word aligned.

Parameters:
r = Output data array of shorts
x = Input data array of shorts
nx = Length of autocorrelation
nr = Number of lags
Algorithm:
DSP_autocor_cn.c is the natural C equivalent of the optimized intrinsic C code without restrictions note that the intrinsic C code is optimized and restrictions may apply.
Assumptions:
The first nr elements are assumed to be zero.
NX >= 8; NX % 8 == 0
NR >= 4; NR % 4 == 0
x[] must be double word alligned
Implementation notes:
Endian Support: The code supports both big and little endian modes.
Interruptibility: The code is interruptible.


Copyright 2014, Texas Instruments Incorporated