% Simulate discrete convolution
% The routine deconv1_cont_comp.m must be 
% computed before this one.
%
% Samuli Siltanen Jan 2015

% Let's construct discrete approximation of the target
n    = 128;
xvec = [0:(n-1)]/n;
Dx   = xvec(2)-xvec(1);
f    = target1(xvec);

% Let's construct the discrete PSF
load data/PSF a Ca
nu   = floor(a/Dx);
tvec = [-nu:nu]*Dx; 
p    = PSF(tvec,a);
p    = p/Ca;

% Let us build the measurement matrix
A = Dx*DC_convmtx(p,n);

% Save results to disc
save data/deconv2 n xvec f tvec p A

% Plot the results
deconv2_discretedata_plot