Bio Radio SDK - Xamarin Android
GLNeuroTech.Devices.Common.Signal Class Reference

Represents a single stream of samples from a device sensor. More...

Inheritance diagram for GLNeuroTech.Devices.Common.Signal:
GLNeuroTech.Devices.BioRadio.BioRadioSignal GLNeuroTech.Devices.BioRadio.BioPotentialSignal GLNeuroTech.Devices.BioRadio.Signals.AccelerometerSignal GLNeuroTech.Devices.BioRadio.Signals.AuxiliarySignal GLNeuroTech.Devices.BioRadio.Signals.GyroscopeSignal GLNeuroTech.Devices.BioRadio.Signals.HeartRateSignal GLNeuroTech.Devices.BioRadio.Signals.PpgSignal GLNeuroTech.Devices.BioRadio.Signals.SpO2Signal GLNeuroTech.Devices.BioRadio.Signals.GsrSignal

Public Member Functions

void Reset ()
 Clears any data in the input buffer for this signal. More...
 
void AddSample (uint timeStamp, long rawValue)
 Add Sample More...
 
long GetNextRawValue ()
 Returns the next raw sensor value in the buffer. More...
 
double [] GetScaledValueArray ()
 Used to retrieve an array of scaled sample values from the signal More...
 
double [] GetScaledValueArray (int count)
 Creates an array of values representing the samples from the signal. More...
 
IEnumerable< double > GetScaledValues ()
 Enumerates over all scaled values currently in the signal buffer. More...
 
long [] GetRawValueArray (int count)
 Gets an array of raw (unscaled) values from the signal. More...
 
IEnumerable< long > GetRawValues (int count)
 Enumerates over raw values in the signal buffer. More...
 
IEnumerable< long > GetRawValues ()
 Enumerates over raw values in the signal buffer. More...
 
Sample GetNextSample ()
 Used to retrieve the next Sample object in the signal buffer. More...
 
IEnumerable< SampleGetSamples ()
 Iterates over all samples currently in the signal buffer. More...
 
void Dispose ()
 

Protected Member Functions

 Signal ()
 

Properties

SignalGroup Owner [get]
 The SignalGroup to which this signal belongs. More...
 
int SamplesPerSecond [get, set]
 The number of samples transmitted by the device in one second. More...
 
TimeSpan SampleInterval [get, set]
 The time interval between sample readings. More...
 
double MaxValue [get, set]
 The maximum scaled value that this signal supports. More...
 
double MinValue [get, set]
 The miniumum scaled value that this signal supports. More...
 
double RawMinValue [get, set]
 The minimum unscaled value that this signal supports. More...
 
double RawMaxValue [get, set]
 The maximum unscaled value that this signal supports. More...
 
string Name [get, set]
 The name associated with this signal. More...
 
string Units [get, set]
 The units of measurement in which scaled values are reported. More...
 
int ReadingsAvailable [get, set]
 The number of samples available to be read More...
 
bool Enabled [get, set]
 Indicates whether the signal is enabled. More...
 

Detailed Description

Represents a single stream of samples from a device sensor.

The sample class contains methods to read data from a device in various ways. It also contains metadata that describes the range of the signal values, the sample rate, and other pertinent details.

Constructor & Destructor Documentation

◆ Signal()

GLNeuroTech.Devices.Common.Signal.Signal ( )
protected

Member Function Documentation

◆ AddSample()

void GLNeuroTech.Devices.Common.Signal.AddSample ( uint  timeStamp,
long  rawValue 
)

Add Sample

Parameters
timeStamp
rawValue

◆ Dispose()

void GLNeuroTech.Devices.Common.Signal.Dispose ( )

◆ GetNextRawValue()

long GLNeuroTech.Devices.Common.Signal.GetNextRawValue ( )

Returns the next raw sensor value in the buffer.

Returns
The next raw sensor value in the buffer.

◆ GetNextSample()

