Real or complex continuous 1-D wavelet coefficients using extension parameters

`COEFS = cwtext(S,SCALES,`

* 'wname'*)

COEFS = cwtext(S,SCALES,

`'wname'`

EXTMODE = struct('Mode',ModeVAL,'Side',SideVAL,'Len',LenVAL);

EXTMODE = {ModeVAL,SideVAL,LenVAL};

COEFS = cwtext(...,'PlotMode',PLOTMODE)

`COEFS = cwtext(S,SCALES,`

computes
the continuous wavelet coefficients of the vector S at real, positive
SCALES, using a wavelet named * 'wname'*)

`'wname'`

`COEFS = cwtext(S,SCALES,`

computes and plots the continuous wavelet transform
coefficients using extra parameters. Valid values for PropName are: * 'wname'*,PropName1,ProVal1,
...)

`'ExtMode'`

`'ExtSide'`

`'ExtLen'`

`'PlotMode'`

`'xlim'`

The continuous wavelet transform coefficients are computed using the extension parameters:

`'ExtMode'`

`'ExtSide'`

`'ExtLen'`

Valid values for * ExtMode* are:

'

`zpd`

' (zero padding)'

`sp0`

' (smooth extension of order 0)'

`sp1`

' (smooth extension of order 1)

etc.

Valid values for * ExtSide* are:

`ExtSide = 'l'`

(or`'u'`

) for left (or up) extension`ExtSide = 'r'`

(or`'d'`

) for right (or down) extension`ExtSide = 'b'`

for extension on both sides`ExtSide = 'n'`

null extension

For the complete list of valid values for `ExtMode`

and `ExtSide`

,
see `wextend`

.

`ExtLen`

is the length of extension.

Default values for extension parameters are `'zpd'`

and `'b'`

. `ExtLen`

is
computed using the maximum of SCALES.

Instead of three parameters, use the following syntaxes:

`EXTMODE = struct('Mode',ModeVAL,'Side',SideVAL,'Len',LenVAL);`

`EXTMODE = {ModeVAL,SideVAL,LenVAL};`

`COEFS = cwtext(...,'PlotMode',PLOTMODE)`

computes
and plots the continuous wavelet transform coefficients. Coefficients
are colored using `PLOTMODE`

:

`PLOTMODE = 'lvl'`

(By scale)`PLOTMODE = 'glb'`

(All scales)`PLOTMODE = 'abslvl'`

or`'lvlabs'`

(Absolute value and By scale)`PLOTMODE = 'absglb'`

or`'glbabs'`

(Absolute value and All scales)

You get 3-D plots (surfaces) using the same keywords listed
above for the `PLOTMODE`

parameter, preceded by `'3D'`

,
for example, `PLOTMODE = '3Dlvl'`

.

When `PLOTMODE = 'scal'`

or `'scalCNT'`

the
continuous wavelet transform coefficients and the corresponding scalogram
(percentage of energy for each coefficient) are computed.

When `PLOTMODE`

is `'scal'`

,
a scaled image of scalogram is displayed. When `PLOTMODE`

is `'scalCNT'`

,
a contour representation of scalogram is displayed.

If the `XLIM`

parameter is given, the continuous
wavelet transform coefficients are colored using `PLOTMODE`

and `XLIM`

.

`XLIM = [x1 x2]`

with ```
1 <= x1 <
x2 <= length(S)
```

.

For each given scale `a`

within the vector `SCALES`

,
the wavelet coefficients `C(a,b)`

are computed for ```
b
= 1
```

to `ls = length(S)`

, and are stored
in `COEFS(i,:) `

if `a = SCALES(i)`

.

Output argument `COEFS`

is a `la`

-by-`ls`

matrix
where `la`

is the length of `SCALES`

. `COEFS`

is
a real or complex matrix depending on the wavelet type.

Examples of valid use are as follows:

t = linspace(-1,1,512); s = 1-abs(t); c = cwtext(s,1:32,'cgau4'); c = cwtext(s,[64 32 16:-2:2],'morl'); c = cwtext(s,[3 18 12.9 7 1.5],'db2'); c = cwtext(s,1:32,'sym2','plotMode','lvl'); c = cwtext(s,1:64,'sym4','plotMode','abslvl','xlim',[100 400]); [c,Sc] = cwtext(s,1:64,'sym4','plotMode','scal'); [c,Sc] = cwtext(s,1:64,'sym4','plotMode','scalCNT'); [c,Sc] = cwtext(s,1:64,'sym4','plotMode','scalCNT', ... 'extMode','sp1'); c = cwtext(s,1:64,'sym4','plotMode','lvl','extMode','sp0'); c = cwtext(s,1:64,'sym4','plotMode','lvl','extMode','sp1'); c = cwtext(s,1:64,'sym4','plotMode','lvl', ... 'extMode',{'sp1','b',300}); ext = struct('Mode','sp1','Side','b','Len',300); c = cwtext(s,1:64,'sym4','plotMode','lvl','extMode',ext);

This example demonstrates the difference between a continuous wavelet transform which deals with signal extension and one which does not.

% Load and plot the signal load wcantor plot(wcantor)

% Compute and plot the coefficients cwt(wcantor,(1:256),'mexh','absglb'); colormap(pink(4))

In this figure above, which is produced by the `cwt`

function, the values of coefficients
are tremendously affected by the boundary effect due to the discontinuity
of the signal on the right. The default (zero-padding) extension mode
on the right explains this important discontinuity because the last
value is 1. On the left there is no effect because the first value
is 0.

% Compute and plot the coefficients with adapted extension mode figure; cwtext(wcantor,(1:256),'mexh','extmode','sp0','extLen',2000, ... 'plotMode','absglb'); colormap(pink(4))

In this figure, produced by the `cwtext`

function,
the suitable extension mode of the signal is very efficient, giving
as it can be seen, a good result.

Was this topic helpful?