# MuseStudio: Brain Activity Data Management Library for Low-Cost EEG Devices
## 2 Background
### Connection with Muse Devices  
In order to connect Muse with a computer using Bluetooth, there exist two applications that use Lab Streaming Layer (LSL) to transmit data. While MUSE-LSL [30] connects to one Muse, BlueMuse ([[https://github.com/kowalej/BlueMuse](https://github.com/kowalej/BlueMuse)]([https://github.com/kowalej/BlueMuse](https://github.com/kowalej/BlueMuse)), accessed on 17 November 2020) can stream data from multiple Muse devices at the same time. However, note that the multidevice capabilities rely on the capacity of the receiving Bluetooth adapter. The data can be further recorded in files with LabRecorder ([[https://github.com/labstreaminglayer/App-LabRecorder](https://github.com/labstreaminglayer/App-LabRecorder)]([https://github.com/labstreaminglayer/App-LabRecorder](https://github.com/labstreaminglayer/App-LabRecorder)), accessed on 30 November 2020), which can store data from several Muse devices in a single eXtensible Data Format (XDF) file.  
As an alternative, there is a hardware-based framework [31] that measures EEG data obtained from 10 or more people using the Muse headband and allows acquiring EEG data at up to a 1 kHz frequency from up to 20 people simultaneously. However, in this hardware proposal, EEG data management cannot be provided, and it is only a graphical visualization tool.  
The developed library requires some specific Python packages to work with the data, which are outlined in the repository. Additionally, it is compatible with other software applications that extend its functionality. The library has two main starting points: recordings already stored and live visualization of EEG data. The former requires files in XDF ([[https://github.com/sccn/xdf](https://github.com/sccn/xdf)]([https://github.com/sccn/xdf](https://github.com/sccn/xdf)), accessed on 5 November 2020), which is a container specifically designed to include multichannel time series data with associated meta information. It can handle multiple types of data, including EEG. The latter adds compatibility with LSL ([[https://github.com/sccn/labstreaminglayer](https://github.com/sccn/labstreaminglayer)]([https://github.com/sccn/labstreaminglayer](https://github.com/sccn/labstreaminglayer)), accessed on 5 November 2020), which allows sending and receiving data in research experiments through the network. In addition, it features time synchronization and real-time data access in a structured manner. LSL can send several channels at the same time through the same stream, which ensures synchronization even at the channel level. As described previously, Muse has different kinds of data, including EEG, PPG, accelerometer, and gyroscope data. Those sensors do not function at the same sampling frequency, so they must be separated into different streams because of this incompatibility. The sampling frequencies are: 256 Hz for EEG, 64 Hz for PPG, 50 Hz for the accelerometer, and 50 Hz for the gyroscope. For this reason, the channels of the same type are sent in the form of a container with the captured data for a particular sample, but different types are sent over distinct containers. Four streams or containers are expected for a standard experiment with three channels in each of them, except for EEG, which contains four due to the four channels available. In general, equally sampled data are always sent in the same package.