Skip to content

wfdb_to_wav: read digital samples directly instead of converting back with adc() #638

Closed

Description

@tompollard

wfdb_to_wav reads the record with physical values and then converts them back to digital with record.adc(), which it needs to write the .wav samples:

record = rdrecord(record_name, ..., smooth_frames=True)
...
np.left_shift(np.subtract(record.adc(), offset), shift)

Reading with physical=False and using record.d_signal would avoid that round trip. It would also save a full-length float64 copy of the signal, and the output would no longer depend on how adc() rounds the floating-point values.

Found while reviewing #632.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions