How can I do FFT of EEG

5 Ansichten (letzte 30 Tage)
nazmican
nazmican am 22 Dez. 2022
I am performing FFT on EEG data. My ultimate goal is to have a frequency by time plot. However, the range of frequencies should be from 0Hz to 70.87Hz. How can I limit these frequencies so that my results are in the correct range? Below is my code. My sampling rate is 2000Hz.
Now we want to visualize the frequency spectrum magnitude of one EEG_1 with respect to frequency for frequency range 0 - 70.87Hz
% First find the df, the frequency resolution of the signal, that is the frequency equivalent of a single point
% Using df how many frequency points do we need to show ? Create a frequency vector f for the x
% axis and spectrum absolute magnitude vector EEG_1_Spectrum for the y axis.
Nbin=
f=
EEG_1Spec=
%Create a new figure
figure;
%Plot the computed spectrum using the stem() function for thefrequency range 0 - 70.87Hz on top row of the figure.
subplot(2,1,1);
stem()
%put title , xlabel, ylabel,
% Repeat the above step for the VEPconvolved average signal.
% Can you use the same frequency vector for the x axis?
subplot(2,1,2);
VEPconvAveSpec=fft()
stem()
% put title, xlabel, ylabel
  1 Kommentar
nazmican
nazmican am 22 Dez. 2022
Bearbeitet: nazmican am 22 Dez. 2022
%My code
Nbin=length(t) ;
df=fs/L ; %Frequency resolution
EEG_1Spec=0:70.87;
figure;
subplot(2,1,1);
stem(df,abs(EEG_1Spec));
plot(EEG_1Spec);
title('EEG_1Spec');
xlabel('frequency(Hz)');
ylabel('Amplitude(microV)');
subplot(2,1,2);
VEPconvAveSpec=fft(127); %Number of EEGdata/Gain=130048/1024
stem(VEPconvAveSpec);
plot(VEPconvAveSpec);
title('VEPconvAveSpec');
xlabel('frequency(Hz)');
ylabel('Amplitude(microV)');

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov am 23 Dez. 2022
If I have understood your question correctly, you want to put limitations along y-axis. If so, you can use one of these two options:
(1)
ylim([0, 70.87])
OR
(2)
axis([xmin xmas ymin ymax])

Kategorien

Mehr zu EEG/MEG/ECoG finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by