From d53f6bdf7e99a87fefd7a4986526e351de18516b Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Mon, 7 Jul 2025 06:45:42 +0200 Subject: [PATCH] print the absolute sample position of synchronization --- decode.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/decode.cc b/decode.cc index 698fc29..4faed60 100644 --- a/decode.cc +++ b/decode.cc @@ -150,16 +150,18 @@ struct Decoder : Common DSP::Phasor osc; const cmplx *buf; int output_index = 0; + int sample_count = 0; while (output_index < output_count) { do { if (!pcm->good()) return; buf = next_sample(); + ++sample_count; } while (!correlator(buf)); symbol_pos = correlator.symbol_pos; cfo_rad = correlator.cfo_rad; - std::cerr << "symbol pos: " << symbol_pos << std::endl; + std::cerr << "symbol pos: " << sample_count - buffer_len + symbol_pos << std::endl; std::cerr << "coarse cfo: " << cfo_rad * (rate / Const::TwoPi()) << " Hz " << std::endl; osc.omega(-cfo_rad);