EmotiBit / ofxEmotiBit

OpenFrameworks library and examples for the EmotiBit
MIT License
34 stars 8 forks source link

Parse data using LSL markers #126

Closed nitin710 closed 2 years ago

nitin710 commented 2 years ago

description

feature add: parser should be able to parse data using LSL markers if present in the raw file

Rough Draft

basics

If LSL stream is found by the oscilloscope, control packets containing LSL time sync information are sent from the Oscilloscope to the EmotiBit using TCP

232093,35393,8,LM,1,100,TSC,7446.9015709,TS,7446.9015839,LC,7446.9025545,LD,,0.123450004
232105,35394,4,TX,1,100,TL,2022-05-23_15-16-25-071389,LC,7446.9175159

LM stand for LSL Markers and is followed by TSC, TS, LC, LD https://github.com/EmotiBit/ofxEmotiBit/blob/372b60a8e349e974a8a68fbe830175fbaee81320/EmotiBitOscilloscope/src/ofApp.cpp#L1427-L1437

TX stand for timestamp_cross_time and is followed by the local device time (TL) and the LSL time (LSL time)

List of file changes

Proposed code changes

Notes

Proposed flow for first pass through data

outstanding questions

nitin710 commented 2 years ago

Current implementation to handle parsing additional timeDomain

nitin710 commented 2 years ago

Tests

nitin710 commented 2 years ago

Notes: the curernt implementation creates a map(map). this creates an implicit order dependency [TL][LC].xTimes != [LC][TL].xTimes.(which is incorrect) https://github.com/EmotiBit/ofxEmotiBit/blob/cf306100d54a3fdb4a6842840808100d600c981c/EmotiBitDataParser/src/ofApp.cpp#L912

https://github.com/EmotiBit/ofxEmotiBit/blob/cf306100d54a3fdb4a6842840808100d600c981c/EmotiBitDataParser/src/ofApp.cpp#L572-L573

If the TX packet created is in the order LC, TL rather than TL, LC, then the code will need to be tweaked to accommodate for that.

nitin710 commented 2 years ago

Tests

nitin710 commented 2 years ago

Timestamp analysis

Timestamp type PI AX TH T1 EA
Timestamp Local Figure 2022-06-15 082523 (1) Figure 2022-06-15 082523 (5) Figure 2022-06-15 082523 (14) Figure 2022-06-15 082523 (15) Figure 2022-06-15 082523 (3)
LslLocal Figure 2022-06-15 083029 (1) Figure 2022-06-15 083029 (5) Figure 2022-06-15 083029 (14) Figure 2022-06-15 083029 (15) Figure 2022-06-15 083029 (3)
LalMarkerSource Figure 2022-06-15 083136 (1) Figure 2022-06-15 083136 (5) Figure 2022-06-15 083136 (14) Figure 2022-06-15 083136 (15) Figure 2022-06-15 083136 (3)

Conclusion