How to get rid of the 1/f in EEG data?
34 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I am not a very experienced user in Matlab. I am doing time-frequency analyses on my EEG data, looking at low frequencies. To do so, I need to get rid of 1/f (pink noise), but I am not sure how to do it. I am using polyfit function to estimate the 1/f slope, but I don't know if I am doing it correctly, and I don't know what to do next. I am following this paper: https://www.sciencedirect.com/science/article/abs/pii/S0306452205011711
Some EEG people using Matlab could help me? I have done the log10 transformation to both the power spectrum and the frequencies of my data. My code is the following:
f = evoked_power_dB.freq(2:212);
x = f
y = mean(eeg_data,1) %mean of the 53 channels - 1x211
p = polyfit(x,y,1)
x1= f(1:211)
yfit=polyval(p,x1)
figure;
plot(x,y,'o')
xlim([0 4])
ylim([-10 20])
hold on
plot(x1,yfit)
fitresult = (evoked_power.powspctrm./evoked_power.freq).^p(1); %we use the non-log-transformed data
Any suggestions/ideas on how to continue?
Thanks,
Iris
1 个评论
ROHAN JAIN
2020-9-16
Hi Iris,
If it still remains an open question, I have a little suggestion for you.
Are you fitting 1/f line on the power spectral density or eeg data itself ? Since you are using frequency in X-axis, you should consider log transformed power in Y-axis and there fit the regression line using polyfit as you did.
Hope it helps!
回答(1 个)
Spencer Chen
2020-2-3
polyfit() is not for estimating 1/f functions.
Something like this is more appopriate:
fout = fit(x,y,'(a/x)^b','Lower',[0 0])
Blessings,
Spencer
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 EEG/MEG/ECoG 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!