I need to reanalyse my matlab ERP analysis in python. I managed somehow to code it and the wave form (in my knowledge) looks reasonable I guess. But, there is a huuuge difference in the amplitude size. Matlab gives me values up to about 5 mV whereas python give me hardly values higher then 1 mV.
Would you think this is a analysis mistake like e.g. baseline; or would you think it is only a display error?
from the figures it seems that the unit you get is uV, not mV, which is already a good sign as the signal seems to be within a reasonable range
As for your actual question, it’s basically impossible to tell without seeing the code you used in both Matlab and MNE-Python, so I’m afraid I cannot provide any helpful guess here, sorry. All I can say is that the data seems to have been baseline-corrected in MNE, so at least you’ve go that going for you already
Juhey thank you! I tried to be very careful in regard to same filtering, baseline range etc. when transfering into python but I guess there is still something wrong
In python, I load in preprocessed data and ran ERP analysis with the following code:
Load in data_CSplus_Forgotten, averaged the data, did a grand average then doing the same for
data_CSplus_Remembered and the compare the both grand averages with each other in one plot
Indeed, the matlab code used mastoid, I used average reference in python.
Still I am worried about the baseline values being far below zero, especially in this plot
But you said you initially used the wrong reference, no? So I assumed you now applied the correct reference post-hoc, i.e. after applying baseline correction. Is that not the case?
In any case you can just try to apply baseline correction again and see if that fixes the issue; it’s a “non-destructive” operation and can be done repeatedly if desired. You can apply it directly on the ERPs, i.e. you don’t even have to go back to the level of epochs.
Yes but independed off if I reference to average or mastoid, there shouldnt be such negative baseline value, or am I wrong about that?
I do baseline correction before averaging, but it doesnt help
for subject in participant_list:
data_CSplus_Remembered=data['Stimulus/S 28','Stimulus/S 29']
data_CSplus_Remembered.filter(0.1,20)
data_CSplus_Remembered.apply_baseline(baseline=(-0.2, 0)).crop(-0.2,1.0)
data_CSplus_Remembered_avg.append(
data_CSplus_Remembered['Stimulus/S 28','Stimulus/S 29'].average()
)
#data_CSplus_Remembered.plot()
grand_avg_CSplus_rem = mne.grand_average(data_CSplus_Remembered_avg)
grand_avg_CSplus_rem.plot(picks=['Fz'])
Left looks alright to me, what exactly is your issue with that? What baseline correction does is that it makes it such that the average signal during the baseline period is zero in each channel. It seems very much to me like that is the case in the left figure.
Since there’s quite some activity during the baseline period, one could argue that some task-dependent activity is included in your baseline period. But it’s not an issue with MNE; if anything, it either indicates a problem with your experimental design or the choice of your baseline period.
Also the signal amplitude of the peak around 0.3 sec is much smaller in MNE than in Matlab. So something is still wrong with the referencing here, I believe.