GetPowerSpectrum [Int32]


Function

Performs FFT/DFT conversion and obtain the power spectrum. (When smoothing is enabled, convert using the corrected value)

 

Format

Ret = dncFFT1.GetPowerSpectrum(InData , OutData )

 

Parameters

InData [ C#: int[] ] [ VB.NET: Integer() ]
Specifies the array that stores the data to be processed.

 

OutData [ C#: out float[] ] [ VB.NET: Single() ]  
Specifies an array to store the power spectrum.

 

Return value

Ret [ C#: int ] [ VB.NET: Integer ]

Value

Description

0

Normality completion

510001

The input parameter is invalid. Check the parameter contents.

Other errors (See also: Error code details)

 

Remarks

Performs FFT/DFT conversion and obtain the power spectrum. (When smoothing is enabled, convert using the corrected value)

 

Data is stored in OutData in the following format.

 

<Data image in OutData array>

*When number of sampling channels: 2, number of sampling data: 256

Array index

Stored data

0

Frequency resolution x 0

1

CH0: Power spectrum

2

CH1: Power spectrum

3

Frequency resolution x 1

4

CH0: Power spectrum

5

CH1: Power spectrum

・・・

・・・

384

Frequency resolution x 128

385

CH0: Power spectrum

386

CH1: Power spectrum

 

 

The number of valid power spectrum data for FFT/DFT calculations is half of the sampling data.

For OutData, please prepare an array of [(Number of sampling data / 2) +1 ) × (Number of channels +1)] or more.

 

Example

Calculates the power spectrum of triangular wave data with amplitude -10.0 to +10.0.

C#

int    Ret;

int[]  InData = new int[4];
float[]  OutData = new float[4];

InData[0] = 0;
InData[1] = 10;
InData[2] = -10;

InData[3] = 0;


ret = dncFFT1.GetPowerSpectrum(InData, out OutData);

 

VB.NET

Dim Ret As Integer
Dim InData(3) As Integer
Dim OutData(3) As Single


InData(0) = 0;
InData(1) = 10;
InData(2) = -10;

InData(3) = 0;

Ret = dncFFT1.GetPowerSpectrum(InData, OutDatta)