clear all close all
t=0:1/1023:1; s = 20*t.^(2).*((1-t).^(4)).*(cos(12*pi*t)); plot(t,s); title('Origional Signal') %plot of first trend after haar wavelet transform ylabel('Amplitude') xlabel('Time')
if mod(length(s),2)~=0 s=[s 0]; end
d=length(s); m=1:d/2;
h0= (1+sqrt(3))/(4*(sqrt(2))); h1= (3+sqrt(3))/(4*(sqrt(2))); h2= (3-sqrt(3))/(4*(sqrt(2))); h3= (1-sqrt(3))/(4*(sqrt(2)));
g0=h3; g1=-h2; g2=h1; g3=-h0;
% %Daubechies Scaling Function a1=h0*s(2*m)+h1*s(2*m+1)+h2*s(2*m+2)+h3*s(2*m+3);
% %Daubechies Wavelet Function d1=g0*s(2*m)+g1*s(2*m+1)+g2*s(2*m+2)+g3*s(2*m+3);
figure() subplot(2,1,1) plot(t,s) title('Original Signal') %plot of the original signal ylabel('Amplitude') xlabel('Time') axis tight
subplot(2,1,2) plot(t,[a1 d1]) title('Transformed Signal') %plot of the final signal obtained after the transformation xlabel('Amplitude') ylabel('Time') axis tight
Best Answer