Skip to content

Commit

Permalink
Merge pull request #246 from anarkiwi/align
Browse files Browse the repository at this point in the history
fix n_vlen != 1 for I/Q inference.
  • Loading branch information
anarkiwi authored Apr 15, 2024
2 parents d3d45d1 + e7d2410 commit 76eb35a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/iq_inference_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_];
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 76eb35a

Please sign in to comment.