|
a |
|
b/ECGSegment.py |
|
|
1 |
|
|
|
2 |
|
|
|
3 |
|
|
|
4 |
import numpy as np |
|
|
5 |
from preprocessOfApneaECG.mit2Segments import Mit2Segment, SEGMENTS_BASE_PATH, SEGMENTS_NUMBER_TRAIN |
|
|
6 |
|
|
|
7 |
|
|
|
8 |
class ECGSegment(Mit2Segment): |
|
|
9 |
""" |
|
|
10 |
Every ECGSegment object includes some base informations and feature vectors. |
|
|
11 |
""" |
|
|
12 |
def __init__(self): |
|
|
13 |
# base attributions |
|
|
14 |
super(ECGSegment, self).__init__() |
|
|
15 |
# features |
|
|
16 |
self.RR_intervals = [] |
|
|
17 |
self.R_peaks_amplitude = [] |
|
|
18 |
self.EDR = [] |
|
|
19 |
|
|
|
20 |
def read_rri_ramp_edr(self): |
|
|
21 |
self.RR_intervals = np.load(self.base_file_path + "/RRI.npy") # RR intervals extracted from ECG. |
|
|
22 |
self.R_peaks_amplitude = np.load(self.base_file_path + "/RAMP.npy") # R peaks amplitude extracted from ECG. |
|
|
23 |
self.EDR = np.load(self.base_file_path + "/EDR.npy") # ECG-Derived Respiration signal |
|
|
24 |
|
|
|
25 |
|