OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

fft_filters

Contents

Menu Information

FFT Filters

Brief Information

Perform FFT Filtering

Command Line Usage

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));

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input iy

Input

XYRange

<active>

Specifies the input range

Filter Type filter

Input

int

Low Pass

Specifies the type of the filter

Option list

  • low:Low Pass
    Allows only low frequency components to pass
  • high:High Pass
    Allows only high frequency components to pass
  • bandpass:Band Pass
    Allow only frequency components within a specified range to pass
  • bandblock:Band Block
    Allow only frequency components outside a specified range to pass
  • threshold:Threshold
    Allow only frequency components whose amplitudes are larger than the threshold to pass
  • lowpp :
    This is a parabolic low-pass filter.
Lower Cutoff Frequency freq1

Input

double

0

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

-1

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

0

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

-1

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

-1

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

-1

This option is available only when the filter type is threshold. It specifies the amplitude threshold.

Keep DC Offset offset

Input

int

1

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

<new>

Specifies the output

See the syntax here.

Description

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.

Examples

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:

fft_filters iy:=col(2) cutoff:=3

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:

fft_filters -t "my fft filter theme.oth"

3. To open the dialog, you can either type

fft_filters -d

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.

Image:fft_filters_help_English_files_image002.jpg

For more examples, please refer to XF Script Dialog (press F11).

Algorithm

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:

Image:fft_filters_help_English_files_image004.gif

Let fc be the cut-off frequency. The window function can be expressed by:

w(f) =  \begin{cases}    1, & \mbox{if }f  \le f_{c} \\   0, & \mbox{if }f  > f_{c} \end{cases}

Window for high pass filter:

Image:fft_filters_help_English_files_image006.gif

Let fc be the cut-off frequency. The window function can be expressed by:

w(f) =  \begin{cases}    0, & \mbox{if }f  \le f_{c} \\   1, & \mbox{if }f  > f_{c} \end{cases}

Window for band pass filter:

Image:fft_filters_help_English_files_image008.gif

Let fc1 be the lower cutoff frequency and fc2 be the upper cutoff frequency. The window function can be expressed by: w(f) =  \begin{cases}    1, & \mbox{if } f_{c1} < f < f_{c2} \\   0, & \mbox{otherwise } \end{cases}

Window for band block filter

Image:fft_filters_help_English_files_image010.gif

Let fc1 be the lower cutoff frequency and fc2 be the upper cutoff frequency. The window function can be expressed by: w(f) =  \begin{cases}    0, & \mbox{if } f_{c1} < f < f_{c2} \\   1, & \mbox{otherwise } \end{cases}

Window for low-pass parabolic filter

Image:Low_pass_parabolic_filter.PNG

Let fc1 be the pass frequency and fc2 be the stop frequency. The window function can be expressed by: w(f) =  \begin{cases}    1, & \mbox{if }f \le f_{c1} \\   1-\frac{(f-f_{c1})^2}{(f_{c2}-f_{c1})^2}, & \mbox{if } f_{c1} < f < f_{c2} \\   0, & \mbox{if }f \ge f_{c2} \end{cases}

Related X-Functions

fft1, ifft1