# CrossSpectrum

Advanced Analysis Library Only

AnalysisLibErrType CrossSpectrum (double xArray[], double yArray[], int numberOfElements, double realSxy[], double imaginarySxy[]);

## Purpose

Calculates the double-sided cross power spectrum, Sxy, of the input sequences X and Y according to the following formula:

where FFT*[X] is the complex conjugate of FFT[X] and n is the number of points in the arrays.

The input sequences are copied to internal buffers and zero-padded to numberOfElements samples before the FFTs are computed. The output arrays are the real and imaginary parts of the cross spectrum CrossSpectrum.

## Parameters

Input
Name | Type | Description
xArray | double-precision array | Time-domain signal X.
yArray | double-precision array | Time-domain signal Y.
numberOfElements | integer | Number of elements in the input arrays.
Output
Name | Type | Description
realSxy | double-precision array | Real part of the double-sided cross power spectrum between signals X and Y. The size of this array must be at least numberOfElements.
imaginarySxy | double-precision array | Imaginary part of the double-sided cross power spectrum between signals X and Y. The size of this array must be at least numberOfElements.

## Return Value

Name | Type | Description
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.