% Continuous wavelet transform of a 1D Piece-wise smooth signal. N = 4096; % signal length. nvoice = 12; % Number fo voices/octave. amin = 0.66; % Minimum scale. wavsupp = 8; % Mexican hat wavelet support. octave = floor(log2(amin*wavsupp)); % octave is such that the % number of scales = log2(N) - octave. WaveName = 'Sombrero'; % Mexican hat wavelet. % Create signal. x = MakeSignal('Piece-Regular',N); subplot(211); plot(x); set(gca,'FontSize',14); title(sprintf('Piece-wise Regular Signal'));axis tight % Compute CWT with Mexican hat wavelet. cwt = CWT_Wavelab(x,nvoice,WaveName,octave,4); % display CWT subplot(212); ImageCWT(fliplr(cwt),'Individual','gray','log',octave,4); set(gca,'FontSize',14); xlabel('Position');ylabel('log_2(scale)');title('CWT') saveas(gcf,'cwtdemo.eps','epsc');