Jump to content
  • 0

Question about time stamps in exported CSV files.


titusjan

Question

I have an Analog Discovery 2 board an use the WaveForms software (version 3.12.2 64-bit Windows 10) to record 8192 samples when channel-1 is triggered. A CSV file is automatically written to disk at every trigger. So far so good.

The file contains a `Date Time` line in the header with a timestamp. Next to that the first column is a relative time in seconds. Here is an example:

#Digilent WaveForms Oscilloscope Acquisition
#Device Name: Discovery2
#Serial Number: SN:210321AD9442
#Date Time: 2020-04-17 17:38:35.342
#Sample rate: 8000Hz
#Samples: 8192
#Trigger: Source: Channel 1 Type: Edge Condition: Rising Level: 5 V Hyst.: Auto HoldOff: 0 s
#Channel 1: Range: 2 V/div Offset: -8 V Attenuation: 1 X
#Channel 2: Range: 1 V/div Offset: -3 V Attenuation: 1 X
#Distance: Function: return (70 * C2 - 210) / 1000

Time (s),Channel 1 (V),Channel 2 (V),Distance (m)
-0.5119944736842106,-0.07884120513254622,0.9852008429664028,-0.1410359409923518
-0.5118694736842105,-0.07511546608381536,0.9852008429664028,-0.1410359409923518
-0.5117444736842106,-0.07511546608381536,0.9852008429664028,-0.1410359409923518
...[snip]...
-0.00036947368421052633,-0.07511546608381536,1.4289757875299878,-0.10997169487290086
-0.00024447368421052633,-0.07884120513254622,1.4289757875299878,-0.10997169487290086
-0.00011947368421052633,-0.07511546608381536,1.4327049887448078,-0.10971065078786346
5.526315789473677e-6,5.234062678356029,1.4327049887448078,-0.10971065078786346
0.00013052631578947368,8.959801727085745,1.4289757875299878,-0.10997169487290086
0.0002555263157894737,8.952350248988285,1.4289757875299878,-0.10997169487290086
0.0003805263157894737,8.956075988037014,1.4289757875299878,-0.10997169487290086
...[snip]...
0.5116305263157894,-0.07138972703508628,0.9852008429664028,-0.1410359409923518
0.5117555263157895,-0.07511546608381536,0.9852008429664028,-0.1410359409923518
0.5118805263157894,-0.07138972703508628,0.9852008429664028,-0.1410359409923518

I assumed that the first column is relative to the timestamp in the header (so that the timestamp corresponds with the value where the first column is 0). However, when I compare the CVS files with data from another source, I strongly suspect that the timestamp in the header correlates to, approximately, the last sample.

My question is therefore: how do the timestamp in the header and the first column relate?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...