[Eeglablist] Help with importing data in MATLAB/biosig
kostas/othon Hatzimpaloglou
kostasoch at gmail.com
Fri Jun 16 08:46:16 PDT 2023
Dear Sir or Madam,
I am having difficulty understanding importing EEG data to the matlab
file (attached)/ the file is used to pre-proccesse EEG data. using the
Biosig plugin. I am having two individuals' data that the stages (sound
signal & response) of the experiment are in csv files and the measured data
from each electrode were saved in excel file (two excel files). The files
have different timestamps which gives me a harder task to understand how I
need to solve this problem. I am attaching also two file from the two
different formats. How I can use them to be read by the eegpreproc.m script.
I am attaching the files to show the timestamp incoherence.and the MATLAB
script
Kind regards,
--------------------------------
Konstantinos Othon Chatzimpaloglou
Postgraduate Researcher
University of Exeter
-------------- next part --------------
[ALLEEG EEG CURRENTSET ALLCOM] = eeglab; %start eeglab
eeglab nogui; %start eeglab without GUI
EEG = pop_biosig('data1'); %load dataset
[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0 ); %save the dataset in EEGLAB memory
EEG = eeg_checkset(EEG); %check the dataset consistency
EEG = pop_reref( EEG, []); %average reference
EEG = eeg_checkset(EEG);
%pop_eegplot(EEG, 1, 0, 1); %plot the data
EEG = pop_resample(EEG, 250);
EEG = eeg_checkset(EEG);
EEG = pop_eegfiltnew(EEG, 'locutoff', 1, 'hicutoff', 50); %pass 1-50Hz
EEG = eeg_checkset(EEG);
EEG.data(:,:) = detrend(EEG.data(:,:)')';
EEG = eeg_checkset(EEG);
EEG = pop_runica(EEG, 'icatype', 'runica', 'extended',1,'interrupt','on'); %ICA
%[weights,sphere] = runica(EEG.data);
EEG = eeg_checkset(EEG);
pop_eegplot( EEG, 0, 1, 1);
figure(1);
pop_spectopo(EEG, 1, [0 468750] , 'EEG' , 'electrodes','off');
EEGf = fft(EEG.data); %FFT
banda = bandpass(EEGf, [8 13], 250); %alpha band
bandb = bandpass(EEGf, [14 26], 250); %beta band
bandg = bandpass(EEGf, [30 50], 250); %gamma band
bandd = bandpass(EEGf, [1 4], 250); %delta band
bandth = bandpass(EEGf, [4 8], 250); %theta band
figure(2)
powera = bandpower(banda); %alpha band power
powerb = bandpower(bandb); %beta band power
powerg = bandpower(bandg); %gamma band power
powerd = bandpower(bandd); %delta band power
powerth = bandpower(bandth); %theta band power
%plot(powera);
More information about the eeglablist
mailing list