You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to downsample one of SDDB signal from 250Hz to 128 Hz due i need to compare it with NSR-DB. Here what I do to downsample it:
import wfdb
from wfdb import processing as proc
#this is from sddb
sig,fields=wfdb.rdsamp(r'C:\Users\Yosafat VS\PycharmProjects\Paper Reproduce\dataset\sddb\30',channels=[0])
ann = wfdb.rdann(r'C:\Users\Yosafat VS\PycharmProjects\Paper Reproduce\dataset\sddb\30',extension='atr')
#this is from nsr_db
nsig,nfields=wfdb.rdsamp(r'C:\Users\Yosafat VS\PycharmProjects\Paper Reproduce\dataset\nsr\16265',channels=[0])
# print(nsig)
nann = wfdb.rdann(r'C:\Users\Yosafat VS\PycharmProjects\Paper Reproduce\dataset\nsr\16265',extension='atr')
print(sig[:,0])
print(lambda sig: [item for sublist in sig for item in sublist])
# print(ann.fs)
# print(nann.fs)
new_sig,new_ann= proc.resample_singlechan(sig[:,0],ann,fields['fs'],nfields['fs'])
print(new_x,new_t)
But when i run it, it return nan for new signal. For record number 30 to 35, it generate nan operation for record number 30 and 34.
The text was updated successfully, but these errors were encountered:
Hey @Yosafat1997, it looks like it was a Scipy issue where it would return all NaNs if there were any NaN values in the input array when attempting to resample. I am pushing a new pull request now to fix this. Thanks for catching this! 👍
Fixes error when downsampling single channel if NaN values are present. This was a Scipy issue so extra pre-processing and input validation was done to help safe-guard against this issue re-occuring in the future. Fixes#249.
Uh oh!
There was an error while loading. Please reload this page.
Dear devs,
I try to downsample one of SDDB signal from 250Hz to 128 Hz due i need to compare it with NSR-DB. Here what I do to downsample it:
But when i run it, it return nan for new signal. For record number 30 to 35, it generate nan operation for record number 30 and 34.
The text was updated successfully, but these errors were encountered: