data from brainflow and openbci_gui seems different

ZCHZCH BUAA, China

I am using Cyton with a dongle for SSVEP online classification using my own python code. However, CCA method failed to correctly classify, and I can't find a peak in the frequency domain at the same frequency as the stimulus (for both my code and GUI). When I compare the data from Brainflow and from OpenBCI_GUI, I found that they are different and this can be a problem.

I'm curious about which transform GUI is used for processing raw data? Also, I would like to know the width of the window in the GUI's FFT plot.

My connections are listed below:

It comes from E. Marx, M. Benda, and I. Volosyak, "Optimal Electrode Positions for an SSVEP-based BCI," 2019 IEEE International Conference on Systems, Man and Cybernetics (SMC), Bari, Italy, 2019, pp. 2731-2736, doi: 10.1109/SMC.2019.8914280.

pos pin
AFz BIAS
Cz SRB2
N1 O1
N2 O2

I tested the impedance, and I think it's acceptable. I also tried different biosensing setups, and EMG is observable, so I don't think the hardware is the problem.

Here is the raw data from Brainflow:


This is the data from the GUI:

The data from Brainflow differs from the GUI in the following ways (they were observed under the same conditions, but not at the same time since the GUI and Brainflow can't use the serial port simultaneously):

  • Value: The data from Brainflow is not centered; in this case, it's around -10000 µV.
  • Energy in the frequency domain: The data from Brainflow has a peak at 50 Hz. In the GUI, I tried turning the filter on and off, but no peak at 50 Hz was found (there might be power frequency disturbances, but the GUI is not affected).

Here is my code, and I think there are no obvious mistakes:

data = self.board_shim.get_current_board_data(self.num_points)

.....

for i in range(len(channels)):
            self.axes[i,0].clear()
            self.axes[i,1].clear()

            #print raw data
            self.axes[i,0].plot(data[i+1])
            self.axes[i,0].set_title(f"Data {i+1}")

            centered_data = (data[i+1] - np.mean(data[i+1]))/np.std(data[i+1])
            centered_data_array.append(centered_data)

            # note: self.d = 1/self.sampling_rate
            fft_x = np.fft.fftfreq(len(centered_data),self.d)
            fft_x = fft_x[0:int(fft_x.shape[0]/2 )]

            fft_y = np.abs(np.fft.fft(centered_data))
            fft_y = fft_y[0:int(fft_y.shape[0]/2)]**2

            self.axes[i,1].plot(fft_x,fft_y)
            self.axes[i,1].set_xlim([0, 100])
            self.axes[i,1].set_ylim([0, 1000])
            self.axes[i,1].set_title(f"FFT Power{i+1}")

Actually, I am lost in debugging. I assume there should be an observable peak in the frequency domain when flicker stimuli are applied, but there is no phenomenon. I checked the precision of the stimuli by counting frames in a 240 fps video and confirmed that the Cyton hardware is fine since EMG can be observed. Now, I suspect that the difference between the data from Brainflow and OpenBCI_GUI is causing the trouble. In addition to this, what other aspects should I debug? I would greatly appreciate any suggestions you can provide.

Comments

Sign In or Register to comment.