OpenViBE forum

The OpenViBE community
It is currently Fri Dec 15, 2017 9:30 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Thu Jul 21, 2011 8:43 am 
Offline

Joined: Mon May 02, 2011 2:07 pm
Posts: 18
Hello,

While modifying the brain invaders, I found that the signal corresponding to the first flash was not epoched by its corresponding stimulation based epocher. Waited stimulation and signal are there, but debuging showed me that, in stimulation based epoching box, the offset sample count was not initialised the very first call to this box, thus "samples to skip" is high, and the box does not epoch the signal even if it has the right stimulation.

I managed to make it work by forcing samplesToSkip to 0 (see code below), but I'm not very happy with this solution as I'm not sure of the consequences (I don't get a whole understanding there...).

Could you lead me to a better solution ?
Thanks.
Nicolas.

Code:
boolean CAlgorithmStimulationBasedEpoching::process(void)
{
   if (isInputTriggerActive(OVP_Algorithm_StimulationBasedEpoching_InputTriggerId_Reset))
   {
      m_ui64ReceivedSamples=0;
      m_ui64SamplesToSkip=0; // *** instead of : m_ui64OffsetSampleCount ***
   }


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 21, 2011 1:39 pm 
Offline
Site Admin

Joined: Fri Sep 01, 2006 3:39 pm
Posts: 645
Dear Nicolas,

can you tell me how close to the start the first stimulation comes ?

Are you using an offset so that you select signal before the actual stimulation ?

Yann

_________________
CTO at Mensia Technologies | Image my blog | Image my tweets | Image my linkedin


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 26, 2011 9:21 am 
Offline

Joined: Mon May 02, 2011 2:07 pm
Posts: 18
Hi Yann,

The first stimulation comes something like 30s after the scenario's start. At that time, the signal is available for the stimulation based epoching box. The boxes configurations are :

epoch duration : 0.600000
epoch offset : 0.000000
stimulation to epoch from : OVTK_StimulationId_Label_xx (with xx from 01 to 0C)

It looks like the epoching algo has not been initialised yet when the first stim arrives. I'm investigating this.

Nicolas.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 26, 2011 11:41 am 
Offline

Joined: Mon May 02, 2011 2:07 pm
Posts: 18
Just giving an update on my investigation :

Looking at log and stimulation listener, I get this :

[WARNING] At time 161195491328 (0x2588000000) <Box algorithm::stim based epoch input> For input 0 (0x0) with name Stimulation stream 1 got stimulation 32771 (0x8003)[OVTK_StimulationId_SegmentStart] at date 160674725992 (0x2568f5c068) and duration 0 (0x0)
[WARNING] At time 161195491328 (0x2588000000) <Box algorithm::stim based epoch input> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33026 (0x8102)[OVTK_StimulationId_Label_02] at date 160674725992 (0x2568f5c068) and duration 0 (0x0)
[WARNING] At time 161195491328 (0x2588000000) <Box algorithm::stim based epoch input> For input 0 (0x0) with name Stimulation stream 1 got stimulation 32780 (0x800c)[OVTK_StimulationId_VisualStimulationStop] at date 160889474355 (0x2575c28d33) and duration 0 (0x0)
[ INF ] At time 161229045760 (0x258a000000) <Box algorithm::Stimulation based epoching> Created new epocher at time 160674725992 (0x2568f5c068):160674725992 (0x2568f5c068):163251706369 (0x26028f5a01)

It looks like the stim based epoching initialisation happens after the stimulation has been received.

I'm looking why, any help welcomed :D


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 08, 2011 4:08 pm 
Offline
Site Admin

Joined: Fri Sep 01, 2006 3:39 pm
Posts: 645
Dear Nicolas,

one of your trace message comes from a stimulation listener box, the other one from a stimulation based epoching. It is not guaranteed how those two boxes are scheduled if you did not set their priorities manually (which I doubt as this functionality is not currently exposed to the Designer).

In order to get help, can you tell us what you are trying to achieve ? I actually don't catch the relation between this question and your initial problem.

Yann

_________________
CTO at Mensia Technologies | Image my blog | Image my tweets | Image my linkedin


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 09, 2011 2:49 pm 
Offline

Joined: Mon May 02, 2011 2:07 pm
Posts: 18
Hi Yann,

Sorry if this was confusing, I'm going to try to make it simple :)

Giving a summary of the code I'm focusing on may help :

Code:
boolean CBoxAlgorithmStimulationBasedEpoching::process(void)
(...)
l_oEpocher.m_pEpocher->initialize();                                             // sets m_ui64OffsetSampleCount to 0.
(...)
l_oEpocher.m_pEpocher->process(OVP_Algorithm_StimulationBasedEpoching_InputTriggerId_Reset);    // when we enter this, I found m_ui64OffsetSampleCount having a crazy value
(...)
l_oEpocher.m_pEpocher->process(OVP_Algorithm_StimulationBasedEpoching_InputTriggerId_PerformEpoching);  // thus, when this is called, the epoching is not performed


This is true the very first time, for the first stim. After that, everything run smoothly.

There's something I'm missing at initialisation time... Could you give a hand ?


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 27, 2011 1:58 pm 
Offline
Site Admin

Joined: Fri Sep 01, 2006 3:39 pm
Posts: 645
Dear Nicolas,

I suspect that you have an "early" stimulation and that l_ui64OffsetSampleCount would be less than zero (being unsigned, that results in so called crazy value :) ).

That may be a bug but can you confirm that this is happening in your case (see line 222 of ovpCBoxAlgorithmStimultionBasedEpoching.cpp) ?

Sorry for late reply btw,
Hope this helps,
Yann

_________________
CTO at Mensia Technologies | Image my blog | Image my tweets | Image my linkedin


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 07, 2011 12:15 pm 
Offline

Joined: Fri Oct 07, 2011 11:56 am
Posts: 1
Hello,

I am experiencing a bug with the stimulation based epoching script: When using negative offset values, the data is outputted with a delay. For example, 2s epoch with -2s offset, should return the data immediately after the stimulation occurs, however the output data does not appear on the stream until 2s later (the length of the epoch). Trying various numbers for duration and offset revealed that the delay is always the duration of the epoch, regardless of the offset value.

I have reproduced this bug with both the gdf_reader and keyboard stimulation inputs, and on multiple machines. I believe the epoched data is timed correctly, implying that the epoching procedure itself is correct, but that the output is handled incorrectly.

Any and all assistance would be welcome,
Eoin


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 25, 2011 9:55 am 
Offline
Site Admin

Joined: Wed Oct 07, 2009 12:11 pm
Posts: 417
Hi Eoin!

Sorry for the late reply!
Indeed the Stimulation based epoching is producing the epoch with a delay, equal to the epoch duration.
This behavior is constant, for positive or negative offsets. In the negative case it's obviously a problem.

I added a bug report on the bugtracker. Don't hesitate to add a note if you want to give more precisions.

We will try to correct this a.s.a.p.

Laurent-

_________________
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Americanized by Maƫl Soucaze.