CSV file writer - sampling frequency issue

Come here to discuss about OpenViBE in general!
Post Reply
Posts: 5
Joined: Fri Oct 11, 2019 11:35 am

CSV file writer - sampling frequency issue

Post by JelenaJ »

I am trying to write certain data to a CSV file which is sampled every 0.1 seconds (10 Hz). However, for some reason, the CSV file writer box writes the sampling frequency to be 1 Hz in the header. The timestamps in the same file say otherwise - they have a step of 0.1s, so the frequency is obviously 10 Hz. This produces problems when I try to read from that file later on.
Is there any explanation why this is happening? I am using OpenVibe Acquisition Server to stream data from Matlab via LSL, and then I epoch the data with epoch duration of 3s, epoch interval 0.1s (that's why in the CSV file the timestamps are 0.1s apart = 10 Hz). After that, I process the data in some way.
But the data from Matlab is sent every 0.002 seconds, which does not correspond to the frequency of 1 Hz. I would just like to understand where does this 1 Hz sampling frequency come from even if I can't change it. Could it be that the processing steps after time-based epoching (filtering, averaging, DSP etc.) cause this?

Oh, and I use the latest version 3.0.0 OpenVibe.

Please help!!!

Posts: 67
Joined: Wed Mar 04, 2020 3:38 pm

Re: CSV file writer - sampling frequency issue

Post by Thomas »

Hi JelenaJ,

If matlab sends data at 512Hz, a time based epoching (setp=0.1s, duration=3s) should create chunks of 3 seconds every 0.1 seconds of the signal, but it should not change the sampling frequency.
You can confirm it if you create a scenario with just the acquisition client, a time based epoching and the CSV Writer.

Could you share your scenario, or at least a exemple scenario with which I could reproduce the error ? I am pretty sure Ia am missing something, so that would help a lot.


Post Reply