From e7d2410d225b428c22c8bf81a560d121aea4f732 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Mon, 15 Apr 2024 00:16:57 +0000 Subject: [PATCH] fix n_vlen != 1 for I/Q inference. --- lib/iq_inference_impl.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/iq_inference_impl.cc b/lib/iq_inference_impl.cc index c3c95391..2af1a7a1 100644 --- a/lib/iq_inference_impl.cc +++ b/lib/iq_inference_impl.cc @@ -436,8 +436,8 @@ void iq_inference_impl::process_items_(COUNT_T power_in_count, const float *&power_in, COUNT_T &consumed) { for (COUNT_T i = 0; i < power_in_count; i += n_vlen_, power_in += batch_, - samples_since_tag_ += batch_, sample_clock_ += batch_) { - ++consumed; + samples_since_tag_ += batch_, sample_clock_ += batch_, + consumed += n_vlen_) { COUNT_T j = (power_read + i) % sample_buffer_; volk_32f_index_max_16u(max_.get(), power_in, batch_); float power_max = power_in[*max_]; @@ -522,6 +522,10 @@ int iq_inference_impl::general_work(int noutput_items, const auto rel = tag.offset - in_first; in_first += rel; + // TODO: in theory we might have a vector with more than one frequency's + // samples, as the SDR probably isn't vector aligned. In practice this + // should not happen in the most common Ettus low power workaround state, + // because tags are delayed until after re-tuning has been verified. if (rel > 0) { process_items_(rel, power_read, power_in, consumed); }