How to segment signals by time?

조회 수: 8 (최근 30일)
Juan Sanchez
Juan Sanchez 2018년 8월 17일
댓글: Juan Sanchez 2018년 8월 20일
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일
편집: 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