Files
gnss-sdr/src/core/interfaces/channel_interface.h
T
joebre 2b6a1bb89c Unify pcps_acquisition's Doppler search into a single N-bin API
set_doppler_uncertainty() only ever supported two states: the full
configured grid, or a single exactly-known bin (assisted narrowing's
2-bin variant). Regular searches, primary-frequency-assisted secondary
signals, and any future partial-uncertainty search (e.g. a visibility-
aware Doppler prediction with residual error) all had to be shoehorned
into one of those two cases instead of directly stating how many
candidate bins they actually need.

Replaces it with set_doppler_num_bins(uint32_t): 0 is a sentinel for
"the full configured range" (the only value a caller can't supply
directly, since that count is otherwise private to this class); any
other value is the literal candidate bin count, from 1 (exactly known,
as when assisted by an already-tracked primary frequency) up to the
full grid. Regular and narrowed searches now go through the exact same
code path -- update_grid_doppler_wipeoffs(), compute_statistics(), the
two statistic functions -- differing only in candidate_count.

CFAR reference-bin placement is generalized the same way:
needs_extra_reference_row(candidate_bins) reproduces both today's
full-grid conditional extra-row behavior (only when the in-grid
wraparound distance can't clear reference_bin_min_sidelobes) and
narrowed mode's unconditional extra-row assumption, for any candidate
count. d_min_reference_separation_hz is derived automatically from the
new reference_bin_min_sidelobes config parameter (default 4) and
coherent_integration_time_ms, rather than needing to be set directly.

Also fixes a latent asymmetry: whenever a dedicated reference row is
needed for more than one real candidate, two rows are now computed --
at +doppler_max and -doppler_max -- and the statistic picks whichever
sits opposite the winning candidate's side of center. Previously the
reference was always fixed at +doppler_max regardless of which side
the signal landed on; a candidate near the edge of the search range
could end up right next to its own reference sample. With exactly one
real candidate (always at offset 0, no side to mirror), a single fixed
row is kept, matching prior behavior.

The detection threshold (d_threshold_active) is recalibrated by
set_doppler_num_bins() whenever the active candidate count changes,
since compute_threshold() folds the bin count into the false-alarm
probability.

Propagates the rename through AcquisitionInterface,
PcpsAcquisitionAdapter, ChannelInterface, Channel, and
GNSSFlowgraph's two assist_acquisition_doppler() call sites (0 ->
literal full-grid sentinel for the regular/unassisted case, 1 for the
dual-frequency-assisted case -- an exact inversion of the old
uncertainty-flag convention).

Verified: full local test suite (acq_test, trk_test, gnss_block_test,
flowgraph_test -- 105 tests) passes against a from-scratch build off
upstream/next, isolated from other in-progress work in this tree.
2026-09-11 15:25:54 +02:00

66 lines
2.4 KiB
C++

/*!
* \file channel_interface.h
* \brief This class represents an interface to a channel GNSS block.
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
* Luis Esteve, 2011. luis(at)epsilon-formacion.com
*
* Abstract class for channel blocks. Since all its methods are virtual,
* this class cannot be instantiated directly, and a subclass can only be
* instantiated directly if all inherited pure virtual methods have been
* implemented by that class or a parent class.
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_CHANNEL_INTERFACE_H
#define GNSS_SDR_CHANNEL_INTERFACE_H
#include "gnss_block_interface.h"
#include "gnss_signal.h"
#include <cstdint>
/** \addtogroup Core
* \{ */
/** \addtogroup GNSS_Block_Interfaces
* \{ */
/*!
* \brief This abstract class represents an interface to a channel GNSS block.
*
* Abstract class for channel blocks. Since all its methods are pure virtual,
* this class cannot be instantiated directly, and a subclass can only be
* instantiated directly if all inherited pure virtual methods have been
* implemented by that class or a parent class.
*/
class ChannelInterface : public GNSSBlockInterface
{
public:
virtual gr::basic_block_sptr get_left_block_trk() = 0;
virtual gr::basic_block_sptr get_right_block_trk() = 0;
virtual gr::basic_block_sptr get_left_block_acq() = 0;
virtual gr::basic_block_sptr get_right_block_acq() = 0;
virtual gr::basic_block_sptr get_left_block() = 0;
virtual gr::basic_block_sptr get_right_block() = 0;
virtual Gnss_Signal get_signal() = 0;
virtual void start_acquisition() = 0;
// doppler_num_bins: number of Doppler bins to search, or 0 (the default)
// for the full configured range -- see AcquisitionInterface::set_doppler_num_bins().
virtual void assist_acquisition_doppler(double Carrier_Doppler_hz, uint32_t doppler_num_bins = 0) = 0;
virtual void stop_channel() = 0;
virtual void set_signal(const Gnss_Signal&) = 0;
};
/** \} */
/** \} */
#endif // GNSS_SDR_CHANNEL_INTERFACE_H