How to segment signals by time?

6 visualizaciones (últimos 30 días)
Juan Sanchez
Juan Sanchez el 17 de Ag. de 2018
Comentada: Juan Sanchez el 20 de Ag. de 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

Respuesta aceptada

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy el 18 de Ag. de 2018
Editada: Yuvaraj Venkataswamy el 18 de Ag. de 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 comentario
Juan Sanchez
Juan Sanchez el 20 de Ag. de 2018
Thank you very much!! Your help is most appreciated and working perfectly!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Productos


Versión

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by