MATLAB: Draw a Morlet wavelet w(t) with t being set from -0.5 to 0.5 sec

MATLABmb

The mother wavelet of Morlet wavelet transform is formed by multiplying a sinusoidal wave with a Gaussian window: cycles = 8 and 0 f = 40Hz.

Best Answer

fo = 40;
cycles = 8;
sigmaf = fo/cycles;
sigmat = 1/(2*pi*sigmaf);
t = linspace(-0.5,0.5,1000);
omega_t = 1./(sigmat.*sqrt(2.*pi)).*(exp(-t.^2./(2.*sigmat.^2))).*exp(2i.*pi.*fo.*t);
plot(t,omega_t,'-*m')