How can I adjust the keyboard "sampling frequency"?

Come here to discuss about OpenViBE in general!
Post Reply
kirnet
Posts: 1
Joined: Mon Sep 22, 2014 1:04 pm

How can I adjust the keyboard "sampling frequency"?

Post by kirnet »

Hi everybody,

I´m new to this Forum; I am a Student doing her Bachelor Thesis on an n-back-test EEG study where subjects have to press the space bar every time they identify an according stimulus.
The EEG data is being sampled with a frequency of 500 Hz. My question is: How can I achieve that the Keyboard data is being "sampled" with (at least) the same frequency? Right now the space bar presses are being registered with a much lower frequency, so I can´t detect them precisely enough.

I have never worked with openvibe before and I didn´t code the program myself, but am using an "old" one. So I am really completely inexperienced with openvibe.

Thank you very much in advance for any answer!

kirnet

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

Re: How can I adjust the keyboard "sampling frequency"?

Post by jtlindgren »

Hi Kirnet, you can try to increase 32LL (32 times per sec) in ovpCKeyboardStimulator.h and recompile,

virtual OpenViBE::uint64 getClockFrequency(){ return (32LL<<32); }

Unfortunately the result may still not be perfectly aligned with the EEG data, should you need that.
The reason is that if Designer tags some stimulus to time t and associates it with data at time t
(i.e. its perceived 'current' time), this t is not the onset of the post-stimulus data that arrives
from the amp but its earlier than that -- because it is an earlier data block that Designer currently
has at the moment t. The more accurate way to do this would be to make an external stimulator app
which sends the stimulus to the acquisition server either via a software or a hardware trigger,
or an openvibe box that launches a thread independent of the Designer processing
frequency, doing the same. However, all this would need some programming.


Happy hacking,
Jussi

Post Reply