# AutoPowerSpectrum

Advanced Analysis Library Only

AnalysisLibErrType AutoPowerSpectrum (double inputArray[], int numberOfElements, double dt, double autoSpectrum[], double *df);

## Purpose

Calculates the single-sided, scaled auto power spectrum of a time-domain signal. The auto power spectrum is defined as shown in the following figure:

where | n is the number of points in the signal array X
| * denotes a complex conjugate

AutoPowerSpectrum converts the auto power spectrum to a single-sided form.

## Parameters

Input
Name | Type | Description
inputArray | double-precision array | The time-domain signal.
numberOfElements | integer | Number of elements in the input array. Default Value: 1024.
dt | double-precision | Sample period of the time-domain signal, usually in seconds. dt = 1/fs, where fs is the sampling frequency of the time-domain signal. Default Value: 1.0.
Output
Name | Type | Description
autoSpectrum | double-precision array | Single-sided power spectrum in volts rms squared, if the input signal is in volts. If the input signal is not in volts, the results are in input signal units rms squared. This array must be at least numberOfElements/2 elements long.
df | double-precision | Points to the frequency interval, in Hertz, if dt is in seconds. df = 1/(numberOfElements × dt)

## 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.