2013-08-28 17:17:57 +00:00
|
|
|
/*!
|
|
|
|
* \file galileo_e1_pcps_tong_ambiguous_acquisition.h
|
|
|
|
* \brief Adapts a PCPS Tong acquisition block to an AcquisitionInterface for
|
|
|
|
* Galileo E1 Signals
|
|
|
|
* \author Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2013-08-28 17:17:57 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2013-08-28 17:17:57 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is a software defined Global Navigation
|
|
|
|
* Satellite Systems receiver
|
|
|
|
*
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2013-08-28 17:17:57 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2013-08-28 17:17:57 +00:00
|
|
|
*/
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H
|
|
|
|
#define GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H
|
2013-08-28 17:17:57 +00:00
|
|
|
|
2019-03-20 14:13:17 +00:00
|
|
|
#include "channel_fsm.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "gnss_synchro.h"
|
2013-08-28 17:17:57 +00:00
|
|
|
#include "pcps_tong_acquisition_cc.h"
|
2018-07-04 11:05:44 +00:00
|
|
|
#include <gnuradio/blocks/stream_to_vector.h>
|
2019-06-30 02:47:15 +00:00
|
|
|
#include <memory>
|
2018-07-04 11:05:44 +00:00
|
|
|
#include <string>
|
2019-06-30 02:47:15 +00:00
|
|
|
#include <vector>
|
2013-08-28 17:17:57 +00:00
|
|
|
|
|
|
|
class ConfigurationInterface;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Adapts a PCPS Tong acquisition block to an AcquisitionInterface
|
|
|
|
* for Galileo E1 Signals
|
|
|
|
*/
|
2018-03-03 01:03:39 +00:00
|
|
|
class GalileoE1PcpsTongAmbiguousAcquisition : public AcquisitionInterface
|
2013-08-28 17:17:57 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-06-29 07:07:41 +00:00
|
|
|
GalileoE1PcpsTongAmbiguousAcquisition(
|
|
|
|
const ConfigurationInterface* configuration,
|
2018-12-02 04:29:11 +00:00
|
|
|
const std::string& role,
|
|
|
|
unsigned int in_streams,
|
2018-03-03 01:03:39 +00:00
|
|
|
unsigned int out_streams);
|
2013-08-28 17:17:57 +00:00
|
|
|
|
2019-07-21 17:32:52 +00:00
|
|
|
~GalileoE1PcpsTongAmbiguousAcquisition() = default;
|
2013-08-28 17:17:57 +00:00
|
|
|
|
2017-08-21 09:45:12 +00:00
|
|
|
inline std::string role() override
|
2013-08-28 17:17:57 +00:00
|
|
|
{
|
|
|
|
return role_;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition"
|
|
|
|
*/
|
2017-08-21 09:45:12 +00:00
|
|
|
inline std::string implementation() override
|
2013-08-28 17:17:57 +00:00
|
|
|
{
|
|
|
|
return "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition";
|
|
|
|
}
|
2017-08-15 22:58:10 +00:00
|
|
|
|
2017-08-21 09:45:12 +00:00
|
|
|
inline size_t item_size() override
|
2013-08-28 17:17:57 +00:00
|
|
|
{
|
|
|
|
return item_size_;
|
|
|
|
}
|
|
|
|
|
2017-08-15 22:58:10 +00:00
|
|
|
void connect(gr::top_block_sptr top_block) override;
|
|
|
|
void disconnect(gr::top_block_sptr top_block) override;
|
|
|
|
gr::basic_block_sptr get_left_block() override;
|
|
|
|
gr::basic_block_sptr get_right_block() override;
|
2013-08-28 17:17:57 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
|
|
|
|
* to efficiently exchange synchronization data between acquisition and
|
|
|
|
* tracking blocks
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
2013-08-28 17:17:57 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set acquisition channel unique ID
|
|
|
|
*/
|
2019-03-20 14:44:59 +00:00
|
|
|
inline void set_channel(unsigned int channel) override
|
2019-03-20 14:13:17 +00:00
|
|
|
{
|
|
|
|
channel_ = channel;
|
|
|
|
acquisition_cc_->set_channel(channel_);
|
|
|
|
}
|
2013-08-28 17:17:57 +00:00
|
|
|
|
2019-03-20 14:13:17 +00:00
|
|
|
/*!
|
|
|
|
* \brief Set channel fsm associated to this acquisition instance
|
|
|
|
*/
|
2019-04-09 15:39:48 +00:00
|
|
|
inline void set_channel_fsm(std::weak_ptr<ChannelFsm> channel_fsm) override
|
2019-03-20 14:13:17 +00:00
|
|
|
{
|
|
|
|
channel_fsm_ = channel_fsm;
|
|
|
|
acquisition_cc_->set_channel_fsm(channel_fsm);
|
|
|
|
}
|
2013-08-28 17:17:57 +00:00
|
|
|
/*!
|
|
|
|
* \brief Set statistics threshold of TONG algorithm
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void set_threshold(float threshold) override;
|
2013-08-28 17:17:57 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set maximum Doppler off grid search
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void set_doppler_max(unsigned int doppler_max) override;
|
2013-08-28 17:17:57 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set Doppler steps for the grid search
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void set_doppler_step(unsigned int doppler_step) override;
|
2013-08-28 17:17:57 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Initializes acquisition algorithm.
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void init() override;
|
2013-08-28 17:17:57 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Sets local code for Galileo E1 TONG acquisition algorithm.
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void set_local_code() override;
|
2013-08-28 17:17:57 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns the maximum peak of grid search
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
signed int mag() override;
|
2013-08-28 17:17:57 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Restart acquisition algorithm
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void reset() override;
|
2013-08-28 17:17:57 +00:00
|
|
|
|
2015-02-14 10:32:22 +00:00
|
|
|
/*!
|
|
|
|
* \brief If state = 1, it forces the block to start acquiring from the first sample
|
|
|
|
*/
|
2018-07-04 11:05:44 +00:00
|
|
|
void set_state(int state) override;
|
2015-02-13 20:40:08 +00:00
|
|
|
|
2018-10-28 10:07:53 +00:00
|
|
|
/*!
|
|
|
|
* \brief Stop running acquisition
|
|
|
|
*/
|
|
|
|
void stop_acquisition() override;
|
|
|
|
|
2018-12-05 15:50:32 +00:00
|
|
|
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
|
|
|
|
|
2013-08-28 17:17:57 +00:00
|
|
|
private:
|
2020-06-29 07:07:41 +00:00
|
|
|
float calculate_threshold(float pfa);
|
|
|
|
const ConfigurationInterface* configuration_;
|
2013-08-28 17:17:57 +00:00
|
|
|
pcps_tong_acquisition_cc_sptr acquisition_cc_;
|
|
|
|
gr::blocks::stream_to_vector::sptr stream_to_vector_;
|
2020-06-29 07:07:41 +00:00
|
|
|
std::weak_ptr<ChannelFsm> channel_fsm_;
|
|
|
|
std::vector<std::complex<float>> code_;
|
|
|
|
Gnss_Synchro* gnss_synchro_;
|
2013-08-28 17:17:57 +00:00
|
|
|
std::string item_type_;
|
2020-06-29 07:07:41 +00:00
|
|
|
std::string dump_filename_;
|
|
|
|
std::string role_;
|
|
|
|
int64_t fs_in_;
|
|
|
|
size_t item_size_;
|
|
|
|
float threshold_;
|
2013-08-28 17:17:57 +00:00
|
|
|
unsigned int vector_length_;
|
|
|
|
unsigned int code_length_;
|
|
|
|
unsigned int channel_;
|
|
|
|
unsigned int doppler_max_;
|
|
|
|
unsigned int doppler_step_;
|
|
|
|
unsigned int sampled_ms_;
|
|
|
|
unsigned int tong_init_val_;
|
|
|
|
unsigned int tong_max_val_;
|
2016-08-11 11:13:30 +00:00
|
|
|
unsigned int tong_max_dwells_;
|
2013-08-28 17:17:57 +00:00
|
|
|
unsigned int in_streams_;
|
|
|
|
unsigned int out_streams_;
|
2020-06-29 07:07:41 +00:00
|
|
|
bool dump_;
|
2013-08-28 17:17:57 +00:00
|
|
|
};
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H
|