% Plot the point spread function. 
%
% Jennifer Mueller and Samuli Siltanen, January 2013

% Plot parameters
fsize  = 20;
lwidth = 2.5;

% Parameter that specifies the width of the PSF, must satisfy 0<a<1/2. 
% The support of the building block of the PSF is [-a,a], and this 
% building block is replicated at each integer to produce a periodic
% function.
a = 0.2;

% Create plot points
Nxx = 512;
xx  = linspace(-.5,.5,Nxx);
Dxx = xx(2)-xx(1);

% Evaluate point spread function
psf = zeros(size(xx));
ind = abs(xx)<a;
psf(ind) = DC_PSF(xx(ind),a);
Ca  = 1/(Dxx*sum(abs(psf))); % Normalization constant
psf = Ca*psf;

% Create plot window
figure(1)
clf

% Plot the psf
plot(xx,psf,'r','linewidth',lwidth)
xlim([-1/2 1/2])
box off
set(gca,'xtick',[-.5,-a,0,a,.5],'fontsize',fsize)
set(gca,'xticklabel',{'-0.5','-a','0','a','0.5'},'fontsize',fsize)
set(gca,'PlotBoxAspectRatio' , [2 1 1])

