Closed jrevels closed 4 years ago
It would be nice to have a decode function that basically does something like the following:
decode
function decode(signal::EDF.Signal) digital_range = Int(signal.digital_max) - Int(signal.digital_min) physical_range = Int(signal.physical_max) - Int(signal.physical_min) return (physical_range / digital_range) * signal.samples end
Somebody should check that code, though. Also, there should be extra checks to ensure this properly fails when the signal isn't simply LPCM encoded.
Perhaps there could even be a separate API function that returns physical_range / digital_range (e.g. resolution_in_unit(::EDF.Signal)) and decode could wrap around that
physical_range / digital_range
resolution_in_unit(::EDF.Signal)
It would be nice to have a
decode
function that basically does something like the following:Somebody should check that code, though. Also, there should be extra checks to ensure this properly fails when the signal isn't simply LPCM encoded.