2011-10-01 18:45:20 +00:00
|
|
|
/*!
|
|
|
|
* \file gps_l1_ca_pcps_acquisition.h
|
2012-07-12 21:17:37 +00:00
|
|
|
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
|
|
|
* GPS L1 C/A signals
|
2012-09-12 15:03:38 +00:00
|
|
|
* \authors <ul>
|
|
|
|
* <li> Javier Arribas, 2011. jarribas(at)cttc.es
|
|
|
|
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
2013-08-28 17:17:57 +00:00
|
|
|
* <li> Marc Molina, 2013. marc.molina.pena(at)gmail.com
|
2013-07-23 18:03:07 +00:00
|
|
|
* </ul>
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*
|
2015-01-08 18:49:59 +00:00
|
|
|
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is a software defined Global Navigation
|
|
|
|
* Satellite Systems receiver
|
|
|
|
*
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
|
|
|
* GNSS-SDR is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
2015-01-08 18:49:59 +00:00
|
|
|
* (at your option) any later version.
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2011-12-28 03:05:37 +00:00
|
|
|
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_
|
|
|
|
#define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2014-01-12 20:07:38 +00:00
|
|
|
#include <string>
|
|
|
|
#include <gnuradio/blocks/stream_to_vector.h>
|
2015-02-13 01:17:00 +00:00
|
|
|
#include <gnuradio/blocks/float_to_complex.h>
|
2012-01-27 18:01:17 +00:00
|
|
|
#include "gnss_synchro.h"
|
2011-10-01 18:45:20 +00:00
|
|
|
#include "acquisition_interface.h"
|
2012-07-12 21:17:37 +00:00
|
|
|
#include "pcps_acquisition_cc.h"
|
2016-01-20 17:24:03 +00:00
|
|
|
#include "pcps_acquisition_sc.h"
|
2015-02-13 01:17:00 +00:00
|
|
|
#include "complex_byte_to_float_x2.h"
|
2016-01-20 17:24:03 +00:00
|
|
|
#include <volk_gnsssdr/volk_gnsssdr.h>
|
2014-01-12 20:07:38 +00:00
|
|
|
|
2012-11-25 11:15:11 +00:00
|
|
|
|
2011-10-01 18:45:20 +00:00
|
|
|
|
|
|
|
class ConfigurationInterface;
|
|
|
|
|
2012-09-12 15:03:38 +00:00
|
|
|
/*!
|
|
|
|
* \brief This class adapts a PCPS acquisition block to an AcquisitionInterface
|
|
|
|
* for GPS L1 C/A signals
|
|
|
|
*/
|
2011-10-01 18:45:20 +00:00
|
|
|
class GpsL1CaPcpsAcquisition: public AcquisitionInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GpsL1CaPcpsAcquisition(ConfigurationInterface* configuration,
|
|
|
|
std::string role, unsigned int in_streams,
|
2016-04-13 14:45:17 +00:00
|
|
|
unsigned int out_streams);
|
2011-10-01 18:45:20 +00:00
|
|
|
|
|
|
|
virtual ~GpsL1CaPcpsAcquisition();
|
|
|
|
|
2017-08-21 09:45:12 +00:00
|
|
|
inline std::string role() override
|
2011-10-01 18:45:20 +00:00
|
|
|
{
|
|
|
|
return role_;
|
|
|
|
}
|
2013-02-04 00:16:22 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns "GPS_L1_CA_PCPS_Acquisition"
|
|
|
|
*/
|
2017-08-21 09:45:12 +00:00
|
|
|
inline std::string implementation() override
|
2011-10-01 18:45:20 +00:00
|
|
|
{
|
2012-06-22 14:17:28 +00:00
|
|
|
return "GPS_L1_CA_PCPS_Acquisition";
|
2011-10-01 18:45:20 +00:00
|
|
|
}
|
2017-08-15 22:58:10 +00:00
|
|
|
|
2017-08-21 09:45:12 +00:00
|
|
|
inline size_t item_size() override
|
2011-10-01 18:45:20 +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;
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2012-09-12 15:03:38 +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;
|
2012-09-12 15:03:38 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set acquisition channel unique ID
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void set_channel(unsigned int channel) override;
|
2012-09-12 15:03:38 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set statistics threshold of PCPS algorithm
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void set_threshold(float threshold) override;
|
2012-09-12 15:03:38 +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;
|
2012-09-12 15:03:38 +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;
|
2012-09-12 15:03:38 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Initializes acquisition algorithm.
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void init() override;
|
2012-09-12 15:03:38 +00:00
|
|
|
|
2013-07-23 18:03:07 +00:00
|
|
|
/*!
|
|
|
|
* \brief Sets local code for GPS L1/CA PCPS acquisition algorithm.
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void set_local_code() override;
|
2013-07-23 18:03:07 +00:00
|
|
|
|
2012-09-12 15:03:38 +00:00
|
|
|
/*!
|
|
|
|
* \brief Returns the maximum peak of grid search
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
signed int mag() override;
|
2012-09-12 15:03:38 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Restart acquisition algorithm
|
|
|
|
*/
|
2017-08-15 22:58:10 +00:00
|
|
|
void reset() override;
|
2011-10-01 18:45:20 +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
|
|
|
|
*/
|
2015-02-10 18:30:15 +00:00
|
|
|
void set_state(int state);
|
|
|
|
|
2011-10-01 18:45:20 +00:00
|
|
|
private:
|
2013-05-16 16:25:51 +00:00
|
|
|
ConfigurationInterface* configuration_;
|
2012-07-12 21:17:37 +00:00
|
|
|
pcps_acquisition_cc_sptr acquisition_cc_;
|
2016-01-20 17:24:03 +00:00
|
|
|
pcps_acquisition_sc_sptr acquisition_sc_;
|
2012-11-25 11:15:11 +00:00
|
|
|
gr::blocks::stream_to_vector::sptr stream_to_vector_;
|
2015-02-13 01:17:00 +00:00
|
|
|
gr::blocks::float_to_complex::sptr float_to_complex_;
|
|
|
|
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
|
2011-10-01 18:45:20 +00:00
|
|
|
size_t item_size_;
|
|
|
|
std::string item_type_;
|
|
|
|
unsigned int vector_length_;
|
2013-08-28 17:17:57 +00:00
|
|
|
unsigned int code_length_;
|
|
|
|
bool bit_transition_flag_;
|
2016-02-25 17:21:30 +00:00
|
|
|
bool use_CFAR_algorithm_flag_;
|
2011-10-01 18:45:20 +00:00
|
|
|
unsigned int channel_;
|
|
|
|
float threshold_;
|
|
|
|
unsigned int doppler_max_;
|
|
|
|
unsigned int doppler_step_;
|
|
|
|
unsigned int sampled_ms_;
|
2013-08-28 17:17:57 +00:00
|
|
|
unsigned int max_dwells_;
|
2011-10-01 18:45:20 +00:00
|
|
|
long fs_in_;
|
|
|
|
long if_;
|
|
|
|
bool dump_;
|
|
|
|
std::string dump_filename_;
|
2012-07-12 21:17:37 +00:00
|
|
|
std::complex<float> * code_;
|
2012-10-28 12:09:03 +00:00
|
|
|
Gnss_Synchro * gnss_synchro_;
|
2011-10-01 18:45:20 +00:00
|
|
|
std::string role_;
|
|
|
|
unsigned int in_streams_;
|
|
|
|
unsigned int out_streams_;
|
2013-05-16 16:25:51 +00:00
|
|
|
|
|
|
|
float calculate_threshold(float pfa);
|
2011-10-01 18:45:20 +00:00
|
|
|
};
|
|
|
|
|
2011-12-28 03:05:37 +00:00
|
|
|
#endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ */
|