0

I have a eeg recording with sfreq of 2500 Hz, I tried to preprocess it with mne, as following: (resampling, filtering, interpolating bad channels, ICA, setting eeg reference) but looking at evokes, there is a sinusoidal noise in it, which I don't see it when preprocessing with fieldtrip and even when I preprocessd it before by mne... Can anyone help me with this?the final evoke for a stimulus seen in Cz this is the true answer

raw_erp = mne.io.read_raw_brainvision(vhdr_fname=vhdr_fname_erp, preload=True)
sfreq = 250
raw_erp_ready = raw_erp.filter(l_freq=None, h_freq=sfreq/2)
raw_erp_resampled = raw_erp.resample(sfreq=sfreq)

l_freq = .1 # Hz
h_freq = 40 # Hz
raw_erp_filtered = raw_erp_resampled.filter(l_freq=l_freq, h_freq=h_freq)

bad_channels = ['AF8', 'Fz','PO7','PO8'] # bad channels by exploring signal traces
raw_erp_filtered.info['bads'].extend(bad_channels) # adding some bad channels after exploring signals 
raw_rm_bd_ch = raw_erp_filtered.interpolate_bads(reset_bads=True, mode='accurate', verbose=None)

ica = mne.preprocessing.ICA(n_components=20, random_state=97, max_iter=800)
ica.fit(raw_rm_bd_ch)
ica.exclude = [0, 1] # which components should be removed after looking at the components  
ica.apply(raw_rm_bd_ch)

raw_avg_ref = raw_rm_bd_ch.set_eeg_reference(ref_channels='average', projection=False)

events = mne.events_from_annotations(raw_avg_ref)
#events idx need to be resampled (in this case 2500 / 250 = 10)
for idx in range(len(events[0])):
    events[0][idx][0] = int(events[0][idx][0] / 10)

epochs = mne.Epochs(raw_avg_ref, events[0], event_id=events[1], tmin=-0.2, tmax=0.5,
                    preload=True)
epochs.apply_baseline(baseline=(None, 0))

I tried before with mne, almost the same approach, but seems that I changed sth that I cant figure it out..any idea? thanks in advance

0 Answers0