Repository navigation
Receiving data streams
A node receives the raw data from a sensor from a streamer, which transmits the sensor data using the lab streaming layer (LSL). In order to communicate with the streamer the node must be configured to receive the data by using the options in Configuring the node.
The relevant options for receiving a signal from a streamer using the LSL are:
primary_node = True
primary_n_channels = 2
primary_channel_names = Ch1, Ch2
primary_channel_descriptions = First channel, Second channel
primary_sampling_rate = 500
primary_buffer_size_s = 10
lsl_stream_name = MyStreamThe most important option is the lsl_stream_name which is used to identify and connect to the stream. This option should have the same value as the corresponding LSL-stream used by the streamer.
If the node produces secondary data, the following options must also be defined:
secondary_node = True
secondary_n_channels = 1
secondary_buffer_size = 300
secondary_channel_names = S_Ch1
secondary_channel_descriptions = Secondary Channel 1Note! The primary data channels in the node all share the same time array, i.e., it is assumed that each channel being received is sampled at the same rate.
However, the secondary data channels in the node each have their own time array. This means, that each secondary data channel can have a different sampling rate. However, all secondary data channel arrays are of equal size (secondary_buffer_size in the INI file).
Once these options are correctly configured, the node will automatically receive the data stream (with one or more channels) and store the data, for each channel, in a circular buffer of size (in samples) primary_sampling_rate * primary_buffer_size_s. If the LSL-stream is operating at a variable sampling rate, setting the sampling rate to 0 in the configuration file will interpet the primary_buffer_size_s as samples.