Sample GLNeuroTech.Devices.Common.Signal.GetNextSample ( )

Used to retrieve the next Sample object in the signal buffer.

Returns
A Sample object representing the next reading from the signal buffer.

◆ GetRawValueArray()

long [] GLNeuroTech.Devices.Common.Signal.GetRawValueArray ( int  count)

Gets an array of raw (unscaled) values from the signal.

Parameters
countThe number of samples to read
Returns
An array of long values representing sequential readings from the device.

◆ GetRawValues() [1/2]

IEnumerable<long> GLNeuroTech.Devices.Common.Signal.GetRawValues ( int  count)

Enumerates over raw values in the signal buffer.

Parameters
countThe number of values to read. Must be less than the total ReadingsAvailable
Returns
An enumerator object of long values
Exceptions
ArgumentOutOfRangeException

◆ GetRawValues() [2/2]

IEnumerable<long> GLNeuroTech.Devices.Common.Signal.GetRawValues ( )

Enumerates over raw values in the signal buffer.

Returns

◆ GetSamples()

IEnumerable<Sample> GLNeuroTech.Devices.Common.Signal.GetSamples ( )

Iterates over all samples currently in the signal buffer.

Returns
An enumerator object of Samples

◆ GetScaledValueArray() [1/2]

double [] GLNeuroTech.Devices.Common.Signal.GetScaledValueArray ( )

Used to retrieve an array of scaled sample values from the signal

Returns

◆ GetScaledValueArray() [2/2]

double [] GLNeuroTech.Devices.Common.Signal.GetScaledValueArray ( int  count)

Creates an array of values representing the samples from the signal.

Parameters
countThe number of readings to read from the device. Must be less than or equal to the number of ReadingsAvailable
Returns
An array of double precision values that represent sequential scaled readings from the device

◆ GetScaledValues()

IEnumerable<double> GLNeuroTech.Devices.Common.Signal.GetScaledValues ( )

Enumerates over all scaled values currently in the signal buffer.

Returns
An enumerator object of double values.

◆ Reset()

void GLNeuroTech.Devices.Common.Signal.Reset ( )

Clears any data in the input buffer for this signal.

Property Documentation

◆ Enabled

bool GLNeuroTech.Devices.Common.Signal.Enabled
getset

Indicates whether the signal is enabled.

Enabled is set to true by default. When set to false, no data will be saved to the signal. This is useful when there are unused signals being sent from the device. Disabling them will save system resources and processing time.

◆ MaxValue

double GLNeuroTech.Devices.Common.Signal.MaxValue
getset

The maximum scaled value that this signal supports.

◆ MinValue

double GLNeuroTech.Devices.Common.Signal.MinValue
getset

The miniumum scaled value that this signal supports.

◆ Name

string GLNeuroTech.Devices.Common.Signal.Name
getset

The name associated with this signal.

◆ Owner

SignalGroup GLNeuroTech.Devices.Common.Signal.Owner
get

The SignalGroup to which this signal belongs.

All Signals belong to a SignalGroup which clusters similar signals together for convenient access.

◆ RawMaxValue

double GLNeuroTech.Devices.Common.Signal.RawMaxValue
getset

The maximum unscaled value that this signal supports.

◆ RawMinValue

double GLNeuroTech.Devices.Common.Signal.RawMinValue
getset

The minimum unscaled value that this signal supports.

◆ ReadingsAvailable

int GLNeuroTech.Devices.Common.Signal.ReadingsAvailable
getset

The number of samples available to be read

◆ SampleInterval

TimeSpan GLNeuroTech.Devices.Common.Signal.SampleInterval
getset

The time interval between sample readings.

◆ SamplesPerSecond

int GLNeuroTech.Devices.Common.Signal.SamplesPerSecond
getset

The number of samples transmitted by the device in one second.

◆ Units

string GLNeuroTech.Devices.Common.Signal.Units
getset

The units of measurement in which scaled values are reported.