Information regarding the sampling rate

Posted in General by Dennis Giovani Fri Jan 19 2018 13:02:20 GMT+0000 (Coordinated Universal Time)·3·Viewed 308 times

Hello, I am a phd student and I am currently conducting a research in the field of handwriting recognition using your hardware, the slate 2. I would like to get some information about the sampling rate when an user is writing on the device. I am trying to capture the time stamp between each pair of points sampled by the hardware i.e., technically speaking every time the event AUTO_PEN_3D is called. The item 6 of the "MagicBeep example on VS" example states that your Pen tip 3D position and contact status when using the AUTO_PEN_3D event is returned at a 140Hz frequency. It means that within one second we sample 140 points, thus we have each point sampled in around 0.007142 seconds, is this correct? However, I am getting some considerable difference when capturing some pairs, varying from 0.002 (which is even below the specified sampling rate) to 0.03, for instance. Also I have noticed that for a specific time interval, the faster a user draws the higher the number of computed points. I would like to know how your software deals with it and if you have any suggestions on how to get more consistent results regarding the time sampling. Thank you in advance. Best regards, Dennis
Jan 22, 2018

Hi,

Can you tell me :

  • The operating system
  • The type of the connection ( BLE / USB (CDC/HID) )
  • The firmware version of the Slate

Also, How do you measure the time between 2 frame? Can you show me the code that do this part?

Important notice: If you receive a point later than another, it don't mean that the point has been captured or processed later by the Slate, it just mean you received the data with a little delay due to the transport layer (USB CDC) and the API.

In USB (USB CDC = ISKN API), you should be able to increment an internal counter on all received points = t + 7 ms.
In BLE, we have a filter that increase the number of points/s to 140Hz only when it's needed = fast movements.

Best regards,
Steven for the iskn team

Jan 23, 2018

Hi Steven, thanks for your reply.

Here are the informations you asked:

Operating system: Windows 10 Pro
Type of connection: USB CDC (ISKN API)
Slate version: 3.0.19.0

I started with your MagicBeep example on VS, so here is the code:

void MagicBeep::processEvent(ISKN_API::Event &e, unsigned int timecode)
{
switch (e.Type)
{
...

    case ISKN_API::EVT_PEN_3D:
    {            
        ISKN_API::Vector3D pos = e.Pen3D.getPosition();
        isTouched = e.Pen3D.Touch();        

        if (isTouched)
        {            
            double milliseconds_since_epoch = std::chrono::duration_cast<std::chrono::nanoseconds> (std::chrono::system_clock::now().time_since_epoch()).count() / pow(10,9);

            timeArrayEpoch.push_back(milliseconds_since_epoch);
            posArray.push_back(pos);
        }
    }

    ...
}
...

}

I am using the chrono lib to store the current time in a vector each time a point is computed. Once all points are stored, I compute the time interval for each pair of adjacent points.

I have made some tests regarding the sampling points and I have noticed that even with usb connection, the sample rate is changing according to the movement speed. For instance, with my pencil standing still for 10 seconds I have got only 115 samples and with my pencil moving really fast I have got 1222 samples. If I got that right, the amount of points should have been around 1400 regardless the speed given my current configurations.

Do you have any idea why am I getting these results?

Thank you for your attention.

Best regards,

Dennis

Jan 25, 2018

Hi Dennis,

You are totally right : there is a moving filter integrated in the firmware of the Slate.
If you move slowly, the Slate send less points per seconds.

Unfortunately, this filter cannot be disabled through the API.

If you need more information, feel free to ask!

Best regards,
Steven for the iskn team

  
Markdown is allowed