Skip to content

Commit 45d5a7d

Browse files
authored
Merge pull request #111 from wfel/fix-resample-multichan
fix resample-multichan and resample-singlechan
2 parents ae9071e + ce81f53 commit 45d5a7d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

wfdb/processing/basic.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,15 @@ def resample_singlechan(x, ann, fs, fs_target):
121121
new_sample = resample_ann(resampled_t, ann.sample)
122122
assert ann.sample.shape == new_sample.shape
123123

124-
resampled_ann = Annotation(ann.record_name, ann.extension, new_sample,
125-
ann.symbol, ann.num, ann.subtype, ann.chan, ann.aux_note, fs_target)
124+
resampled_ann = Annotation(record_name=ann.record_name,
125+
extension=ann.extension,
126+
sample=new_sample,
127+
symbol=ann.symbol,
128+
subtype=ann.subtype,
129+
chan=ann.chan,
130+
num=ann.num,
131+
aux_note=ann.aux_note,
132+
fs=fs_target)
126133

127134
return resampled_x, resampled_ann
128135

@@ -165,8 +172,15 @@ def resample_multichan(xs, ann, fs, fs_target, resamp_ann_chan=0):
165172
new_sample = resample_ann(lt, ann.sample)
166173
assert ann.sample.shape == new_sample.shape
167174

168-
resampled_ann = Annotation(ann.record_name, ann.extension, new_sample, ann.symbol,
169-
ann.num, ann.subtype, ann.chan, ann.aux_note, fs_target)
175+
resampled_ann = Annotation(record_name=ann.record_name,
176+
extension=ann.extension,
177+
sample=new_sample,
178+
symbol=ann.symbol,
179+
subtype=ann.subtype,
180+
chan=ann.chan,
181+
num=ann.num,
182+
aux_note=ann.aux_note,
183+
fs=fs_target)
170184

171185
return np.column_stack(lx), resampled_ann
172186

0 commit comments

Comments
 (0)