Exporting samples together with their timestamps to an hdf file

  • Software
  • Exporting samples together with their timestamps to an hdf file
Jose Vallet

Posted on 23.10.2019 08:09

Hi.


I am recording sound pressure and exporting the recorded data to hdf format. How to export the samples together with their timestamps?


BR,

J.


Matic Pevec
Customer Support Engineer
Posted on 24.10.2019 08:49

Dear Jose, 


I reproduced data export into the .hdf format. What I got is that basically timestamp is not exported in synchronous channels but it is, if the asynchronous channels are used. In that point, I would need more information regarding your setup. 


The reason for exporting without timestamp is that synchronous channels have basically a constant sample rate. If you multiply the sample number with the acquisition rate, you get the exact time of data. See the explanation on the picture from HDF viewer.


This is also possible in Dewesoft with Basic statistics and writing data into an additional channel, which you can export it alongside measured data. 


Best regards


Matic Pevec


Jose Vallet

Posted on 25.10.2019 16:27

@Matic Pevec


Hi Matic.


Our setup: we need to combine data gathered by different data collection systems, sound captured with a SIRIUS/Dewesoft X3 being only one of them. The different data collection systems are not synchronized, meaning that they do not know when others are collecting samples. Thus, in order to be able to combine the output of the different sensors/data collection systems, we need:

a) a common time frame for all subsystems. We have chosen UTC from an NTP server for this. And

b) a way to associate the collection time instant to each of the collected samples.


Regarding the sound pressure collection subsystem, Dewesoft X3 already comes with an NTP client, so part "a" is solved. However, part "b" is not when we export the data to hdf format. What you suggest, namely that we could multiply the sample number by the sampling period, will give us relative time since the first sample, but we need the UTC time for each sample, that is: a global timestamp. We could somehow use your suggested method if we had the UTC timestamp of at least one of the samples, but I do not know how to get that. I am aware that the hdf contains the time of the start and end of the recording. However,

a) their resolution goes down to seconds only, which is not acceptable for us, and

b) I ignore whether they correspond to the first and last recording samples, respectively.


So, the way that I see it, we need either:

a) to store timestamps for each measurement, or

b) to store an accurate timestamp of at least one measurement, but better the first and last one.


I hope that you Thusnow better understand our setting and the problem that we need to solve. Any ideas are welcome.


BR,

José Vallet


Matic Pevec
Customer Support Engineer
Posted on 28.10.2019 12:38

Dear Jose,


Thank you for explanation of measuring problem with different DAQ data collected.

We have tested it here and It is true that the exported start/stop time goes to one second only.

I have discussed with our developers in order to export data file to HDF with more accurate information of the start/stop time.

I have added it to the wish list and we will let you know as soon as we get any information about.


If you are able to import *.txt files, maybe there is a workaround using *.txt export in Dewesoft.


Best regards


Matic Pevec


Jose Vallet

Posted on 29.10.2019 15:23

@Matic Pevec


Hi Matic.


Thanks for the suggestion. However, exporting to a .txt file is prohibitively slow and space hungry for us. For example, for a 2.1 Gb DewesoftX data file containing around 3 h of sound, the conversion took about 3 h as well, and the resulting file is 19.9 GB large. And we need to record sound for much longer times (this was only a test). As you can understand, this gets unmanageable.


Exporting to hdf took only a few minutes and 2.2 Gb of space. It seems more reasonable and manageable. Please let us know when this option is available with accurate start and stop timestamps. Any other ideas until then?


BR,

José Vallet



Matic Pevec
Customer Support Engineer
Posted on 30.10.2019 15:27

Dear Jose,


It is true that .hdf is less demanding and in this case much better solution. The option is already on the wish list. I will let you know as soon as it will be available.


Till then is my suggestion that you manually read the start time of the first data. Option is in the .TXT or in the the Dewesoft. I believe that three decimals are enough for you? On the picture below you can see both options.



After you know the start time you can manually sum each sample rate. This is the way how you can get UTC time for each data.


Best regards,


Matic Pevec

Login to reply to this topic. If you don't have account yet, you can signup for free account .