EegChunk

class EegChunk(val deviceId: DeviceId, val channels: List<String>, val srate: Int, val samples: FloatArray, val sampleCount: Int, val accel: FloatArray?, val gyro: FloatArray?, val firstSampleIndex: Long, val hostTimeNs: Long, val isDummy: BooleanArray, val contact: BooleanArray, val batteryPct: Float)

A batch of decoded samples from one stream packet — the efficient public unit (one object per packet, not per sample). Channel labels + srate travel with the data so consumers never reconstruct layout by hand (the legacy positional FloatArray contract is gone).

IMU values are in the physical units the BrainAccess C/Python SDK delivers — the conversion from the wire's raw counts is per hardware generation (DeviceHardware); an EegChunk never carries counts.

Constructors

Link copied to clipboard
constructor(deviceId: DeviceId, channels: List<String>, srate: Int, samples: FloatArray, sampleCount: Int, accel: FloatArray?, gyro: FloatArray?, firstSampleIndex: Long, hostTimeNs: Long, isDummy: BooleanArray, contact: BooleanArray, batteryPct: Float)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

flat [sampleCount * 3] accelerometer x/y/z in m/s², or null when the hardware has no accelerometer (HALO V1/V2). One reading per packet, repeated on each sample.

Link copied to clipboard
Link copied to clipboard

active-channel labels, in column order (length == column count).

Link copied to clipboard

per-active-channel electrode contact (length == channels.size); false = not connected.

Link copied to clipboard
Link copied to clipboard

device sample counter of the first sample (gaps detectable).

Link copied to clipboard

flat [sampleCount * 3] gyroscope x/y/z in degrees per second, or null when the hardware has no gyroscope (every board before the V3 generation).

Link copied to clipboard

host monotonic clock at receipt (for sync/LSL).

Link copied to clipboard

per-sample gap-fill marker (length == sampleCount).

Link copied to clipboard
Link copied to clipboard

flat [sampleCount * channels.size], row-major, µV — or, in impedance mode, device-computed electrode impedance in kΩ (one value per sample; NOT a raw ADC count).

Link copied to clipboard
val srate: Int

Functions

Link copied to clipboard
fun streaming(sample: Int): Float

C-SDK-parity STREAMING value for sample: 1f when the sample really arrived over the air, 0f when it is a zero-filled gap sample. The inverse of isDummy, named so consumers cannot invert the polarity by accident.