wfdb-python icon indicating copy to clipboard operation
wfdb-python copied to clipboard

Multi-frequency data with wfdb.wrsamp

Open bemoody opened this issue 4 years ago • 1 comments

If you have some multi-frequency data and are trying to save it as a WFDB record, currently the only way to do so is to create a Record object and call Record.wrsamp. This is laborious and error-prone because of all the auxiliary fields that Record.wrsamp requires.

It'd be nice to be able to pass an e_d_signal or e_p_signal parameter to wfdb.wrsamp instead, e.g.:

wfdb.wrsamp(
    'example',
    fs=125,
    units=['mV', 'mmHg'],
    sig_name=['ECG', 'ABP'],
    samps_per_frame=[4, 1],
    e_p_signal=[
        numpy.array([0.282, 0.297, 0.304, 0.304,
                     0.311, 0.311, 0.333, 0.333]),
        numpy.array([70.093, 75.623])])

bemoody avatar Nov 15 '21 21:11 bemoody

Related warts:

  • set_d_features(expanded=True, do_adc=True) is broken (it stores the data incorrectly in d_signal rather than e_d_signal)

  • adc(expanded=True) fails if n_sig is unset (it doesn't do that with expanded=False)

bemoody avatar Mar 07 '24 19:03 bemoody