EEG Preprocessing

  • MNE version: e.g. 0.24.0
  • operating system: Windows 10
    Hi, I’m working with Epoc + (14 channels), my EEG data is in a .csv file. I need a guidiline of preprocessing. I need a FFT, High pass filter and FIR filters. I trying a lot of code but it doesnt work with me…if there is someone who managed to do them can you share it with me or is there any open source can help me. Thank you

you could firstly read the csv file use pandas, like pd.read_csv(filename), then transfer the data to numpy.arrary with the shape of (channel_number, time_step), then use the sampling rate, channels’ name and data to create a Raw or Epoch object.

1 Like

The problem with storing EEG data in .csv file is that the format is non-standard and varies a lot depending on who created the .csv. You have to figure out yourself how to read it, parse it and transform it into a format understood by MNE, namely a numpy array of shape (n_channels, n_times) for a RAW instance; and (n_epochs, n_channels, n_times) for an EPOCH instance.

Documentation to create raw or epoch instance from numpy array:

Bandpass filter can then be applied with instance.filter(), e.g. for raw.filter(): mne.io.RawArray — MNE 0.24.1 documentation

For FFT, you could use PSD methods:

All the links I provided are part of the API; and you can find at the end of each class/function/method tutorials using it. You can also look the available tutorials directly here: Tutorials — MNE 0.24.1 documentation

2 Likes