-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecgsignal.m
110 lines (63 loc) · 1.68 KB
/
ecgsignal.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
x=0.01:0.01:2;
V=32;% example input voltage
threshold=6; % example threshold
if(V>threshold)
li=30/72;
a_pwav=0.25;
d_pwav=0.09;
t_pwav=0.16;
a_qwav=0.025;
d_qwav=0.066;
t_qwav=0.166;
a_qrswav=1.6;
d_qrswav=0.11;
a_swav=0.25;
d_swav=0.066;
t_swav=0.09;
a_twav=0.35;
d_twav=0.142;
t_twav=0.2;
a_uwav=0.035;
d_uwav=0.0476;
t_uwav=0.433;
else
li=30/72;
%p wave specifications
a_pwav=0;
d_pwav=0.09; %duration
t_pwav=0.16; %p-r interval
%q wave specifications
a_qwav=0;
d_qwav=0.066;
t_qwav=0.166;
%qrs wave specifications
d_qrswav=0.11;
a_qrswav=0;;
%s wave specifications
d_swav=0.066;
t_swav=0.09;
a_swav=0;
% t wave specifications
a_twav=0;
d_twav=0.142;
t_twav=0.2;
% u wave specifications
a_uwav=0;
d_uwav=0.0476;
t_uwav=0.433;
end
pwav=p_wav(x,a_pwav,d_pwav,t_pwav,li);
%qwav output
qwav=q_wav(x,a_qwav,d_qwav,t_qwav,li);
%qrswav output
qrswav=qrs_wav(x,a_qrswav,d_qrswav,li);
%swav output
swav=s_wav(x,a_swav,d_swav,t_swav,li);
%twav output
twav=t_wav(x,a_twav,d_twav,t_twav,li);
%uwav output
uwav=u_wav(x,a_uwav,d_uwav,t_uwav,li);
%ecg output
ecg=pwav+qrswav+twav+swav+qwav+uwav;
figure(1)
plot(x,ecg);