Hello all,
I am writing a box whose task is to write a signal from the acquisition client (eventually with some known modifications) and other information channels (text marks) in an smr file.
Is it possible to get informations on the signal (channels number, sampling rate ...) when initializing the box, so before starting the acquisition ?
Thank you,
Amélie
signal informations
Re: signal informations
Hi Amélie and welcome on board !
You can retrieve all the information you need (channel count, channel name) in the header part of the signal that comes from the acquisition client.
In your box, I assume you have a Signal Decoder, to decode the stream that comes from the acquisition client box.
In the <your-box>.h file it may look like that :
The Stream decoder takes an input memory buffer, and outputs a sampling frequency and a decoded matrix.
One the first call of m_pSignalDecoder->process(), in your <your-box>::process function, the sampling frequency is outputed, and a header is decoded. Check if the signal decoder has decoded a header by checking the related trigger :
At this step, the decoded matrix is empty, but its structure is set.
You can check the matrix dimensions and labels to retrieve the channel count and labels. Look here for the API calls you need.
The structure of the signal stream is explained on this page. The signal stream represents a 2-dimension matrix, channel count and labels on the first dimension.
Hope this helps.
Laurent-
You can retrieve all the information you need (channel count, channel name) in the header part of the signal that comes from the acquisition client.
In your box, I assume you have a Signal Decoder, to decode the stream that comes from the acquisition client box.
In the <your-box>.h file it may look like that :
Code: Select all
//the input signal decoder
OpenViBE::Kernel::IAlgorithmProxy* m_pSignalDecoder;
OpenViBE::Kernel::TParameterHandler < const OpenViBE::IMemoryBuffer* > ip_pMemoryBufferToDecode;
OpenViBE::Kernel::TParameterHandler < OpenViBE::uint64 > op_ui64SamplingRate;
OpenViBE::Kernel::TParameterHandler < OpenViBE::IMatrix* > op_pDecodedMatrix;
One the first call of m_pSignalDecoder->process(), in your <your-box>::process function, the sampling frequency is outputed, and a header is decoded. Check if the signal decoder has decoded a header by checking the related trigger :
Code: Select all
if(m_pSignalDecoder->isOutputTriggerActive(OVP_GD_Algorithm_SignalStreamDecoder_OutputTriggerId_ReceivedHeader))
{
//matrix information now available !
//use these information here...
}
You can check the matrix dimensions and labels to retrieve the channel count and labels. Look here for the API calls you need.
The structure of the signal stream is explained on this page. The signal stream represents a 2-dimension matrix, channel count and labels on the first dimension.
Hope this helps.
Laurent-
Re: signal informations
Hi Laurent,
it was simple and my box works now perfectly.
I did not think these informations would be available at initialization (I wondered when the signal-stream header was receive exactly).
Thank you very much !
Amélie
it was simple and my box works now perfectly.
I did not think these informations would be available at initialization (I wondered when the signal-stream header was receive exactly).
Thank you very much !
Amélie
Re: signal informations
Great
I am curious... what are these smr file you are talking about ?
all I found on the web is something like "Cambridge Electronic Design" file format.
Laurent-
I am curious... what are these smr file you are talking about ?
all I found on the web is something like "Cambridge Electronic Design" file format.
Laurent-
Re: signal informations
It is the format of the files generated by the Biomea acquisition system that we use.
Indeed, the only software I know to read this format is provided by Cambridge Electronic Design (Spike2). But I don't know much more about it
Amélie
Indeed, the only software I know to read this format is provided by Cambridge Electronic Design (Spike2). But I don't know much more about it
Amélie