suggestions on realtime SSVEP in Python or Matlab?

JDavidJDavid Portugal
edited July 2 in General Discussion
Hi,
I am trying to implement a real time SSVEP baased BCI system . Does anyone knows how to implement it in Python or Matlab?
Now, I am using OpenBCI_Python to obtain raw eeg data from a Cyton board. Then, I am transmitting it to Matlab and receiving it
through LSL (ReceiveData.m). I already can do it, but I am having difficulties into implement the signal processing in real time.
Then, after I extract the command from processing the signal, this would be sent to an ESP module.
Any ideas to help me?

Another question is that if is possible to implement this idea in Python, I was thinking about using threads, one to data acquising
and the other processed the signal and would give the command extracted.

Thanks for the help.

Comments

  • wjcroftwjcroft Mount Shasta, CA
    JDavid, hi.

    Are you using a Python DSP library?


    Some of these work in a realtime fashion, you feed the function a stream of realtime samples. Then the output is a stream of filtered amplitudes, for example at a particular bandpass filter, centered on your SSVEP modulation frequency. 

    One researcher I am aware of, suggests that sine wave amplitude modulation of the SSVEP light generator, results in cleaner visual response, with fewer harmonics.

    Regards,

    William

  • JDavidJDavid Portugal
    edited July 3
    Hello, thanks for the reply.
    Yes, I am using.
    But when I process the output of stream, wouldn't I be losing some realtime samples ?
    Regards,

  • wjcroftwjcroft Mount Shasta, CA
    edited July 3
    "But when I process the output of stream"

    Are you referring to the output of the FILTER? Yes, any type of signal processing filter (digital or even analog) has a corresponding delay factor or phase delay. However in SSVEP you are only interested when the output (amplitude) of the bandpass filter at your stimulation frequency range passes a certain threshold. THEN your "ESP module" is alerted via the other serial port.

    For typical bandpass filters a few hertz wide and say order 5 or less, your delay will be less than a second.


    William

  • JDavidJDavid Portugal
    I am using a notch filter and then a bandpass filter to limit my frequency bandwidth, and I apply certains methods. The features extraction (amplitude of the signal) is then obtained by a FFT method or Welch or CCA method.
  • wjcroftwjcroft Mount Shasta, CA
    FFT response is generally slower than an individual bandpass filter at your desired frequency. How many stimulation frequencies are available to the subject? You could compare how responsive the interface is using FFT vs bandpass.
  • JDavidJDavid Portugal
    In my case, I have 4 frequencies. One question, the bandpass filter only does a limition fo the signal bandwdith, right? How can I extract a SSVEP with a bandpass filter?
  • wjcroftwjcroft Mount Shasta, CA
    To turn the output of a bandpass into a scalar amplitude, take the absolute value (now all samples are positive), then do a moving average of that. Say with a time constant of .3 seconds. That moving average represents the amplitude of that frequency component.
Sign In or Register to comment.