Wavelet Toolbox |
New Wavelet for CWT Using the Command Line
The following example illustrates how to generate a new wavelet starting from a pattern.
% Load original pattern: a pseudo sine one. load ptpssin1; % Variables X and Y contain the pattern. whos Name Size Bytes Class IntVAL 1x1 8 double array X 1x256 2048 double array Y 1x256 2048 double array caption 1x35 70 char array Grand total is 548 elements using 4174 bytes % This example is a demo-example, so we have the value of the % integral of the pattern as well as the details about its % construction in the caption variable. IntVAL IntVAL = 0.1592 % The pattern defined on the interval [0,1] is of integral 0.1592. % So it is not a wavelet but it is a good candidate since it % oscillates like a wavelet. plot(X,Y), title('Original Pattern') % To synthesize a new wavelet adapted to the given pattern, let % us use a least squares polynomial approximation of degree 6 with % constraints of continuity at the beginning and the end of the % pattern. [psi,xval,nc] = pat2cwav(Y, 'polynomial',6, 'continuous') ; % The new wavelet is given by xval and nc*psi. plot(X,Y,'-',xval,nc*psi,'--'), title('Original Pattern and Adapted Wavelet (dashed line)') % Let us notice that the version of the wavelet correctly % defined in order to be used in the CWT algorithm must be of % square norm equal to 1. It is simply given by xval and psi.
New Wavelet for CWT | New Wavelet for CWT Using the Graphical Interface |
© 1994-2005 The MathWorks, Inc.