spectral features extraction from eeg
2 ビュー (過去 30 日間)
古いコメントを表示
hi evrey body, i am novice in signal proccessing and matlab scripts, i try to write a function to extract relative power of the eeg frequencies bands from the PSD, the code i used is the next but i am not sure if it is rigth, can someone help me to correct it, thanks
function [p_tot Prdelta Prtheta Pralpha Prsigma Prbeta]=freq_feat(data,debut,fin,Fs,win)
epoch=data(debut:fin);
%%%%%calcul de la densité spéctrale avec la methode de welch
[Pxx,f]= pwelch(epoch,win,10,1024,250);
figure;
Hy=spectrum.welch;
psd(Hy,epoch,'Fs',Fs,'NFFT',1024);
%%%%%%%%%extraction des caractéristiques
%%%%puissance total
p_tot=sum(Pxx);
%%%%%puissnance relative bande delta
%Filtrage bande delta
n=10;
Wn1=[0.5 3]/50;
[b1,a1] = butter(n,Wn1,'bandpass');
delta = filter(b1,a1,epoch);
%%%%DSP delta
[Pdelta,fd] =pwelch(delta);
%%%puissance relative
Ptot_delta =sum(Pdelta);
Prdelta= Ptot_delta./p_tot;
%%%%puissnance relative bande theta
%Filtrage bande theta
n=10;
Wn2=[4 7]/50;
[b2,a2] = butter(n,Wn2,'bandpass');
theta = filter(b2,a2,epoch);
%%%%DSP delta
[Ptheta,ft] = pwelch(theta);
%%%puissance relative
Ptot_theta =sum(Ptheta);
Prtheta= Ptot_theta./p_tot;
%%%%%puissnance relative bande alpha
%Filtrage bande alpha
n=10;
Wn3=[8 12]/50;
[b3,a3] = butter(n,Wn3,'bandpass');
alpha = filter(b3,a3,epoch);
%%%%DSP alpha
[Palpha,fa] = pwelch(alpha);
%%%puissance relative
Ptot_alpha =sum(Palpha);
Pralpha= Ptot_alpha./p_tot;
%%%%%puissnance relative bande sigma
%Filtrage bande sigma
n=10;
Wn4=[12 14]/50;
[b4,a4] = butter(n,Wn4,'bandpass');
sigma = filter(b4,a4,epoch);
%%%%DSP sigma
[Psigma,fsig] = pwelch(sigma);
%%%puissance relative sigma
Ptot_sigma =sum(Psigma);
Prsigma= Ptot_sigma./p_tot;
%%%%%puissnance relative bande beta
%Filtrage bande beta
n=10;
Wn5=[13 22]/50;
[b5,a5] = butter(n,Wn5,'bandpass');
beta = filter(b5,a5,epoch);
%%%%DSP beta
[Pbeta,fb] = pwelch(beta);
%%%puissance relative
Ptot_beta =sum(Pbeta);
Prbeta= Ptot_beta./p_tot;
0 件のコメント
回答 (2 件)
Kosai
2012 年 6 月 28 日
you can do the same JOB easily with wavelet transformation look at wavelet toolbox and Wavelet - Decomposition Level ...
0 件のコメント
BOMMALA SILPA
2021 年 11 月 15 日
Hello iam silpa. Iam also searching for code of PSD of EEG frequency rythms can you help me
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!