How to segment signals by time?

21 次查看(过去 30 天)
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

采纳的回答

Yuvaraj Venkataswamy
编辑:Yuvaraj Venkataswamy 2018-8-18
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 个评论
Juan Sanchez
Juan Sanchez 2018-8-20
Thank you very much!! Your help is most appreciated and working perfectly!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 EEG/MEG/ECoG 的更多信息

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by