Reduce XY data by resampling on X
Minimum Origin Version Required: 8.1 SR0
reduce_ex subgroup:=inter bins:=5 method:=yfirstxfirst
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 | iy |
Input XYRange |
|
Specifies the input data range. |
SubGroup | subgroup |
Input int |
|
Specify the method to divide the source data into subgroups. After the dividing, each group of data points are merged into one data point.
Option list:
|
Sampling Interval | dx |
Input double |
|
This is available only when By Sampling Interval is selected in SubGroup. Use it to specify the value of sampling interval. |
Interval Number | bins |
Input int |
|
This is available only when By Number of Intervals is selected in SubGroup. Use it to specify the number of intervals. |
Resample Factor | rfactor |
Input int |
|
This is available only when Every N Points is selected in SubGroup. It specifies the value of N. |
Resample Frequency | rfre |
Input double |
|
This is available only when By Frequency is selected in SubGroup. It specifies the resample frequency. |
X Start | start |
Input double |
|
This is available only when Every N Points, By Number of Intervals or By Frequency is selected in SubGroup. Use it to specify the X value to start grouping. |
X End | end |
Input double |
|
This is available only when Every N Points, By Number of Intervals or By Frequency is selected in SubGroup. Use it to specify the X value to end grouping. |
Sampling Method | method |
Input int |
|
Specifies the method to pick the Y value for the merged data point in each group.
Option list:
|
Even Sampling Interval Tolerance(%) | variation |
Input double |
|
This is available only when you Every N Points is selected in SubGroup. Use it to specify the tolerance used to check whether the input X values are evenly spaced. For more details, please refer to the Algorithm section below. |
Plot FFT for Preview | plot |
Input int |
|
Specifies whether to plot the FFT results of the original data and the reduced data in the preview panel. |
Output | oy |
Output XYRange |
|
Specifies the output range. See the syntax of Output Notations. |
This X-Function is for reducing XY data into smaller size with evenly-spaced X values.
EX1
There is a dataset whose X values are not evenly spaced. The dataset contains 1000 data points.
If you perform the following steps, you will get 100 points of them. The output data will be even-sampled:
You can also use the following script command to reduce the data points (suppose the input data is highlighted before the script is executed):
reduce_ex subgroup:=bins bins:=100 method:=yfirstxfirst oy:=(<new>,<new>);
EX2
Run following LabTalk scripts to import sample data fitConv.dat and reduce it by frequency.
newbook ; fname$= system.path.program$+ "Samples\Curve Fitting\fitConv.dat" ; impASC; worksheet -s 2; reduce_ex -r 2 subgroup:=freq;
When check whether the input X values are evenly spaced, it needs to specify a tolerance (from 0 to 1) for the even sampling interval. Here is the definition:
Keywords:data reduction, sampling interval, frequency