%
% Optical Imaging and Spectroscopy
%
% David J. Brady
% Duke University
% www.opticalimaging.org
%
% Figure 3.11%
%
% Haar wavelets and scaling functions
%
xA=linspace(-.5,1.5,1024);
phi=rect(xA-.5);
psi=rect(2*xA-.5)-rect(2*xA-1.5);
phi1=sqrt(2)*rect(2*xA-.5);
psi1=sqrt(2)*(rect(4*xA-.5)-rect(4*xA-1.5));
phi2=sqrt(4)*rect(4*xA-.5);
psi2=sqrt(4)*(rect(8*xA-.5)-rect(8*xA-1.5));
phi3=sqrt(8)*rect(8*xA-.5);
psi3=sqrt(8)*(rect(16*xA-.5)-rect(16*xA-1.5));
figure(1);set(gcf,'color','white');
subplot(1,2,1);plot(xA,[phi;phi1+1.1;phi2+2.6;phi3+4.7],'-k');title('\phi (x),\phi_{-1,0}(x),\phi_{-2,0}(x), and \phi_{-3,0}(x)');axis off;
subplot(1,2,2);plot(xA,[psi;psi1+2.5;psi2+6;psi3+11],'-k');title('\psi (x),\psi_{-1,0}(x),\psi_{-2,0}(x), and \psi_{-3,0}(x)');axis off;