synchronization problem due to Sampling rate

hazzhazz korea
edited June 2021 in Software

Hi, I have some concern.

I'm preparing for an Online Auditory Attention Detection (AAD) experiment using Cyton + Daisy and brainflow.
I estimate the correlation between sound segments (15s in length) divided in advance and EEG segments (15s in length) acquired by listening to undivided original sound.

However, the problem is that Cyton's sampling rate is 125.xx Hz, not 125.00 Hz.
I know that the drift is constant and there is no problem with timestamps.
According to the sentence above, EEG data for 1 to 15 seconds is acquired as 187x.xx sample length, not 125*15 = 1875 sample length.

In that case, I prepare the exact 1875 sample length, so the sound segment and acquired EEG data will gradually become out of sync over time.

I checked how many sample lengths are recorded through brainflow while sending external trigger of 60 seconds to cyton, and it's increased by 20 samples on average ( theory :125*60 = 7500 samples / actual : 7520~7522 samples). It changes slightly every time. [ I referred to the sample length of AUX data because I believe that the cyton acquires the same length of AUX data and length of EEG data. ]
In other words, sound and EEG data are about 20 samples apart in the second half. I think this problem will affect performance accuracy.

Am I wrong the way checked?
And is there any way to solve this issue?

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Hazz, hi.

    If you have the ability to use the Aux data for external triggers source, why not just place a trigger at appropriate points of your audio presentation? Using an external trigger is the best solution, rather than counting samples or worrying about 'approximate' synchronization.

    https://docs.openbci.com/docs/02Cyton/CytonExternal#optoisolation

    Regards, William

  • hazzhazz korea
    edited June 2021

    Thank you for response.

    yes, I have been use external triggers to detect onset of stimuli (points of audio presentation).
    The sample length I mean is the sample length from the the point of onset.

    Then, can I ignore the increase in the sample length caused the drift( additional stacking caused by 125.xxx ) ?
    In other words, if I want to match EEG data acquired for 15 second from the point of onset ( 0s ) with speech segment (0 ~ 15s),
    can I just segment the length of 1875 sample (125*15) from the point of onset and match the speech segment corresponding to that duration(0~15s) ?

    Thanks

  • wjcroftwjcroft Mount Shasta, CA

    If you have the external trigger onset recorded simultaneously with your EEG stream, then you have precise alignment of the stimulus with the resulting EEG. You should not need to assume there are 1875 samples exactly. You already have optimal synchronization if you are using the external trigger.

    What feature extraction are you using? This paper mentions several types that have been researched,

    https://res.mdpi.com/d_attachment/sensors/sensors-21-00531/article_deploy/sensors-21-00531.pdf

    William

Sign In or Register to comment.