Skip to contents

This function reads a raw binary stream from a provided connection, expecting a specific format that contains the sign bits for complex spectral values. The data is divided into 6 groups corresponding to: C13r, C13i, C23r, C23i, C12r, and C12i.

Usage

seasonder_CSSY_read_csign(connection, key)

Arguments

connection

A binary connection to read raw bytes from.

key

A list containing:

size

An integer specifying the total number of bytes to be read. It must equal 6 times the number of bytes per group.

key

A string identifier (expected to be "csign").

Value

A named list of 6 vectors. Each vector represents one group (e.g., C13r, C13i, etc.) and contains integers (0 or 1) corresponding to the bits (in little-endian order) extracted from the raw data.

Details

The function performs the following steps:

  • Reads key$size bytes from the specified connection.

  • Checks if enough bytes were read.

  • Ensures that the total number of bytes is divisible by 6, allowing equal distribution among the groups.

  • Splits the raw byte vector into 6 groups based on the calculated number of bytes per group.

  • Converts each byte into its 8-bit representation (using rawToBits) and flattens the result.