bardiabarabadi / uvicMUSE

BlueMuse Alternative with MATLAB Stream (UDP)
BSD 3-Clause "New" or "Revised" License
14 stars 6 forks source link

Recieving UDP into Python? #3

Closed jacksongoode closed 3 years ago

jacksongoode commented 4 years ago

Hi,

I've been testing your package out and was wondering if there was some easy instructions on how to receive the UDP packets into other platforms like Python instead of Matlab?

jacksongoode commented 4 years ago

I see that everything is being streamed over UDP port 1963, but I was wondering if you could give the schema for this data (which values are associated with which sensor?) I get a list of 24 values and it would be nice to split and assign them with osc /tags.

bardiabarabadi commented 3 years ago

Hello Jackson,

The data streams come into different UDP ports. Below are the offsets (for example, ACC come in 1963+2=1965) EEG_OFFSET = 0; PPG_OFFSET = 1; ACC_OFFSET = 2; GYRO_OFFSET = 3;

For each socket, the data comes in the form of an array of little-endian floating points. The last element of the array is the timestamp, and the rest contains the data for that sensor. However, the length of the data array is different for different sensors. For example, EEG has 5 data elements (in addition to TimeStamp), PPG has 3, etc.

See this Let me know if that does not answer your question. Otherwise, please go ahead and close the issue.

jacksongoode commented 3 years ago

Thank you, this would be nice to document on the readme so users can potentially grab these UDP streams for other purposes.