OpenViBE forum

The OpenViBE community
It is currently Thu Sep 21, 2017 6:47 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Sep 06, 2017 4:10 am 
Offline

Joined: Tue Oct 18, 2016 7:26 pm
Posts: 10
Hi.

I'm understanding the driver for OpenEEG in OV:

"ovasCDriverOpenEEGModularEEG.cpp"

in the block:
Code:
boolean CDriverOpenEEGModularEEG::loop(void){
   if(!m_rDriverContext.isConnected()) { return false; }

   if(this->readPacketFromTTY(m_i32FileDescriptor)<0)
   {
      m_rDriverContext.getLogManager() << LogLevel_ImportantWarning << "Could not receive data from " << m_sTTYName << "\n";
      return false;
   }

   if(m_vChannelBuffer.size()!=0)
   {
      if(m_rDriverContext.isStarted())
      {
         for(uint32 i=0; i<m_vChannelBuffer.size(); i++)
         {
            for(uint32 j=0; j<m_ui32ChannelCount; j++)
            {
               m_pSample[j]=(float32)m_vChannelBuffer[i][j]-512.f;
            }
            m_pCallback->setSamples(m_pSample, 1);
         }
         m_rDriverContext.correctDriftSampleCount(m_rDriverContext.getSuggestedDriftCorrectionSampleCount());
      }
      m_vChannelBuffer.clear();
   }

   return true;
}


in the line:

m_pSample[j]=(float32)m_vChannelBuffer[i][j]-512.f;

I understand that to subtract 512 from the value retrieved is to transfer the values from (0 - 1023) to (+/- 512), but the resulting values are raw values; the question is: where are these raw values converted to microvolts, or so they send the designer?.

Sergio Vivar


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 06, 2017 7:45 am 
Offline

Joined: Tue Dec 04, 2012 3:53 pm
Posts: 564
Location: INRIA Rennes, FRANCE
Hello Sergio,

the driver should convert the values to be compatible with a specification it should do with a call m_oHeader.setChannelUnits(); usually most drivers declare microvolts and then provide the samples in such a scale. Since the OpenEEG driver does not seem to be doing that declaration, and looking at the code, I assume its pushing out whatever values result from that -512 computation. Comparing OpenEEG spec (if available, I haven't looked) and the code should reveal what the units are. If not microvolts, getting them there is probably just a matter of simple manipulation of the numbers, but you need to know the scale of the data coming from the amp first.


Cheers,
Jussi


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 11, 2017 9:11 pm 
Offline

Joined: Tue Oct 18, 2016 7:26 pm
Posts: 10
I was searching that conversion; thanks Jussi


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


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:  
Powered by phpBB® Forum Software © phpBB Group
Americanized by Maƫl Soucaze.