-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeconv08a_L1reg_plot.m
43 lines (37 loc) · 1.07 KB
/
deconv08a_L1reg_plot.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% Plot the results of deconv09_TVreg_comp.m
%
% Samuli Siltanen Oct 2019
% Parameters for controlling the plot
lwidth = 1.5;
fsize = 20;
msize = 6;
colorGray = [.5 .5 .5];
colorRecon= [144 2 190]/255;
% Load precomputed stuff
load data/deconv08a_L1reg n alpha xvec f mn recn sig_num
ymin = min(f)-.2;
ymax = max(f)+.2;
% Calculate reconstruction error
errn = norm(recn(:)-f(:))/norm(f(:));
% Create a plot window
figure(1)
clf
% Plot the data
subplot(2,1,1)
p1 = plot(xvec,f,'k','linewidth',lwidth);
set(p1,'color',colorGray)
hold on
plot(xvec,mn,'r','linewidth',lwidth)
set(gca,'ytick',[0,1],'fontsize',fsize)
axis([0 1 ymin ymax])
title(['Noisy measurement (red) of signal ',num2str(sig_num),' (gray)'],'fontsize',fsize)
% Plot reconstruction
subplot(2,1,2)
p1 = plot(xvec,f,'k','linewidth',lwidth);
set(p1,'color',colorGray)
hold on
p2 = plot(xvec,recn,'b','linewidth',lwidth);
set(p2,'color',colorRecon)
set(gca,'ytick',[0,1],'fontsize',fsize)
axis([0 1 ymin ymax])
title(['L1 penalty reconstruction, \alpha=',num2str(alpha),', error ',num2str(100*errn,'%0.1f'),'%'],'fontsize',fsize)