windytan / redsea

Command-line FM-RDS decoder with JSON output.
MIT License
390 stars 36 forks source link

Fractional seconds in timestamp #70

Closed windytan closed 4 years ago

windytan commented 4 years ago

It would be useful to have fractional seconds in the rx_time timestamp. Currently this is not directly possible, as C strftime doesn't support that.

For reference, here's one way to calculate the fractional time itself: https://stackoverflow.com/questions/15845505/how-to-get-higher-precision-fractions-of-a-second-in-a-printout-of-current-tim

windytan commented 4 years ago

Initial results with the buffer timestamping are looking very nice (by specification, these 4A groups should be exactly on the minute +/- 0.10 sec):

$ airspy ... | csdr ... | redsea ... | grep clock_time

{"pi":"0x6203","rx_time":"18:57:59.99","group":"4A","clock_time":"2020-05-18T18:58:00+03:00","prog_type":"Varied","tp":true}
{"pi":"0x6203","rx_time":"18:58:59.99","group":"4A","clock_time":"2020-05-18T18:59:00+03:00","prog_type":"Varied","tp":true}
{"pi":"0x6203","rx_time":"18:59:59.99","group":"4A","clock_time":"2020-05-18T19:00:00+03:00","prog_type":"Varied","tp":true}
{"pi":"0x6203","rx_time":"19:00:59.96","group":"4A","clock_time":"2020-05-18T19:01:00+03:00","prog_type":"News","tp":true}
{"pi":"0x6203","rx_time":"19:01:59.96","group":"4A","clock_time":"2020-05-18T19:02:00+03:00","prog_type":"News","tp":true}
{"pi":"0x6203","rx_time":"19:02:59.96","group":"4A","clock_time":"2020-05-18T19:03:00+03:00","prog_type":"Varied","tp":true}
{"pi":"0x6203","rx_time":"19:04:00.03","group":"4A","clock_time":"2020-05-18T19:04:00+03:00","prog_type":"Varied","tp":true}
{"pi":"0x6203","rx_time":"19:05:00.03","group":"4A","clock_time":"2020-05-18T19:05:00+03:00","prog_type":"Varied","tp":true}
{"pi":"0x6203","rx_time":"19:06:00.02","group":"4A","clock_time":"2020-05-18T19:06:00+03:00","prog_type":"Varied","tp":true}
{"pi":"0x6203","rx_time":"19:07:00.00","group":"4A","clock_time":"2020-05-18T19:07:00+03:00","prog_type":"Varied","tp":true}
{"pi":"0x6203","rx_time":"19:08:00.00","group":"4A","clock_time":"2020-05-18T19:08:00+03:00","prog_type":"Varied","tp":true}
sm3ulc commented 4 years ago

Very nice! Useful to measure delays in upstream transport chain, apart for verification of the clock accuracy. Audemat has had some very interesting clock sync with +- 2-3 secs..

// David

On Mon, May 18, 2020 at 6:10 PM Oona Räisänen notifications@github.com wrote:

Initial results with the buffer timestamping are looking very nice:

$ airspy ... | csdr ... | redsea ... | grep clock_time

{"pi":"0x6203","rx_time":"18:57:59.99","group":"4A","clock_time":"2020-05-18T18:58:00+03:00","prog_type":"Varied","tp":true} {"pi":"0x6203","rx_time":"18:58:59.99","group":"4A","clock_time":"2020-05-18T18:59:00+03:00","prog_type":"Varied","tp":true} {"pi":"0x6203","rx_time":"18:59:59.99","group":"4A","clock_time":"2020-05-18T19:00:00+03:00","prog_type":"Varied","tp":true} {"pi":"0x6203","rx_time":"19:00:59.96","group":"4A","clock_time":"2020-05-18T19:01:00+03:00","prog_type":"News","tp":true} {"pi":"0x6203","rx_time":"19:01:59.96","group":"4A","clock_time":"2020-05-18T19:02:00+03:00","prog_type":"News","tp":true} {"pi":"0x6203","rx_time":"19:02:59.96","group":"4A","clock_time":"2020-05-18T19:03:00+03:00","prog_type":"Varied","tp":true} {"pi":"0x6203","rx_time":"19:04:00.03","group":"4A","clock_time":"2020-05-18T19:04:00+03:00","prog_type":"Varied","tp":true} {"pi":"0x6203","rx_time":"19:05:00.03","group":"4A","clock_time":"2020-05-18T19:05:00+03:00","prog_type":"Varied","tp":true} {"pi":"0x6203","rx_time":"19:06:00.02","group":"4A","clock_time":"2020-05-18T19:06:00+03:00","prog_type":"Varied","tp":true} {"pi":"0x6203","rx_time":"19:07:00.00","group":"4A","clock_time":"2020-05-18T19:07:00+03:00","prog_type":"Varied","tp":true} {"pi":"0x6203","rx_time":"19:08:00.00","group":"4A","clock_time":"2020-05-18T19:08:00+03:00","prog_type":"Varied","tp":true}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/windytan/redsea/issues/70#issuecomment-630285669, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELU6KIWAHPKAYR62GQ5MDTRSFMXXANCNFSM4ND3YWOA .