Star
(Arjun Rajan)
July 7, 2022, 9:56am
1
Hello,
This is a sample of my dataset.
sampling frequency - 128 Hz
operating system: Windows 10
When plotted getting an distorted image like the below one. How to rectify it and get a proper signal.
raw.plot()
In the csv folder of the dataset I have events also. Have created a channel for the events also. But getting error.
ValueError: No stim channels found. Consider specifying them manually using the ‘stim_channel’ parameter.
events = mne.find_events(raw)
How to process the events col. of the csv file and process the eeg signals and predict which event based on the 14 channels?
Thanks
richard
(Richard Höchenberger)
July 7, 2022, 11:44am
2
Hello,
the data values seem to be in µV, but MNE requires SI units, i.e., Volts. Multiply the values by 1e-6 and things should already look much better.
As for the other question, can you please open a separate topic?
Best wishes,
Richard
Star
(Arjun Rajan)
July 7, 2022, 11:57am
3
Hello Richard,
dataframe = pd.read_csv('eeg.csv')
eeg_data = dataframe.transpose().to_numpy()
n_channels = len(dataframe.columns)
sampling_freq = 128
info = mne.create_info(n_channels, sfreq=sampling_freq)
info = mne.create_info(ch_names, ch_types=ch_types, sfreq=sampling_freq)
info.set_montage('standard_1020')
raw = mne.io.RawArray(eeg_data, info)
raw.save('eeg.fif',overwrite=True)
raw.plot()
I’m converting it from .csv to .fif and plotting, so then how do I convert the data unit from µV to V.
Thanks
richard
(Richard Höchenberger)
July 7, 2022, 12:39pm
4
Just multiply the dataframe by 1e-6 before creating the RawArray, that should do the trick.
Best wishes
Richard
richard
(Richard Höchenberger)
July 7, 2022, 12:56pm
6
Hello @Star , great to see it’s working!
Can you please post your other question into a new topic? Thank you!
Richard
Star
(Arjun Rajan)
July 7, 2022, 1:03pm
7
Thanks, Have posted it separately.
Star
(Arjun Rajan)
July 7, 2022, 1:26pm
8
Sorry but now the event column in the data frame also gets multiplied with 1e-6. That why I asked the Event’s based classification question (Event's based Classification ) with this also.
Could you help me with this @richard .
Thanks
richard
(Richard Höchenberger)
July 7, 2022, 2:05pm
9
You can exclude the last column from the multiplication by doing something like:
dataframe.loc[
:, # all rows
dataframe.columns[:-1] # omit last column (events)
] *= 1e-6
Best wishes,
Richard