
Contents |
FFT Filters
Perform FFT Filtering
1. fft_filters Col(2) cutoff:=5;
2. fft_filters Col(2) filter:=bandpass Freq1:=3 Freq2:=3.6;
3. fft_filters Col(2) filter:=threshold threshold:=1;
4. fft_filters Col(2) filter:=bandblock Freq1:=1.1 Freq2:=1.3 oy:= (Col(3), Col(4));
| Display Name | Variable Name | I/O and Type | Default Value | Description |
|---|---|---|---|---|
| Input | iy |
Input XYRange | |
Specifies the input range |
| Filter Type | filter |
Input int | |
Specifies the type of the filter Option list
|
| Lower Cutoff Frequency | freq1 |
Input double | |
This option is available only when the filter type is band pass or band block. It specifies the lower cutoff frequency. |
| Upper Cutoff Frequency | freq2 |
Input double | |
This option is available only when the filter type is band pass or band block. It specifies the upper cutoff frequency. |
| Cutoff Frequency | cutoff |
Input double | |
This option is available only when the filter type is low pass or high pass. It specifies the cutoff frequency. |
| Pass Frequency | pass |
Input double | |
This option is available only when the filter type is Low Pass Parabolic. All frequencies below this value will be kept unchanged after being filtered. |
| Stop Frequency | stop |
Input double | |
This option is available only when the filter type is Low Pass Parabolic. All frequencies above this value will be removed completely. |
| Threshold | threshold |
Input double | |
This option is available only when the filter type is threshold. It specifies the amplitude threshold. |
| Keep DC Offset | offset |
Input int | |
This option is available only when the filter type is high pass, band pass or band block. If this option is checked, the DC offset will remain unchanged during the filtering. |
| Output | oy |
Output XYRange | |
Specifies the output See the syntax here. |
Filtering is a process of selecting frequency components from a signal. A FFT filter performs filtering by using Fourier transforms to analyze the frequency components in the input signal.
There are six types of filters available in this function: low-pass, high-pass, band-pass, band-block, low-pass parabolic and threshold. The first four types are actually ideal filters. The low-pass filters block all frequency components above the cutoff frequency, allowing only the low frequency components to pass. High-pass filters are just the opposite: they block frequency components that are below the cutoff frequency. Band-pass filters only allow frequencies within a specific range determined by the lower and upper cutoff frequencies to pass the filters, while band-block filters remove all frequencies within the chosen range. The low-pass parabolic filter is different from the ideal low-pass filter in that its window function does not jump abruptly at the cut-off frequency. Between the pass frequency and the stop frequency, the window function used to select the frequencies looks like a parabolic curve. On the other hand, you can choose to use the threshold filter, which removes frequencies whose amplitudes are below a specific threshold value.
The dialog of this function allows you to see the real-time preview of the filtered signal when you change the variables. The cutoff frequencies, pass frequency, stop frequency or the threshold can be selected by dragging the lines on the preview pane.
1. To perform low pass filtering using cutoff frequency as 3, to XY data in columns 2 of the active worksheet, use the script command:
2. To perform fft_filtering to data using a pre-saved theme file, save your preferences in the fft_filter dialog, and then execute it by typing the script command as follows, using your own saved-theme title:
3. To open the dialog, you can either type
in the command window or from the Origin menu, choose Analysis: Signal Processing: FFT Filters. In the dialog with the preview on, you can choose the cutoff frequency by dragging the red line on the Amplitude vs. Frequency plot. The pane on the top left shows the original signal and the filtered signal. On this graph, there is a cyan rectangle, which you can move or resize to choose an area to magnify and show on the top right pane.
For more examples, please refer to XF Script Dialog (press F11).
The Fourier transform of the input signal is first computed. Then for low pass, high pass, band pass, band block and low pass parabolic filters, a window (determined by the filter type) is used to multiply the Fourier transform. If 1 is chosen for the variable Keep DC Offset, the first point of the window will be set as 1. For threshold filter, the power of every frequency component is examined. If it is not larger than the threshold, the corresponding frequency component will be discarded. After the altering of the frequencies, a backward or inverse Fourier transform is applied to gain the filtered signal.
Window for low pass filter:
Let fc be the cut-off frequency. The window function can be expressed by:
Window for high pass filter:
Let fc be the cut-off frequency. The window function can be expressed by:
Window for band pass filter:
Let fc1 be the lower cutoff frequency and fc2 be the upper cutoff frequency. The window function can be expressed by:
Window for band block filter
Let fc1 be the lower cutoff frequency and fc2 be the upper cutoff frequency. The window function can be expressed by:
Window for low-pass parabolic filter
Let fc1 be the pass frequency and fc2 be the stop frequency. The window function can be expressed by: