2.11.7 decimate(Pro)

Menu Information

Analysis: Signal Processing: Decimation

Brief Information

Reduce signal size by decreasing sampling rate

Additional Information

Minimum Origin Version Required: 8.1 SR0

This feature is for OriginPro only.

Command Line Usage

1. decimate Col(2) d:=4 filter:=none;

2. decimate Col(2) filter:=ave oy:= (Col(3), Col(4));

3. decimate Col(2) filter:=fir order:=20 oy:= (Col(3), Col(4));

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

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

Input

XYRange

<active>
Specify the input XY data range to be decimated.
Resample factor d

Input

int

5
Specify an integer l here. Then every l samples in the source data will be merged into one in the output dataset.Note that the resample factor must be an integer and should not be greater than the size of the input dataset.
New Size newsize

Input

int

0
This is a uneditable text label that shows the size of the output dataset. It is determined by the size of the input dataset and the resample factor.
Filter Type filter

Input

int

0
Specify the filter that is used in decimating.

Option list:

  • none: No Filter
    Do not use any filter.
  • ave: Moving Average Filter
    Use the moving average filter to decimate the input data. For more information about the moving average filter, please see the Algorithm page.
  • fir: FIR Filter
    Use the FIR (finite impulse response) filter to decimate the input data. For more information about the FIR filter, please see the Algorithm page.
Order order

Input

int

30
This is available only when FIR Filter is chosen for Filter Type. Use it to specify the filter order of the FIR filter. It must be an integer between 8 and 60.
Plot FFT for Preview plot

Input

Int

0
Specify whether to plot the FFT plot in the Preview window on the right panel of the dialog.
Output oy

Output

XYRange

<new>
Specify where to store the output data.

See the syntax here.

Description

Decimation is to reduce the size of the input sequence. Every N samples are merged into one according to the Resample factor you have specified. If the resample factor is d, the decimated vector is d times shorter in length than the input vector.

This function provides two filters for decimation, including Moving Average Filter and FIR Filter (Please refer to Algorithm for more information about two filters). However, no filter is used by default.

Examples

  1. Create a new project and import the data <Origin Program Directory>\Samples\Signal Processing\Sine Signal with High Frequency Noise.dat.
  2. Highlight Column B, select Analysis: Signal Processing: Decimation from the Origin main menu to open the dialog box of this X-Function. Set Resample factor to 10, Filter Type to Moving Average Filter.
    Decimate 5.png
  3. Click the OK button. The decimated data is output to a new column. In the following screenshot, the black line is the original signal while the red line is the decimated signal.
    Decimate 4.png

More Information

For more information, please refer to our User Guide.


Keywords:data reduction, FIR, moving average