-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeconv02_discretedata_plot.m
138 lines (109 loc) · 3.24 KB
/
deconv02_discretedata_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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
% Plot the results of deconv02_discretedata_comp.m
%
% Samuli Siltanen Sep 2022
% Parameters for controlling the plot
lwidth = 1.5;
fsize = 16;
msize = 6;
colorGray = [.5 .5 .5];
% Load precomputed stuff
load data/deconv02 n xvec Dx tvec p pn f1 m1 mn1 f2 m2 mn2 f3 m3 mn3 f4 m4 mn4
% Create a plot window
figure(1)
clf
% Plot target
subplot(3,1,1)
plot(xvec,f1,'k','linewidth',lwidth)
set(gca,'xticklabel','','fontsize',fsize)
set(gca,'ytick',[0,1],'fontsize',fsize)
axis([0 1 -.2 1])
title('Ground truth: signal 1','fontsize',fsize)
% Plot ideal convolution result
subplot(3,1,2)
p1 = plot(xvec,f1,'k','linewidth',lwidth);
set(p1,'color',colorGray)
hold on
plot(xvec,m1,'b','linewidth',lwidth)
set(gca,'xticklabel','','fontsize',fsize)
set(gca,'ytick',[0,1],'fontsize',fsize)
axis([0 1 -.2 1])
title('Convolution (blue) of signal 1 (gray)','fontsize',fsize)
% Plot noisy data
subplot(3,1,3)
p1 = plot(xvec,f1,'k','linewidth',lwidth);
set(p1,'color',colorGray)
hold on
plot(xvec,mn1,'r','linewidth',lwidth)
set(gca,'ytick',[0,1],'fontsize',fsize)
axis([0 1 -.2 1])
title('Noisy measurement (red) of signal 1 (gray)','fontsize',fsize)
% Create a plot window
figure(2)
clf
% Plot target
subplot(3,1,1)
plot(xvec,f2,'k','linewidth',lwidth)
set(gca,'xticklabel','','fontsize',fsize)
set(gca,'ytick',[0,1],'fontsize',fsize)
axis([0 1 -1.2 1.5])
title('Ground truth: signal 2','fontsize',fsize)
% Plot ideal convolution result
subplot(3,1,2)
p1 = plot(xvec,f2,'k','linewidth',lwidth);
set(p1,'color',colorGray)
hold on
plot(xvec,m2,'b','linewidth',lwidth)
set(gca,'xticklabel','','fontsize',fsize)
set(gca,'ytick',[0,1],'fontsize',fsize)
axis([0 1 -1.2 1.5])
title('Convolution (blue) of signal 2 (gray)','fontsize',fsize)
% Plot noisy data
subplot(3,1,3)
p1 = plot(xvec,f2,'k','linewidth',lwidth);
set(p1,'color',colorGray)
hold on
plot(xvec,mn2,'r','linewidth',lwidth)
set(gca,'ytick',[0,1],'fontsize',fsize)
axis([0 1 -1.2 1.5])
title('Noisy measurement (red) of signal 2 (gray)','fontsize',fsize)
% Create a plot window
figure(3)
clf
% Plot target
subplot(2,1,1)
plot([1:length(f3)],f3,'k','linewidth',lwidth)
set(gca,'xticklabel','','fontsize',fsize)
title('Ground truth: signal 3','fontsize',fsize)
% Plot ideal convolution result
subplot(2,1,2)
p1 = plot([1:length(f3)],f3,'k','linewidth',lwidth);
set(p1,'color',colorGray)
hold on
plot([1:length(f3)],m3,'b','linewidth',lwidth)
set(gca,'xticklabel','','fontsize',fsize)
title('Convolution (blue) of signal 3 (gray)','fontsize',fsize)
% Create a plot window
figure(4)
clf
% Plot target
subplot(2,1,1)
plot([1:length(f4)],f4,'k','linewidth',lwidth)
set(gca,'xticklabel','','fontsize',fsize)
title('Ground truth: signal 4','fontsize',fsize)
% Plot ideal convolution result
subplot(2,1,2)
p1 = plot([1:length(f4)],f4,'k','linewidth',lwidth);
set(p1,'color',colorGray)
hold on
plot([1:length(f4)],m4,'b','linewidth',lwidth)
set(gca,'xticklabel','','fontsize',fsize)
title('Convolution (blue) of signal 4 (gray)','fontsize',fsize)
% Create a plot window
figure(10)
clf
% Plot ideal and perturbed PSF
plot(p,'b','linewidth',lwidth)
hold on
plot(pn,'r','linewidth',lwidth)
set(gca,'ytick',[0,max([max(p),max(pn)])],'fontsize',fsize)
title('Ideal convolution kernel (blue) and kernel with modelling error (red)','fontsize',fsize)