FFTSpa (Spatial Fast Fourier Transform)

The FFTSpa instruction performs a Fast Fourier Transform on a time series of measurements stored in an array and stores the result in an array.

Syntax

FFTSpa ( Dest, N, SrcArray, SampleInterval, Units, Option, [ FFTSpaInit ] )

Remarks

An inverse FFT can also be performed with this instruction, generating a time series from the results of an FFT.

The difference in this instruction and FFT is that the results are stored in an array instead of output to a table.

Parameters

Dest (Destination)

The Variable in which to store the results of the instruction. Right-click the parameter to display a list of defined variables.

If this instruction has a Repetitions parameter and it is greater than 1, the results are stored in an array with the variable name. The array must be dimensioned large enough to hold all of the values returned from all of the Reps.

Type: Variable or Array

N (Number of Points in Time Series)

The number of points in the time series (must be a power of 2).

Type: Name

SrcArray (Source Array)

The name of the Source Array for FFT. Right-click the parameter to display a list of defined variables.

Type: Name

For the FFTSpa instruction, the SrcArray is the name of the Variable array that contains the input data for the FFTSpa function.

SampleInterval (Sample Interval)

In normal operation (non-burst mode), this is the datalogger scan rate, or the time series data interval.

If the measurement instruction that created the time-series data used burst mode (that is, the channel was entered as a negative number), the CR6 burst measurement sampling frequency is determined by the fN1 (first notch frequency) parameter, which can go up to a maximum of 93750 Hz (minimum sample interval of 10.667 uS). The SettlingTime parameter is used to delay once prior to beginning the burst. The total time prior to beginning the burst is the SettlingTime plus the ADC flush time (which is 810uS). The sample interval resolution is 1/93750Hz. The specified notch frequency will use the nearest multiple of (1/93750Hz) to get as close to the specified frequency as possible.

Type: Constant (or expression that evaluates as a constant)

For the FFTSpa instruction, this is the sampling interval of the time series. Exact sampling interval can be calculated as Tsample = 1.085069 * INT(SettleUSEC/1.085069) + 0.5), where SettleUSEC is the sample interval entered in the settling time parameter of the source instruction.

Units

The units for the interval parameter. An alphabetical code is entered. Right-click the parameter to display a list.

Alphanumeric Code Description
usec microseconds
msec milliseconds
sec seconds
min minutes

Type: Constant

Option

Used to select the processing option for FFT. Right-click the parameter to display a list.

Option Result
0 FFT. The output is (N/2)+1 complex data points, i.e., the real and imaginary parts of the FFT. The first pair is the DC pair; the last pair is the Nyquist pair.  Zero is seen for their imaginary component.
1 Amplitude spectrum. The output is (N/2)+1 magnitudes. With Acos( ωt ); A is magnitude.
2 Amplitude and Phase Spectrum. The output is (N/2)+1 pairs of magnitude and phase; with Acos(ωt - φ); A is amplitude, φ is phase ( - π, π ).
3 Power Spectrum. The output is (N/2)+1 values normalized to give a power spectrum. With Acos(ωt - φ), the power is A2 / 2. The summation of the (N/2)+1 values yields the total power in the time series signal.
4 Power Spectral Density ( PSD ). The output is (N/2)+1 values normalized to give a power spectral density ( power per hertz ). The Power Spectrum multiplied by T = N * tau yields the PSD. The integral of the PSD over a given bandwidth yields the total power in that band. Note that the bandwidth of each value is 1 / T hertz.
5 Inverse FFT. The input is (N/2)+1 complex numbers, organized as in the output of option 0, which is assumed to be the transform of some real time series. The output is the time series (N values) whose FFT would result in the input array.

If 100 is added to the option code (100, 101, 102, etc.), no FFT will be performed on an array of data that was processed by an FFTSpa instruction. The data will be stored to the data table with the appropriate description fields in the data file/header/table definitions so that it can be appropriately processed/graphed by the software.

Type: Constant

FFTSpaInit (Spatial Fast Fourier Transform)

This is an optional parameter. FFTSpaInit is a variable array that will be initialized at compile time with the frequency axis of the FFT, from DC to the Nyquist frequency, in units of Hertz. The array is not updated at run time.  The array can be dimensioned to hold less than the N/2+1 frequencies, or if it is dimensioned greater than N/2+1, the remainder will be initialized to 0.

Type: Variable (optional parameter)

Normalization Details

Complex FFT result I

i = 1 .. N / 2: ai * cos( wi * t ) + bi * sin( wi * t ).

wi =2 π ( I - 1 ) / T.

φi =atan2( bi, ai ) ( 4 quadrant arctan )

Power(1) = ( a12 + b12 ) / N2 ( DC )

Power(i) = 2 * ( ai2 + bi2 ) / N2 ( i = 2..N / 2, AC )

PSD(i) = Power( I ) * T = Power( I ) * N * tau

A1 = sqrt( a12 + b12 ) / N ( DC )

Ai = 2 * sqrt( ai2 + bi2 ) / N ( AC )

Notes