Power spectral density of a signal

15 vues (au cours des 30 derniers jours)
dark lion
dark lion le 15 Nov 2017
Commenté : Birdman le 16 Nov 2017
Hello I have EEG dataset in excel format with time and voltage values.I need to plot the power spectral density of the signal. I have loaded the excel file in Matlab and plotted the voltage vs time values. Now I need to calculate the power spectral density. Generally the frequency range of EEG signals between 0-30 Hz. Since I have only voltage and Time values, I do not know the frequency of my signal. I need to calculate Power spectral density Using FFT. I am including the code in matlab file and time voltage values of the signal in txt file for reference. Please suggest me.
dataset=xlsread('input signal.xlsx','sheet1','A1:B770');
t = dataset(:,1);
V = dataset(:,2);
X=[t V];
subplot(2,2,1);
plot(X(:,1), X(:,2))
xlabel ('time');
ylabel('voltage');
title('original Signal');

Réponse acceptée

Birdman
Birdman le 16 Nov 2017
I assume that your sampling is 1kHz(in practice), use the following code to see the psd of the signal:
h1=spectrum.welch;
set(h1,'Windowname','Hann');
Fs=1000;
set(h1,'OverlapPercent',66.7);
set(h1,'SegmentLength',512);
myPsd=psd(h1,X(:,2)-mean(X(:,2)),'Fs',Fs)
semilogx(myPsd.Frequencies,myPsd.Data);grid on
You will see that between 0-30Hz, your signal has peaks. Hope this helps.
  2 commentaires
dark lion
dark lion le 16 Nov 2017
Can we calculate This by FFT.
Thanks
Birdman
Birdman le 16 Nov 2017
Yes but for that you should refer to documentation.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Parametric Spectral Estimation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by