07-29-2009 01:24 PM
I am collecting data and saving it to a csv file without a time stamp. I would like to add a time stamp to each measurement and was wondering if it is appropriate to use the sample rate and data capture start time to add a time stamp. For example I have 4 channels sampling at 100 hz. I can use the file creation date/time as the time I begin my measurements and increment 0.001 seconds from that point on. I think this is accurate for a small number of samples but I am concerned that over several hours of data collection and several hundred thousand points if the timing will drift causing an error that will be compounded with such a high number of samples.
Any thoughts?
07-30-2009 02:53 PM
Hi Whistler24,
The drift will not increase with the increase in samples. There will be some offset from the initial timestamp because it will capture it through software timing, however from there on, it will be on the hardware clock and any jitter will be negligible.
Flash
07-30-2009 03:05 PM
If your sample rate is 100 Hz, you need to increment your times by 10 ms, not 0.001 s.
The hardware clock in the DAQ board, the tick counter clock, the computer's time of day clock, and your wrist watch will all have slightly different frequencies. Timekeeping by by any of these sources will be fairly stable and consistent with itself, but will drift with respect to any of the others. As Flash said above, jitter will be negligible with the hardware clock.
You need to decide how much error an what kinds of errors are allowable in your system. That will then determine the type of timekeeping required. Unless you have very stringent timing requirements, what you are proposing to do should work fine.
Lynn