Skip to main content

DWT

DWT [/I/S/D/P=num/T=type /N=num /V=value] srcWaveName, destWaveName

The DWT operation performs discrete wavelet transform on the input wave srcWaveName. The operation works on one or more dimensions only as long as the number of elements in each dimension is a power of 2 or when the /P flag is specified.

Flags

/DDenoises the source wave. Performs the specified wavelet transform in the forward direction. It then zeros all transform coefficients whose magnitude fall below value % of the maximum magnitude of the transform (value specified by the /V flag). It then performs the inverse transform placing the result in destWaveName. The /I flag is incompatible with the /D flag.
/FREECreates destWaveName as a free wave.
/FREE is allowed only in functions and only if destWaveName is a simple name or wave reference structure field.
See Free Waves for more discussion.
The /FREE flag was added in Igor Pro 10.00.
/IPerform the inverse wavelet transform. The /S and /D flags are incompatible with the /I flag.
/N=numSpecifies the number of wavelet coefficients. See the table in the Details section for supported combinations.
/P=num
num =1:Adds zero padding to the end of the dimension up to nearest power of 2 when the number of data elements in a given dimension of srcWaveName is not a power of 2.
num =2: ::Uses zero padding to compute the transform, but the resulting wave is truncated to the length of the input wave
/SSmooths the source wave. This performs the specified wavelet transform in the forward direction. It then zeros all transform coefficients except those between 0 and the cut-off value (specified in % by /V flag). It then performs the inverse transform placing the result in destWaveName. The /I flag is incompatible with the /S flag.
/T=typePerforms the wavelet transform specified by type. See the table in the Details section for the transform name associated with each type code for the transform and the allowed values of the num parameter used with the /N flag. "NA" means that the /N flag is not applicable to the corresponding transform.
/V=valueSpecifies the degree of smoothing with the /S and /D flags only. For /S, value gives the cutoff as % of data points above which coefficients are set to zero. For /D, value specifies the percentage of the maximum magnitude of the transform such that coefficients smaller than this value are set to zero.

Details

When using the /T or /N flags, the following combinations of type and num are permitted for the given transform:

Transform/T=type/N=num
Daubechies1 (default)4,6,8,10,12,20
Haar2NA
Battle-Lemarie4NA
Burt-Adelson8NA
Coifman162, 4, 6
Pseudo-Coifman32NA
Splines641 (2-2), 2 (2-4),
3 (3-3), 4 (3-7)

If destWaveName exists, DWT overwrites it; if it does not exist, DWT creates it.

When used in a function, the DWT operation automatically creates a wave reference for the destination wave. See Automatic Creation of Wave References for details.

If destWaveName is not specified, the operation stores the results in W_DWT for 1D waves and M_DWT for higher dimensions.

When working with 1D waves, the transform results are packed such that the higher half of each array contains the detail components and the lower half contains the smooth components and each successive scale is packed in the lower elements. For example, if the source wave contains 128 points then the lowest scale results are stored in elements 64-127, the next scale (power of 2) are stored from 32-63, the following scale from 16-31 etc.

Examples

Make/O/N=1024 testData=sin(x/100)+gnoise(0.05)
DWT /S/N=20/V=25 testData, smoothedData

See Also

For continuous wavelet transforms use the CWT operation. The FFT operation.

Demos

Open Wavelet Demo 2.0.pxp