2018-03-24 18:42:04 +00:00
|
|
|
/*!
|
|
|
|
* \file glonass_l2_ca_pcps_acquisition.h
|
|
|
|
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
|
|
|
* Glonass L2 C/A signals
|
|
|
|
* \author Damian Miralles, 2018, dmiralles2009@gmail.com
|
|
|
|
*
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2018-03-24 18:42:04 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2018-03-24 18:42:04 +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
|
2018-03-24 18:42:04 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2018-03-24 18:42:04 +00:00
|
|
|
*/
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H
|
|
|
|
#define GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H
|
2018-03-24 18:42:04 +00:00
|
|
|
|
2019-11-06 22:00:41 +00:00
|
|
|
#include "acq_conf.h"
|
2019-03-20 14:13:17 +00:00
|
|
|
#include "channel_fsm.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "complex_byte_to_float_x2.h"
|
2018-03-24 18:42:04 +00:00
|
|
|
#include "gnss_synchro.h"
|
|
|
|
#include "pcps_acquisition.h"
|
|
|
|
#include <gnuradio/blocks/float_to_complex.h>
|
2019-06-30 02:47:15 +00:00
|
|
|
#include <memory>
|
2018-03-24 18:42:04 +00:00
|
|
|
#include <string>
|
2019-06-30 02:47:15 +00:00
|
|
|
#include <vector>
|
2018-03-24 18:42:04 +00:00
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup Acquisition
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup Acq_adapters
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
2018-03-24 18:42:04 +00:00
|
|
|
class ConfigurationInterface;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief This class adapts a PCPS acquisition block to an AcquisitionInterface
|
|
|
|
* for GLONASS L2 C/A signals
|
|
|
|
*/
|
|
|
|
class GlonassL2CaPcpsAcquisition : public AcquisitionInterface
|
|
|
|
{
|
|
|
|
public:
|
2020-06-29 07:07:41 +00:00
|
|
|
GlonassL2CaPcpsAcquisition(
|
|
|
|
const ConfigurationInterface* configuration,
|
2018-12-02 04:29:11 +00:00
|
|
|
const std::string& role,
|
|
|
|
unsigned int in_streams,
|
2018-03-24 18:42:04 +00:00
|
|
|
unsigned int out_streams);
|
|
|
|
|
2019-07-21 17:32:52 +00:00
|
|
|
~GlonassL2CaPcpsAcquisition() = default;
|
2018-03-24 18:42:04 +00:00
|
|
|
|
|
|
|
inline std::string role() override
|
|
|
|
{
|
|
|
|
return role_;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns "GLONASS_L2_CA_PCPS_Acquisition"
|
|
|
|
*/
|
|
|
|
inline std::string implementation() override
|
|
|
|
{
|
|
|
|
return "GLONASS_L2_CA_PCPS_Acquisition";
|
|
|
|
}
|
|
|
|
|
|
|
|
inline size_t item_size() override
|
|
|
|
{
|
|
|
|
return item_size_;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
|
|
|
|
* to efficiently exchange synchronization data between acquisition and
|
|
|
|
* tracking blocks
|
|
|
|
*/
|
|
|
|
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \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_->set_channel(channel_);
|
|
|
|
}
|
2018-03-24 18:42:04 +00:00
|
|
|
|
2019-03-20 14:13:17 +00:00
|
|
|
/*!
|
2019-06-30 02:47:15 +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_->set_channel_fsm(channel_fsm);
|
|
|
|
}
|
2019-06-30 02:47:15 +00:00
|
|
|
|
2018-03-24 18:42:04 +00:00
|
|
|
/*!
|
|
|
|
* \brief Set statistics threshold of PCPS algorithm
|
|
|
|
*/
|
|
|
|
void set_threshold(float threshold) override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set maximum Doppler off grid search
|
|
|
|
*/
|
|
|
|
void set_doppler_max(unsigned int doppler_max) override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set Doppler steps for the grid search
|
|
|
|
*/
|
|
|
|
void set_doppler_step(unsigned int doppler_step) override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Initializes acquisition algorithm.
|
|
|
|
*/
|
|
|
|
void init() override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Sets local code for GLONASS L2/CA PCPS acquisition algorithm.
|
|
|
|
*/
|
|
|
|
void set_local_code() override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns the maximum peak of grid search
|
|
|
|
*/
|
|
|
|
signed int mag() override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Restart acquisition algorithm
|
|
|
|
*/
|
|
|
|
void reset() override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \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;
|
2018-03-24 18:42:04 +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{};
|
|
|
|
|
2018-03-24 18:42:04 +00:00
|
|
|
private:
|
|
|
|
pcps_acquisition_sptr acquisition_;
|
2020-06-25 00:50:07 +00:00
|
|
|
std::vector<std::complex<float>> code_;
|
|
|
|
std::weak_ptr<ChannelFsm> channel_fsm_;
|
2018-03-24 18:42:04 +00:00
|
|
|
gr::blocks::float_to_complex::sptr float_to_complex_;
|
|
|
|
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
|
2020-06-25 00:50:07 +00:00
|
|
|
Gnss_Synchro* gnss_synchro_;
|
|
|
|
Acq_Conf acq_parameters_;
|
2018-03-24 18:42:04 +00:00
|
|
|
std::string item_type_;
|
2020-06-25 00:50:07 +00:00
|
|
|
std::string dump_filename_;
|
|
|
|
std::string role_;
|
|
|
|
int64_t fs_in_;
|
|
|
|
size_t item_size_;
|
|
|
|
float threshold_;
|
2018-03-24 18:42:04 +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 in_streams_;
|
|
|
|
unsigned int out_streams_;
|
|
|
|
};
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
|
|
|
|
/** \} */
|
|
|
|
/** \} */
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H
|