| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Wavelet Toolbox |
| Contents | Index |
Continuous 1-D wavelet transform
coefs = cwt(x,scales,'wname') coefs = cwt(x,scales,'wname','plot') coefs = cwt(x,scales,'wname','coloration') [coefs, sgram] = cwt(x,scales,'wname','scal') [coefs, sgram] = cwt(x,scales,'wname','scalCNT') coefs = cwt(x,scales,'wname','coloration',xlim)
coefs = cwt(x,scales,'wname') computes the continuous wavelet coefficients of the signal vector x at real, positive scales, using wavelet 'wname' (see waveinfo for more information). x is real and the wavelet can be real or complex. coefs is an la-by-lx matrix, where la is the length of scales and lx is the length of the input x. coefs is a real or complex matrix, depending on the wavelet type.
coefs = cwt(x,scales,'wname','plot') plots the continuous wavelet transform coefficients, using default coloration 'absglb'.
coefs = cwt(x,scales,'wname','coloration') uses the specified coloration.
[coefs,sgram] = cwt(x,scales,'wname','scal') displays a scaled image of the scalogram.
[coefs,sgram] = cwt(x,scales,'wname','scalCNT') displays a contour representation of the scalogram.
coefs = cwt(x,scales,'wname','coloration',xlim) colors the coefficients using coloration and xlim, where xlim is a vector, [x1 x2], with 1
x1 < x2
length(x).
Scale values
Scale values determine the degree to which the wavelet is compressed or stretched. Low scale values compress the wavelet and correlate better with high frequencies. The low scale CWT coefficients represent the fine-scale features in the input signal vector. High scale values stretch the wavelet and correlate better with the low frequency content of the signal. The high scale CWT coefficients represent the coarse-scale features in the input signal.
Coloration
Coloration is the method used to scale the coefficient values for plotting. Each coefficient is divided by the resulting coloration value.
For 3-D plots (surfaces), use the coloration parameter preceded by '3D', such as coefs = cwt(...,'3Dplot') or coefs = cwt(...,'3Dlvl') ...
Scalogram
Scalograms are plots that represent the percentage energy for each coefficient.
Plot the continuous wavelet transform and scalogram using sym2 wavelet at all integer scales from 1 to 32, using a fractal signal as input:
load vonkoch vonkoch=vonkoch(1:510); len = length(vonkoch); cw1 = cwt(vonkoch,1:32,'sym2','plot'); title('Continuous Transform, absolute coefficients.') ylabel('Scale') [cw1,sc] = cwt(vonkoch,1:32,'sym2','scal'); title('Scalogram') ylabel('Scale')
Compare discrete and continuous wavelet transforms, using a fractal signal as input:
load vonkoch vonkoch=vonkoch(1:510); len=length(vonkoch); [c,l]=wavedec(vonkoch,5,'sym2'); % Compute and reshape DWT to compare with CWT. cfd=zeros(5,len); for k=1:5 d=detcoef(c,l,k); d=d(ones(1,2^k),:); cfd(k,:)=wkeep(d(:)',len); end cfd=cfd(:); I=find(abs(cfd) <sqrt(eps)); cfd(I)=zeros(size(I)); cfd=reshape(cfd,5,len); % Plot DWT. subplot(311); plot(vonkoch); title('Analyzed signal.'); set(gca,'xlim',[0 510]); subplot(312); image(flipud(wcodemat(cfd,255,'row'))); colormap(pink(255)); set(gca,'yticklabel',[]); title('Discrete Transform,absolute coefficients'); ylabel('Level'); % Compute CWT and compare with DWT subplot(313); ccfs=cwt(vonkoch,1:32,'sym2','plot'); title('Continuous Transform, absolute coefficients'); set(gca,'yticklabel',[]); ylabel('Scale');
Daubechies, I. Ten Lectures on Wavelets, Philadelphia, PA: Society for Industrial and Applied Mathematics (SIAM), 1992.
Mallat, S. A Wavelet Tour of Signal Processing, San Diego, CA: Academic Press, 1998.
One-Dimensional Continuous Wavelet Analysis
| Provide feedback about this page |
![]() | coifwavf | cwtext | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |