%
%
% Optical Imaging and Spectroscopy
%
% David J. Brady
% Duke University
% www.opticalimaging.org
%
% Figure 3.8
%
%
% zero order spline plot
% 
xA=linspace(-7.485, 8.5, 1024);
xS=xA(5)-xA(4);
figure(1);set(gcf,'color','white');
%f=sin(pi*xA)+2.5+.8*cos(.3*pi*xA)+.001*xA.^3+5*exp(-20*(xA-pi).^2);
f=xA.^2/10;
ds=kron(eye(16),ones(1,64));
ds=circshift(ds',32)';
fd=ds*f'/64;
fu=fd'*ds;
plot(xA,[f; fu],'-k');
axis([-7.5 8.5 0 7]);
title('(a) f(x)=x^2/10 and P_{V_0}f');
return
ds=kron(eye(32),ones(1,32));
ds=circshift(ds',16)';
fd=ds*f'/32;
fu=fd'*ds;
subplot(3,1,2);plot(xA,[f; fu]);
axis([-7.5 8.5 0 7]);
title('(b) f(x)and P_{V_{-1}}f');
ds=kron(eye(128),ones(1,8));
ds=circshift(ds',4)';
fd=ds*f'/8;
fu=fd'*ds;
subplot(3,1,3);plot(xA,[f; fu]);
axis([-7.5 8.5 0 7]);
title('(c) f(x)and P_{V_{-3}}f');