Skip to content

Produces EDF file from WFDB format #244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wfdb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from wfdb.io.record import (Record, MultiRecord, rdheader, rdrecord, rdsamp,
wrsamp, dl_database, edf2mit, wav2mit, wfdb2mat, sampfreq, signame)
wrsamp, dl_database, edf2mit, mit2edf, wav2mit, wfdb2mat, sampfreq, signame)
from wfdb.io.annotation import (Annotation, rdann, wrann, show_ann_labels,
show_ann_classes, ann2rr)
from wfdb.io.download import get_dbs, get_record_list, dl_files, set_db_index_url
Expand Down
2 changes: 1 addition & 1 deletion wfdb/io/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from wfdb.io.record import (Record, MultiRecord, rdheader, rdrecord, rdsamp, wrsamp,
dl_database, edf2mit, wav2mit, wfdb2mat, sampfreq, signame, SIGNAL_CLASSES)
dl_database, edf2mit, mit2edf, wav2mit, wfdb2mat, sampfreq, signame, SIGNAL_CLASSES)
from wfdb.io._signal import est_res, wr_dat_file
from wfdb.io.annotation import (Annotation, rdann, wrann, show_ann_labels,
show_ann_classes, ann2rr)
Expand Down
13 changes: 9 additions & 4 deletions wfdb/io/_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def adc(self, expanded=False, inplace=False):
for ch in range(self.n_sig):
# NAN locations for the channel
ch_nanlocs = np.isnan(self.e_p_signal[ch])
ch_d_signal = self.e_p_signal.copy()
ch_d_signal = self.e_p_signal[ch].copy()
np.multiply(ch_d_signal, self.adc_gain[ch], ch_d_signal)
np.add(ch_d_signal, self.baseline[ch], ch_d_signal)
ch_d_signal = ch_d_signal.astype(intdtype, copy=False)
Expand Down Expand Up @@ -704,9 +704,14 @@ def convert_dtype(self, physical, return_res, smooth_frames):
if current_dtype != return_dtype:
self.p_signal = self.p_signal.astype(return_dtype, copy=False)
else:
for ch in range(self.n_sig):
if self.e_p_signal[ch].dtype != return_dtype:
self.e_p_signal[ch] = self.e_p_signal[ch].astype(return_dtype, copy=False)
if self.e_p_signal is not None:
for ch in range(self.n_sig):
if self.e_p_signal[ch].dtype != return_dtype:
self.e_p_signal[ch] = self.e_p_signal[ch].astype(return_dtype, copy=False)
else:
for ch in range(self.n_sig):
if self.p_signal[ch].dtype != return_dtype:
self.p_signal[ch] = self.p_signal[ch].astype(return_dtype, copy=False)
else:
return_dtype = 'int'+str(return_res)
if smooth_frames is True:
Expand Down
Loading