2.11.2.7 mdwt(Pro)
Contents
Menu Information
Analysis: Signal Processing: Wavelet: Multi-Scale DWT
Brief Information
Perform multi-level wavelet decomposition
Additional Information
This feature is for OriginPro only.
Command Line Usage
1. mdwt ix:=2 level:=4; 2. mdwt ix:=2 type:=db2 level:=5;
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 | ix |
Input vector |
|
Specify the input signal |
| Wavelet Type | type |
Input int |
|
Specify the wavelet type Option list
|
| Extension Mode | ext |
Input int |
|
Specify the end extension mode used in wavelet transform Option list
|
| Decomposition Level | level |
Input int |
|
Specify the number of levels for which detail coefficients are to be thresholded. A large level will cause more noise to be removed; but unfortunately the probability that the useful signal is distorted will be larger, compared with a small level. |
| Multiple Coeff Data | rd |
Output ReportData |
|
Specify the output worksheet for the approximation coefficients and detail coefficients of different levels. |
Examples
- To perform 4-level wavelet decomposition to data in columns 2 of the active worksheet, use the script command:
mdwt ix:=2 level:=4;
- To specify wavelet type, use the type variable. For example, if you want to use Daubechies wavelet (N=2) to perform 5-level wavelet decomposition to data in column 2, enter the following script command:
mdwt ix:=2 type:=db2 level:=5;
- Code Sample
// Wavelet decomposition and reconstruction with two different wavelet types //Create a new workbook and import sample data newbook name:="Wavelet Demo" sheet:=1; fname$=system.path.program$ + "Samples\Signal Processing\Step Signal With Random Noise.dat"; impasc; //Multi-level wavelet decomposition using two wavelet types mdwt ix:=col(2) type:=haar level:=3 rd:=[<input>]"Haar"; mdwt ix:=1!col(2) type:=db7 level:=3 rd:=[<input>]"DB7"; //Reconstruction idwt ca:=2!1 cd:=2!2 type:=haar; idwt ca:=2!5 cd:=2!3 type:=haar; idwt ca:=2!6 cd:=2!4 type:=haar; idwt ca:=3!1 cd:=3!2 type:=db2; idwt ca:=3!5 cd:=3!3 type:=db2; idwt ca:=3!6 cd:=3!4 type:=db2; //Report newsheet name:="report" labels:="|Haar|DB7"; wcolwidth irng:=1:3 width:="15"; wrowheight irng:=col(1)[1:5] height:=5; wcellcolor irng:=col(1)[1:5] color:=color(249, 236, 151); col(1)[1]$="CA3"; col(1)[2]$="CD3"; col(1)[3]$="CD2"; col(1)[4]$="CD1"; col(1)[5]$="Reconstructed"; //Insert sparklines for coefficients and reconstructed signals insertSparklines irng:=(2!1:4, 2!7) name:=0 orng:=col(2)[1]; insertSparklines irng:=(3!1:4, 3!7) name:=0 orng:=col(3)[1]; window -z; //Maximize window
More Information
For more information, please refer to our User Guide.
Related X-Functions
Keywords:decompose