clear all
close all

load('transient_oscillations.mat')

% generate data example
duration = max(t)
n = duration / dt+1
fmax=1/dt

fs=1/dt

coefs2 = cwt(final,1:100,'cmor1-1'); 
coefs1 = cwt(final,1:100,'morl'); 
coefs3 = cwt(final,1:100,'cgau1'); 

figure(1)
PP=abs(coefs1);
colormap jet; 
logPP=10*log10(PP);
minPP=min(squeeze(min(PP)))
maxPP=max(squeeze(max(PP)))
minlogPP=min(squeeze(min(logPP)));
maxlogPP=max(squeeze(max(logPP)));
%pcolor(squeeze(time),freq,logPP');
pcolor(squeeze(t),1:100,PP);
% %imagesc(squeeze(data_1(:,1)),freq,10*log10(PP));
view(0,90);
%caxis([minlogPP,maxlogPP]);shading flat;
caxis([minPP,maxPP]);shading flat;
%caxis([20,maxlogPP]);shading flat;
%caxis([1.0e+02,2.0e+06]);shading flat;
%axis([1,n,1,100]);
colorbar();
ylabel('scales')
xlabel('time [s]')

figure(2)
PP=abs(coefs2);
colormap jet; 
logPP=10*log10(PP);
minPP=min(squeeze(min(PP)))
maxPP=max(squeeze(max(PP)))
pcolor(squeeze(t),1:100,PP);
view(0,90);
caxis([minPP,maxPP]);shading flat;
colorbar();
ylabel('scales')
xlabel('time [s]')

figure(3)
PP=abs(coefs3);
colormap jet; 
minPP=min(squeeze(min(PP)))
maxPP=max(squeeze(max(PP)))
pcolor(squeeze(t),1:100,PP);
view(0,90);
caxis([minPP,maxPP]);shading flat;
colorbar();
ylabel('scales')
xlabel('time [s]')