API Methods and Properties
bossdevice
Methods
arm
Arming bossdevice would allow bossdevice to actively search for the Brain states already set into it and generate the TTL output sequence configured using “configure_time_port_marker” upon every instance of detection.
bossdevice
The bossdevice API can be initialized as a MATLAB Class object and provides access to its methods and functions to generate various TTL outputs and define multiple brain states upon which the predefined TTL output sequence to be released.
configure_generator_sequence
configure_generator_sequence method of bossdevice allows you to prepare a sequence of TTL output in [time duration port marker] vector style. Maximum of 400 TTL outputs can be loaded onto this configuration method. In order to prepare a single TTL output in [time duration port marker] style, just give input argument as [0 0.001 1 1] vector. Each TTL output in this vector has four elements, first index being time after trigger, the second element is the pulse width in seconds, the third element is the port number of bossdevice to deliver the output pulse and the last elment is the 8-bit event marker to be generated and written to the Biosignal processor for respective TTL output.
manualTrigger
Sends a single trigger with the current active sequence. See configure_generator_sequence for more information about generating custom trigger sequences. The function is blocking and will wait until the sequence is complete. disarm
Disarming bossdevice would allow bossdevice to stop search for the Brain states already by now “Armed’ into it and immediately stops the generation of the planned TTL output sequence configured using “configure_time_port_marker” .
initialize
Initializes the bossdevice by establishing the connection and loading the firmware. When the bossdevice is initialized, the real-time application can be started with the start method.
sendPulse
sendPulse method of the bossdevice class allows you to generate 1 TTL pusle at a specified Output port (out of 4) of the bossdevice.
start
Starts running the firmware on the bossdevice with the default parameter settings, generator and trigger status.
stop
Stops the firmware running on the bossdevice. Any pulse triggering or processing will stop immediately. It leaves the bossdevice on idle and the firmware ready for another test.
clearPersonalSettings
Clear any bossdevice target settings including name and IP address that may have been entered by the user and restores the factory settings "bossdevice" and "192.168.7.5" respectively.
changeBossdeviceIP
Change the remote IP address on the bossdevice used for the host-target communication.
After executing this command, the bossdevice will reboot. Please wait a few seconds, until the device is back online before executing further commands.
setparam
The setparam method can be used to tune parameters on the bossdevice. This is useful in some advanced use cases. For example, consider the following commands to control the triggering in the bossdevice by remote markers sent from the amplifier.
selectFirmware
Open user dialog to select firmware file (.mldatx file extension) to load into the bossdevice.
installFirmwareOnToolbox
Copies the firmware file into the toolbox folder for later reuse. It is recommended to run selectFirmware first.
plot_generator_sequence
Plots the currently configured generator sequence that will be generated on the bossdevice as soon as a trigger is raised.
Properties
theta
Refer to bossdevice_oscillation.
alpha
Refer to bossdevice_oscillation.
beta
Refer to bossdevice_oscillation.
sample_and_hold_seconds
Upon an artifactual event such as pulse artifact etc., the data gets distorted and is accumulated with a lot of noise, in order to hold the samples for a specified period of time, sample and hold period method can be helpful.
spatial_filter_weights
Spatial filtering of the signals is an important step before commencing real-time brain states detection. The bossdevice allows to specify two different spatially filtered channels and can detect brain states (based on the target phase & amplitude) for both of these spatial filtered channels in parallel. If any one of them is specified then the other one is ignored and assigned 0 weights. The index of eeg_channels being streamed from the Biosignal processor e.g. ActiCHamp or NeurOne corrosponds to the index of the weights matrix explained below.
min_inter_trig_interval
Minimum inter pulse interval allows you to define the time period for which the bossdevice should wait before generating another TTL output. It is the time span between falling and rising flanks of the trigger signal.
triggers_remaining
Number of triggers remaining for the current trial.
marker_pulse_width_sec
Tunable width of marker pulse signals in seconds. This pulse width is constant and independent of the TTL pulse outputs width.
generator_sequence
Outputs the currently configured sequence of TTL output in [time duration port marker].
num_eeg_channels
bossdevice can work on maximum of 128 EEG channels, however the minimum number of channels required to work with EEG associated features of bossdevice have been kept flexible and can be defined as in number of EEG cannnels being streamed from your Biosignal Processor.
num_aux_channels
bossdevice can work on maximum of 8 Auxiliary/Biopolar/EMG channels, however the minimum number of channels required to work with Auxiliary Channels associated features of bossdevice have been kept flexible and can be defined as in number of Aux cannnels being streamed from your Biosignal Processor.
isConnected
Gets bossdevice connected status.
isRunning
Gets bossdevice execution or running status.
isArmed
Gets bossdevice armed status.
isGeneratorRunning
Gets bossdevice generator running status.
bossdevice_oscillation
Methods
ignore
Set amplitude and phase tolerance values that will disable triggering for the corresponding oscillation. You can pass an additional argument to the ignore command if you want to ignore a certain channel. Passing no argument will ignore all the channels.
Properties
phase_target
bossdevice contains 3 built in Oscillatory phase prediction models each for Theta (4-8 Hz), Alpha (8-14Hz) and Beta (14-30Hz) frequency bands. Real-time phase detection can be performed for maximum of 2 different, pre-specified spatially filtered channels in parallel. This method allows to define a target phase in radians for a particular frequency band.
- spatial_filter_channel_number: integer having value 1 or 2
- Phase angle for Peak: 0
- Phase angle for Trough: pi
- Phase angle for Rising Flank: -pi/2
- Phase angle for Falling Flank: pi/2
- Phase angle for Random Phase: 0 (note: specify phase_plusminus as pi in this particular case)
phase_plusminus
Defining absolute target phase angles in order to detect a brain state is often prone to error mainly due to the resolution of data obtained after sampling rate transition. In order to overcome this digitization resolution error another parameter has to be defined such that the vicinities of the target phase shall be made clear to the detection algorithm. For an instance, while detecting a 0 radians phase, the phase vector would probably look like this [-0.001324 -0.00234 0.00243 0.004324], and since none of them are mathematically equivalent to zero therefore in order to not allow to skip such Oscillatory Peak events and to increase the accuracy of the phase detection, a tolerance value is to be provided.
amplitude_min
Defining minimum amplitude threshold in order to match a specific brain state is important. The bossdevice allows to define minimum amplitude threshold in micro volts that must be reached along with other brain state associated conditions such as maximum amplitude, phase target, and phase tolerance in order to be able to declare the brain state as detected and generate TTL output sequence. The bossdevice contains 3 built in Oscillatory minimum amplitude estimation models each for Theta (4-8 Hz), Alpha (8-14Hz) and Beta (14-30Hz) frequency bands. Real-time minimum amplitude detection can be performed for maximum of 2 different, pre-specified spatially filtered channels in parallel.
amplitude_max
Defining maximum amplitude threshold in order to match a specific brain state is important. The bossdevice allows to define maximum amplitude threshold in micro volts that must be not be reached in order to be able to declare the brain state as detected and generare TTL output sequence. The bossdevice contains 3 built in Oscillatory maximum amplitude estimation models each for Theta (4-8 Hz), Alpha (8-14Hz) and Beta (14-30Hz) frequency bands. Real-time maximum amplitude detection can be performed for maximum of 2 different, pre-specified spatially filtered channels in parallel.
lpf_fir_coeffs
Spatially filtered channel’s signals described in the “spatial_filter_weights” function are passed through a low pass FIR filter for anti-aliasing. The coefficients of this filter can be specified using this function provided that the filter has an order of 100 at maximum.
- Alpha (8-14 Hz) @ 500 Hz
- Theta (4-8 Hz) @ 250 Hz
- Beta(14-30 Hz) @ 1000 Hz
bpf_fir_coeffs
Low pass filtered channel’s signal described in the “lpf_fir_coeffs” function is then pass through an FIR Band Pass filter. The coefficients of this filter can be specified using this function provided that the filter has an order of 100 at maximum.
- Alpha (8-14 Hz) @ 500 Hz / 2ms
- Theta (4-8 Hz) @ 250 Hz / 4ms
- Beta(14-30 Hz) @ 1000 Hz / 1ms
offset_samples
Number of samples within the phase being analyzed counting backwards. The larger the value the older the first sample in time is being considered, and therefore, a larger time span. This is a scalar value that can be different for every phase.
Please refer to demo_phase_prediction_error_simple to see an example of how number of offset samples can be used to adjust the offset in the computation of the phase prediction error.