I am working on a pre-processed data set which was recorded with BioSemi 256 channel net. As a next step, I was running Surface Laplacian using the Matlab code which was provided with your book ‘Analyzing Neural time Series Data’. But when I plot them, it does not look right. I am interested in mu ERD/ERS over the motor cortex so I included only Cz(A1), C4(G16), and C3(C23) in the code below. Could you please let me know what I need to do to fix this? Just in case here is the link to the data set.

Thank you so much.

chan1 = ‘A1’;

chan2 = ‘G23’;

chan2 = ‘C23’;

chan3 = ‘G16’;eucdist1 = zeros(1, 256);

eucdist2 = zeros(1, 256);

eucdist3 = zeros(1, 256);chan1idx = strcmpi(chan1, {EEG.chanlocs.labels});

chan2idx = strcmpi(chan2, {EEG.chanlocs.labels});

chan3idx = strcmpi(chan3, {EEG.chanlocs.labels});for chani=1:EEG.nbchan

eucdist1(chani) = sqrt( (EEG.chanlocs(chani).X-EEG.chanlocs(chan1idx).X)^2 + (EEG.chanlocs(chani).Y-EEG.chanlocs(chan1idx).Y)^2 + (EEG.chanlocs(chani).Z-EEG.chanlocs(chan1idx).Z)^2 );

eucdist2(chani) = sqrt( (EEG.chanlocs(chani).X-EEG.chanlocs(chan2idx).X)^2 + (EEG.chanlocs(chani).Y-EEG.chanlocs(chan2idx).Y)^2 + (EEG.chanlocs(chani).Z-EEG.chanlocs(chan2idx).Z)^2 );

eucdist3(chani) = sqrt( (EEG.chanlocs(chani).X-EEG.chanlocs(chan3idx).X)^2 + (EEG.chanlocs(chani).Y-EEG.chanlocs(chan3idx).Y)^2 + (EEG.chanlocs(chani).Z-EEG.chanlocs(chan3idx).Z)^2 );

endhi_spatfreq = 2

exp(- (eucdist1.^2)/(295^2) );

lo_spatfreq = exp(- (eucdist2.^2)/(250^2) ) + exp(- (eucdist3.^2)/(250^2) );figure

subplot(221)

topoplot(hi_spatfreq,EEG.chanlocs,‘plotrad’,.53);

title(‘Low spatial frequency feature’)

subplot(222)

topoplot(lo_spatfreq,EEG.chanlocs,‘plotrad’,.53);

title(‘High spatial frequency features’)

subplot(223)

topoplot(hi_spatfreq+lo_spatfreq,EEG.chanlocs,‘plotrad’,.53);

title(‘Low+high features’)