|
a |
|
b/preprocessOfApneaECG/list2mat.py |
|
|
1 |
""" |
|
|
2 |
|
|
|
3 |
""" |
|
|
4 |
|
|
|
5 |
import scipy.io as sio |
|
|
6 |
from preprocessOfApneaECG.mit2Segments import Mit2Segment |
|
|
7 |
|
|
|
8 |
|
|
|
9 |
def list2mat(segment, is_debug=False): |
|
|
10 |
""" |
|
|
11 |
Convert python list to matlab .mat file. |
|
|
12 |
:param Mit2Segment segment: python list of ecg data. |
|
|
13 |
:param bool is_debug: python list of ecg data. |
|
|
14 |
:return None: |
|
|
15 |
""" |
|
|
16 |
|
|
|
17 |
if is_debug: |
|
|
18 |
print("Convert list to .mat %s" % str(segment.global_id)) |
|
|
19 |
name = segment.base_file_path + 'denoised_ecg_data.mat' |
|
|
20 |
sio.savemat(name, {'denoised_ecg_data': segment.denoised_ecg_data}) |