How can I do FFT of EEG

4 visualizaciones (últimos 30 días)
nazmican
nazmican el 22 de Dic. de 2022
Respondida: Sulaymon Eshkabilov el 23 de Dic. de 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 comentario
nazmican
nazmican el 22 de Dic. de 2022
Editada: nazmican el 22 de Dic. de 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)');

Iniciar sesión para comentar.

Respuestas (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 23 de Dic. de 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])

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by