Analysis : Signal Processing : STFT
Compute short time fourier transform of signal
This feature is for OriginPro only.
1. stft ix:=col(2);
2. stft ix:=col(2) interval:=4;
3. stft ix:=col(2) option:=complex;
4. stft ix:=col(2) winlen:=32 fftlen:=64 overlap:=16;
5. stft ix:=col(2) win:=tri;
6. stft ix:=col(2) win:=gauss correct:=power alpha:=3;
7. stft ix:=col(2) win:=kaiser beta:=2;
8. stft ix:=col(2) plot:=0;
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 |
Specify By | mode |
Input int |
|
Option list:
|
Sampling Interval | interval |
Input double |
|
Specifies the sampling interval if mode is interval. The default is <auto>, which corresponds to an automatically-calculated interval. |
Sampling Frequency | freq |
Input double |
|
Specifies the sampling frequency if mode is frequency. The default is <auto>, which corresponds to an automatically-calculated frequency. |
FFT Length | fftlen |
Input int |
|
Specifies the size of FFT section |
Window length | winlen |
Input int |
|
Specifies the window size, which must not be greater than the size of an FFT section |
Overlap | overlap |
Input int |
|
Specifies the number of data points by which the window sections overlap. It should be less than the window size |
Window Type | win |
Input int |
|
Specifies the window type used by FFT
Option list:
|
Alpha | alpha |
Input double |
|
This variable is only available when Window Type is Gaussian. It specifies the Alpha parameter 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
| |
Option | option |
Input int |
|
Specifies the computation option. The default is 2, which correspond to the computing of the amplitude in dB.
Option list:
|
Swap Time and Frequency | swapxy |
Input int |
|
Specifies whether to swap the time axis and the frequency axis in the image plot. |
Output Matrix | om |
Output MatrixObject |
|
Specify the output matrix |
Create Image Plot | plot |
Input int |
|
Specify whether an image plot of the result will be generated |
Output Worksheet | rd |
Output ReportData |
|
Specify the output worksheet. |
1. To perform stft of Column B using the default setting:
stft ix:=col(b)
2. To perform stft with Hanning window:
stft -d
to open the dialog. Then select Hanning window for Window Type.
3. To perform stft using a pre-saved analysis theme called MyTheme, use the Command Window:
stft -t "MyTheme"
stft Computation
stft is computed in the following procedure:
1. N points are taken from the input signal, where N is equal to the window size.
2. A window of the chosen type is used to multiply the extracted data, point-by-point.
3. Zeros will be padded on both sides of the window, if the window size is less than the size of the FFT section.
4. FFT is computed on the FFT section.
5. Move the window according to the user-specified overlap size, and repeat steps 1 through 4 until the end of the input signal is reached.
The Window Functions
The sliding windows are defined as follows:
Rectangular Window:
Welch Window:
Triangular Window:
Bartlett Window:
Hanning Window:
Hamming Window:
Blackman Window:
Gaussian Window:
Kaiser Window:
where I(ix) denotes Bessel Function.
Computation of the Sampling Interval
For details of the auto computation of the sampling interval, please see the X-Function document for fft1.
For more information, please refer to our User Guide.
Keywords:fft, sliding window, time slice