Analysis: Signal Processing: FFT: FFT
Compute fourier transform
This feature is updated in 8.0 SR5.
1. fft1 ix:=Col(1); 2. fft1 ix:=(col(2),col(3)); 3. fft1 ix:=Col(1) interval:=2; 4. fft1 ix:=Col(1) win:=hanning correct:=power; 5. fft1 ix:=Col(1) shift:=1; 6. fft1 ix:=Col(1) psd:=1 norm:=ssa st:=oneside;
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Input | ix |
Input vector<complex> |
|
Specifies the input signal, which could be complex. The real and imaginary parts of the signal can be saved in different columns or in the same column. The default is <Active>, which corresponds to the active dataset. |
Sampling Interval | interval |
Input double |
|
Specifies the sampling interval. The default is <Auto>, which corresponds to an automatically-computed interval. Please see the algorithm part for details. |
Window | win |
Input int |
|
Specifies the type of window to be used for suppressing the leakage. Please see the algorithm part for details. Option list
|
Alpha | alpha |
Input double |
This variable is only available when window type is Gaussian. It specifies the Alpha parameter (the reciprocal of the standard deviation) for Gaussian window. | |
Beta | beta |
Input double |
This variable is only available when window type is Kaiser. It specifies the Beta parameter for Kaiser window. | |
Window Correction | correct |
Input int |
Specifies the Window Correction Factor used to correct the alteration made by applying a window to the input data. Option list
| |
Reserved | Reserved |
Input int |
|
This is a reserved variable. It has no effect on the computation. |
Normalize Re, Im and Mag | norma |
Input int |
|
Specifies whether to normalize the complex, real, imaginary, magnitude and sqaure magnitude output. The default is false. Note that other outputs such as amplitude are not affected by this variable. Please see the algorithm section for details. |
Shift | shift |
Input int |
|
Specifies whether the result should be rearranged so that the lower frequency components are in the center. |
Unwrap phase | unwrap |
Input int |
|
Specifies whether the phase should be unwrapped. If wrapped, Phase angle is modulo reduced to be between + and - 180 degrees. |
Factor | factor |
Input int |
|
Specifies whether the Electrical Engineering or Science convention is used to set the sign of the Exponential Phase factor. Option list
|
Spectrum Type | st |
Input int |
|
Specifies the Nyquist interval over which power is calculated. Note that this will also affect the computation of other results. Option list
|
Normalize power to | norm |
Input int |
|
Specifies the power density normalization method. Please see the algorithm part for detail. Option list
|
Preview | pre |
Input int |
|
Specifies the preview content in the dialog. Option list
|
Real | re |
Input int |
|
Specifies whether or not to output a graph of the real parts of the FFT result. |
Imag | im |
Input int |
|
Specifies whether or not to output a graph of the imaginary parts of the FFT result. |
Amplitude/Phase | ap |
Input int |
|
Specifies whether or not to output a combined graph of amplitude and phase. |
Phase | phase |
Input int |
|
Specifies whether or not a graph of the phase will be outputted. |
Power/Phase | pp |
Input int |
|
Specifies whether or not to output a graph of the phase. |
Real/Imag | ri |
Input int |
|
Specifies whether or not to output a combined graph of power and phase. |
Magnitude | mag |
Input int |
|
Specifies whether or not to output a graph of the magnitude. |
Amplitude | amp |
Input int |
|
Specifies whether or not to output a graph of the amplitude. |
Power | psd |
Input int |
|
Specifies whether or not to output a graph of the power. |
dB | db |
Input int |
|
Specifies whether or not to output a graph of the result of dB. |
Normalized dB | ndb |
Input int |
|
Specifies whether or not to output a graph of the result of normalized dB. |
RMS Amplitude | rms |
Input int |
|
Specifies whether or not to output a graph of the RMS amplitude. |
Square Amplitude | sqr_amp |
Input int |
|
Specifies whether or not to output a graph of the squared amplitude. |
Square Magnitude | sqr_mag |
Input int |
|
Specifies whether or not to output a graph of the squared magnitude. |
Result Data Sheet | rd |
Output ReportData |
|
Specifies the output data sheet. |
Result Graph Sheet | rt |
Output ReportTree |
|
Specifies the output graph sheet. |
fft1 col(2)
// This example plots two different FFT Amplitudes from two date ranges of sunspot data to illustrate the ~11 year sunspot cycle // Import the data string fname$ = system.path.program$ + "Samples\Signal Processing\dayssn.dat"; //col(1) = year, col(2)=month, col(3)=day, //col(4) = date values in contiguous year with fractions //col(5) = observation //so we should have a sheet with 5 col and col(4)=X col(5)=Y newbook s:=0;newsheet cols:=5 xy:="NNNXY"; impasc; // Interpolate to replace missing values and put result to col(6) interp1q 4 (4,5) 6; // this is our data range rData1 = 6[1:14609];// row range for years 1818 to 1858 range rData2 = 6[54057:end];// row range for years 1966 - 2006 // now start the FFT with the fft1 X-Function which will create a ReportData sheet and a ReportTable sheet fft1 rData1; //after running an XF, a tree with same name is created, here we will make use of fft1.rd the ReportData node range rReportData1=fft1.rd$;//range to hold the Report Data from the FFT result range rAmp1=%(rReportData1.getlayer()$)col(Amplitude); rAmp1[C]$="1818 - 1858"; // change the Comment to make better legend for the graph fft1 rData2; range rReportData2=fft1.rd$; range rAmp2=%(rReportData2.getlayer()$)col(Amplitude); rAmp2[C]$="1966 - 2006"; // Open a new empty graph. Use your own template if needed. win -t plot; // Plot output to active graph layer plotxy rAmp1 plot:=200 color:=color(red) o:=<active>; plotxy rAmp2 plot:=200 color:=color(blue) o:=<active>; // Zoom in to show the peak x1=0;x2=0.5;y1=0;y2=100; // Mark 11 years with a vertical line draw -n peakval -l -v 1/11; peakval.linewidth = 3; peakval.color = color(orange); // and add a text label label -n peaklabel \b(11 Year Cycle of Sunspots); peaklabel.x = peakval.x + 1.1 * peaklabel.dx / 2; peaklabel.y = (y1 + y2) / 2; peaklabel.fsize = 30;
For more information, please refer to our User Guide.
Keywords:discrete, amplitude, phase, power, window correction