Delay or Latency Between Sensors and On-Screen Feedback

SamBSamB Colorado
edited August 2024 in General Discussion

Hi,
Does anyone know how to test the total time it takes for an EEG amplifier to register its data on a display? I want to see what the base delay is and what factors impact it, and by how much—factors such as different BCI software, different delays, higher-order filters, or more layers of various processing elements.
I am currently using Cyton with Bluetooth and Brainbay for neurofeedback software.
I would also love to hear any suggestions for reducing delay.

Here are two studies that suggest that more delay results in poorer neurofeedback training. They both had a method to test total delay, but for the life of me, I did not grasp it from their explanations.
https://pubmed.ncbi.nlm.nih.gov/33166941/
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8913511/

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Hi Sam,

    I believe you can assume MOST of the neurofeedback (NFB) session latency factor, occurs during the signal processing operations in the laptop app that you are using. By keeping the order of your filters say in the range of 4 (instead of higher orders 6,7 etc.) your delay factor is only a couple hundred milliseconds. I do know that many of these apps (Bioexplorer, BioEra, BrainBay, etc.) have a way to display the graph of delay vs frequency for each filter that you implement. The digital filter delay is unavoidable and is just the way these filters operate on time series.

    https://www.google.com/search?q=dsp+filter+delay

    The latency caused by the firmware and buffering (radio packets, usb delays, OS buffering) are minimal and only a few milliseconds. In the case of Cyton, it is operating at 250 Hz and thus samples every 4 ms. The OS, radio and usb buffering might add some additional few ms, but that is all.

    The second link you referenced inserts very LARGE delays of 1 second or 20 seconds. So certainly understandable that this would generate poor coupling for the trainee. As a counter example regarding latency, consider the type of infra-low frequency neurofeedback offered by the Othmers (ILF) or Mark Smith (ISF). Those infra-low waves are well below .1 Hz and take many seconds to complete a cycle. Yet those systems still produce results consistently.

    The internals of Cygnet are proprietary and not published. However there have been various articles and papers written on ILF / ISF training,

    [Fall 2013 issue of ISNR NeuroConnections; "What's happening below .5 hz?"]
    https://docs.wixstatic.com/ugd/cba323_fdd03c418d2348f59879f475b82439ee.pdf

    [all issues]
    https://www.isnr.org/neuroconnections

    Regards, William

  • wjcroftwjcroft Mount Shasta, CA

    As an addendum, if you are working with ERP projects and need very precise timing, then the External Trigger pages are relevant. But almost all neurofeedback is not working with that paradigm.

    https://docs.openbci.com/Cyton/CytonExternal/

    [using a photoresistor to tightly couple monitor visual stimuli with the data stream trigger channel]
    https://docs.openbci.com/Examples/VideoExperiment/

  • SamBSamB Colorado

    Hi William,
    Thank you for your speedy and informative response. It's nice to know that latency outside of filtering is minimal.
    The math on how much delay a filter creates is going over my head. I may dig into this later on. Brainbay also does not have a way to show the delay from filtering. I accept that if I have a single filter at order 4, then there is nothing to worry about. However, I see the need to have multiple filters in line or have higher order filters, as I get either sub-delta or 60 Hz bleeding through my filters. When training high-beta, that 60hz is impacting my amplitudes unless I stack additional bandstop filtering, and likewise for high-passing sub-delta when training lower frequencies. I wonder if it is better, in terms of latency, to use a single bandpass filter with higher order, like 6-8, or if it's better to use a order 2 (highpass or bandstop) filter then an order 4 bandpass filter.
    P.S. Thank you for the extra resource on ILF. I witnessed an ILF session recently, and I hope this is possible on the Cyton.

  • wjcroftwjcroft Mount Shasta, CA

    @SamB said:
    ...
    The math on how much delay a filter creates is going over my head. I may dig into this later on. Brainbay also does not have a way to show the delay from filtering.

    BrainBay and BioEra apps both use the FIDLIB library, read more about it here:

    https://uazu.net/fidlib/

    FIDLIB comes with a companion app that can show filter delay times, called FiView.

    https://uazu.net/fiview/
    https://uazu.net/fiview/HELP.TXT

    HELP doc shows how to select the different screens. For example to switch between frequency plot and time plot.

    I accept that if I have a single filter at order 4, then there is nothing to worry about. However, I see the need to have multiple filters in line or have higher order filters, as I get either sub-delta or 60 Hz bleeding through my filters. When training high-beta, that 60hz is impacting my amplitudes unless I stack additional bandstop filtering, and likewise for high-passing sub-delta when training lower frequencies.

    The mains notch filter is always a good idea. Not sure if extra sub-delta is needed.

    I wonder if it is better, in terms of latency, to use a single bandpass filter with higher order, like 6-8, or if it's better to use a order 2 (highpass or bandstop) filter then an order 4 bandpass filter.

    I would imagine the latter, though you can use FiView to check delays.

    P.S. Thank you for the extra resource on ILF. I witnessed an ILF session recently, and I hope this is possible on the Cyton.

    Yes, Cyton is DC coupled, so can track ILF.

    William

Sign In or Register to comment.