Skip to content
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

fix resample-multichan and resample-singlechan #111

Merged
merged 1 commit into from
Mar 8, 2018
Merged
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
22 changes: 18 additions & 4 deletions wfdb/processing/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,15 @@ def resample_singlechan(x, ann, fs, fs_target):
new_sample = resample_ann(resampled_t, ann.sample)
assert ann.sample.shape == new_sample.shape

resampled_ann = Annotation(ann.record_name, ann.extension, new_sample,
ann.symbol, ann.num, ann.subtype, ann.chan, ann.aux_note, fs_target)
resampled_ann = Annotation(record_name=ann.record_name,
extension=ann.extension,
sample=new_sample,
symbol=ann.symbol,
subtype=ann.subtype,
chan=ann.chan,
num=ann.num,
aux_note=ann.aux_note,
fs=fs_target)

return resampled_x, resampled_ann

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

resampled_ann = Annotation(ann.record_name, ann.extension, new_sample, ann.symbol,
ann.num, ann.subtype, ann.chan, ann.aux_note, fs_target)
resampled_ann = Annotation(record_name=ann.record_name,
extension=ann.extension,
sample=new_sample,
symbol=ann.symbol,
subtype=ann.subtype,
chan=ann.chan,
num=ann.num,
aux_note=ann.aux_note,
fs=fs_target)

return np.column_stack(lx), resampled_ann

Expand Down