% We plot naive reconstructions (deconvolutions) from simulated 1D
% convolution data with and without inverse crime.
%
% The routines DC1_cont_data_comp.m and DC2_discretedata_comp.m must be
% executed before running this code.
%
% Jennifer Mueller and Samuli Siltanen, January 2013
% Plot parameters. Modify only if the line width, font size or point size
% in the plots are not optimal.
fsize = 10;
lwidth = 1;
msize = 6;
% Load precomputed results. The routines DC1_cont_data_comp.m and
% DC2_discretedata_comp.m must be executed before running this code.
load DC2_discretedata A x n m mn mIC sigma
% Construct original signal for comparison
targ = DC_target(xx);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Compute reconstruction from data with inverse crime
%reco = inv(A)*(mIC(:)+0.001*randn(size(mIC)));
reco = inv(A)*mIC(:);
% Create plot window
figure(2)
clf
% Plot original target
plot(xx,targ,'k','linewidth',lwidth)
hold on
% Plot the naive reconstruction
plot(x,reco,'r.','markersize',msize)
plot(x,reco,'r')
% Axis settings
axis([0 1 -.2 1.6])
box off
set(gca,'ytick',[0,.5,1,1.5],'fontsize',fsize)
set(gca,'xtick',[0,.5,1],'fontsize',fsize)
set(gca,'PlotBoxAspectRatio' , [2 1 1])
title('Naive reconstruction (red) from ideal data with inverse crime')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Compute reconstruction from ideal data without inverse crime
reco = inv(A)*m(:);
% Create plot window
figure(3)
clf
% Plot original target
plot(xx,targ,'k','linewidth',lwidth)
hold on
% Plot the naive reconstruction
plot(x,reco,'r.','markersize',msize)
plot(x,reco,'r')
% Axis settings
axis([0 1 -.2 1.6])
box off
set(gca,'ytick',[0,.5,1,1.5],'fontsize',fsize)
set(gca,'xtick',[0,.5,1],'fontsize',fsize)
set(gca,'PlotBoxAspectRatio' , [2 1 1])
title('Naive reconstruction (red) from ideal data without inverse crime')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Compute reconstruction from noisy data without inverse crime
recon = inv(A)*mn(:);
% Create plot window
figure(4)
clf
% Plot original target
plot(xx,targ,'k','linewidth',lwidth)
hold on
% Plot the naive reconstruction
plot(x,recon,'r.','markersize',msize)
plot(x,recon,'r')
% Axis settings
axis([0 1 -.2 1.6])
box off
set(gca,'ytick',[0,.5,1,1.5],'fontsize',fsize)
set(gca,'xtick',[0,.5,1],'fontsize',fsize)
set(gca,'PlotBoxAspectRatio' , [2 1 1])
title('Naive reconstruction (red) from noisy data without inverse crime')