Giter Site home page Giter Site logo

pmavros / shimmer_lsl_streamer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 582 KB

A simple script (and GUI) to stream data from a shimmer GSR device to LSL Lab Recorder, using the LabStreamingLayer.

Home Page: https://pmavros.github.io/shimmer_lsl_streamer/

MATLAB 100.00%
eda gsr lsl

shimmer_lsl_streamer's Introduction

Shimmer LSL streamer

screenshots/demo.gif

As the name says, this is a script that allows you to send data from a shimmer device to LSL Lab Recorder, using the LabStreamingLayer.

flowchart LR
    A(Shimmer GSR+)
    B(Shimmer LSL Streamer)
    C(LSL LabRecorder)
    D(Other streams, e.g. EEG / EYE)
    
    A --> B
    B --> C
    D --> C
    
 

This works with Shimmer GSR+ is a (typically) wristwarn sensor to record skin conductance (also known as EDA or GSR), heart rate (using a photoplythesmographer, PPG), electrocardiography (ECG) as well as kinematics (using 3-axis accelerometer, gyroscope and magnetometer).

In our research we mainly use the GSR (skin conductance) and heart-rate module, to undertand emotional reactions to different environments. We often collect multiple datastreams from stimuli, behaviour (e.g. reaction times), EEG, and eye-tracking.

One open-source solution to integrate all these datastreams in a single file during data collection (which save post-processing time and effort) is the LabStreamingLayer, or LSL, which allows the synchronisation across multiple devices, datastreams and even computers (as long as they are on the same network.

The script is put together using example files from shimmer and lsl. A GUI was added to make experimental sessions a littel easier to run.

Data

While in use, the script receives data from the shimmer, and trasmits three variables: timestamp, skin conductance, and heart-rate.

Dependencies you MUST install

  1. https://sourceforge.net/projects/realterm/files/Realterm/2.0.0.70/ read page 6 of the shimmer matlab manual. otherwise this will not work.

Instructions for use

To use/run the script, you will need:

  1. A Shimmer GSR+ device (concected to your computer over bluetooth.;-))
  2. A working version of Matlab.
  3. Download LSL for matlab, and follow the installation instructions.
  4. Download shimmer for Matlab and follow the installation instructions.
  5. Opent he shimmer_lsl_streamer.m file
  6. Check which comport is connecting to the Shimmer.
  7. initialise the streamer by typing shimmer_lsl_streamer('') make sure to replace with the ID of the port the shimmer is connected (e.g. '12')
  8. select the montage you are using (i.e. where have you placed the EDA electrodes?)
  9. press 'connect' to connect with the shimmer AND start an LSL stream
  10. press 'start' to start streaming data to LSL
  11. press 'stop' to stop streaming data LSL (for now this does not close the LSL stream, just stops sending data over).
  12. Collect and record your data in LabRecorder.

A note on timestamp accuracy (#synchronisation)

The LSL framework handles the synchronisation (and potential delays) between matlab and LabRecorder / other data streams. At present the timestamp of each sample is taken from the clock of the computer, not the clock of the sensor. Therefore, there might be an offset of a few milliseconds between the time a sample is measured and the timestamp associated with it (the time it takes to reach the computer over bluetooth). According to Shimmer this is around 25 milliseconds (max 100ms), which should be sufficient for the measurement of 'slow response signals' such as skin conductance (reaction to stimuli is on the range of a several seconds). Better solutions for more precise timing are welcome!

Future work / To do

  • select COMPORT from the GUI
  • change sampling rate from the GUI
  • stream other data (gyro, accel, etc)
  • improve timestamp, using the shimmer timestamp (see above time-syncrhonisation)
  • close LSL stream when the user presses stop, or when then GUI is closed

Alternatives

I don't like/have Matlab, are there any other options I can use for my experiment?

Yes! @ryohajika has written a similar application called ShimmerProjectECL which requires Java + Eclipse; I have not tested it.

Disclaimer

Not related with the company that makes Shimmer devices.

shimmer_lsl_streamer's People

Contributors

pabloacebillo avatar pmavros avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.