Stimulation Setting in Matlab Script

About BCI and box tutorial/demo scenarios bundled with OpenViBE.
Post Reply
shelldream
Posts: 35
Joined: Thu Sep 20, 2012 9:40 am

Stimulation Setting in Matlab Script

Post by shelldream »

Hi, I have read the tutorials about the matlab script box ,but I have one question:how to set the time point when the stimulation is sent. What is the meaning of arguments of the function :

stim_set = [stimulation; box_in.clock; 0];
box_in=OV_addOutputBuffer(box_in,2,start_time,end_time,stim_set);?

For example ,I have a signal buffer to send whose samples_per_buffer is 15,and I want to send the stimulation with the second sample in the buffer,what should I do? :D
Thanks ,
Shelldream :D

jtlindgren
Posts: 778
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Stimulation Setting in Matlab Script

Post by jtlindgren »

Hi,

the start_time and end_time for OV_addOutputBuffer() should specify the interval of the data block in question. The second value in the stim_set is the actual time stamp of the stimulation. You'll need to figure out the exact time your second sample corresponds to. Then, the stim_set time stamp should be inside the interval of start_time and end_time. For example, the sinus tutorial sets the timestamp of the sent stimulus equal to the end_time of the block.


Happy hacking,
Jussi

Post Reply