For the online MATLAB-engine based feedback experiment, it is possible to choose the buffer size, and update the position of the flying ball. But what I want is to update, for example, every 0.5 second, with the window length of 1 second; which means 0.5 second overlapped windows.
Can anyone tell me how to introduce this?
Thanks in advance.
How to introduce overlapped windows for online feedback?
-
soncyme
- Posts: 7
- Joined: 03 Aug 2009, 06:28
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
-
soncyme
- Posts: 7
- Joined: 03 Aug 2009, 06:28
Hi, thanks for your answering.
I set the SampleBlockSize to 64 with sampling frequency 256 Hz, which means 3/4 seconds overlapped. Then in the function bci_Process,
I wrote :
buffSize=256;
circBuff=zeros(5,buffSize);
circBuff=[circBuff in_signal];
circBuff(:,1:64)=[];
but the first 192 points of circBuff are always zero.
Then I added a global variable named temp equal to zero in bci_Initialize,
and the codes in bci_Process changed to the below
global temp;
buffSize=256;
if temp==0
circBuff=zeros(5,buffSize);
else
circBuff=[circBuff in_signal];
circBuff(:,1:64)=[];
end
temp=1;
and the end of the function I let temp equal to zero again.
But this produced the same result.
Could you tell me where I went wrong?
Thanks a lot!
I set the SampleBlockSize to 64 with sampling frequency 256 Hz, which means 3/4 seconds overlapped. Then in the function bci_Process,
I wrote :
buffSize=256;
circBuff=zeros(5,buffSize);
circBuff=[circBuff in_signal];
circBuff(:,1:64)=[];
but the first 192 points of circBuff are always zero.
Then I added a global variable named temp equal to zero in bci_Initialize,
and the codes in bci_Process changed to the below
global temp;
buffSize=256;
if temp==0
circBuff=zeros(5,buffSize);
else
circBuff=[circBuff in_signal];
circBuff(:,1:64)=[];
end
temp=1;
and the end of the function I let temp equal to zero again.
But this produced the same result.
Could you tell me where I went wrong?
Thanks a lot!
mellinger wrote:You will need to set SampleBlockSize to the equivalent of 0.5 seconds, and introduce your own 1-second buffer on the Matlab side, appending each incoming data block at the end of the buffer, and removing the first 0.5 seconds from the buffer.
HTH,
Juergen
Who is online
Users browsing this forum: No registered users and 0 guests
