ETHZ-TEC / RocketLogger

Official development repository of the RocketLogger project.
https://github.com/ETHZ-TEC/RocketLogger/wiki
BSD 3-Clause "New" or "Revised" License
14 stars 4 forks source link

Theoretical sample rate calculation #13

Closed lsigrist closed 3 years ago

lsigrist commented 3 years ago

The real sample rate of the RocketLogger does not exactly match the configured the ADC data rate. The ADC data rates are exact for a 2.048 MHz clock, the closest the BeagleBone can generate using PWM is 2.041 MHz (49 PWM cycles period at 100 MHz).

When using "relative" timestamps (derived considering the sample rate and sample indices only!) one may use the following scaling factor for the sample rate for more precise timestamps:

SAMPLE_RATE_SCALING = (100e6 / 49) / 2.048e6

Note: If you rely on precise timestamps, you should consider using the timestamps recorded during the measurements. See the documentation of the RocketLogger data format.

Relates to: https://gitlab.ethz.ch/tec/public/rocketlogger/-/issues/130

lsigrist commented 3 years ago