integrate HEG data with typical Cyton inputs like EEG or ECG ?

edited June 21 in Cyton

Hello, my question is just the post title. I know the answer may not necessarily be to send the HEG data directly to the board, but maybe use some trickery in BrainFlow or something else. I'm not even sure if there's a way to connect the two devices. I know both devices generate CSV files, and as kind of a noob to this kind of customization, I wondered if any of the pros had any suggestions. Past posts on the topic were either years old or unresolved. Thank you!

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Hi Seventh,

    The HEG data stream changes much more slowly than either ECG or EEG. Although the analog to digital converter on HEGduino V1 or V2 runs fairly quickly, in reality meaningful changes only happen over a matter of seconds. So even a 'reduced' sample rate of 1 or 2 samples per second would capture the very slow increases / decreases that happen over time. This is assuming that some type of running average of the data is performed. This would filter out noise jitter that may happen at higher sample rates.

    For a program streaming your Cyton data in realtime, the recommended approach is to use Brainflow, in the language of your choice, for example Python. Examples are shown on the Brainflow site and docs pages.

    Best way to integrate HEG data with typical Cyton inputs like EEG or ECG? I know the answer may not necessarily be to send the HEG data directly to the board, but maybe use some trickery in BrainFlow or something else. I'm not even sure if there's a way to connect the two devices. I know both devices generate CSV files...

    No, the approach would not be to send HEG data to the Cyton board (too unwieldy), nor to use CSV files, because the latter is not optimal for real-time streams.

    It appears from the HEGduino pages, that most of their apps are geared to running as web apps. And these web apps read data streams from the device. If you want to write (for example) a Python program that takes realtime data from both Cyton and HEGduino, then I would suggest posting on the HEGduino forum site,

    https://www.hegalpha.com/forum/software-development

    And ask how you would open a connection to the HEGduino from Python. This should be straightforward. I seem to recall that one of the modes the HEGduino supports, is to output the data stream to a usb serial port. Thus using a multi-threaded Python approach, you could simultaneously read both the Cyton Brainflow stream, and the HEG stream simultaneously.

    Note that Josh is now taking orders for a V2 version. And this likely has more capability than V1. But I'm sure both would support access from Python.

    https://github.com/moothyknight
    https://github.com/moothyknight/HEG_ESP32
    https://github.com/moothyknight/HEG_ESP32_Delobotomizer V2

    Regards, William

  • wjcroftwjcroft Mount Shasta, CA

    At some point there may be an official Brainflow interface to HEGduino / V1 / V2 directly. But I don't see it currently on the list.

    https://brainflow.readthedocs.io/en/stable/SupportedBoards.html

  • Thank you, this is very helpful. Now I at least know the general approach to making this work. I've also been in communication with Josh who gave me some things to try.

  • wjcroftwjcroft Mount Shasta, CA

    I think you will want to do your own moving average on top of what he is doing. For example to reduce the effective sample rate to only a few Hz. Some screenshots he shows depict a fairly noisy trend graph:

    https://static.wixstatic.com/media/dffc12_12e6a2d47cbe4fc6923cb952db9bc180~mv2.png

    The spikes and "white noise" shown there is not real HEG movement, but rather an artifact. Your own running average will smooth that out to see the only real changes that happen very slowly.

Sign In or Register to comment.