Ganglion latency tests via external markers or analog input

lelalela Paris, France
edited December 2018 in Ganglion
Hi all,

In I few days I will get my Ganglion board and I started looking around for ways to test the latency between the generation of the signals and the moment they are received by my processing algorythms. This requires to get some external digital trigger or analog signal and add it to the output stream. Both options are avialable for Cyton boards. And, as I understood from other discussions, with the ganglion board it should be possible to analogread() a signal and add it to the data stream. 
Has somebody found a way to measure the latency of this board?

Thank you for your time,

regards,

Leonardo

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Leo, hi.

    This is not strictly an answer to your question. However from this description,


    It is mentioned that, 

    "The Ganglion data samples are 24-bit signed (2’s compliment), MSB first. If we did not compress the data, we could only fit one sample on each BLE packet because 24-bits is 3-bytes times 4 samples for each channel comes to 12-bytes, which would lead to a max sample rate of 100Hz, remember upper limit of consistent BLE transmission is somewhere around 100 packets per second. Therefore we aimed to get two samples per packet, which gives a real time 200Hz streaming sample rate. "

    So the latency over BLE radio channel is around 5 to 10 milliseconds. The rest of the latency will be in the BLE stack on the host operating system. Likely much shorter than this.

    My hunch is the only way you could accurately measure this, is with some type of hardware setup where you simultaneously toggle the analog pin on the Ganglion, and at the same time, change state on some independently sensed device on the host. Of course that 'independent' device will have it's own latency issues, if for example it is going over a serial port / usb. Older PC's used to provide a DB25 port with "parallel port" TTL signals that could be monitored by the CPU with low latency. But those don't exist any more.


    You might be able to rig up an Arduino to do a test like this, but again, you are probably more interested in the latency figures to a laptop platform.

    Regards,

    William

  • lelalela Paris, France
    Hi William,

    thank you for the advices, I think I see the big lines of what you suggest. The latency I need to measure is that coming from the ble stack, OS, routig through labstreaminglayer etc. But first of all I have to learn how to tell the ganglion to read the signal coming from the analog pin and to route the values it gets to the output data stream. As for the independently sensed device I may use one for which the delays are known (or can be measured).

    Best,

    Leonardo
  • wjcroftwjcroft Mount Shasta, CA
    What is the application you are targeting, that has the low latency requirement?

    In the field of neurofeedback, DSP bandwidth filters (such as Butterworth), already impose a latency, depending on how many 'poles', (or 'filter order') are involved. Generally a few hundred milliseconds delay, between (say) the alpha waves arriving, and the alpha band filter showing the amplitude of that alpha band -- is typical. That alpha amplitude could then, for example, drive an audio or visual feedback ('reward'). Such feedback rewards work fine with this amount of latency.

    Regards,

    William

  • lelalela Paris, France
    Hi William,

    I would like to test some algorithms aimed at on-line estimation of the instantaneous phase of the theta waves. The idea is to get the signals from the different channels as raw as possible and then to apply my own pipeline. For now I am more interested in the performance of the algorithms (including how much latency comes out from the acquisition + processing steps) than in their applications.

    Best,

    Leonardo
  • lelalela Paris, France
    edited December 2018
    Hi,

    as from a comment of the 27th of July it should be quite easy to change the firmware so that signals coming from analog pins A3, A4, A5, A6 are added to the output stream:


    However, it is also written that analog signals are sampled at 10Hz by default and that changing that would imply changing the library. This at the time being exceeds my competences.

    Best,

    Leonardo



Sign In or Register to comment.