Jump to content

Contributions:LSLSource: Difference between revisions

From BCI2000 Wiki
Pbrunner (talk | contribs)
No edit summary
Mellinger (talk | contribs)
 
(35 intermediate revisions by 3 users not shown)
Line 1: Line 1:
LSLSource
==Location==
<tt>/src/contrib/SignalSource/LSLSource</tt>


==Function==
==Introduction==


The lab streaming layer (LSL) is a system for the unified collection of measurement time series in research experiments that handles both the networking, time-synchronization, (near-) real-time access as well as optionally the centralized collection, viewing and disk recording of the data.
===Labstreaminglayer===
"LSLSource" can collect data from different hardware and feed it into "BCI2000" for further analysis in real time.


===LSLSource Hardware===
The Labstreaminglayer (LSL) is a system for the unified collection of measurement time series in research experiments that handles both the networking, time-synchronization, (near-) real-time access, and optionally the centralized collection, viewing and disk recording of the data.
More information can be found at [https://github.com/sccn/labstreaminglayer/ GitHub README] and [https://labstreaminglayer.readthedocs.io/info/getting_started.html online documentation].


Different hardware can be connected to the LSLSource including "USBAmp" "OpenBCI" "Mouse" ... All the masters to the hardware are provide on GitHub. Some software can be downloaded from the following website [https://github.com/sccn/labstreaminglayer/tree/master/Apps].  
A list of LSL supported devices can also be found at this [https://labstreaminglayer.readthedocs.io/info/supported_devices.html link].


==Installation==
===LSLSource===


The master for the hardware must be installed first.  
The "LSLSource" source module uses Labstreaminglayer to acquire data from different hardware, such as OpenBCI, gUSBAmp, and eye trackers. This source module can automatically detect the sampling rate and the number of channels of the input signal and configure the output signal.


==Parameters:LiveAmpADC==
==Steps to use LSLSource==
Parameters common to all source modules are described under [[User Reference:DataIOFilter]].
Using LSL requires that you have both the LSL Application for your hardware installed and BCI2000, as the LSL Application streams data to the LSLSource BCI2000 source module.  
In addition, the ''LiveAmpADC'' provides the following parameters:


[[File:LSLSource.png| 500px| center| ]]
1.Acquire the appropriate LSL Application for your hardware. Information on how to do this can be found on the LSL [https://github.com/sccn/labstreaminglayer/ GitHub].


===SerialNumber===
2.Connect your hardware to the PC with BCI2000, and the LSL Application installed. Launch the LSL Application.
Each LiveAmp has the serial number. The serial number can be found on the back of the amplifier. This number must be set as a parameter (without letters "LA-"). It is necessary for the Bluetooth connection
 
3.In the LSL Application, configure the appropriate hardware parameters, such as sampling rate, number of channels, and filters, and open the connection to hardware. You can now start the LSL stream.
 
4.Now launch BCI2000 with LSLSource as the signal acquisition module. Click "Config" and navigate to the "Source" tab. Enter your desired sample block size and other parameters you wish to specify. Note that the "SourceCh" and "SamplingRate" parameters should be set to "auto", as these are configured in the LSL Application. 
 
5.Click "Set Config" and start your experiment!
 
==Parameters:LSLSource==
 
[[File:LSLSource.PNG| 500px| center| ]]


===SourceCh===
===SourceCh===
The total number of channels: EEG + AUX + Acc + Triggers (see parameters below).  
The source module will automatically detect the number of channels. Set this parameter to "auto".


===SampleBlockSize===
===SampleBlockSize===
Samples per channel per digitized block.  
Samples per channel per digitized block.  
Together with the sampling rate, this parameter determines how often per second data are collected, processed, and feedback is updated. For example, at 500 Hz sampling and a SampleBlockSize of 20, the system (e.g., source signal display, signal processing, and stimulus presentation) will be updated 25 times per second.
This parameter determines how often per second data are collected, processed, and feedback is updated with the sampling rate. For example, at 500 Hz sampling and a SampleBlockSize of 20, the system (e.g., source signal display, signal processing, and stimulus presentation) will be updated 25 times per second.


===SamplingRate===
===SamplingRate===
The sample rate of the system. All data is either acquired at 250, 500 or 1000Hz
The sample rate of the system. Set this parameter to "auto" as the source module can automatically detect the sampling rate.
In case you are experiencing problems by higher sampling rates (e.g., data loss, jerky display, etc.), increase the SampleBlockSize so that you are updating the system less frequently (usually, updating the system 20-30 times per second is sufficient for most applications), and increase Visualize->VisualizeSourceDecimation. This parameter will decrease the number of samples per second that are actually drawn in the Source display.
The sampling rate should be compatible with the sample block size and the computational capabilities of your computer. If your sampling rate is too high and your sample block size is too small, your PC may not be able to keep up with the data acquisition stream, causing data loss, jerky display, etc. If you are experiencing problems like this, increase the SampleBlockSize to update the system less frequently (usually, updating the system 20-30 times per second is sufficient for most applications) and increase Visualize->VisualizeSourceDecimation parameter. This will decrease the number of samples per second that are actually drawn in the Source display.


===SourceChGain===
===SourceChGain===
Gain for each channel.  
The gain for each channel. If set to "auto", this parameter is 1μV. Usually EEG is on the scale of 100's of μV, while EKG is on the order of 1mV.


===SourceChOffset===
===SourceChOffset===
Line 43: Line 52:
Names of each channel.
Names of each channel.


===AcquisitionMode===
===StreamSelectionProperty===
Data acquisition mode, it can be:
The property used for stream selection, e.g. 'type', 'name', or 'source_id'.
*inactive - no recording
*analog signal acquisition - standard recording mode
*test signal - a test signal, same on all channels
 
==Parameters:LiveAmp==
 
===EegChList===
List of indexes of EEG channels used. For example, you can write index in any order, like: 21, 3, 5, 6, 7, 8 (the order of channels does not matter). That means that only 6 EEG physical channels will be recorder: 3,5,6,7,8 and 21. Channels may not be listed twice.
 
===BipolarChannels===
Checking this option the last 8 of 32 channels will be bipolar. When user wants to record bipolar channel, he/she must put appropriate indexes in the 'EegCHList' (indexes between 25 and 32).
 
===AuxChList===
List of indexes of AUX channels. For example, if there are 6 AUX available, you can put 1, 2, 5, 6. That mans that only 4 AUX channel will be recorder, with indexes 1,2, 5 and 6.
 
===ACCList===
List of indexes of Acc (acceleration sensor) channels. There are 3 Acc channels, with indexes 1(x), 2(y) and 3(z).


===TriggerChList===
===StreamSelectionPropertyValue===
List of indexes of trigger channels. There is one analog and 8 digital channels. The order of indexes can be used in the same manner as EEG and AUX channel indexes.  
The desired value of the ''StreamSelectionProperty'', e.g. 'EEG'.


==See also==
==See also==

Latest revision as of 11:53, 14 October 2023

Location

/src/contrib/SignalSource/LSLSource

Introduction

Labstreaminglayer

The Labstreaminglayer (LSL) is a system for the unified collection of measurement time series in research experiments that handles both the networking, time-synchronization, (near-) real-time access, and optionally the centralized collection, viewing and disk recording of the data. More information can be found at GitHub README and online documentation.

A list of LSL supported devices can also be found at this link.

LSLSource

The "LSLSource" source module uses Labstreaminglayer to acquire data from different hardware, such as OpenBCI, gUSBAmp, and eye trackers. This source module can automatically detect the sampling rate and the number of channels of the input signal and configure the output signal.

Steps to use LSLSource

Using LSL requires that you have both the LSL Application for your hardware installed and BCI2000, as the LSL Application streams data to the LSLSource BCI2000 source module.

1.Acquire the appropriate LSL Application for your hardware. Information on how to do this can be found on the LSL GitHub.

2.Connect your hardware to the PC with BCI2000, and the LSL Application installed. Launch the LSL Application.

3.In the LSL Application, configure the appropriate hardware parameters, such as sampling rate, number of channels, and filters, and open the connection to hardware. You can now start the LSL stream.

4.Now launch BCI2000 with LSLSource as the signal acquisition module. Click "Config" and navigate to the "Source" tab. Enter your desired sample block size and other parameters you wish to specify. Note that the "SourceCh" and "SamplingRate" parameters should be set to "auto", as these are configured in the LSL Application.

5.Click "Set Config" and start your experiment!

Parameters:LSLSource

SourceCh

The source module will automatically detect the number of channels. Set this parameter to "auto".

SampleBlockSize

Samples per channel per digitized block. This parameter determines how often per second data are collected, processed, and feedback is updated with the sampling rate. For example, at 500 Hz sampling and a SampleBlockSize of 20, the system (e.g., source signal display, signal processing, and stimulus presentation) will be updated 25 times per second.

SamplingRate

The sample rate of the system. Set this parameter to "auto" as the source module can automatically detect the sampling rate. The sampling rate should be compatible with the sample block size and the computational capabilities of your computer. If your sampling rate is too high and your sample block size is too small, your PC may not be able to keep up with the data acquisition stream, causing data loss, jerky display, etc. If you are experiencing problems like this, increase the SampleBlockSize to update the system less frequently (usually, updating the system 20-30 times per second is sufficient for most applications) and increase Visualize->VisualizeSourceDecimation parameter. This will decrease the number of samples per second that are actually drawn in the Source display.

SourceChGain

The gain for each channel. If set to "auto", this parameter is 1μV. Usually EEG is on the scale of 100's of μV, while EKG is on the order of 1mV.

SourceChOffset

Offset for each channel.

ChannelNames

Names of each channel.

StreamSelectionProperty

The property used for stream selection, e.g. 'type', 'name', or 'source_id'.

StreamSelectionPropertyValue

The desired value of the StreamSelectionProperty, e.g. 'EEG'.

See also

User Reference:Filters, Contributions:ADCs