% Try naive reconstruction
%
% Samuli Siltanen Jan 2015


% Let's construct discrete approximation of the target
n    = 512;
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);

% Construct measurement
%mIC = A*f(:) + 0.0001*randn(n,1);
mIC = A*f(:);

% Naive inversion
recIC = inv(A)*mIC;

% Save results to disc
save data/deconv3 n xvec f tvec p A mIC recIC

deconv3_naive_plot

