% Example computations related to one-dimensional deconvolution.
% Demonstration of truncated SVD solution applied to simulated noisy data
% involving no inverse crime.
%
% The following routines must be computed before this one:
% DC3_nocrimedata_comp.m
%
% Jennifer Mueller and Samuli Siltanen, January 2014

% Parameters for formatting the plotted figures. Modify if the linewidth, 
% font size or point size in the plots are not optimal in the figures.
lwidth = 1;
thickline = 2;
fsize = 16;
msize = 4;

% Load precomputed measurement matrix
load DC2_discretedata A 

% Compute singular value decomposition (SVD)
tic
[U,D,V] = svd(A);
comptime = toc;
svals = diag(D);

% Create a plot window
figure(1)
clf

% Plot the singular values
semilogy(svals)
title(['Computation of SVD took ', num2str(comptime), ' seconds'],'fontsize',fsize)

