How to segment signals by time?

21 vues (au cours des 30 derniers jours)
Juan Sanchez
Juan Sanchez le 17 Août 2018
Commenté : Juan Sanchez le 20 Août 2018
I'm sorry for the basic question but Im working with a signal of 22 seconds duration with a Sample frequency of 500 Hz. I want to separate the vector into smaller vectors of 0.5 seconds each. Any idea on how to do it?
This is the code I have:
%
erp=ALLEEG(2).data(1,:,1) % The Test signal extracted from EEGLAB
FS=500 % Sample frequency
T=1/FS
L=length(erp); %Length of erp signal is 11264 samples
tiempo=(0:L-1)*T;
plot(tiempo,erp)
So I need to separate the singal into smaller vectors of data of 500 ms each. EEGlab allows you to work on one signal but because im working with a lot of them I'm scripting to process all data.
Sorry for the basic question and thanks for any help.
Best regards

Réponse acceptée

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy le 18 Août 2018
Modifié(e) : Yuvaraj Venkataswamy le 18 Août 2018
22 seconds of EEG signal having 11264 samples. Here, you can find the number of samples for 1 second. Then you find easly for 0.5 sec.
From your input,if you are going to divide 0.5 second samples means totally you will get 44 epochs. So,
11264/44=256 is 0.5 second samples. In your data, 0 to 256 samples= 0 to 0.5 second 257 to 512 samples= 0.5 to 1 second . . . Etc.
For 0.5 second, You will get 44 epochs and each epochs contain 256 samples.
  1 commentaire
Juan Sanchez
Juan Sanchez le 20 Août 2018
Thank you very much!! Your help is most appreciated and working perfectly!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur EEG/MEG/ECoG dans Help Center et File Exchange

Produits


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by