Skip to content

Commit 7ae08ee

Browse files
committed
new python class inherit object
1 parent 0b249ac commit 7ae08ee

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

wfdb/_headers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from . import downloads
99

1010
# Class of common methods for single and multi-segment headers
11-
class BaseHeadersMixin():
11+
class BaseHeadersMixin(object):
1212

1313
# Write a wfdb header file. The signals or segments fields are not used.
1414
def wrheader(self):

wfdb/_signals.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Class with signal methods
1010
# To be inherited by WFDBrecord from records.py.
11-
class SignalsMixin():
11+
class SignalsMixin(object):
1212

1313
def wrdats(self):
1414

@@ -819,6 +819,13 @@ def wrdatfile(filename, fmt, d_signals):
819819
bwrite = d_signals.astype('uint8')
820820

821821
elif fmt == '212':
822+
823+
# Each sample is represented by a 12-bit two’s complement amplitude.
824+
# The first sample is obtained from the 12 least significant bits of the first byte pair (stored least significant byte first).
825+
# The second sample is formed from the 4 remaining bits of the first byte pair (which are the 4 high bits of the 12-bit sample)
826+
# and the next byte (which contains the remaining 8 bits of the second sample).
827+
# The process is repeated for each successive pair of samples.
828+
822829
# convert to 12 bit two's complement
823830
d_signals[d_signals<0] = d_signals[d_signals<0] + 65536
824831
# Split samples into separate bytes using binary masks

wfdb/records.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
# The base WFDB class to extend to create Record and MultiRecord. Contains shared helper functions and fields.
23-
class BaseRecord():
23+
class BaseRecord(object):
2424
# Constructor
2525
def __init__(self, recordname=None, nsig=None,
2626
fs=None, counterfreq=None, basecounter = None,

0 commit comments

Comments
 (0)