-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotBaselineWanderComparison.m
More file actions
219 lines (187 loc) · 6.14 KB
/
plotBaselineWanderComparison.m
File metadata and controls
219 lines (187 loc) · 6.14 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
%% Plot the comparison of baseline wander filtering using the two methods
% of forward-backward filtering with a Butterworth IIR filter and a Hamming
% window FIR filtering with the method of sampling rate alteration
%% Subject 1 before biofeedback
figure
annotation('textbox', [0 0.9 1 0.1], ...
'String', 'ECG of subject 1 Before Biofeedback', ...
'EdgeColor', 'none', ...
'FontWeight', 'bold', ...
'HorizontalAlignment', 'center')
sub1 = subplot(3,1,1);
plot(t_S1B,ecg_S1B_detr)
title('Before baseline wander filtering')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub2 = subplot(3,1,2);
plot(t_S1B,ecg_S1B_forBack)
title('Forward-backward IIR filtered')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub3 = subplot(3,1,3);
plot(t_S1B,ecg_S1B_rateAlt(1:length(t_S1B)))
title('Hamming window FIR filtered with sampling rate alteration')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
axis([sub1 sub2 sub3],[0 t_S1B(end) -Inf Inf])
%% Subject 1 after biofeedback
figure
annotation('textbox', [0 0.9 1 0.1], ...
'String', 'ECG of subject 1 After Biofeedback', ...
'EdgeColor', 'none', ...
'FontWeight', 'bold', ...
'HorizontalAlignment', 'center')
sub1 = subplot(3,1,1);
plot(t_S1A,ecg_S1A_detr)
title('Before baseline wander filtering')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub2 = subplot(3,1,2);
plot(t_S1A,ecg_S1A_forBack)
title('Forward-backward IIR filtered')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub3 = subplot(3,1,3);
plot(t_S1A,ecg_S1A_rateAlt(1:length(t_S1A)))
title('Hamming window FIR filtered with sampling rate alteration')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
axis([sub1 sub2 sub3],[0 t_S1A(end) -Inf Inf])
%% Subject 2 before biofeedback
figure
annotation('textbox', [0 0.9 1 0.1], ...
'String', 'ECG of subject 2 Before Biofeedback', ...
'EdgeColor', 'none', ...
'FontWeight', 'bold', ...
'HorizontalAlignment', 'center')
sub1 = subplot(3,1,1);
plot(t_S2B,ecg_S2B_detr)
title('Before baseline wander filtering')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub2 = subplot(3,1,2);
plot(t_S2B,ecg_S2B_forBack)
title('Forward-backward IIR filtered')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub3 = subplot(3,1,3);
plot(t_S2B,ecg_S2B_rateAlt(1:length(t_S2B)))
title('Hamming window FIR filtered with sampling rate alteration')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
axis([sub1 sub2 sub3],[0 t_S2B(end) -Inf Inf])
%% Subject 2 after biofeedback
figure
annotation('textbox', [0 0.9 1 0.1], ...
'String', 'ECG of subject 2 After Biofeedback', ...
'EdgeColor', 'none', ...
'FontWeight', 'bold', ...
'HorizontalAlignment', 'center')
sub1 = subplot(3,1,1);
plot(t_S2A,ecg_S2A_detr)
title('Before baseline wander filtering')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub2 = subplot(3,1,2);
plot(t_S2A,ecg_S2A_forBack)
title('Forward-backward IIR filtered')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub3 = subplot(3,1,3);
plot(t_S2A,ecg_S2A_rateAlt(1:length(t_S2A)))
title('Hamming window FIR filtered with sampling rate alteration')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
axis([sub1 sub2 sub3],[0 t_S2A(end) -Inf Inf])
%% Subject 3 before biofeedback
figure
annotation('textbox', [0 0.9 1 0.1], ...
'String', 'ECG of subject 3 Before Biofeedback', ...
'EdgeColor', 'none', ...
'FontWeight', 'bold', ...
'HorizontalAlignment', 'center')
sub1 = subplot(3,1,1);
plot(t_S3B,ecg_S3B_detr)
title('Before baseline wander filtering')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub2 = subplot(3,1,2);
plot(t_S3B,ecg_S3B_forBack)
title('Forward-backward IIR filtered')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub3 = subplot(3,1,3);
plot(t_S3B,ecg_S3B_rateAlt(1:length(t_S3B)))
title('Hamming window FIR filtered with sampling rate alteration')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
axis([sub1 sub2 sub3],[0 t_S3B(end) -Inf Inf])
%% Subject 3 after biofeedback
figure
annotation('textbox', [0 0.9 1 0.1], ...
'String', 'ECG of subject 3 After Biofeedback', ...
'EdgeColor', 'none', ...
'FontWeight', 'bold', ...
'HorizontalAlignment', 'center')
sub1 = subplot(3,1,1);
plot(t_S3A,ecg_S3A_detr)
title('Before baseline wander filtering')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub2 = subplot(3,1,2);
plot(t_S3A,ecg_S3A_forBack)
title('Forward-backward IIR filtered')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub3 = subplot(3,1,3);
plot(t_S3A,ecg_S3A_rateAlt(1:length(t_S3A)))
title('Hamming window FIR filtered with sampling rate alteration')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
axis([sub1 sub2 sub3],[0 t_S3A(end) -Inf Inf])
%% Subject 4 before biofeedback
figure
annotation('textbox', [0 0.9 1 0.1], ...
'String', 'ECG of subject 4 Before Biofeedback', ...
'EdgeColor', 'none', ...
'FontWeight', 'bold', ...
'HorizontalAlignment', 'center')
sub1 = subplot(3,1,1);
plot(t_S4B,ecg_S4B_detr)
title('Before baseline wander filtering')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub2 = subplot(3,1,2);
plot(t_S4B,ecg_S4B_forBack)
title('Forward-backward IIR filtered')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub3 = subplot(3,1,3);
plot(t_S4B,ecg_S4B_rateAlt(1:length(t_S4B)))
title('Hamming window FIR filtered with sampling rate alteration')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
axis([sub1 sub2 sub3],[0 t_S4B(end) -Inf Inf])
%% Subject 4 after biofeedback
figure
annotation('textbox', [0 0.9 1 0.1], ...
'String', 'ECG of subject 4 After Biofeedback', ...
'EdgeColor', 'none', ...
'FontWeight', 'bold', ...
'HorizontalAlignment', 'center')
sub1 = subplot(3,1,1);
plot(t_S4A,ecg_S4A_detr)
title('Before baseline wander filtering')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub2 = subplot(3,1,2);
plot(t_S4A,ecg_S4A_forBack)
title('Forward-backward IIR filtered')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
sub3 = subplot(3,1,3);
plot(t_S4A,ecg_S4A_rateAlt(1:length(t_S4A)))
title('Hamming window FIR filtered with sampling rate alteration')
xlabel('Time [s]')
ylabel('Amplitude [mV]')
axis([sub1 sub2 sub3],[0 t_S4A(end) -Inf Inf])