a b/4-Models/autoECG-tensorflow-keras/parameters.py
1
import numpy as np
2
3
4
##Sampling Rate and Duration
5
sampling_rate = 250 #Hz
6
duration = 10 #seconds
7
8
## Gamma, a (12,5) matrix to modify the five waves' amplitudes of 12 leads
9
gamma = np.array([[1, 0.1, 1, 1.2, 1],
10
                   [2, 0.2, 0.2, 0.2, 3],
11
                   [1, -0.1, -0.8, -1.1, 2.5],
12
                   [-1, -0.05, -0.8, -0.5, -1.2],
13
                   [0.05, 0.05, 1, 1, 1],
14
                   [1, -0.05, -0.1, -0.1, 3],
15
                   [-0.5, 0.05, 0.2, 0.5, 1],
16
                   [0.05, 0.05, 1.3, 2.5, 2],
17
                   [1, 0.05, 1, 2, 1],
18
                   [1.2, 0.05, 1, 2, 2],
19
                   [1.5, 0.1, 0.8, 1, 2],
20
                   [1.8, 0.05, 0.5, 0.1, 2]])
21
22
## Normal ECG Parameters
23
Anoise = 0.01
24
25
#heart rate
26
mu_hr_1 = 60          # mean of the heart rate
27
sigma_hr_1 = 7        # variance of the heart rate
28
29
#noise
30
min_noise_1 = 0.01      
31
max_noise_1 = 0.1
32
33
#For PQRST five spikes
34
# t, the starting position along the circle of each interval in radius
35
mu_t_1 = np.array((-70, -15, 0, 15, 100))  
36
sigma_t_1 = np.ones(5)*3
37
38
# a, the amplitude of each spike; b, the width of each spike
39
mu_a_1 = np.array((1.2, -5, 30, -7.5, 0.75))
40
mu_b_1 = np.array((0.25, 0.1, 0.1, 0.1, 0.4))
41
sigma_a_1 = np.abs(mu_a_1/5)
42
sigma_b_1 = np.abs(mu_b_1/5)
43
44
## Abnormal ECG Parameters
45
#heart rate
46
mu_hr_2 = 60          # mean of the heart rate
47
sigma_hr_2 = 7        # variance of the heart rate
48
49
#noise
50
min_noise_2 = 0.01      
51
max_noise_2 = 0.1
52
53
#t, a, b
54
mu_t_2 = np.array((-70, -15, 0, 15, 100))
55
mu_a_2 = np.array((1.2, -4, 25, -6.5, 0.75))
56
mu_b_2 = np.array((0.25, 0.1, 0.1, 0.1, 0.4))
57
sigma_t_2 = np.ones(5)*3
58
sigma_a_2 = np.abs(mu_a_1/5)
59
sigma_b_2 = np.abs(mu_b_1/5)
60