Plot a multichannel signal to identify the frequency value

3 vues (au cours des 30 derniers jours)
Riddhi Gala
Riddhi Gala le 20 Juil 2018
Modifié(e) : Jesus Sanchez le 23 Juil 2018
I have a multi-channel EEG data of size 64x1000, where 64 is the number of channels and 1500 time points. I already know that this signal is of 8Hz. I want to plot this signal to show that there is a peak 8Hz indicating the signal frequency.
How can I do it??

Réponse acceptée

Jesus Sanchez
Jesus Sanchez le 20 Juil 2018
Modifié(e) : Jesus Sanchez le 20 Juil 2018
I would do a fast fourier transform for each channel (fft in matlab), so you have the frequential componentes of each channel. Then just use a function such as mesh, surf or pcolor. As these functions represent 3D surfaces, I would define X as channel, Y as frequency and Z as the value given by the FFT.
So in general lines the code will be something like this:
nFFT = 2048; % I asked for 2048 frequency points because why not.
nChannels = 64;
data_freq =fft( multi-channel-EEG-data.',nFFT);
% FFT is applied to columns, that is why it is neccesary to transpose them.
x = 1:nChannels;
y = 1:nFFT;
[X,Y]=meshgrid(x,y);
figure
mesh(X,Y,data_freq);
shading interp;
I did not try the code, so there are probably several mistakes, but if you follow this lines, it should work :). You might need to apply another .' to data_freq to represent it. Good luck!
  2 commentaires
Riddhi Gala
Riddhi Gala le 21 Juil 2018
This doesn't work. I don't have a peak at 8Hz.
Jesus Sanchez
Jesus Sanchez le 23 Juil 2018
Modifié(e) : Jesus Sanchez le 23 Juil 2018
Can you upload your data? If there is a peak appearing somewhere different from 8 Hz, it could be that the plot is shifted. Moreover, maybe 2048 points for the FFT is too little. Try to do it directly with
fft( multi-channel-EEG-data.');
and see if that works.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by