www.gusucode.com > wavelet 源码程序 matlab案例代码 > wavelet/ContinuousWaveletAnalysisExample.m

    %% Continuous Wavelet Analysis  
% This example shows how to perform time-frequency analysis using the continuous
% wavelet transform (CWT). Continuous wavelet analysis provides a time-scale/time-frequency
% analysis of signals and images. The Wavelet Toolbox(TM) software has both
% command line and interactive functionality to support continuous wavelet
% analysis of 1-D signals.   

%% 
% Construct a signal consisting of two sinusoids with frequencies of 100
% and 50 Hz. The support of the two sinusoids is disjoint. The 100-Hz sine 
% wave begins at t = 0 and has a duration of 1 second. The 50-Hz sinusoid 
% begins at three seconds and has a duration of two seconds. 
Fs = 1000;
t = linspace(0,5,5e3);
x = cos(2*pi*100*t).*(t<1)+cos(2*pi*50*t).*(3<t)+0.3*randn(size(t));
%%
% Obtain the CWT and plot its scalogram
cwt(x,Fs);