Original text: gist.github.com/jonathangjertsen/a2fe912dd3403bd317359fcd7531ddc7 This measurement always outputs 33.339ms for the duration (and a garbage sample rate as a result). What am I missing?
No, wait, the problem is still there if I do a measurement that's shorter than 33.3 ms. And even for longer measurements, the calculated sample rate is being underestimated (it converges to the correct sample rate when the measurement duration is increased). The duration seem to be quantized to multiples of 33.3ms, I guess that is the size of one chunk? Are you sure the timestamps are being correctly adjusted to the measurement range?
Activity Newest / Oldest
Saleae
Status changed to: Live
Saleae
It's not ideal, but you have the start time, end time, and the sample count. You can calculate the sample rate using all of them
Jonathan
Oh, nice! That should suffice then. I didn't see anything about these properties in the docs but I guess they are attributes of AnalogData?
Saleae
support.saleae.com/extensions/api-documentation#class-saleae-data-analogdata-raw_samples-ndarray-voltage_transform_gain-float-voltage_transform_offset-float-start_time-saleae-data-timing-graphtime-end_time-saleae-data-timing-graphtime
Jonathan Gjertsen
EDIT: Fixed my silly bug...
Original text: gist.github.com/jonathangjertsen/a2fe912dd3403bd317359fcd7531ddc7 This measurement always outputs 33.339ms for the duration (and a garbage sample rate as a result). What am I missing?
Jonathan Gjertsen
Is process_data() guaranteed to be called in chronological order such that the above gist will always work?
Jonathan Gjertsen
No, wait, the problem is still there if I do a measurement that's shorter than 33.3 ms. And even for longer measurements, the calculated sample rate is being underestimated (it converges to the correct sample rate when the measurement duration is increased). The duration seem to be quantized to multiples of 33.3ms, I guess that is the size of one chunk? Are you sure the timestamps are being correctly adjusted to the measurement range?
Saleae
This might be the size of a single chunk, what sample rate are you using btw?
Jonathan Gjertsen
3.125 MHz, but I still get roughly 33-34 ms when using 781.25 kHz, or 50 MHz.
Saleae
We'll look into this and keep you posted