Cyton signal processing, UDP, Python, MATLAB, drone control
I am sending the EEG signal acquired by Cyton's 8ch to python by UDP. Therefore, I would like to know the details of the UDP signal of the EEG signal acquired by Cyton's 8ch.
How many signals do you receive when sending EEG signals over UDP? (Hz, amount of information per packet, amount of information per channel when FFT is applied, etc.)
Comments
Hi Yumino,
Did you look at the Widget Guide?
https://docs.openbci.com/Software/OpenBCISoftware/GUIWidgets/
https://docs.openbci.com/Software/OpenBCISoftware/GUIWidgets/#networking
https://docs.google.com/document/d/e/2PACX-1vR_4DXPTh1nuiOwWKwIZN3NkGP3kRwpP4Hu6fQmy3jRAOaydOuEI1jket6V4V6PG4yIG15H1N7oFfdV/pub
[OpenBCI_GUI Networking Data Formats]
Regards, William
If you use this code, how many HZ can you send by UDP at one time?
Yumino, You did not mention how you have configured your Networking Widget. Mentioning Richard @retiutut.
I used UDP in networking. Data type is time serious.
I believe that the "[OpenBCI_GUI Networking Data Formats]" document, quoted above, implies that one JSON string is sent per packet. So one sample per UDP packet. At normal Cyton sample rates that would mean 250 UDPs per second. Is that right Richard @retiutut ? If that is the true packet rate, then your program receiving the data must be capable of some buffering. The OS IP/TCP/UDP stack does do some of this for you, but I don't know how much.
Richard, perhaps you could also clarify the UDP packet details for Network Widget FFT data format? Do I have the wrong impression that 125 floats per channel (= 125 * 8 * say 4 text_bytes = 4000 bytes??) Which would exceed default IP / UDP packet size of around 512 bytes:
https://stackoverflow.com/questions/1098897/what-is-the-largest-safe-udp-packet-size-on-the-internet
It is possible to negotiate larger IP datagram size (MTU, max transfer unit).
https://www.google.com/search?q=how+to+negotiate+larger+ip+packet+size
Regards, William
I don't recommend sending TimeSeries data over UDP if the GUI is being used. TimeSeries can be sent over LSL in chunks, but it's actually a lot of information to be sent over UDP for all channels. The GUI is actually able to "crunch some numbers" to provide more meaningful information than simply raw data. There are also a number of other configurations that can be done to collect data using BrainFlow and the GUI.
I do recommend using another DataType, such as BandPower, EMG, or Focus when sending data from the GUI over UDP to another device, app, or process.
Important Question: What is this data being sent to and the end goal? @YuminosukeSato
I'm trying to move the drone with brain waves. I'm trying to send commands from OPEBCI to python via UDP and analyze them in MATLAB. I would appreciate it if you could tell me how to use it. @retiutut
If you want to control multiple flight parameters (such as up/down, rotation, forward/reverse, speed, etc.) this is quite difficult using MATLAB and simplistic BCI paradigms such as band power, P300, Motor Imagery, etc. A better approach may be to write your drone control program using the free open source BCI, MindAffect. By directing your gaze to different control-button boxes on the screen, you select that command.
https://openbci.com/forum/index.php?p=/discussion/2783/mindaffect-announces-open-source-release-of-their-cvep-bci-speller-games-etc
https://www.mindaffect.nl/
I want to process brain waves in MATLAB instead of python. So, is there any open platform that can be used with MATLAB?
MindAffect is your best bet, it uses Python. What BCI paradigm would you use with MATLAB?
This is a BCI paradigm that can acquire brain waves in real time in MATLAB.
Below is a list of typical BCI 'paradigms', what I am pointing to as paradigm. For example, an extremely simplistic paradigm would allow you to change the height of the drone (no other parameter), by the amplitude of the alpha band power. Alpha increases when eyes are closed.
https://www.gtec.at/product/bcisystem/
Hold your right hand to move forward. Hold your left hand to move backwards. The signal of the muscle of the hand is read by the brain wave and the drone is moved.
Your original post stated you were using EEG. Muscle sensing is called EMG, and sensors are applied not to the scalp, but to the appropriate body part. See:
https://docs.openbci.com/GettingStarted/Biosensing-Setups/EMGSetup/
I get the brain waves when I move my right hand and the brain waves when I move my left hand. It's not myoelectric. Specifically, I want to acquire brain waves that I want to move my right hand. Use that brain wave as a command to move the drone.
The closest BCI paradigm to that is called Motor Imagery.
https://www.google.com/search?as_q=motor+imagery&as_sitesearch=openbci.com
https://docs.openbci.com/Examples/EEGProjects/MotorImagery/
Your comment: "The signal of the muscle of the hand is read by the brain wave and the drone is moved.", this signal is not easily present at the scalp, and requires a fair amount of signal processing. Flying a drone with only forward / back 'may' be possible, but in general the MindAffect approach, with many more degrees of freedom, would allow a more pleasant operator experience.
thank you.