Hi Dr. Mike Cohen,
Your book and lectures are really amazing.
I have a question regarding single-trial baseline normalization for time-frequency power. I
am now dealing with EEG data set that has a continuous variable, and this
variable changes trial-by-trial. Because of this, I would like to look at the
trial-by-trial changes in power using bandpass-filtering and Hilbert
transformation with single-trial baseline normalization.
In your firfilter.m file, you normalized the bandpassed, Hilbert-transformed power across trials:
temppow = mean(abs(hilbert(filtered_data)).^2,2);
pow(i,:) = 10*log10( temppow./mean(temppow(baseidx(1):baseidx(2))) );
I however need to do it at the single trial level. When I
tried this, I got very noisy plot:
% EEG.data has already been band-passed.
for curChan = 1: EEG.nbchan
EEG.data(curChan,:,:) = abs(hilbert(EEG.data(curChan,:,:))).^2;
end
for curChan = 1: EEG.nbchan
for curTrial = 1: EEG.trials
basePow(curChan,curTrial) = mean(EEG.data(curChan,baseidx(1):baseidx(2),curTrial),2);
for curPoint = 1: EEG.pnts
EEG.data(curChan,curPoint,curTrial) = 10.*log10(EEG.data(curChan,curPoint,curTrial)./basePow(curChan,curTrial));
end
end
end
pow27 = (mean(EEG.data(27,:,:),3));
plot(EEG.times,pow27);
Strangely enough, when I tried percent change normalization (as opposed to dB) at the single trial level, it seems to be working.
for curChan = 1: EEG.nbchan
EEG.data(curChan,:,:) = abs(hilbert(EEG.data(curChan,:,:))).^2;
end
for curChan = 1: EEG.nbchan
for curTrial = 1: EEG.trials
basePow(curChan,curTrial) = mean(EEG.data(curChan,baseidx(1):baseidx(2),curTrial),2);
for curPoint = 1: EEG.pnts
EEG.data(curChan,curPoint,curTrial) = 100*((EEG.data(curChan,curPoint,curTrial) - basePow(curChan,curTrial))./basePow(curChan,curTrial));
end
end
end
pow27 = (mean(EEG.data(27,:,:),3));
plot(EEG.times,pow27);
Am I missing something important here?
Thank you so much,
Narun
PS. Note though that this script below got the same result with your two-line version : )
for curChan = 1: EEG.nbchan
EEG.data(curChan,:,:) = abs(hilbert(EEG.data(curChan,:,:))).^2;
for curTrial = 1: EEG.trials
basePow(curChan,curTrial ) = mean(EEG.data(curChan,baseidx(1):baseidx(2),curTrial));
end
basePowMeanTrial(curChan) = mean(basePow(curChan,:));
end
for curChan = 1: EEG.nbchan
for curTrial = 1: EEG.trials
for curPoint = 1: EEG.pnts
EEG.data(curChan,curPoint,curTrial) = (EEG.data(curChan,curPoint,curTrial)./basePowMeanTrial(curChan));
end
end
end
pow27 = 10.*log10(mean(EEG.data(27,:,:),3));
plot(EEG.times,pow27);
--
You received this message because you are subscribed to the Google Groups "AnalyzingNeuralTimeSeriesData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimeseriesdata+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/analyzingneuraltimeseriesdata.
For more options, visit https://groups.google.com/d/optout.
% convenientize power
convdatPower = abs(convdat2keep).^2;
% single-trial linear baseline correction
convdat2keepB = convdatPower - repmat(mean(convdatPower(baselineidx(1):baselineidx(2),:),1),size(convdatPower,1),1);
--
You received this message because you are subscribed to a topic in the Google Groups "AnalyzingNeuralTimeSeriesData" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/analyzingneuraltimeseriesdata/8198m7dMoEE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to analyzingneuraltimeseriesdata+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/analyzingneuraltimeseriesdata.
For more options, visit https://groups.google.com/d/optout.