From a5ec16177330693336e149e6831faea967afc527 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Sun, 6 Jul 2025 15:17:20 +0200 Subject: [PATCH] print SFO and residual CFO --- decode.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/decode.cc b/decode.cc index c35d2ea..698fc29 100644 --- a/decode.cc +++ b/decode.cc @@ -180,8 +180,8 @@ struct Decoder : Common phase[i] = arg(demod_or_erase(tone[i], chan[i])); } tse.compute(index, phase, tone_count); - //std::cerr << "Theil-Sen slope = " << tse.slope() << std::endl; - //std::cerr << "Theil-Sen yint = " << tse.yint() << std::endl; + std::cerr << "coarse sfo: " << -1000000 * tse.slope() / Const::TwoPi() << " ppm" << std::endl; + std::cerr << "residual cfo: " << tse.yint() * rate / (Const::TwoPi() * symbol_len) << " Hz" << std::endl; for (int i = 0; i < tone_count; ++i) chan[i] *= DSP::polar(1, tse(i+tone_off)); for (int i = pilot_off; i < tone_count; i += block_length)