Borrar filtros
Borrar filtros

How we can calculate Power spectrum of EEG signal?

41 visualizaciones (últimos 30 días)
siddhartha chandel
siddhartha chandel el 6 de Sept. de 2012
Comentada: Keerthivasan M el 14 de Nov. de 2022
Dear all . I want to calculate power spectrum of single channel eeg . I have coded following but it gives error
??? Subscript indices must either be real positive integers or logicals.
Error in ==> modemotion at 17
plot(ff,pp(0:63)); ylabel('power spectrum
density');xlabel('frequency');title('signal power spectrum');
Please give me how i can short out this.
%%%%%Program to calculate the power spectrum of EEG signal%%%%
clear all;
clc;
data=xlsread('C:\Users\SID\Desktop\emotion regulation post2\emotion\shim1.xlsx');
figure(1); xlabel('sample'); ylabel('magnitude'); plot(data);
legend('14 channel plot of subject1 BASELINE');
data= data';
value1=data(1,:);
chan1= value1-mean(value1);
fs=128;d=1/fs;
t=[0:length(chan1)-1]*d;
figure(2);
plot(chan1);title('original signal');
fs=fft(chan1,128);
pp=fs.*conj(fs)/128;
ff=(0:63)/128/d;
figure(3);
plot(ff,pp(0:63)); ylabel('power spectrum density');xlabel('frequency');title('signal power spectrum');
  2 comentarios
Star Strider
Star Strider el 6 de Sept. de 2012
%%%%%Program to calculate the power spectrum of EEG signal%%%%
clear all;
clc;
data=xlsread('C:\Users\SID\Desktop\emotion regulation post2\emotion\shim1.xlsx');
figure(1);
xlabel('sample');
ylabel('magnitude');
plot(data);
legend('14 channel plot of subject1 BASELINE');
data= data';
value1=data(1,:);
chan1= value1-mean(value1);
fs=128;
d=1/fs;
t=[0:length(chan1)-1]*d;
figure(2);
plot(chan1);
title('original signal');
fs=fft(chan1,128);
pp=fs.*conj(fs)/128;
ff=(0:63)/128/d;
figure(3);
plot(ff,pp(0:63));
ylabel('power spectrum density');
xlabel('frequency');
title('signal power spectrum');
shivani puranik
shivani puranik el 27 de Jun. de 2016
but the error remains the same

Iniciar sesión para comentar.

Respuestas (2)

Krishnapriya V B
Krishnapriya V B el 23 de Sept. de 2019
%%%%%Program to calculate the power spectrum of EEG signal%%%%
clear all;
clc;
data=xlsread('C:\Users\SID\Desktop\emotion regulation post2\emotion\shim1.xlsx');
figure(1); xlabel('sample'); ylabel('magnitude'); plot(data);
legend('14 channel plot of subject1 BASELINE');
data= data';
value1=data(1,:);
chan1= value1-mean(value1);
fs=128;d=1/fs;
t=[0:length(chan1)-1]*d;
figure(2);
plot(chan1);title('original signal');
fs=fft(chan1,128);
pp=fs.*conj(fs)/128;
ff=(0:63)/128/d;
figure(3);
plot(ff,pp(0:63)); ylabel('power spectrum density');xlabel('frequency');title('signal power spectrum');
  2 comentarios
Ashish Tiwari
Ashish Tiwari el 17 de Dic. de 2019
plot(ff,pp( :,1:64)); ylabel('power spectrum density');xlabel('frequency');title('signal power spectrum');
do the minor change in your code and you will get your result just look at the last line and change that to this--->>"plot(ff,pp( : ,1:64)); .indexing was not done properly in your mentioned code
Keerthivasan M
Keerthivasan M el 14 de Nov. de 2022
which date to be load

Iniciar sesión para comentar.


Ashish Tiwari
Ashish Tiwari el 28 de Dic. de 2019
plot(ff,pp( :,1:64)); ylabel('power spectrum density');xlabel('frequency');title('signal power spectrum');
do the minor change in your code and you will get your result just look at the last line and change that to this--->>"plot(ff,pp( : ,1:64)); .indexing was not done properly in your mentioned code

Categorías

Más información sobre EEG/MEG/ECoG en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by