3.5.4.7 ifftshift

Description

Undo the shift of FFT result.

Note that the output for this function are complex values, so when doing calculation on data columns, you need to set column data type to complex prior to set column formula. For details, see the example section below.

Syntax

vector<complex> ifftshift(vector<complex> cx)

Parameters

cx

The FFT complex results (shifted)

Return

Return the FFT result that shift is cancelled.

Example

// Import the signal data
string fname$ = system.path.program$ + "Samples\Signal Processing\fftfilter1.DAT";
impASC fname:=fname$;
 
// Add a new column to store the shifted FFT complex result
worksheet -a 2;
 
// Set data type to complex 16 in advance
wks.col3.numerictype = 11;
wks.col4.numerictype = 11;

// Set column labels
col(C)[L]$ = "Shifted Result";
col(D)[L]$ = "Undo Shift";
 
// Use fftshift and fftc to calculate shifted result
col(C) = fftshift(fftc(col(B)));

// Undo the shift and put the result to column D
col(D) = ifftshift(col(C));

See Also

fftshift