vallenae.io.decode_data_blob

vallenae.io.decode_data_blob(data_blob, data_format, factor_millivolts, *, raw=False)[source]

Decodes (compressed) 16-bit ADC values from BLOB to array of voltage values.

Parameters:
  • data_blob (bytes) – Blob from tradb

  • data_format (int) –

    • 0: uncompressed

    • 2: FLAC compression

  • factor_millivolts (float) – Factor from int16 representation to millivolts. Stored in tradb -> tr_params as ‘TR_mV’

  • raw (bool) – Return data as ADC values (np.int16), factor_millivolts will be ignored

Return type:

ndarray

Returns:

Array of voltage values or ADC values if raw is True