1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-15 11:45:47 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into release_0010

This commit is contained in:
Carles Fernandez 2018-12-12 01:34:23 +01:00
commit 9fc9357a08
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
442 changed files with 3125 additions and 2381 deletions

View File

@ -47,13 +47,20 @@ DerivePointerAlignment: true
DisableFormat: false DisableFormat: false
ExperimentalAutoDetectBinPacking: false ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeBlocks: Merge
IncludeCategories: IncludeCategories:
- Regex: '^<.*\.h>' - Regex: '^.*.h"'
Priority: 1 Priority: 1
- Regex: '^<.*' - Regex: '^.*(boost|gflags|glog|gnsssdr|gpstk|gtest|gnuradio|pmt|uhd|volk)/'
Priority: 2
- Regex: '^.*(armadillo|matio|pugixml)'
Priority: 2 Priority: 2
- Regex: '.*' - Regex: '.*'
Priority: 3 Priority: 3
- Regex: '^<.*\.h>'
Priority: 4
- Regex: '^<.*'
Priority: 5
IndentCaseLabels: false IndentCaseLabels: false
IndentWidth: 4 IndentWidth: 4
IndentWrappedFunctionNames: false IndentWrappedFunctionNames: false
@ -73,7 +80,7 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200 PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left PointerAlignment: Left
ReflowComments: true ReflowComments: true
SortIncludes: false SortIncludes: true
SpaceAfterCStyleCast: false SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements SpaceBeforeParens: ControlStatements

View File

@ -1,3 +1,3 @@
--- ---
Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-move-const-arg,readability-named-parameter,readability-string-compare' Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-container-size-empty,readability-named-parameter,readability-non-const-parameter,readability-string-compare'
HeaderFilterRegex: '.*' HeaderFilterRegex: '.*'

View File

@ -12,10 +12,10 @@
<xs:sequence> <xs:sequence>
<xs:element type="xs:byte" name="first"/> <xs:element type="xs:byte" name="first"/>
<xs:element name="second"> <xs:element name="second">
<xs:complexType mixed="true"> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:element type="xs:byte" name="i_satellite_PRN"/> <xs:element type="xs:byte" name="i_satellite_PRN"/>
<xs:element type="xs:byte" name="i_Toa"/> <xs:element type="xs:int" name="i_Toa"/>
<xs:element type="xs:byte" name="i_WNa"/> <xs:element type="xs:byte" name="i_WNa"/>
<xs:element type="xs:byte" name="i_IODa"/> <xs:element type="xs:byte" name="i_IODa"/>
<xs:element type="xs:float" name="d_Delta_i"/> <xs:element type="xs:float" name="d_Delta_i"/>

View File

@ -1,4 +1,4 @@
<<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="boost_serialization"> <xs:element name="boost_serialization">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>

View File

@ -10,8 +10,8 @@
<xs:element type="xs:float" name="Delta_tLS_6"/> <xs:element type="xs:float" name="Delta_tLS_6"/>
<xs:element type="xs:float" name="t0t_6"/> <xs:element type="xs:float" name="t0t_6"/>
<xs:element type="xs:float" name="WNot_6"/> <xs:element type="xs:float" name="WNot_6"/>
<xs:element type="xs:float" name="WN_LSF_6"/> <xs:element type="xs:short" name="WN_LSF_6"/>
<xs:element type="xs:float" name="DN_6"/> <xs:element type="xs:byte" name="DN_6"/>
<xs:element type="xs:float" name="Delta_tLSF_6"/> <xs:element type="xs:float" name="Delta_tLSF_6"/>
<xs:element type="xs:byte" name="flag_utc_model"/> <xs:element type="xs:byte" name="flag_utc_model"/>
</xs:sequence> </xs:sequence>

View File

@ -30,11 +30,11 @@
#include "rtklib_pvt.h" #include "rtklib_pvt.h"
#include "pvt_conf.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include <boost/archive/xml_oarchive.hpp> #include "pvt_conf.h"
#include <boost/archive/xml_iarchive.hpp> #include <boost/archive/xml_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>
#include <boost/serialization/map.hpp> #include <boost/serialization/map.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#if OLD_BOOST #if OLD_BOOST
@ -214,6 +214,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 31; if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 31;
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 33; // L1+E1+E5a
// RTKLIB PVT solver options // RTKLIB PVT solver options
// Settings 1 // Settings 1

View File

@ -34,8 +34,8 @@
#include "galileo_almanac_helper.h" #include "galileo_almanac_helper.h"
#include "gnss_sdr_create_directory.h" #include "gnss_sdr_create_directory.h"
#include "pvt_conf.h" #include "pvt_conf.h"
#include <boost/archive/xml_oarchive.hpp>
#include <boost/archive/xml_iarchive.hpp> #include <boost/archive/xml_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>
#include <boost/exception/all.hpp> #include <boost/exception/all.hpp>
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
#include <boost/serialization/map.hpp> #include <boost/serialization/map.hpp>
@ -43,9 +43,9 @@
#include <gnuradio/gr_complex.h> #include <gnuradio/gr_complex.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <algorithm> #include <algorithm>
#include <exception>
#include <iostream> #include <iostream>
#include <map> #include <map>
#include <exception>
#if OLD_BOOST #if OLD_BOOST
#include <boost/math/common_factor_rt.hpp> #include <boost/math/common_factor_rt.hpp>
namespace bc = boost::math; namespace bc = boost::math;
@ -1410,6 +1410,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
b_rinex_header_written = true; // do not write header anymore b_rinex_header_written = true; // do not write header anymore
} }
break; break;
case 33: // L1+E1+E5a
if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and
(galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()))
{
std::string gal_signal("1B 5X");
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model);
b_rinex_header_written = true; // do not write header anymore
}
break;
default: default:
break; break;
} }
@ -1490,6 +1500,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
case 32: // L1+E1+L5+E5a case 32: // L1+E1+L5+E5a
rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map);
break; break;
case 33: // L1+E1+E5a
rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map);
break;
default: default:
break; break;
} }
@ -1784,6 +1797,20 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
b_rinex_header_updated = true; // do not write header anymore b_rinex_header_updated = true; // do not write header anymore
} }
break; break;
case 33: // L1+E1+E5a
if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()))
{
rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map);
}
if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0) and (d_pvt_solver->galileo_utc_model.A0_6 != 0))
{
rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model);
rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model);
b_rinex_header_updated = true; // do not write header anymore
}
break;
default:
break;
} }
} }
} }
@ -2441,7 +2468,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
} }
if (d_rtcm_MSM_rate_ms != 0) if (d_rtcm_MSM_rate_ms != 0)
{ {
std::map<int, Gnss_Synchro>::const_iterator gnss_observables_iter;
std::map<int, Galileo_Ephemeris>::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); std::map<int, Galileo_Ephemeris>::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin();
int gal_channel = 0;
for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
std::string system(&gnss_observables_iter->second.System, 1);
if (gal_channel == 0)
{
if (system == "E")
{
gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend())
{
gal_channel = 1;
}
}
}
}
if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0))
{ {
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);

View File

@ -31,26 +31,26 @@
#ifndef GNSS_SDR_RTKLIB_PVT_CC_H #ifndef GNSS_SDR_RTKLIB_PVT_CC_H
#define GNSS_SDR_RTKLIB_PVT_CC_H #define GNSS_SDR_RTKLIB_PVT_CC_H
#include "gps_ephemeris.h"
#include "nmea_printer.h"
#include "kml_printer.h"
#include "gpx_printer.h"
#include "geojson_printer.h" #include "geojson_printer.h"
#include "gps_ephemeris.h"
#include "gpx_printer.h"
#include "kml_printer.h"
#include "nmea_printer.h"
#include "pvt_conf.h"
#include "rinex_printer.h" #include "rinex_printer.h"
#include "rtcm_printer.h" #include "rtcm_printer.h"
#include "pvt_conf.h"
#include "rtklib_solver.h" #include "rtklib_solver.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <gnuradio/sync_block.h> #include <gnuradio/sync_block.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <chrono> #include <chrono>
#include <cstdint> #include <cstdint>
#include <fstream> #include <fstream>
#include <utility>
#include <string> #include <string>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/types.h>
#include <utility>
class rtklib_pvt_cc; class rtklib_pvt_cc;

View File

@ -30,12 +30,12 @@
*/ */
#include "hybrid_ls_pvt.h" #include "hybrid_ls_pvt.h"
#include "Galileo_E1.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "GPS_L2C.h" #include "GPS_L2C.h"
#include "Galileo_E1.h"
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/posix_time.hpp>
#include <utility>
#include <glog/logging.h> #include <glog/logging.h>
#include <utility>
using google::LogMessage; using google::LogMessage;

View File

@ -32,12 +32,12 @@
#ifndef GNSS_SDR_HYBRID_LS_PVT_H_ #ifndef GNSS_SDR_HYBRID_LS_PVT_H_
#define GNSS_SDR_HYBRID_LS_PVT_H_ #define GNSS_SDR_HYBRID_LS_PVT_H_
#include "ls_pvt.h"
#include "galileo_navigation_message.h"
#include "gps_navigation_message.h"
#include "gps_cnav_navigation_message.h"
#include "galileo_almanac.h" #include "galileo_almanac.h"
#include "galileo_navigation_message.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "gps_cnav_navigation_message.h"
#include "gps_navigation_message.h"
#include "ls_pvt.h"
#include "rtklib_rtkcmn.h" #include "rtklib_rtkcmn.h"
#include <fstream> #include <fstream>
#include <map> #include <map>

View File

@ -33,8 +33,8 @@
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include <string>
#include <map> #include <map>
#include <string>
class Pvt_Conf class Pvt_Conf
{ {

View File

@ -33,9 +33,9 @@
#define GNSS_SDR_PVT_SOLUTION_H_ #define GNSS_SDR_PVT_SOLUTION_H_
#include <armadillo>
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/posix_time.hpp>
#include <deque> #include <deque>
#include <armadillo>
const unsigned int PVT_MAX_CHANNELS = 90; const unsigned int PVT_MAX_CHANNELS = 90;
const unsigned int PVT_MAX_PRN = 127; // 126 is SBAS const unsigned int PVT_MAX_PRN = 127; // 126 is SBAS

View File

@ -29,21 +29,21 @@
*/ */
#include "rinex_printer.h" #include "rinex_printer.h"
#include <boost/date_time/time_zone_base.hpp>
#include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/local_time/local_time.hpp> #include <boost/date_time/local_time/local_time.hpp>
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/time_zone_base.hpp>
#include <boost/filesystem/operations.hpp> // for create_directories, exists #include <boost/filesystem/operations.hpp> // for create_directories, exists
#include <boost/filesystem/path.hpp> // for path, operator<< #include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem #include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h> #include <glog/logging.h>
#include <unistd.h> // for getlogin_r()
#include <algorithm> // for min and max #include <algorithm> // for min and max
#include <cmath> // for floor #include <cmath> // for floor
#include <cstdlib> // for getenv() #include <cstdlib> // for getenv()
#include <iterator> #include <iterator>
#include <ostream> #include <ostream>
#include <set> #include <set>
#include <unistd.h> // for getlogin_r()
#include <utility> #include <utility>
#include <vector> #include <vector>
@ -7057,7 +7057,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
double int_sec = 0; double int_sec = 0;
// Avoid compiler warning // Avoid compiler warning
if (glonass_band.size()) if (!glonass_band.empty())
{ {
} }

View File

@ -51,21 +51,21 @@
#ifndef GNSS_SDR_RINEX_PRINTER_H_ #ifndef GNSS_SDR_RINEX_PRINTER_H_
#define GNSS_SDR_RINEX_PRINTER_H_ #define GNSS_SDR_RINEX_PRINTER_H_
#include "gps_navigation_message.h" #include "GLONASS_L1_L2_CA.h"
#include "gps_cnav_navigation_message.h"
#include "galileo_navigation_message.h"
#include "glonass_gnav_navigation_message.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include "GLONASS_L1_L2_CA.h" #include "galileo_navigation_message.h"
#include "glonass_gnav_navigation_message.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "gps_cnav_navigation_message.h"
#include "gps_navigation_message.h"
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/posix_time.hpp>
#include <cstdint> #include <cstdint>
#include <string>
#include <fstream> #include <fstream>
#include <sstream> // for stringstream
#include <iomanip> // for setprecision #include <iomanip> // for setprecision
#include <map> #include <map>
#include <sstream> // for stringstream
#include <string>
class Sbas_Raw_Msg; class Sbas_Raw_Msg;

View File

@ -38,10 +38,10 @@
#include <boost/filesystem/path_traits.hpp> // for filesystem #include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h> #include <glog/logging.h>
#include <cstdint> #include <cstdint>
#include <fcntl.h> // for O_RDWR
#include <iomanip> #include <iomanip>
#include <utility>
#include <fcntl.h> // for O_RDWR
#include <termios.h> // for tcgetattr #include <termios.h> // for tcgetattr
#include <utility>
using google::LogMessage; using google::LogMessage;

View File

@ -148,7 +148,7 @@ private:
std::string rtcm_devname; std::string rtcm_devname;
uint16_t port; uint16_t port;
uint16_t station_id; uint16_t station_id;
int32_t rtcm_dev_descriptor; // RTCM serial device descriptor (i.e. COM port) int32_t rtcm_dev_descriptor; // RTCM serial device descriptor (i.e. COM port)
int32_t init_serial(const std::string& serial_device); //serial port control int32_t init_serial(const std::string& serial_device); //serial port control
void close_serial(); void close_serial();
std::shared_ptr<Rtcm> rtcm; std::shared_ptr<Rtcm> rtcm;

View File

@ -52,13 +52,13 @@
* -----------------------------------------------------------------------*/ * -----------------------------------------------------------------------*/
#include "rtklib_solver.h" #include "rtklib_solver.h"
#include "rtklib_conversions.h" #include "GLONASS_L1_L2_CA.h"
#include "rtklib_solution.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include "GLONASS_L1_L2_CA.h" #include "rtklib_conversions.h"
#include <matio.h> #include "rtklib_solution.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <matio.h>
#include <utility> #include <utility>
@ -820,7 +820,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
} }
} }
if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_); if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_.data());
this->set_valid_position(true); this->set_valid_position(true);
arma::vec rx_position_and_time(4); arma::vec rx_position_and_time(4);
rx_position_and_time(0) = pvt_sol.rr[0]; // [m] rx_position_and_time(0) = pvt_sol.rr[0]; // [m]

View File

@ -55,14 +55,15 @@
#define GNSS_SDR_RTKLIB_SOLVER_H_ #define GNSS_SDR_RTKLIB_SOLVER_H_
#include "rtklib_rtkpos.h"
#include "galileo_navigation_message.h"
#include "gps_navigation_message.h"
#include "gps_cnav_navigation_message.h"
#include "glonass_gnav_navigation_message.h"
#include "galileo_almanac.h" #include "galileo_almanac.h"
#include "galileo_navigation_message.h"
#include "glonass_gnav_navigation_message.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "gps_cnav_navigation_message.h"
#include "gps_navigation_message.h"
#include "pvt_solution.h" #include "pvt_solution.h"
#include "rtklib_rtkpos.h"
#include <array>
#include <fstream> #include <fstream>
#include <map> #include <map>
#include <string> #include <string>
@ -82,7 +83,7 @@ private:
bool d_flag_dump_enabled; bool d_flag_dump_enabled;
bool d_flag_dump_mat_enabled; bool d_flag_dump_mat_enabled;
int d_nchannels; // Number of available channels for positioning int d_nchannels; // Number of available channels for positioning
double dop_[4]; std::array<double, 4> dop_;
public: public:
sol_t pvt_sol; sol_t pvt_sol;
@ -99,7 +100,7 @@ public:
std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
std::map<int, Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris std::map<int, Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris
std::map<int, Glonass_Gnav_Ephemeris> glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephmeris std::map<int, Glonass_Gnav_Ephemeris> glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephemeris
Galileo_Utc_Model galileo_utc_model; Galileo_Utc_Model galileo_utc_model;
Galileo_Iono galileo_iono; Galileo_Iono galileo_iono;

View File

@ -30,12 +30,12 @@
*/ */
#include "galileo_e1_pcps_8ms_ambiguous_acquisition.h" #include "galileo_e1_pcps_8ms_ambiguous_acquisition.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include "galileo_e1_signal_processing.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "galileo_e1_signal_processing.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
using google::LogMessage; using google::LogMessage;

View File

@ -32,9 +32,9 @@
#ifndef GNSS_SDR_GALILEO_E1_PCPS_8MS_AMBIGUOUS_ACQUISITION_H_ #ifndef GNSS_SDR_GALILEO_E1_PCPS_8MS_AMBIGUOUS_ACQUISITION_H_
#define GNSS_SDR_GALILEO_E1_PCPS_8MS_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_8MS_AMBIGUOUS_ACQUISITION_H_
#include "gnss_synchro.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "galileo_pcps_8ms_acquisition_cc.h" #include "galileo_pcps_8ms_acquisition_cc.h"
#include "gnss_synchro.h"
#include <gnuradio/blocks/stream_to_vector.h> #include <gnuradio/blocks/stream_to_vector.h>
#include <string> #include <string>
@ -131,6 +131,9 @@ public:
void set_state(int state __attribute__((unused))) override{}; void set_state(int state __attribute__((unused))) override{};
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
galileo_pcps_8ms_acquisition_cc_sptr acquisition_cc_; galileo_pcps_8ms_acquisition_cc_sptr acquisition_cc_;

View File

@ -30,11 +30,11 @@
*/ */
#include "galileo_e1_pcps_ambiguous_acquisition.h" #include "galileo_e1_pcps_ambiguous_acquisition.h"
#include "Galileo_E1.h"
#include "acq_conf.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "galileo_e1_signal_processing.h" #include "galileo_e1_signal_processing.h"
#include "Galileo_E1.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "acq_conf.h"
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
@ -50,7 +50,6 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
in_streams_(in_streams), in_streams_(in_streams),
out_streams_(out_streams) out_streams_(out_streams)
{ {
Acq_Conf acq_parameters;
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; std::string default_item_type = "gr_complex";
std::string default_dump_filename = "./acquisition.mat"; std::string default_dump_filename = "./acquisition.mat";
@ -61,41 +60,67 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
acq_parameters.fs_in = fs_in_; acq_parameters_.fs_in = fs_in_;
acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters.fs_in)));
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
acq_parameters.doppler_max = doppler_max_; acq_parameters_.doppler_max = doppler_max_;
acq_parameters.ms_per_code = 4; acq_parameters_.ms_per_code = 4;
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters.ms_per_code); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters_.ms_per_code);
acq_parameters.sampled_ms = sampled_ms_; acq_parameters_.sampled_ms = sampled_ms_;
if ((acq_parameters.sampled_ms % acq_parameters.ms_per_code) != 0) if ((acq_parameters_.sampled_ms % acq_parameters_.ms_per_code) != 0)
{ {
LOG(WARNING) << "Parameter coherent_integration_time_ms should be a multiple of 4. Setting it to 4"; LOG(WARNING) << "Parameter coherent_integration_time_ms should be a multiple of 4. Setting it to 4";
acq_parameters.sampled_ms = acq_parameters.ms_per_code; acq_parameters_.sampled_ms = acq_parameters_.ms_per_code;
} }
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
acq_parameters.bit_transition_flag = bit_transition_flag_; acq_parameters_.bit_transition_flag = bit_transition_flag_;
use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_;
acquire_pilot_ = configuration_->property(role + ".acquire_pilot", false); //will be true in future versions acquire_pilot_ = configuration_->property(role + ".acquire_pilot", false); //will be true in future versions
max_dwells_ = configuration_->property(role + ".max_dwells", 1); max_dwells_ = configuration_->property(role + ".max_dwells", 1);
acq_parameters.max_dwells = max_dwells_; acq_parameters_.max_dwells = max_dwells_;
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
acq_parameters.dump = dump_; acq_parameters_.dump = dump_;
acq_parameters.dump_channel = configuration_->property(role + ".dump_channel", 0); acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0);
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters.blocking = blocking_; acq_parameters_.blocking = blocking_;
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
acq_parameters.dump_filename = dump_filename_; acq_parameters_.dump_filename = dump_filename_;
//--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
float samples_per_ms = static_cast<float>(fs_in_) * 0.001; acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false);
acq_parameters.samples_per_ms = samples_per_ms; if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex")
acq_parameters.samples_per_code = acq_parameters.samples_per_ms * static_cast<float>(Galileo_E1_CODE_PERIOD_MS); {
vector_length_ = sampled_ms_ * samples_per_ms; LOG(WARNING) << "Galileo E1 acqisition disabled the automatic resampler feature because its item_type is not set to gr_complex";
acq_parameters_.use_automatic_resampler = false;
}
if (acq_parameters_.use_automatic_resampler)
{
if (acq_parameters_.fs_in > Galileo_E1_OPT_ACQ_FS_HZ)
{
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / Galileo_E1_OPT_ACQ_FS_HZ);
uint32_t decimation = acq_parameters_.fs_in / Galileo_E1_OPT_ACQ_FS_HZ;
while (acq_parameters_.fs_in % decimation > 0)
{
decimation--;
};
acq_parameters_.resampler_ratio = decimation;
acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast<int>(acq_parameters_.resampler_ratio);
}
//--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
}
else
{
//--- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
}
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(Galileo_E1_CODE_PERIOD_MS);
vector_length_ = sampled_ms_ * acq_parameters_.samples_per_ms;
if (bit_transition_flag_) if (bit_transition_flag_)
{ {
vector_length_ *= 2; vector_length_ *= 2;
@ -111,12 +136,12 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
} }
acq_parameters.it_size = item_size_; acq_parameters_.it_size = item_size_;
acq_parameters.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4); acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0); acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false); acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false);
acq_parameters.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false);
acquisition_ = pcps_make_acquisition(acq_parameters); acquisition_ = pcps_make_acquisition(acq_parameters_);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";
if (item_type_ == "cbyte") if (item_type_ == "cbyte")
@ -227,13 +252,29 @@ void GalileoE1PcpsAmbiguousAcquisition::set_local_code()
{ {
//set local signal generator to Galileo E1 pilot component (1C) //set local signal generator to Galileo E1 pilot component (1C)
char pilot_signal[3] = "1C"; char pilot_signal[3] = "1C";
galileo_e1_code_gen_complex_sampled(code, pilot_signal, if (acq_parameters_.use_automatic_resampler)
cboc, gnss_synchro_->PRN, fs_in_, 0, false); {
galileo_e1_code_gen_complex_sampled(code, pilot_signal,
cboc, gnss_synchro_->PRN, acq_parameters_.resampled_fs, 0, false);
}
else
{
galileo_e1_code_gen_complex_sampled(code, pilot_signal,
cboc, gnss_synchro_->PRN, fs_in_, 0, false);
}
} }
else else
{ {
galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, if (acq_parameters_.use_automatic_resampler)
cboc, gnss_synchro_->PRN, fs_in_, 0, false); {
galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal,
cboc, gnss_synchro_->PRN, acq_parameters_.resampled_fs, 0, false);
}
else
{
galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal,
cboc, gnss_synchro_->PRN, fs_in_, 0, false);
}
} }
@ -352,3 +393,8 @@ gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_right_block()
{ {
return acquisition_; return acquisition_;
} }
void GalileoE1PcpsAmbiguousAcquisition::set_resampler_latency(uint32_t latency_samples)
{
acquisition_->set_resampler_latency(latency_samples);
}

View File

@ -32,10 +32,11 @@
#ifndef GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_H_ #ifndef GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_H_
#define GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_H_
#include "acq_conf.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "complex_byte_to_float_x2.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "pcps_acquisition.h" #include "pcps_acquisition.h"
#include "complex_byte_to_float_x2.h"
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <string> #include <string>
@ -137,8 +138,16 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
/*!
* \brief Sets the resampler latency to account it in the acquisition code delay estimation
*/
void set_resampler_latency(uint32_t latency_samples) override;
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
Acq_Conf acq_parameters_;
pcps_acquisition_sptr acquisition_; pcps_acquisition_sptr acquisition_;
gr::blocks::float_to_complex::sptr float_to_complex_; gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_; complex_byte_to_float_x2_sptr cbyte_to_float_x2_;

View File

@ -30,9 +30,9 @@
*/ */
#include "galileo_e1_pcps_ambiguous_acquisition_fpga.h" #include "galileo_e1_pcps_ambiguous_acquisition_fpga.h"
#include "Galileo_E1.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "galileo_e1_signal_processing.h" #include "galileo_e1_signal_processing.h"
#include "Galileo_E1.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
@ -89,7 +89,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
// dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); // dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
// acq_parameters.dump_filename = dump_filename_; // acq_parameters.dump_filename = dump_filename_;
//--- Find number of samples per spreading code (4 ms) ----------------- //--- Find number of samples per spreading code (4 ms) -----------------
unsigned int code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)));
//acq_parameters.samples_per_code = code_length_; //acq_parameters.samples_per_code = code_length_;
//int samples_per_ms = static_cast<int>(std::round(static_cast<double>(fs_in_) * 0.001)); //int samples_per_ms = static_cast<int>(std::round(static_cast<double>(fs_in_) * 0.001));
//acq_parameters.samples_per_ms = samples_per_ms; //acq_parameters.samples_per_ms = samples_per_ms;
@ -120,9 +120,9 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
// compute all the GALILEO E1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // compute all the GALILEO E1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
// a channel is assigned) // a channel is assigned)
gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT
std::complex<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code
gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E1_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E1_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search float max; // temporary maxima search
@ -174,7 +174,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
// // fill in zero padding // // fill in zero padding
for (int s = code_length; s < nsamples_total; s++) for (int s = code_length; s < nsamples_total; s++)
{ {
code[s] = std::complex<float>(static_cast<float>(0, 0)); code[s] = std::complex<float>(0.0, 0.0);
//code[s] = 0; //code[s] = 0;
} }

View File

@ -33,11 +33,11 @@
#define GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_FPGA_H_
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "complex_byte_to_float_x2.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "pcps_acquisition_fpga.h" #include "pcps_acquisition_fpga.h"
#include "complex_byte_to_float_x2.h"
#include <gnuradio/blocks/stream_to_vector.h>
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/stream_to_vector.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <string> #include <string>
@ -142,6 +142,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
//pcps_acquisition_sptr acquisition_; //pcps_acquisition_sptr acquisition_;

View File

@ -30,12 +30,12 @@
*/ */
#include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h" #include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include "galileo_e1_signal_processing.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "galileo_e1_signal_processing.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
using google::LogMessage; using google::LogMessage;

View File

@ -32,8 +32,8 @@
#ifndef GNSS_SDR_GALILEO_E1_PCPS_CCCWSR_AMBIGUOUS_ACQUISITION_H_ #ifndef GNSS_SDR_GALILEO_E1_PCPS_CCCWSR_AMBIGUOUS_ACQUISITION_H_
#define GNSS_SDR_GALILEO_E1_PCPS_CCCWSR_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_CCCWSR_AMBIGUOUS_ACQUISITION_H_
#include "gnss_synchro.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "gnss_synchro.h"
#include "pcps_cccwsr_acquisition_cc.h" #include "pcps_cccwsr_acquisition_cc.h"
#include <gnuradio/blocks/stream_to_vector.h> #include <gnuradio/blocks/stream_to_vector.h>
#include <string> #include <string>
@ -131,6 +131,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_cccwsr_acquisition_cc_sptr acquisition_cc_; pcps_cccwsr_acquisition_cc_sptr acquisition_cc_;

View File

@ -30,12 +30,12 @@
*/ */
#include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" #include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include "galileo_e1_signal_processing.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "galileo_e1_signal_processing.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
using google::LogMessage; using google::LogMessage;

View File

@ -32,8 +32,8 @@
#ifndef GNSS_SDR_GALILEO_E1_PCPS_QUICKSYNC_AMBIGUOUS_ACQUISITION_H_ #ifndef GNSS_SDR_GALILEO_E1_PCPS_QUICKSYNC_AMBIGUOUS_ACQUISITION_H_
#define GNSS_SDR_GALILEO_E1_PCPS_QUICKSYNC_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_QUICKSYNC_AMBIGUOUS_ACQUISITION_H_
#include "gnss_synchro.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "gnss_synchro.h"
#include "pcps_quicksync_acquisition_cc.h" #include "pcps_quicksync_acquisition_cc.h"
#include <gnuradio/blocks/stream_to_vector.h> #include <gnuradio/blocks/stream_to_vector.h>
#include <string> #include <string>
@ -135,6 +135,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_quicksync_acquisition_cc_sptr acquisition_cc_; pcps_quicksync_acquisition_cc_sptr acquisition_cc_;

View File

@ -30,12 +30,12 @@
*/ */
#include "galileo_e1_pcps_tong_ambiguous_acquisition.h" #include "galileo_e1_pcps_tong_ambiguous_acquisition.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include "galileo_e1_signal_processing.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "galileo_e1_signal_processing.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
using google::LogMessage; using google::LogMessage;

View File

@ -32,8 +32,8 @@
#ifndef GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H_ #ifndef GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H_
#define GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H_
#include "gnss_synchro.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "gnss_synchro.h"
#include "pcps_tong_acquisition_cc.h" #include "pcps_tong_acquisition_cc.h"
#include <gnuradio/blocks/stream_to_vector.h> #include <gnuradio/blocks/stream_to_vector.h>
#include <string> #include <string>
@ -134,6 +134,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_tong_acquisition_cc_sptr acquisition_cc_; pcps_tong_acquisition_cc_sptr acquisition_cc_;

View File

@ -36,12 +36,12 @@
*/ */
#include "galileo_e5a_noncoherent_iq_acquisition_caf.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include "galileo_e5_signal_processing.h"
#include "Galileo_E5a.h" #include "Galileo_E5a.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "galileo_e5_signal_processing.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
using google::LogMessage; using google::LogMessage;

View File

@ -38,9 +38,9 @@
#ifndef GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H_ #ifndef GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H_
#define GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H_ #define GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H_
#include "gnss_synchro.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h"
#include "gnss_synchro.h"
#include <string> #include <string>
class ConfigurationInterface; class ConfigurationInterface;
@ -137,6 +137,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr acquisition_cc_; galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr acquisition_cc_;

View File

@ -29,11 +29,11 @@
*/ */
#include "galileo_e5a_pcps_acquisition.h" #include "galileo_e5a_pcps_acquisition.h"
#include "Galileo_E5a.h"
#include "acq_conf.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "galileo_e5_signal_processing.h" #include "galileo_e5_signal_processing.h"
#include "Galileo_E5a.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "acq_conf.h"
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <volk_gnsssdr/volk_gnsssdr_complex.h> #include <volk_gnsssdr/volk_gnsssdr_complex.h>
@ -49,7 +49,6 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
in_streams_(in_streams), in_streams_(in_streams),
out_streams_(out_streams) out_streams_(out_streams)
{ {
Acq_Conf acq_parameters = Acq_Conf();
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; std::string default_item_type = "gr_complex";
std::string default_dump_filename = "./acquisition.mat"; std::string default_dump_filename = "./acquisition.mat";
@ -60,8 +59,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
acq_parameters.fs_in = fs_in_; acq_parameters_.fs_in = fs_in_;
acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters.fs_in)));
acq_pilot_ = configuration_->property(role + ".acquire_pilot", false); acq_pilot_ = configuration_->property(role + ".acquire_pilot", false);
acq_iq_ = configuration_->property(role + ".acquire_iq", false); acq_iq_ = configuration_->property(role + ".acquire_iq", false);
if (acq_iq_) if (acq_iq_)
@ -69,22 +67,58 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
acq_pilot_ = false; acq_pilot_ = false;
} }
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
acq_parameters.dump = dump_; acq_parameters_.dump = dump_;
acq_parameters.dump_channel = configuration_->property(role + ".dump_channel", 0); acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
acq_parameters.doppler_max = doppler_max_; acq_parameters_.doppler_max = doppler_max_;
sampled_ms_ = 1; sampled_ms_ = 1;
max_dwells_ = configuration_->property(role + ".max_dwells", 1); max_dwells_ = configuration_->property(role + ".max_dwells", 1);
acq_parameters.max_dwells = max_dwells_; acq_parameters_.max_dwells = max_dwells_;
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
acq_parameters.dump_filename = dump_filename_; acq_parameters_.dump_filename = dump_filename_;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
acq_parameters.bit_transition_flag = bit_transition_flag_; acq_parameters_.bit_transition_flag = bit_transition_flag_;
use_CFAR_ = configuration_->property(role + ".use_CFAR_algorithm", false); use_CFAR_ = configuration_->property(role + ".use_CFAR_algorithm", false);
acq_parameters.use_CFAR_algorithm_flag = use_CFAR_; acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_;
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters.blocking = blocking_; acq_parameters_.blocking = blocking_;
acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false);
if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex")
{
LOG(WARNING) << "Galileo E5a acquisition disabled the automatic resampler feature because its item_type is not set to gr_complex";
acq_parameters_.use_automatic_resampler = false;
}
if (acq_parameters_.use_automatic_resampler)
{
if (acq_parameters_.fs_in > Galileo_E5a_OPT_ACQ_FS_HZ)
{
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / Galileo_E5a_OPT_ACQ_FS_HZ);
uint32_t decimation = acq_parameters_.fs_in / Galileo_E5a_OPT_ACQ_FS_HZ;
while (acq_parameters_.fs_in % decimation > 0)
{
decimation--;
};
acq_parameters_.resampler_ratio = decimation;
acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast<int>(acq_parameters_.resampler_ratio);
}
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
}
else
{
acq_parameters_.resampled_fs = fs_in_;
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
}
//--- Find number of samples per spreading code (1ms)------------------------- //--- Find number of samples per spreading code (1ms)-------------------------
code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS))); code_length_ = static_cast<unsigned int>(std::round(static_cast<double>(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS)));
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
@ -104,16 +138,15 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
LOG(WARNING) << item_type_ << " unknown acquisition item type"; LOG(WARNING) << item_type_ << " unknown acquisition item type";
} }
acq_parameters.it_size = item_size_; acq_parameters_.it_size = item_size_;
acq_parameters.samples_per_ms = static_cast<float>(fs_in_) * 0.001; acq_parameters_.sampled_ms = sampled_ms_;
acq_parameters.sampled_ms = sampled_ms_; acq_parameters_.ms_per_code = 1;
acq_parameters.ms_per_code = 1; acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GALILEO_E5a_CODE_PERIOD_MS);
acq_parameters.samples_per_code = acq_parameters.samples_per_ms * static_cast<float>(GALILEO_E5a_CODE_PERIOD_MS); acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4); acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0); acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false);
acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false); acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false);
acq_parameters.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); acquisition_ = pcps_make_acquisition(acq_parameters_);
acquisition_ = pcps_make_acquisition(acq_parameters);
channel_ = 0; channel_ = 0;
threshold_ = 0.0; threshold_ = 0.0;
@ -224,7 +257,14 @@ void GalileoE5aPcpsAcquisition::set_local_code()
strcpy(signal_, "5I"); strcpy(signal_, "5I");
} }
galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, fs_in_, 0); if (acq_parameters_.use_automatic_resampler)
{
galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, acq_parameters_.resampled_fs, 0);
}
else
{
galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, fs_in_, 0);
}
for (unsigned int i = 0; i < sampled_ms_; i++) for (unsigned int i = 0; i < sampled_ms_; i++)
{ {
@ -311,3 +351,8 @@ gr::basic_block_sptr GalileoE5aPcpsAcquisition::get_right_block()
{ {
return acquisition_; return acquisition_;
} }
void GalileoE5aPcpsAcquisition::set_resampler_latency(uint32_t latency_samples)
{
acquisition_->set_resampler_latency(latency_samples);
}

View File

@ -128,13 +128,19 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
/*!
* \brief Sets the resampler latency to account it in the acquisition code delay estimation
*/
void set_resampler_latency(uint32_t latency_samples) override;
private: private:
float calculate_threshold(float pfa); float calculate_threshold(float pfa);
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_; pcps_acquisition_sptr acquisition_;
Acq_Conf acq_parameters_;
size_t item_size_; size_t item_size_;
std::string item_type_; std::string item_type_;

View File

@ -29,9 +29,9 @@
*/ */
#include "galileo_e5a_pcps_acquisition_fpga.h" #include "galileo_e5a_pcps_acquisition_fpga.h"
#include "Galileo_E5a.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "galileo_e5_signal_processing.h" #include "galileo_e5_signal_processing.h"
#include "Galileo_E5a.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
@ -89,7 +89,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
acq_pilot_ = false; acq_pilot_ = false;
} }
unsigned int code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS))); auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS)));
acq_parameters.code_length = code_length; acq_parameters.code_length = code_length;
// The FPGA can only use FFT lengths that are a power of two. // The FPGA can only use FFT lengths that are a power of two.
float nbits = ceilf(log2f((float)code_length)); float nbits = ceilf(log2f((float)code_length));
@ -108,9 +108,9 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
// compute all the GALILEO E5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // compute all the GALILEO E5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
// a channel is assigned) // a channel is assigned)
gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT
std::complex<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code
gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E5a_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E5a_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search float max; // temporary maxima search
@ -141,7 +141,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
// fill in zero padding // fill in zero padding
for (int s = code_length; s < nsamples_total; s++) for (int s = code_length; s < nsamples_total; s++)
{ {
code[s] = std::complex<float>(static_cast<float>(0, 0)); code[s] = std::complex<float>(0.0, 0.0);
//code[s] = 0; //code[s] = 0;
} }

View File

@ -130,6 +130,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
//float calculate_threshold(float pfa); //float calculate_threshold(float pfa);

View File

@ -32,11 +32,11 @@
*/ */
#include "glonass_l1_ca_pcps_acquisition.h" #include "glonass_l1_ca_pcps_acquisition.h"
#include "GLONASS_L1_L2_CA.h"
#include "acq_conf.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "glonass_l1_signal_processing.h" #include "glonass_l1_signal_processing.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "acq_conf.h"
#include "GLONASS_L1_L2_CA.h"
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>

View File

@ -35,9 +35,9 @@
#define GNSS_SDR_GLONASS_L1_CA_PCPS_ACQUISITION_H_ #define GNSS_SDR_GLONASS_L1_CA_PCPS_ACQUISITION_H_
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "complex_byte_to_float_x2.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "pcps_acquisition.h" #include "pcps_acquisition.h"
#include "complex_byte_to_float_x2.h"
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <string> #include <string>
@ -137,6 +137,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_; pcps_acquisition_sptr acquisition_;

View File

@ -31,11 +31,11 @@
*/ */
#include "glonass_l2_ca_pcps_acquisition.h" #include "glonass_l2_ca_pcps_acquisition.h"
#include "GLONASS_L1_L2_CA.h"
#include "acq_conf.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "glonass_l2_signal_processing.h" #include "glonass_l2_signal_processing.h"
#include "GLONASS_L1_L2_CA.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "acq_conf.h"
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>

View File

@ -34,9 +34,9 @@
#define GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H_ #define GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H_
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "complex_byte_to_float_x2.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "pcps_acquisition.h" #include "pcps_acquisition.h"
#include "complex_byte_to_float_x2.h"
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <string> #include <string>
@ -136,6 +136,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_; pcps_acquisition_sptr acquisition_;

View File

@ -34,11 +34,11 @@
*/ */
#include "gps_l1_ca_pcps_acquisition.h" #include "gps_l1_ca_pcps_acquisition.h"
#include "configuration_interface.h"
#include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "gnss_sdr_flags.h"
#include "acq_conf.h" #include "acq_conf.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include "gps_sdr_signal_processing.h"
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
@ -54,7 +54,6 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
in_streams_(in_streams), in_streams_(in_streams),
out_streams_(out_streams) out_streams_(out_streams)
{ {
Acq_Conf acq_parameters = Acq_Conf();
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; std::string default_item_type = "gr_complex";
std::string default_dump_filename = "./acquisition.mat"; std::string default_dump_filename = "./acquisition.mat";
@ -64,36 +63,64 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
item_type_ = configuration_->property(role + ".item_type", default_item_type); item_type_ = configuration_->property(role + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
acq_parameters.fs_in = fs_in_; acq_parameters_.fs_in = fs_in_;
acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast<float>(acq_parameters.fs_in)));
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
acq_parameters.dump = dump_; acq_parameters_.dump = dump_;
acq_parameters.dump_channel = configuration_->property(role + ".dump_channel", 0); acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0);
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters.blocking = blocking_; acq_parameters_.blocking = blocking_;
doppler_max_ = configuration_->property(role + ".doppler_max", 5000); doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
acq_parameters.doppler_max = doppler_max_; acq_parameters_.doppler_max = doppler_max_;
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
acq_parameters.sampled_ms = sampled_ms_; acq_parameters_.sampled_ms = sampled_ms_;
acq_parameters.ms_per_code = 1; acq_parameters_.ms_per_code = 1;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
acq_parameters.bit_transition_flag = bit_transition_flag_; acq_parameters_.bit_transition_flag = bit_transition_flag_;
use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_;
max_dwells_ = configuration_->property(role + ".max_dwells", 1); max_dwells_ = configuration_->property(role + ".max_dwells", 1);
acq_parameters.max_dwells = max_dwells_; acq_parameters_.max_dwells = max_dwells_;
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
acq_parameters.dump_filename = dump_filename_; acq_parameters_.dump_filename = dump_filename_;
acq_parameters.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4); acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0); acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false); acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false);
//--- Find number of samples per spreading code ------------------------- acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false);
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex")
acq_parameters.samples_per_ms = static_cast<float>(fs_in_) * 0.001; {
acq_parameters.samples_per_code = acq_parameters.samples_per_ms * static_cast<float>(GPS_L1_CA_CODE_PERIOD * 1000.0); LOG(WARNING) << "GPS L1 CA acquisition disabled the automatic resampler feature because its item_type is not set to gr_complex";
acq_parameters_.use_automatic_resampler = false;
}
if (acq_parameters_.use_automatic_resampler)
{
if (acq_parameters_.fs_in > GPS_L1_CA_OPT_ACQ_FS_HZ)
{
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GPS_L1_CA_OPT_ACQ_FS_HZ);
uint32_t decimation = acq_parameters_.fs_in / GPS_L1_CA_OPT_ACQ_FS_HZ;
while (acq_parameters_.fs_in % decimation > 0)
{
decimation--;
};
acq_parameters_.resampler_ratio = decimation;
acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast<int>(acq_parameters_.resampler_ratio);
}
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast<float>(acq_parameters_.resampled_fs)));
}
else
{
acq_parameters_.resampled_fs = fs_in_;
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast<float>(acq_parameters_.fs_in)));
}
vector_length_ = std::floor(acq_parameters.sampled_ms * acq_parameters.samples_per_ms) * (acq_parameters.bit_transition_flag ? 2 : 1); acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GPS_L1_CA_CODE_PERIOD * 1000.0);
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1);
code_ = new gr_complex[vector_length_]; code_ = new gr_complex[vector_length_];
if (item_type_ == "cshort") if (item_type_ == "cshort")
@ -105,9 +132,9 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
} }
acq_parameters.it_size = item_size_; acq_parameters_.it_size = item_size_;
acq_parameters.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false);
acquisition_ = pcps_make_acquisition(acq_parameters); acquisition_ = pcps_make_acquisition(acq_parameters_);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";
if (item_type_ == "cbyte") if (item_type_ == "cbyte")
@ -208,8 +235,14 @@ void GpsL1CaPcpsAcquisition::set_local_code()
{ {
auto* code = new std::complex<float>[code_length_]; auto* code = new std::complex<float>[code_length_];
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); if (acq_parameters_.use_automatic_resampler)
{
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, acq_parameters_.resampled_fs, 0);
}
else
{
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
}
for (unsigned int i = 0; i < sampled_ms_; i++) for (unsigned int i = 0; i < sampled_ms_; i++)
{ {
memcpy(&(code_[i * code_length_]), code, memcpy(&(code_[i * code_length_]), code,
@ -325,3 +358,8 @@ gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_right_block()
{ {
return acquisition_; return acquisition_;
} }
void GpsL1CaPcpsAcquisition::set_resampler_latency(uint32_t latency_samples)
{
acquisition_->set_resampler_latency(latency_samples);
}

View File

@ -36,10 +36,11 @@
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_
#define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_
#include "acq_conf.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "complex_byte_to_float_x2.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "pcps_acquisition.h" #include "pcps_acquisition.h"
#include "complex_byte_to_float_x2.h"
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <string> #include <string>
@ -141,9 +142,17 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
/*!
* \brief Sets the resampler latency to account it in the acquisition code delay estimation
*/
void set_resampler_latency(uint32_t latency_samples) override;
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_; pcps_acquisition_sptr acquisition_;
Acq_Conf acq_parameters_;
gr::blocks::float_to_complex::sptr float_to_complex_; gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_; complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
size_t item_size_; size_t item_size_;

View File

@ -33,11 +33,11 @@
*/ */
#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" #include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
#include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "acq_conf.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "acq_conf.h" #include "gps_sdr_signal_processing.h"
#include <glog/logging.h> #include <glog/logging.h>
using google::LogMessage; using google::LogMessage;

View File

@ -34,8 +34,8 @@
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H_ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H_
#define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H_
#include "gnss_synchro.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "gnss_synchro.h"
#include "pcps_acquisition_fine_doppler_cc.h" #include "pcps_acquisition_fine_doppler_cc.h"
#include <string> #include <string>
@ -132,6 +132,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
pcps_acquisition_fine_doppler_cc_sptr acquisition_cc_; pcps_acquisition_fine_doppler_cc_sptr acquisition_cc_;
size_t item_size_; size_t item_size_;

View File

@ -34,13 +34,13 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include "gps_l1_ca_pcps_acquisition_fpga.h"
#include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "gps_l1_ca_pcps_acquisition_fpga.h"
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h"
#include <gnuradio/fft/fft.h>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/fft/fft.h>
#include <new> #include <new>
@ -74,7 +74,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
acq_parameters.doppler_max = doppler_max_; acq_parameters.doppler_max = doppler_max_;
unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1);
acq_parameters.sampled_ms = sampled_ms; acq_parameters.sampled_ms = sampled_ms;
unsigned int code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)));
acq_parameters.code_length = code_length; acq_parameters.code_length = code_length;
// The FPGA can only use FFT lengths that are a power of two. // The FPGA can only use FFT lengths that are a power of two.
float nbits = ceilf(log2f((float)code_length)); float nbits = ceilf(log2f((float)code_length));
@ -90,10 +90,10 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
// compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
// a channel is assigned) // a channel is assigned)
gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT auto* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT
// allocate memory to compute all the PRNs and compute all the possible codes // allocate memory to compute all the PRNs and compute all the possible codes
std::complex<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code
gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search float max; // temporary maxima search
for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++)
@ -102,7 +102,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
// fill in zero padding // fill in zero padding
for (int s = code_length; s < nsamples_total; s++) for (int s = code_length; s < nsamples_total; s++)
{ {
code[s] = std::complex<float>(static_cast<float>(0, 0)); code[s] = std::complex<float>(0.0, 0.0);
//code[s] = 0; //code[s] = 0;
} }
int offset = 0; int offset = 0;

View File

@ -140,6 +140,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_acquisition_fpga_sptr acquisition_fpga_; pcps_acquisition_fpga_sptr acquisition_fpga_;

View File

@ -33,11 +33,11 @@
*/ */
#include "gps_l1_ca_pcps_assisted_acquisition.h" #include "gps_l1_ca_pcps_assisted_acquisition.h"
#include <glog/logging.h>
#include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "gps_sdr_signal_processing.h"
#include <glog/logging.h>
using google::LogMessage; using google::LogMessage;

View File

@ -34,8 +34,8 @@
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H_ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H_
#define GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H_
#include "gnss_synchro.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "gnss_synchro.h"
#include "pcps_assisted_acquisition_cc.h" #include "pcps_assisted_acquisition_cc.h"
#include <string> #include <string>
@ -128,6 +128,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
pcps_assisted_acquisition_cc_sptr acquisition_cc_; pcps_assisted_acquisition_cc_sptr acquisition_cc_;
size_t item_size_; size_t item_size_;

View File

@ -30,12 +30,12 @@
*/ */
#include "gps_l1_ca_pcps_opencl_acquisition.h" #include "gps_l1_ca_pcps_opencl_acquisition.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "gps_sdr_signal_processing.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
using google::LogMessage; using google::LogMessage;
@ -220,7 +220,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_local_code()
{ {
if (item_type_ == "gr_complex") if (item_type_ == "gr_complex")
{ {
std::complex<float>* code = new std::complex<float>[code_length_]; auto* code = new std::complex<float>[code_length_];
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
@ -261,9 +261,9 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa)
unsigned int ncells = vector_length_ * frequency_bins; unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells); double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent); double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_); auto lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist(lambda); boost::math::exponential_distribution<double> mydist(lambda);
float threshold = static_cast<float>(quantile(mydist, val)); auto threshold = static_cast<float>(quantile(mydist, val));
return threshold; return threshold;
} }

View File

@ -32,8 +32,8 @@
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_OPENCL_ACQUISITION_H_ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_OPENCL_ACQUISITION_H_
#define GNSS_SDR_GPS_L1_CA_PCPS_OPENCL_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_OPENCL_ACQUISITION_H_
#include "gnss_synchro.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "gnss_synchro.h"
#include "pcps_opencl_acquisition_cc.h" #include "pcps_opencl_acquisition_cc.h"
#include <gnuradio/blocks/stream_to_vector.h> #include <gnuradio/blocks/stream_to_vector.h>
#include <string> #include <string>
@ -130,6 +130,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_opencl_acquisition_cc_sptr acquisition_cc_; pcps_opencl_acquisition_cc_sptr acquisition_cc_;

View File

@ -31,12 +31,12 @@
*/ */
#include "gps_l1_ca_pcps_quicksync_acquisition.h" #include "gps_l1_ca_pcps_quicksync_acquisition.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "gps_sdr_signal_processing.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
using google::LogMessage; using google::LogMessage;

View File

@ -33,10 +33,10 @@
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H_ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H_
#define GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H_
#include "gnss_synchro.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "pcps_quicksync_acquisition_cc.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "gnss_synchro.h"
#include "pcps_quicksync_acquisition_cc.h"
#include <gnuradio/blocks/stream_to_vector.h> #include <gnuradio/blocks/stream_to_vector.h>
#include <string> #include <string>
@ -136,6 +136,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_quicksync_acquisition_cc_sptr acquisition_cc_; pcps_quicksync_acquisition_cc_sptr acquisition_cc_;

View File

@ -30,12 +30,12 @@
*/ */
#include "gps_l1_ca_pcps_tong_acquisition.h" #include "gps_l1_ca_pcps_tong_acquisition.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
#include "gps_sdr_signal_processing.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "gps_sdr_signal_processing.h"
#include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h>
using google::LogMessage; using google::LogMessage;

View File

@ -32,10 +32,10 @@
#ifndef GNSS_SDR_GPS_L1_CA_TONG_ACQUISITION_H_ #ifndef GNSS_SDR_GPS_L1_CA_TONG_ACQUISITION_H_
#define GNSS_SDR_GPS_L1_CA_TONG_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_TONG_ACQUISITION_H_
#include "gnss_synchro.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "pcps_tong_acquisition_cc.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "gnss_synchro.h"
#include "pcps_tong_acquisition_cc.h"
#include <gnuradio/blocks/stream_to_vector.h> #include <gnuradio/blocks/stream_to_vector.h>
#include <string> #include <string>
@ -135,6 +135,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_tong_acquisition_cc_sptr acquisition_cc_; pcps_tong_acquisition_cc_sptr acquisition_cc_;

View File

@ -32,11 +32,11 @@
*/ */
#include "gps_l2_m_pcps_acquisition.h" #include "gps_l2_m_pcps_acquisition.h"
#include "configuration_interface.h"
#include "gps_l2c_signal.h"
#include "GPS_L2C.h" #include "GPS_L2C.h"
#include "gnss_sdr_flags.h"
#include "acq_conf.h" #include "acq_conf.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include "gps_l2c_signal.h"
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
@ -52,7 +52,6 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
in_streams_(in_streams), in_streams_(in_streams),
out_streams_(out_streams) out_streams_(out_streams)
{ {
Acq_Conf acq_parameters = Acq_Conf();
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; std::string default_item_type = "gr_complex";
std::string default_dump_filename = "./acquisition.mat"; std::string default_dump_filename = "./acquisition.mat";
@ -60,42 +59,73 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
LOG(INFO) << "role " << role; LOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type); item_type_ = configuration_->property(role + ".item_type", default_item_type);
//float pfa = configuration_->property(role + ".pfa", 0.0);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
acq_parameters.fs_in = fs_in_; acq_parameters_.fs_in = fs_in_;
acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L2_M_CODE_RATE_HZ) * static_cast<float>(acq_parameters.fs_in)));
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
acq_parameters.dump = dump_; acq_parameters_.dump = dump_;
acq_parameters.dump_channel = configuration_->property(role + ".dump_channel", 0); acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0);
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters.blocking = blocking_; acq_parameters_.blocking = blocking_;
doppler_max_ = configuration->property(role + ".doppler_max", 5000); doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
acq_parameters.doppler_max = doppler_max_; acq_parameters_.doppler_max = doppler_max_;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
acq_parameters.bit_transition_flag = bit_transition_flag_; acq_parameters_.bit_transition_flag = bit_transition_flag_;
use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_;
max_dwells_ = configuration_->property(role + ".max_dwells", 1); max_dwells_ = configuration_->property(role + ".max_dwells", 1);
acq_parameters.max_dwells = max_dwells_; acq_parameters_.max_dwells = max_dwells_;
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
acq_parameters.dump_filename = dump_filename_; acq_parameters_.dump_filename = dump_filename_;
//--- Find number of samples per spreading code ------------------------- acq_parameters_.ms_per_code = 20;
acq_parameters.samples_per_ms = static_cast<float>(fs_in_) * 0.001; acq_parameters_.sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters_.ms_per_code);
acq_parameters.ms_per_code = 20; if ((acq_parameters_.sampled_ms % acq_parameters_.ms_per_code) != 0)
acq_parameters.sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters.ms_per_code);
if ((acq_parameters.sampled_ms % acq_parameters.ms_per_code) != 0)
{ {
LOG(WARNING) << "Parameter coherent_integration_time_ms should be a multiple of 20. Setting it to 20"; LOG(WARNING) << "Parameter coherent_integration_time_ms should be a multiple of 20. Setting it to 20";
acq_parameters.sampled_ms = acq_parameters.ms_per_code; acq_parameters_.sampled_ms = acq_parameters_.ms_per_code;
} }
code_length_ = acq_parameters.ms_per_code * acq_parameters.samples_per_ms; acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false);
acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false);
acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false);
if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex")
{
LOG(WARNING) << "GPS L2CM acquisition disabled the automatic resampler feature because its item_type is not set to gr_complex";
acq_parameters_.use_automatic_resampler = false;
}
if (acq_parameters_.use_automatic_resampler)
{
if (acq_parameters_.fs_in > GPS_L2C_OPT_ACQ_FS_HZ)
{
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GPS_L2C_OPT_ACQ_FS_HZ);
uint32_t decimation = acq_parameters_.fs_in / GPS_L2C_OPT_ACQ_FS_HZ;
while (acq_parameters_.fs_in % decimation > 0)
{
decimation--;
};
acq_parameters_.resampler_ratio = decimation;
acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast<int>(acq_parameters_.resampler_ratio);
}
vector_length_ = acq_parameters.sampled_ms * acq_parameters.samples_per_ms * (acq_parameters.bit_transition_flag ? 2 : 1); //--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L2_M_CODE_RATE_HZ / GPS_L2_M_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L2_M_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
}
else
{
acq_parameters_.resampled_fs = fs_in_;
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L2_M_CODE_RATE_HZ / GPS_L2_M_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L2_M_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
}
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GPS_L2_M_PERIOD * 1000.0);
vector_length_ = acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms * (acq_parameters_.bit_transition_flag ? 2 : 1);
code_ = new gr_complex[vector_length_]; code_ = new gr_complex[vector_length_];
if (item_type_ == "cshort") if (item_type_ == "cshort")
@ -107,14 +137,8 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
} }
acq_parameters.samples_per_code = acq_parameters.samples_per_ms * static_cast<float>(GPS_L2_M_PERIOD * 1000.0); acq_parameters_.it_size = item_size_;
acq_parameters.it_size = item_size_; acquisition_ = pcps_make_acquisition(acq_parameters_);
acq_parameters.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false);
acq_parameters.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false);
acquisition_ = pcps_make_acquisition(acq_parameters);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";
if (item_type_ == "cbyte") if (item_type_ == "cbyte")
@ -127,7 +151,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
threshold_ = 0.0; threshold_ = 0.0;
doppler_step_ = 0; doppler_step_ = 0;
gnss_synchro_ = nullptr; gnss_synchro_ = nullptr;
num_codes_ = acq_parameters.sampled_ms / acq_parameters.ms_per_code; num_codes_ = acq_parameters_.sampled_ms / acq_parameters_.ms_per_code;
if (in_streams_ > 1) if (in_streams_ > 1)
{ {
LOG(ERROR) << "This implementation only supports one input stream"; LOG(ERROR) << "This implementation only supports one input stream";
@ -223,7 +247,16 @@ void GpsL2MPcpsAcquisition::set_local_code()
{ {
auto* code = new std::complex<float>[code_length_]; auto* code = new std::complex<float>[code_length_];
gps_l2c_m_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_);
if (acq_parameters_.use_automatic_resampler)
{
gps_l2c_m_code_gen_complex_sampled(code, gnss_synchro_->PRN, acq_parameters_.resampled_fs);
}
else
{
gps_l2c_m_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_);
}
for (unsigned int i = 0; i < num_codes_; i++) for (unsigned int i = 0; i < num_codes_; i++)
{ {
@ -339,3 +372,7 @@ gr::basic_block_sptr GpsL2MPcpsAcquisition::get_right_block()
{ {
return acquisition_; return acquisition_;
} }
void GpsL2MPcpsAcquisition::set_resampler_latency(uint32_t latency_samples)
{
acquisition_->set_resampler_latency(latency_samples);
}

View File

@ -35,9 +35,9 @@
#define GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_H_ #define GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_H_
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "complex_byte_to_float_x2.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "pcps_acquisition.h" #include "pcps_acquisition.h"
#include "complex_byte_to_float_x2.h"
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <string> #include <string>
@ -139,9 +139,17 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
/*!
* \brief Sets the resampler latency to account it in the acquisition code delay estimation
*/
void set_resampler_latency(uint32_t latency_samples) override;
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_; pcps_acquisition_sptr acquisition_;
Acq_Conf acq_parameters_;
gr::blocks::float_to_complex::sptr float_to_complex_; gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_; complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
size_t item_size_; size_t item_size_;

View File

@ -32,10 +32,10 @@
*/ */
#include "gps_l2_m_pcps_acquisition_fpga.h" #include "gps_l2_m_pcps_acquisition_fpga.h"
#include "configuration_interface.h"
#include "gps_l2c_signal.h"
#include "GPS_L2C.h" #include "GPS_L2C.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "gps_l2c_signal.h"
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
@ -104,10 +104,10 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
// compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
// a channel is assigned) // a channel is assigned)
gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT auto* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT
// allocate memory to compute all the PRNs and compute all the possible codes // allocate memory to compute all the PRNs and compute all the possible codes
std::complex<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code auto* code = new std::complex<float>[nsamples_total]; // buffer for the local code
gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search float max; // temporary maxima search
for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++)
@ -116,7 +116,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
// fill in zero padding // fill in zero padding
for (int s = code_length; s < nsamples_total; s++) for (int s = code_length; s < nsamples_total; s++)
{ {
code[s] = std::complex<float>(static_cast<float>(0, 0)); code[s] = std::complex<float>(0.0, 0.0);
//code[s] = 0; //code[s] = 0;
} }
memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer

View File

@ -35,11 +35,11 @@
#define GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_FPGA_H_
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "complex_byte_to_float_x2.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "pcps_acquisition_fpga.h" #include "pcps_acquisition_fpga.h"
#include "complex_byte_to_float_x2.h"
#include <gnuradio/blocks/stream_to_vector.h>
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/stream_to_vector.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <string> #include <string>
@ -140,6 +140,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
//pcps_acquisition_sptr acquisition_; //pcps_acquisition_sptr acquisition_;

View File

@ -32,11 +32,11 @@
*/ */
#include "gps_l5i_pcps_acquisition.h" #include "gps_l5i_pcps_acquisition.h"
#include "configuration_interface.h"
#include "gps_l5_signal.h"
#include "GPS_L5.h" #include "GPS_L5.h"
#include "gnss_sdr_flags.h"
#include "acq_conf.h" #include "acq_conf.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include "gps_l5_signal.h"
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
@ -52,7 +52,6 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
in_streams_(in_streams), in_streams_(in_streams),
out_streams_(out_streams) out_streams_(out_streams)
{ {
Acq_Conf acq_parameters = Acq_Conf();
configuration_ = configuration; configuration_ = configuration;
std::string default_item_type = "gr_complex"; std::string default_item_type = "gr_complex";
std::string default_dump_filename = "./acquisition.mat"; std::string default_dump_filename = "./acquisition.mat";
@ -63,32 +62,24 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
acq_parameters.fs_in = fs_in_; acq_parameters_.fs_in = fs_in_;
acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters.fs_in)));
dump_ = configuration_->property(role + ".dump", false); dump_ = configuration_->property(role + ".dump", false);
acq_parameters.dump = dump_; acq_parameters_.dump = dump_;
acq_parameters.dump_channel = configuration_->property(role + ".dump_channel", 0); acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0);
blocking_ = configuration_->property(role + ".blocking", true); blocking_ = configuration_->property(role + ".blocking", true);
acq_parameters.blocking = blocking_; acq_parameters_.blocking = blocking_;
doppler_max_ = configuration->property(role + ".doppler_max", 5000); doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
acq_parameters.doppler_max = doppler_max_; acq_parameters_.doppler_max = doppler_max_;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
acq_parameters.bit_transition_flag = bit_transition_flag_; acq_parameters_.bit_transition_flag = bit_transition_flag_;
use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_;
max_dwells_ = configuration_->property(role + ".max_dwells", 1); max_dwells_ = configuration_->property(role + ".max_dwells", 1);
acq_parameters.max_dwells = max_dwells_; acq_parameters_.max_dwells = max_dwells_;
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
acq_parameters.dump_filename = dump_filename_; acq_parameters_.dump_filename = dump_filename_;
acq_parameters.sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); acq_parameters_.sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1);
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS)));
acq_parameters.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters.samples_per_code = acq_parameters.samples_per_ms * static_cast<float>(GPS_L5i_PERIOD * 1000.0);
vector_length_ = std::floor(acq_parameters.sampled_ms * acq_parameters.samples_per_ms) * (acq_parameters.bit_transition_flag ? 2 : 1);
code_ = new gr_complex[vector_length_];
if (item_type_ == "cshort") if (item_type_ == "cshort")
{ {
@ -99,14 +90,51 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
} }
acq_parameters.ms_per_code = 1; acq_parameters_.ms_per_code = 1;
acq_parameters.it_size = item_size_; acq_parameters_.it_size = item_size_;
num_codes_ = acq_parameters.sampled_ms; num_codes_ = acq_parameters_.sampled_ms;
acq_parameters.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4); acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4);
acq_parameters.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0); acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0);
acq_parameters.make_2_steps = configuration_->property(role + ".make_two_steps", false); acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false);
acq_parameters.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false);
acquisition_ = pcps_make_acquisition(acq_parameters); acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false);
if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex")
{
LOG(WARNING) << "GPS L5 acquisition disabled the automatic resampler feature because its item_type is not set to gr_complex";
acq_parameters_.use_automatic_resampler = false;
}
if (acq_parameters_.use_automatic_resampler)
{
if (acq_parameters_.fs_in > GPS_L5_OPT_ACQ_FS_HZ)
{
acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GPS_L5_OPT_ACQ_FS_HZ);
uint32_t decimation = acq_parameters_.fs_in / GPS_L5_OPT_ACQ_FS_HZ;
while (acq_parameters_.fs_in % decimation > 0)
{
decimation--;
};
acq_parameters_.resampler_ratio = decimation;
acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast<int>(acq_parameters_.resampler_ratio);
}
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.resampled_fs)));
}
else
{
acq_parameters_.resampled_fs = fs_in_;
//--- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS)));
acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast<float>(acq_parameters_.fs_in)));
}
acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast<float>(GPS_L5i_PERIOD * 1000.0);
vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1);
code_ = new gr_complex[vector_length_];
acquisition_ = pcps_make_acquisition(acq_parameters_);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";
if (item_type_ == "cbyte") if (item_type_ == "cbyte")
@ -114,6 +142,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
float_to_complex_ = gr::blocks::float_to_complex::make(); float_to_complex_ = gr::blocks::float_to_complex::make();
} }
channel_ = 0; channel_ = 0;
threshold_ = 0.0; threshold_ = 0.0;
doppler_step_ = 0; doppler_step_ = 0;
@ -211,7 +240,15 @@ void GpsL5iPcpsAcquisition::set_local_code()
{ {
auto* code = new std::complex<float>[code_length_]; auto* code = new std::complex<float>[code_length_];
gps_l5i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_);
if (acq_parameters_.use_automatic_resampler)
{
gps_l5i_code_gen_complex_sampled(code, gnss_synchro_->PRN, acq_parameters_.resampled_fs);
}
else
{
gps_l5i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_);
}
for (unsigned int i = 0; i < num_codes_; i++) for (unsigned int i = 0; i < num_codes_; i++)
{ {
@ -327,3 +364,8 @@ gr::basic_block_sptr GpsL5iPcpsAcquisition::get_right_block()
{ {
return acquisition_; return acquisition_;
} }
void GpsL5iPcpsAcquisition::set_resampler_latency(uint32_t latency_samples)
{
acquisition_->set_resampler_latency(latency_samples);
}

View File

@ -35,9 +35,9 @@
#define GNSS_SDR_GPS_L5i_PCPS_ACQUISITION_H_ #define GNSS_SDR_GPS_L5i_PCPS_ACQUISITION_H_
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "complex_byte_to_float_x2.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "pcps_acquisition.h" #include "pcps_acquisition.h"
#include "complex_byte_to_float_x2.h"
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <string> #include <string>
@ -139,9 +139,16 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
/*!
* \brief Sets the resampler latency to account it in the acquisition code delay estimation
*/
void set_resampler_latency(uint32_t latency_samples) override;
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
pcps_acquisition_sptr acquisition_; pcps_acquisition_sptr acquisition_;
Acq_Conf acq_parameters_;
gr::blocks::float_to_complex::sptr float_to_complex_; gr::blocks::float_to_complex::sptr float_to_complex_;
complex_byte_to_float_x2_sptr cbyte_to_float_x2_; complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
size_t item_size_; size_t item_size_;

View File

@ -32,10 +32,10 @@
*/ */
#include "gps_l5i_pcps_acquisition_fpga.h" #include "gps_l5i_pcps_acquisition_fpga.h"
#include "configuration_interface.h"
#include "gps_l5_signal.h"
#include "GPS_L5.h" #include "GPS_L5.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h" #include "gnss_sdr_flags.h"
#include "gps_l5_signal.h"
#include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/exponential.hpp>
#include <glog/logging.h> #include <glog/logging.h>
@ -89,7 +89,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
//dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); //dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
//acq_parameters.dump_filename = dump_filename_; //acq_parameters.dump_filename = dump_filename_;
//--- Find number of samples per spreading code ------------------------- //--- Find number of samples per spreading code -------------------------
unsigned int code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5i_CODE_RATE_HZ / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS)))); auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5i_CODE_RATE_HZ / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS))));
acq_parameters.code_length = code_length; acq_parameters.code_length = code_length;
// The FPGA can only use FFT lengths that are a power of two. // The FPGA can only use FFT lengths that are a power of two.
float nbits = ceilf(log2f((float)code_length)); float nbits = ceilf(log2f((float)code_length));
@ -105,11 +105,11 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
//printf("L5 ACQ CLASS MID 01\n"); //printf("L5 ACQ CLASS MID 01\n");
// compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
// a channel is assigned) // a channel is assigned)
gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT auto* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT
//printf("L5 ACQ CLASS MID 02\n"); //printf("L5 ACQ CLASS MID 02\n");
std::complex<float>* code = new gr_complex[vector_length]; auto* code = new gr_complex[vector_length];
//printf("L5 ACQ CLASS MID 03\n"); //printf("L5 ACQ CLASS MID 03\n");
gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
//printf("L5 ACQ CLASS MID 04\n"); //printf("L5 ACQ CLASS MID 04\n");
d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32
@ -124,7 +124,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
// fill in zero padding // fill in zero padding
for (int s = code_length; s < nsamples_total; s++) for (int s = code_length; s < nsamples_total; s++)
{ {
code[s] = std::complex<float>(static_cast<float>(0, 0)); code[s] = std::complex<float>(0.0, 0.0);
//code[s] = 0; //code[s] = 0;
} }
memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer

View File

@ -35,11 +35,11 @@
#define GNSS_SDR_GPS_L5i_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GPS_L5i_PCPS_ACQUISITION_FPGA_H_
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "complex_byte_to_float_x2.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "pcps_acquisition_fpga.h" #include "pcps_acquisition_fpga.h"
#include "complex_byte_to_float_x2.h"
#include <gnuradio/blocks/stream_to_vector.h>
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/stream_to_vector.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <string> #include <string>
@ -140,6 +140,8 @@ public:
*/ */
void stop_acquisition() override; void stop_acquisition() override;
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private: private:
ConfigurationInterface* configuration_; ConfigurationInterface* configuration_;
//pcps_acquisition_sptr acquisition_; //pcps_acquisition_sptr acquisition_;

View File

@ -38,12 +38,12 @@
#ifndef GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H_ #ifndef GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H_
#define GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H_ #define GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H_
#include "gnss_synchro.h"
#include <gnuradio/block.h>
#include <gnuradio/fft/fft.h>
#include <gnuradio/gr_complex.h>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <gnuradio/block.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/fft/fft.h>
#include "gnss_synchro.h"
class galileo_e5a_noncoherentIQ_acquisition_caf_cc; class galileo_e5a_noncoherentIQ_acquisition_caf_cc;

View File

@ -30,13 +30,13 @@
*/ */
#include "galileo_pcps_8ms_acquisition_cc.h" #include "galileo_pcps_8ms_acquisition_cc.h"
#include <sstream> #include "control_message_factory.h"
#include <utility>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include "control_message_factory.h" #include <sstream>
#include <utility>
using google::LogMessage; using google::LogMessage;

View File

@ -32,12 +32,12 @@
#ifndef GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H_ #ifndef GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H_
#define GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H_
#include "gnss_synchro.h"
#include <gnuradio/block.h>
#include <gnuradio/fft/fft.h>
#include <gnuradio/gr_complex.h>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <gnuradio/block.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/fft/fft.h>
#include "gnss_synchro.h"
class galileo_pcps_8ms_acquisition_cc; class galileo_pcps_8ms_acquisition_cc;

View File

@ -221,6 +221,12 @@ pcps_acquisition::~pcps_acquisition()
} }
void pcps_acquisition::set_resampler_latency(uint32_t latency_samples)
{
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
acq_parameters.resampler_latency_samples = latency_samples;
}
void pcps_acquisition::set_local_code(std::complex<float>* code) void pcps_acquisition::set_local_code(std::complex<float>* code)
{ {
// reset the intermediate frequency // reset the intermediate frequency
@ -280,7 +286,15 @@ bool pcps_acquisition::is_fdma()
void pcps_acquisition::update_local_carrier(gr_complex* carrier_vector, int32_t correlator_length_samples, float freq) void pcps_acquisition::update_local_carrier(gr_complex* carrier_vector, int32_t correlator_length_samples, float freq)
{ {
float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(acq_parameters.fs_in); float phase_step_rad;
if (acq_parameters.use_automatic_resampler)
{
phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(acq_parameters.resampled_fs);
}
else
{
phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(acq_parameters.fs_in);
}
float _phase[1]; float _phase[1];
_phase[0] = 0.0; _phase[0] = 0.0;
volk_gnsssdr_s32f_sincos_32fc(carrier_vector, -phase_step_rad, _phase, correlator_length_samples); volk_gnsssdr_s32f_sincos_32fc(carrier_vector, -phase_step_rad, _phase, correlator_length_samples);
@ -716,9 +730,20 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
{ {
d_test_statistics = first_vs_second_peak_statistic(indext, doppler, d_num_doppler_bins, acq_parameters.doppler_max, d_doppler_step); d_test_statistics = first_vs_second_peak_statistic(indext, doppler, d_num_doppler_bins, acq_parameters.doppler_max, d_doppler_step);
} }
d_gnss_synchro->Acq_delay_samples = static_cast<double>(std::fmod(static_cast<float>(indext), acq_parameters.samples_per_code)); if (acq_parameters.use_automatic_resampler)
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler); {
d_gnss_synchro->Acq_samplestamp_samples = samp_count; //take into account the acquisition resampler ratio
d_gnss_synchro->Acq_delay_samples = static_cast<double>(std::fmod(static_cast<float>(indext), acq_parameters.samples_per_code)) * acq_parameters.resampler_ratio;
d_gnss_synchro->Acq_delay_samples -= static_cast<double>(acq_parameters.resampler_latency_samples); //account the resampler filter latency
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
d_gnss_synchro->Acq_samplestamp_samples = rint(static_cast<double>(samp_count) * acq_parameters.resampler_ratio);
}
else
{
d_gnss_synchro->Acq_delay_samples = static_cast<double>(std::fmod(static_cast<float>(indext), acq_parameters.samples_per_code));
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
d_gnss_synchro->Acq_samplestamp_samples = samp_count;
}
} }
else else
{ {
@ -762,10 +787,23 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
{ {
d_test_statistics = first_vs_second_peak_statistic(indext, doppler, d_num_doppler_bins_step2, static_cast<int32_t>(d_doppler_center_step_two - (static_cast<float>(d_num_doppler_bins_step2) / 2.0) * acq_parameters.doppler_step2), acq_parameters.doppler_step2); d_test_statistics = first_vs_second_peak_statistic(indext, doppler, d_num_doppler_bins_step2, static_cast<int32_t>(d_doppler_center_step_two - (static_cast<float>(d_num_doppler_bins_step2) / 2.0) * acq_parameters.doppler_step2), acq_parameters.doppler_step2);
} }
d_gnss_synchro->Acq_delay_samples = static_cast<double>(std::fmod(static_cast<float>(indext), acq_parameters.samples_per_code));
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler); if (acq_parameters.use_automatic_resampler)
d_gnss_synchro->Acq_samplestamp_samples = samp_count; {
d_gnss_synchro->Acq_doppler_step = acq_parameters.doppler_step2; //take into account the acquisition resampler ratio
d_gnss_synchro->Acq_delay_samples = static_cast<double>(std::fmod(static_cast<float>(indext), acq_parameters.samples_per_code)) * acq_parameters.resampler_ratio;
d_gnss_synchro->Acq_delay_samples -= static_cast<double>(acq_parameters.resampler_latency_samples); //account the resampler filter latency
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
d_gnss_synchro->Acq_samplestamp_samples = rint(static_cast<double>(samp_count) * acq_parameters.resampler_ratio);
d_gnss_synchro->Acq_doppler_step = acq_parameters.doppler_step2;
}
else
{
d_gnss_synchro->Acq_delay_samples = static_cast<double>(std::fmod(static_cast<float>(indext), acq_parameters.samples_per_code));
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
d_gnss_synchro->Acq_samplestamp_samples = samp_count;
d_gnss_synchro->Acq_doppler_step = acq_parameters.doppler_step2;
}
} }
lk.lock(); lk.lock();
@ -865,6 +903,12 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
} }
} }
// Called by gnuradio to enable drivers, etc for i/o devices.
bool pcps_acquisition::start()
{
d_sample_counter = 0ULL;
return true;
}
int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, gr_vector_int& ninput_items, gr_vector_const_void_star& input_items,

View File

@ -52,8 +52,8 @@
#ifndef GNSS_SDR_PCPS_ACQUISITION_H_ #ifndef GNSS_SDR_PCPS_ACQUISITION_H_
#define GNSS_SDR_PCPS_ACQUISITION_H_ #define GNSS_SDR_PCPS_ACQUISITION_H_
#include "gnss_synchro.h"
#include "acq_conf.h" #include "acq_conf.h"
#include "gnss_synchro.h"
#include <armadillo> #include <armadillo>
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <gnuradio/fft/fft.h> #include <gnuradio/fft/fft.h>
@ -98,6 +98,9 @@ private:
float first_vs_second_peak_statistic(uint32_t& indext, int32_t& doppler, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step); float first_vs_second_peak_statistic(uint32_t& indext, int32_t& doppler, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step);
float max_to_input_power_statistic(uint32_t& indext, int32_t& doppler, float input_power, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step); float max_to_input_power_statistic(uint32_t& indext, int32_t& doppler, float input_power, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step);
bool start();
Acq_Conf acq_parameters; Acq_Conf acq_parameters;
bool d_active; bool d_active;
bool d_worker_active; bool d_worker_active;
@ -233,6 +236,9 @@ public:
d_doppler_step = doppler_step; d_doppler_step = doppler_step;
} }
void set_resampler_latency(uint32_t latency_samples);
/*! /*!
* \brief Parallel Code Phase Search Acquisition signal processing. * \brief Parallel Code Phase Search Acquisition signal processing.
*/ */

View File

@ -31,18 +31,18 @@
*/ */
#include "pcps_acquisition_fine_doppler_cc.h" #include "pcps_acquisition_fine_doppler_cc.h"
#include "gps_sdr_signal_processing.h"
#include "control_message_factory.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "control_message_factory.h"
#include "gnss_sdr_create_directory.h" #include "gnss_sdr_create_directory.h"
#include "gps_sdr_signal_processing.h"
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <matio.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm> // std::rotate, std::fill_n #include <algorithm> // std::rotate, std::fill_n
#include <sstream> #include <sstream>
#include <matio.h>
using google::LogMessage; using google::LogMessage;

View File

@ -49,12 +49,12 @@
#ifndef GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_ #ifndef GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_
#define GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_ #define GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_
#include "gnss_synchro.h"
#include "acq_conf.h" #include "acq_conf.h"
#include "gnss_synchro.h"
#include <armadillo> #include <armadillo>
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/fft/fft.h> #include <gnuradio/fft/fft.h>
#include <gnuradio/gr_complex.h>
#include <fstream> #include <fstream>
#include <string> #include <string>

View File

@ -39,9 +39,10 @@
*/ */
#include "pcps_acquisition_fpga.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include "pcps_acquisition_fpga.h" #include <utility>
#define AQ_DOWNSAMPLING_DELAY 40 // delay due to the downsampling filter in the acquisition #define AQ_DOWNSAMPLING_DELAY 40 // delay due to the downsampling filter in the acquisition
@ -50,7 +51,7 @@ using google::LogMessage;
pcps_acquisition_fpga_sptr pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_) pcps_acquisition_fpga_sptr pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_)
{ {
return pcps_acquisition_fpga_sptr(new pcps_acquisition_fpga(conf_)); return pcps_acquisition_fpga_sptr(new pcps_acquisition_fpga(std::move(conf_)));
} }
@ -61,7 +62,7 @@ pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) : gr::block(
// printf("acq constructor start\n"); // printf("acq constructor start\n");
this->message_port_register_out(pmt::mp("events")); this->message_port_register_out(pmt::mp("events"));
acq_parameters = conf_; acq_parameters = std::move(conf_);
d_sample_counter = 0ULL; // SAMPLE COUNTER d_sample_counter = 0ULL; // SAMPLE COUNTER
d_active = false; d_active = false;
d_state = 0; d_state = 0;
@ -74,7 +75,7 @@ pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) : gr::block(
d_doppler_step = 0U; d_doppler_step = 0U;
d_test_statistics = 0.0; d_test_statistics = 0.0;
d_channel = 0U; d_channel = 0U;
d_gnss_synchro = 0; d_gnss_synchro = nullptr;
//printf("zzzz acq_parameters.code_length = %d\n", acq_parameters.code_length); //printf("zzzz acq_parameters.code_length = %d\n", acq_parameters.code_length);
//printf("zzzz acq_parameters.samples_per_ms = %d\n", acq_parameters.samples_per_ms); //printf("zzzz acq_parameters.samples_per_ms = %d\n", acq_parameters.samples_per_ms);
@ -256,7 +257,7 @@ void pcps_acquisition_fpga::set_active(bool active)
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler); d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter;
d_test_statistics = (d_mag / d_input_power); //* correction_factor; d_test_statistics = (d_mag / d_input_power); // correction_factor;
} }
// In the case of the FPGA the option of dumping the results of the acquisition to a file is not available // In the case of the FPGA the option of dumping the results of the acquisition to a file is not available

View File

@ -31,16 +31,16 @@
*/ */
#include "pcps_assisted_acquisition_cc.h" #include "pcps_assisted_acquisition_cc.h"
#include <sstream> #include "GPS_L1_CA.h"
#include <utility> #include "concurrent_map.h"
#include "control_message_factory.h"
#include "gps_acq_assist.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include "concurrent_map.h" #include <sstream>
#include "control_message_factory.h" #include <utility>
#include "gps_acq_assist.h"
#include "GPS_L1_CA.h"
extern concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map; extern concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;

View File

@ -48,12 +48,12 @@
#ifndef GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H_ #ifndef GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H_
#define GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H_
#include "gnss_synchro.h"
#include <gnuradio/block.h>
#include <gnuradio/fft/fft.h>
#include <gnuradio/gr_complex.h>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <gnuradio/block.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/fft/fft.h>
#include "gnss_synchro.h"
class pcps_assisted_acquisition_cc; class pcps_assisted_acquisition_cc;

View File

@ -35,8 +35,8 @@
*/ */
#include "pcps_cccwsr_acquisition_cc.h" #include "pcps_cccwsr_acquisition_cc.h"
#include "control_message_factory.h"
#include "GPS_L1_CA.h" // GPS_TWO_PI #include "GPS_L1_CA.h" // GPS_TWO_PI
#include "control_message_factory.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>

View File

@ -37,12 +37,12 @@
#ifndef GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H_ #ifndef GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H_
#define GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H_
#include "gnss_synchro.h"
#include <gnuradio/block.h>
#include <gnuradio/fft/fft.h>
#include <gnuradio/gr_complex.h>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <gnuradio/block.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/fft/fft.h>
#include "gnss_synchro.h"
class pcps_cccwsr_acquisition_cc; class pcps_cccwsr_acquisition_cc;

View File

@ -49,10 +49,10 @@
*/ */
#include "pcps_opencl_acquisition_cc.h" #include "pcps_opencl_acquisition_cc.h"
#include "GPS_L1_CA.h" //GPS_TWO_PI
#include "control_message_factory.h" #include "control_message_factory.h"
#include "opencl/fft_base_kernels.h" #include "opencl/fft_base_kernels.h"
#include "opencl/fft_internal.h" #include "opencl/fft_internal.h"
#include "GPS_L1_CA.h" //GPS_TWO_PI
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
@ -61,13 +61,14 @@
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <utility>
using google::LogMessage; using google::LogMessage;
pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc( pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc(
unsigned int sampled_ms, unsigned int max_dwells, uint32_t sampled_ms, uint32_t max_dwells,
unsigned int doppler_max, long fs_in, uint32_t doppler_max, int64_t fs_in,
int samples_per_ms, int samples_per_code, int samples_per_ms, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
bool dump, bool dump,
@ -75,15 +76,15 @@ pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc(
{ {
return pcps_opencl_acquisition_cc_sptr( return pcps_opencl_acquisition_cc_sptr(
new pcps_opencl_acquisition_cc(sampled_ms, max_dwells, doppler_max, fs_in, samples_per_ms, new pcps_opencl_acquisition_cc(sampled_ms, max_dwells, doppler_max, fs_in, samples_per_ms,
samples_per_code, bit_transition_flag, dump, dump_filename)); samples_per_code, bit_transition_flag, dump, std::move(dump_filename)));
} }
pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc( pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc(
unsigned int sampled_ms, uint32_t sampled_ms,
unsigned int max_dwells, uint32_t max_dwells,
unsigned int doppler_max, uint32_t doppler_max,
long fs_in, int64_t fs_in,
int samples_per_ms, int samples_per_ms,
int samples_per_code, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
@ -114,7 +115,7 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc(
d_cl_fft_batch_size = 1; d_cl_fft_batch_size = 1;
d_in_buffer = new gr_complex *[d_max_dwells]; d_in_buffer = new gr_complex *[d_max_dwells];
for (unsigned int i = 0; i < d_max_dwells; i++) for (uint32_t i = 0; i < d_max_dwells; i++)
{ {
d_in_buffer[i] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_in_buffer[i] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
} }
@ -122,7 +123,7 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc(
d_fft_codes = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size_pow2 * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_fft_codes = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size_pow2 * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_zero_vector = static_cast<gr_complex *>(volk_gnsssdr_malloc((d_fft_size_pow2 - d_fft_size) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_zero_vector = static_cast<gr_complex *>(volk_gnsssdr_malloc((d_fft_size_pow2 - d_fft_size) * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
for (unsigned int i = 0; i < (d_fft_size_pow2 - d_fft_size); i++) for (uint32_t i = 0; i < (d_fft_size_pow2 - d_fft_size); i++)
{ {
d_zero_vector[i] = gr_complex(0.0, 0.0); d_zero_vector[i] = gr_complex(0.0, 0.0);
} }
@ -140,7 +141,7 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc(
// For dumping samples into a file // For dumping samples into a file
d_dump = dump; d_dump = dump;
d_dump_filename = dump_filename; d_dump_filename = std::move(dump_filename);
} }
@ -148,14 +149,14 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc()
{ {
if (d_num_doppler_bins > 0) if (d_num_doppler_bins > 0)
{ {
for (unsigned int i = 0; i < d_num_doppler_bins; i++) for (uint32_t i = 0; i < d_num_doppler_bins; i++)
{ {
volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]); volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]);
} }
delete[] d_grid_doppler_wipeoffs; delete[] d_grid_doppler_wipeoffs;
} }
for (unsigned int i = 0; i < d_max_dwells; i++) for (uint32_t i = 0; i < d_max_dwells; i++)
{ {
volk_gnsssdr_free(d_in_buffer[i]); volk_gnsssdr_free(d_in_buffer[i]);
} }
@ -193,7 +194,7 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc()
} }
int pcps_opencl_acquisition_cc::init_opencl_environment(std::string kernel_filename) int pcps_opencl_acquisition_cc::init_opencl_environment(const std::string &kernel_filename)
{ {
//get all platforms (drivers) //get all platforms (drivers)
std::vector<cl::Platform> all_platforms; std::vector<cl::Platform> all_platforms;
@ -313,7 +314,7 @@ void pcps_opencl_acquisition_cc::init()
d_cl_buffer_grid_doppler_wipeoffs = new cl::Buffer *[d_num_doppler_bins]; d_cl_buffer_grid_doppler_wipeoffs = new cl::Buffer *[d_num_doppler_bins];
} }
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex *>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
@ -359,7 +360,7 @@ void pcps_opencl_acquisition_cc::set_local_code(std::complex<float> *code)
clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size, clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size,
clFFT_Forward, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(), clFFT_Forward, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(),
0, NULL, NULL); 0, nullptr, nullptr);
//Conjucate the local code //Conjucate the local code
cl::Kernel kernel = cl::Kernel(d_cl_program, "conj_vector"); cl::Kernel kernel = cl::Kernel(d_cl_program, "conj_vector");
@ -406,7 +407,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk()
d_input_power /= static_cast<float>(d_fft_size); d_input_power /= static_cast<float>(d_fft_size);
// 2- Doppler frequency search loop // 2- Doppler frequency search loop
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
// doppler search steps // doppler search steps
doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index; doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
@ -542,7 +543,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
cl::Kernel kernel; cl::Kernel kernel;
// 2- Doppler frequency search loop // 2- Doppler frequency search loop
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
// doppler search steps // doppler search steps
@ -562,7 +563,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size, clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size,
clFFT_Forward, (*d_cl_buffer_1)(), (*d_cl_buffer_2)(), clFFT_Forward, (*d_cl_buffer_1)(), (*d_cl_buffer_2)(),
0, NULL, NULL); 0, nullptr, nullptr);
// Multiply carrier wiped--off, Fourier transformed incoming signal // Multiply carrier wiped--off, Fourier transformed incoming signal
// with the local FFT'd code reference // with the local FFT'd code reference
@ -576,7 +577,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
// compute the inverse FFT // compute the inverse FFT
clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size, clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size,
clFFT_Inverse, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(), clFFT_Inverse, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(),
0, NULL, NULL); 0, nullptr, nullptr);
// Compute magnitude // Compute magnitude
kernel = cl::Kernel(d_cl_program, "magnitude_squared"); kernel = cl::Kernel(d_cl_program, "magnitude_squared");
@ -735,8 +736,8 @@ int pcps_opencl_acquisition_cc::general_work(int noutput_items,
// Fill internal buffer with d_max_dwells signal blocks. This step ensures that // Fill internal buffer with d_max_dwells signal blocks. This step ensures that
// consecutive signal blocks will be processed in multi-dwell operation. This is // consecutive signal blocks will be processed in multi-dwell operation. This is
// essential when d_bit_transition_flag = true. // essential when d_bit_transition_flag = true.
unsigned int num_dwells = std::min(static_cast<int>(d_max_dwells - d_in_dwell_count), ninput_items[0]); uint32_t num_dwells = std::min(static_cast<int>(d_max_dwells - d_in_dwell_count), ninput_items[0]);
for (unsigned int i = 0; i < num_dwells; i++) for (uint32_t i = 0; i < num_dwells; i++)
{ {
memcpy(d_in_buffer[d_in_dwell_count++], static_cast<const gr_complex *>(input_items[i]), memcpy(d_in_buffer[d_in_dwell_count++], static_cast<const gr_complex *>(input_items[i]),
sizeof(gr_complex) * d_fft_size); sizeof(gr_complex) * d_fft_size);

View File

@ -54,8 +54,9 @@
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include "opencl/fft_internal.h" #include "opencl/fft_internal.h"
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/fft/fft.h> #include <gnuradio/fft/fft.h>
#include <gnuradio/gr_complex.h>
#include <cstdint>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <vector> #include <vector>
@ -71,8 +72,8 @@ class pcps_opencl_acquisition_cc;
typedef boost::shared_ptr<pcps_opencl_acquisition_cc> pcps_opencl_acquisition_cc_sptr; typedef boost::shared_ptr<pcps_opencl_acquisition_cc> pcps_opencl_acquisition_cc_sptr;
pcps_opencl_acquisition_cc_sptr pcps_opencl_acquisition_cc_sptr
pcps_make_opencl_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, pcps_make_opencl_acquisition_cc(uint32_t sampled_ms, uint32_t max_dwells,
unsigned int doppler_max, long fs_in, uint32_t doppler_max, int64_t fs_in,
int samples_per_ms, int samples_per_code, int samples_per_ms, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
bool dump, bool dump,
@ -88,15 +89,15 @@ class pcps_opencl_acquisition_cc : public gr::block
{ {
private: private:
friend pcps_opencl_acquisition_cc_sptr friend pcps_opencl_acquisition_cc_sptr
pcps_make_opencl_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, pcps_make_opencl_acquisition_cc(uint32_t sampled_ms, uint32_t max_dwells,
unsigned int doppler_max, long fs_in, uint32_t doppler_max, int64_t fs_in,
int samples_per_ms, int samples_per_code, int samples_per_ms, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
bool dump, bool dump,
std::string dump_filename); std::string dump_filename);
pcps_opencl_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, pcps_opencl_acquisition_cc(uint32_t sampled_ms, uint32_t max_dwells,
unsigned int doppler_max, long fs_in, uint32_t doppler_max, int64_t fs_in,
int samples_per_ms, int samples_per_code, int samples_per_ms, int samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
bool dump, bool dump,
@ -105,30 +106,30 @@ private:
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
int doppler_offset); int doppler_offset);
int init_opencl_environment(std::string kernel_filename); int init_opencl_environment(const std::string& kernel_filename);
long d_fs_in; int64_t d_fs_in;
int d_samples_per_ms; int d_samples_per_ms;
int d_samples_per_code; int d_samples_per_code;
unsigned int d_doppler_resolution; uint32_t d_doppler_resolution;
float d_threshold; float d_threshold;
std::string d_satellite_str; std::string d_satellite_str;
unsigned int d_doppler_max; uint32_t d_doppler_max;
unsigned int d_doppler_step; uint32_t d_doppler_step;
unsigned int d_sampled_ms; uint32_t d_sampled_ms;
unsigned int d_max_dwells; uint32_t d_max_dwells;
unsigned int d_well_count; uint32_t d_well_count;
unsigned int d_fft_size; uint32_t d_fft_size;
unsigned int d_fft_size_pow2; uint32_t d_fft_size_pow2;
int* d_max_doppler_indexs; int* d_max_doppler_indexs;
uint64_t d_sample_counter; uint64_t d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs; gr_complex** d_grid_doppler_wipeoffs;
unsigned int d_num_doppler_bins; uint32_t d_num_doppler_bins;
gr_complex* d_fft_codes; gr_complex* d_fft_codes;
gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_fft_if;
gr::fft::fft_complex* d_ifft; gr::fft::fft_complex* d_ifft;
Gnss_Synchro* d_gnss_synchro; Gnss_Synchro* d_gnss_synchro;
unsigned int d_code_phase; uint32_t d_code_phase;
float d_doppler_freq; float d_doppler_freq;
float d_mag; float d_mag;
float* d_magnitude; float* d_magnitude;
@ -140,12 +141,12 @@ private:
int d_state; int d_state;
bool d_core_working; bool d_core_working;
bool d_dump; bool d_dump;
unsigned int d_channel; uint32_t d_channel;
std::string d_dump_filename; std::string d_dump_filename;
gr_complex* d_zero_vector; gr_complex* d_zero_vector;
gr_complex** d_in_buffer; gr_complex** d_in_buffer;
std::vector<uint64_t> d_sample_counter_buffer; std::vector<uint64_t> d_sample_counter_buffer;
unsigned int d_in_dwell_count; uint32_t d_in_dwell_count;
cl::Platform d_cl_platform; cl::Platform d_cl_platform;
cl::Device d_cl_device; cl::Device d_cl_device;
@ -182,7 +183,7 @@ public:
/*! /*!
* \brief Returns the maximum peak of grid search. * \brief Returns the maximum peak of grid search.
*/ */
inline unsigned int mag() const inline uint32_t mag() const
{ {
return d_mag; return d_mag;
} }
@ -219,7 +220,7 @@ public:
* \brief Set acquisition channel unique ID * \brief Set acquisition channel unique ID
* \param channel - receiver channel. * \param channel - receiver channel.
*/ */
inline void set_channel(unsigned int channel) inline void set_channel(uint32_t channel)
{ {
d_channel = channel; d_channel = channel;
} }
@ -238,7 +239,7 @@ public:
* \brief Set maximum Doppler grid search * \brief Set maximum Doppler grid search
* \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
*/ */
inline void set_doppler_max(unsigned int doppler_max) inline void set_doppler_max(uint32_t doppler_max)
{ {
d_doppler_max = doppler_max; d_doppler_max = doppler_max;
} }
@ -247,7 +248,7 @@ public:
* \brief Set Doppler steps for the grid search * \brief Set Doppler steps for the grid search
* \param doppler_step - Frequency bin of the search grid [Hz]. * \param doppler_step - Frequency bin of the search grid [Hz].
*/ */
inline void set_doppler_step(unsigned int doppler_step) inline void set_doppler_step(uint32_t doppler_step)
{ {
d_doppler_step = doppler_step; d_doppler_step = doppler_step;
} }

View File

@ -29,10 +29,10 @@
*/ */
#include "pcps_quicksync_acquisition_cc.h" #include "pcps_quicksync_acquisition_cc.h"
#include "control_message_factory.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include <gnuradio/io_signature.h> #include "control_message_factory.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h> #include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath> #include <cmath>
@ -247,7 +247,7 @@ void pcps_quicksync_acquisition_cc::set_state(int32_t state)
d_mag = 0.0; d_mag = 0.0;
d_input_power = 0.0; d_input_power = 0.0;
d_test_statistics = 0.0; d_test_statistics = 0.0;
d_active = 1; d_active = true;
} }
else if (d_state == 0) else if (d_state == 0)
{ {

View File

@ -53,13 +53,13 @@
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/fft/fft.h> #include <gnuradio/fft/fft.h>
#include <fstream> #include <gnuradio/gr_complex.h>
#include <string>
#include <algorithm> #include <algorithm>
#include <functional>
#include <cassert> #include <cassert>
#include <fstream>
#include <functional>
#include <string>
class pcps_quicksync_acquisition_cc; class pcps_quicksync_acquisition_cc;
@ -90,17 +90,17 @@ class pcps_quicksync_acquisition_cc : public gr::block
{ {
private: private:
friend pcps_quicksync_acquisition_cc_sptr friend pcps_quicksync_acquisition_cc_sptr
pcps_quicksync_make_acquisition_cc(uint32_t folding_factor, pcps_quicksync_make_acquisition_cc(uint32_t folding_factor,
uint32_t sampled_ms, uint32_t max_dwells, uint32_t sampled_ms, uint32_t max_dwells,
uint32_t doppler_max, int64_t fs_in, uint32_t doppler_max, int64_t fs_in,
int32_t samples_per_ms, int32_t samples_per_code, int32_t samples_per_ms, int32_t samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
bool dump, bool dump,
std::string dump_filename); std::string dump_filename);
pcps_quicksync_acquisition_cc(uint32_t folding_factor, pcps_quicksync_acquisition_cc(uint32_t folding_factor,
uint32_t sampled_ms, uint32_t max_dwells, uint32_t sampled_ms, uint32_t max_dwells,
uint32_t doppler_max, int64_t fs_in, uint32_t doppler_max, int64_t fs_in,
int32_t samples_per_ms, int32_t samples_per_code, int32_t samples_per_ms, int32_t samples_per_code,
bool bit_transition_flag, bool bit_transition_flag,
bool dump, bool dump,
@ -110,36 +110,36 @@ private:
int32_t doppler_offset); int32_t doppler_offset);
gr_complex* d_code; gr_complex* d_code;
uint32_t d_folding_factor; // also referred in the paper as 'p' uint32_t d_folding_factor; // also referred in the paper as 'p'
float* d_corr_acumulator; float* d_corr_acumulator;
uint32_t * d_possible_delay; uint32_t* d_possible_delay;
float* d_corr_output_f; float* d_corr_output_f;
float* d_magnitude_folded; float* d_magnitude_folded;
gr_complex* d_signal_folded; gr_complex* d_signal_folded;
gr_complex* d_code_folded; gr_complex* d_code_folded;
float d_noise_floor_power; float d_noise_floor_power;
int64_t d_fs_in; int64_t d_fs_in;
int32_t d_samples_per_ms; int32_t d_samples_per_ms;
int32_t d_samples_per_code; int32_t d_samples_per_code;
uint32_t d_doppler_resolution; uint32_t d_doppler_resolution;
float d_threshold; float d_threshold;
std::string d_satellite_str; std::string d_satellite_str;
uint32_t d_doppler_max; uint32_t d_doppler_max;
uint32_t d_doppler_step; uint32_t d_doppler_step;
uint32_t d_sampled_ms; uint32_t d_sampled_ms;
uint32_t d_max_dwells; uint32_t d_max_dwells;
uint32_t d_well_count; uint32_t d_well_count;
uint32_t d_fft_size; uint32_t d_fft_size;
uint64_t d_sample_counter; uint64_t d_sample_counter;
gr_complex** d_grid_doppler_wipeoffs; gr_complex** d_grid_doppler_wipeoffs;
uint32_t d_num_doppler_bins; uint32_t d_num_doppler_bins;
gr_complex* d_fft_codes; gr_complex* d_fft_codes;
gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_fft_if;
gr::fft::fft_complex* d_fft_if2; gr::fft::fft_complex* d_fft_if2;
gr::fft::fft_complex* d_ifft; gr::fft::fft_complex* d_ifft;
Gnss_Synchro* d_gnss_synchro; Gnss_Synchro* d_gnss_synchro;
uint32_t d_code_phase; uint32_t d_code_phase;
float d_doppler_freq; float d_doppler_freq;
float d_mag; float d_mag;
float* d_magnitude; float* d_magnitude;
@ -150,7 +150,7 @@ private:
bool d_active; bool d_active;
int32_t d_state; int32_t d_state;
bool d_dump; bool d_dump;
uint32_t d_channel; uint32_t d_channel;
std::string d_dump_filename; std::string d_dump_filename;
public: public:
@ -172,7 +172,7 @@ public:
/*! /*!
* \brief Returns the maximum peak of grid search. * \brief Returns the maximum peak of grid search.
*/ */
inline uint32_t mag() const inline uint32_t mag() const
{ {
return d_mag; return d_mag;
} }
@ -209,7 +209,7 @@ public:
* \brief Set acquisition channel unique ID * \brief Set acquisition channel unique ID
* \param channel - receiver channel. * \param channel - receiver channel.
*/ */
inline void set_channel(uint32_t channel) inline void set_channel(uint32_t channel)
{ {
d_channel = channel; d_channel = channel;
} }
@ -228,7 +228,7 @@ public:
* \brief Set maximum Doppler grid search * \brief Set maximum Doppler grid search
* \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz].
*/ */
inline void set_doppler_max(uint32_t doppler_max) inline void set_doppler_max(uint32_t doppler_max)
{ {
d_doppler_max = doppler_max; d_doppler_max = doppler_max;
} }
@ -237,7 +237,7 @@ public:
* \brief Set Doppler steps for the grid search * \brief Set Doppler steps for the grid search
* \param doppler_step - Frequency bin of the search grid [Hz]. * \param doppler_step - Frequency bin of the search grid [Hz].
*/ */
inline void set_doppler_step(uint32_t doppler_step) inline void set_doppler_step(uint32_t doppler_step)
{ {
d_doppler_step = doppler_step; d_doppler_step = doppler_step;
} }

View File

@ -49,8 +49,8 @@
*/ */
#include "pcps_tong_acquisition_cc.h" #include "pcps_tong_acquisition_cc.h"
#include "control_message_factory.h"
#include "GPS_L1_CA.h" // for GPS_TWO_PI #include "GPS_L1_CA.h" // for GPS_TWO_PI
#include "control_message_factory.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>

View File

@ -53,8 +53,8 @@
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/fft/fft.h> #include <gnuradio/fft/fft.h>
#include <gnuradio/gr_complex.h>
#include <fstream> #include <fstream>
#include <string> #include <string>

View File

@ -53,4 +53,8 @@ Acq_Conf::Acq_Conf()
dump_channel = 0U; dump_channel = 0U;
it_size = sizeof(char); it_size = sizeof(char);
blocking_on_standby = false; blocking_on_standby = false;
use_automatic_resampler = false;
resampler_ratio = 1.0;
resampled_fs = 0LL;
resampler_latency_samples = 0U;
} }

View File

@ -56,6 +56,10 @@ public:
bool blocking; bool blocking;
bool blocking_on_standby; // enable it only for unit testing to avoid sample consume on idle status bool blocking_on_standby; // enable it only for unit testing to avoid sample consume on idle status
bool make_2_steps; bool make_2_steps;
bool use_automatic_resampler;
float resampler_ratio;
int64_t resampled_fs;
uint32_t resampler_latency_samples;
std::string dump_filename; std::string dump_filename;
uint32_t dump_channel; uint32_t dump_channel;
size_t it_size; size_t it_size;

View File

@ -37,9 +37,10 @@
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "gps_sdr_signal_processing.h" #include "gps_sdr_signal_processing.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <fcntl.h> // libraries used by the GIPO
#include <iostream> #include <iostream>
#include <fcntl.h> // libraries used by the GIPO
#include <sys/mman.h> // libraries used by the GIPO #include <sys/mman.h> // libraries used by the GIPO
#include <utility>
#define PAGE_SIZE 0x10000 // default page size for the multicorrelator memory map #define PAGE_SIZE 0x10000 // default page size for the multicorrelator memory map
@ -102,7 +103,7 @@ fpga_acquisition::fpga_acquisition(std::string device_name,
//printf("AAA- vector_length = %d\n ", vector_length); //printf("AAA- vector_length = %d\n ", vector_length);
// initial values // initial values
d_device_name = device_name; d_device_name = std::move(device_name);
//d_freq = freq; //d_freq = freq;
d_fs_in = fs_in; d_fs_in = fs_in;
d_vector_length = vector_length; d_vector_length = vector_length;
@ -121,7 +122,7 @@ fpga_acquisition::fpga_acquisition(std::string device_name,
LOG(WARNING) << "Cannot open deviceio" << d_device_name; LOG(WARNING) << "Cannot open deviceio" << d_device_name;
std::cout << "Acq: cannot open deviceio" << d_device_name << std::endl; std::cout << "Acq: cannot open deviceio" << d_device_name << std::endl;
} }
d_map_base = reinterpret_cast<volatile uint32_t *>(mmap(NULL, PAGE_SIZE, d_map_base = reinterpret_cast<volatile uint32_t *>(mmap(nullptr, PAGE_SIZE,
PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0)); PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0));
if (d_map_base == reinterpret_cast<void *>(-1)) if (d_map_base == reinterpret_cast<void *>(-1))
@ -234,7 +235,7 @@ void fpga_acquisition::set_doppler_sweep(uint32_t num_sweeps)
float phase_step_rad_int_temp; float phase_step_rad_int_temp;
int32_t phase_step_rad_int; int32_t phase_step_rad_int;
//int32_t doppler = static_cast<int32_t>(-d_doppler_max) + d_doppler_step * doppler_index; //int32_t doppler = static_cast<int32_t>(-d_doppler_max) + d_doppler_step * doppler_index;
int32_t doppler = static_cast<int32_t>(-d_doppler_max); auto doppler = static_cast<int32_t>(-d_doppler_max);
//float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in); //float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in);
float phase_step_rad = GPS_TWO_PI * (doppler) / static_cast<float>(d_fs_in); float phase_step_rad = GPS_TWO_PI * (doppler) / static_cast<float>(d_fs_in);
// The doppler step can never be outside the range -pi to +pi, otherwise there would be aliasing // The doppler step can never be outside the range -pi to +pi, otherwise there would be aliasing
@ -408,7 +409,7 @@ void fpga_acquisition::unblock_samples()
void fpga_acquisition::close_device() void fpga_acquisition::close_device()
{ {
uint32_t *aux = const_cast<uint32_t *>(d_map_base); auto *aux = const_cast<uint32_t *>(d_map_base);
if (munmap(static_cast<void *>(aux), PAGE_SIZE) == -1) if (munmap(static_cast<void *>(aux), PAGE_SIZE) == -1)
{ {
printf("Failed to unmap memory uio\n"); printf("Failed to unmap memory uio\n");

View File

@ -38,12 +38,10 @@
using google::LogMessage; using google::LogMessage;
// Constructor // Constructor
Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr<AcquisitionInterface> acq,
std::shared_ptr<GNSSBlockInterface> pass_through, std::shared_ptr<AcquisitionInterface> acq,
std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav, std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav,
std::string role, std::string implementation, gr::msg_queue::sptr queue) std::string role, std::string implementation, gr::msg_queue::sptr queue)
{ {
pass_through_ = std::move(pass_through);
acq_ = std::move(acq); acq_ = std::move(acq);
trk_ = std::move(trk); trk_ = std::move(trk);
nav_ = std::move(nav); nav_ = std::move(nav);
@ -112,32 +110,15 @@ Channel::~Channel() = default;
void Channel::connect(gr::top_block_sptr top_block) void Channel::connect(gr::top_block_sptr top_block)
{ {
if (connected_)
{
LOG(WARNING) << "channel already connected internally";
return;
}
if (flag_enable_fpga == false)
{
pass_through_->connect(top_block);
}
acq_->connect(top_block); acq_->connect(top_block);
trk_->connect(top_block); trk_->connect(top_block);
nav_->connect(top_block); nav_->connect(top_block);
//Synchronous ports //Synchronous ports
if (flag_enable_fpga == false)
{
top_block->connect(pass_through_->get_right_block(), 0, acq_->get_left_block(), 0);
DLOG(INFO) << "pass_through_ -> acquisition";
top_block->connect(pass_through_->get_right_block(), 0, trk_->get_left_block(), 0);
DLOG(INFO) << "pass_through_ -> tracking";
}
top_block->connect(trk_->get_right_block(), 0, nav_->get_left_block(), 0); top_block->connect(trk_->get_right_block(), 0, nav_->get_left_block(), 0);
DLOG(INFO) << "tracking -> telemetry_decoder"; DLOG(INFO) << "tracking -> telemetry_decoder";
// Message ports // Message ports
top_block->msg_connect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); top_block->msg_connect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events"));
top_block->msg_connect(trk_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); top_block->msg_connect(trk_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events"));
@ -153,17 +134,8 @@ void Channel::disconnect(gr::top_block_sptr top_block)
return; return;
} }
if (flag_enable_fpga == false)
{
top_block->disconnect(pass_through_->get_right_block(), 0, acq_->get_left_block(), 0);
top_block->disconnect(pass_through_->get_right_block(), 0, trk_->get_left_block(), 0);
}
top_block->disconnect(trk_->get_right_block(), 0, nav_->get_left_block(), 0); top_block->disconnect(trk_->get_right_block(), 0, nav_->get_left_block(), 0);
if (flag_enable_fpga == false)
{
pass_through_->disconnect(top_block);
}
acq_->disconnect(top_block); acq_->disconnect(top_block);
trk_->disconnect(top_block); trk_->disconnect(top_block);
nav_->disconnect(top_block); nav_->disconnect(top_block);
@ -173,9 +145,19 @@ void Channel::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr Channel::get_left_block() gr::basic_block_sptr Channel::get_left_block()
{ {
return pass_through_->get_left_block(); LOG(ERROR) << "Deprecated call to get_left_block() in channel interface";
return nullptr;
} }
gr::basic_block_sptr Channel::get_left_block_trk()
{
return trk_->get_left_block();
}
gr::basic_block_sptr Channel::get_left_block_acq()
{
return acq_->get_left_block();
}
gr::basic_block_sptr Channel::get_right_block() gr::basic_block_sptr Channel::get_right_block()
{ {

View File

@ -35,15 +35,15 @@
#ifndef GNSS_SDR_CHANNEL_H_ #ifndef GNSS_SDR_CHANNEL_H_
#define GNSS_SDR_CHANNEL_H_ #define GNSS_SDR_CHANNEL_H_
#include "channel_interface.h"
#include "channel_fsm.h" #include "channel_fsm.h"
#include "gnss_synchro.h" #include "channel_interface.h"
#include "channel_msg_receiver_cc.h" #include "channel_msg_receiver_cc.h"
#include <gnuradio/msg_queue.h> #include "gnss_synchro.h"
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <gnuradio/msg_queue.h>
#include <memory> #include <memory>
#include <string>
#include <mutex> #include <mutex>
#include <string>
class ConfigurationInterface; class ConfigurationInterface;
class AcquisitionInterface; class AcquisitionInterface;
@ -60,16 +60,17 @@ class Channel : public ChannelInterface
{ {
public: public:
//! Constructor //! Constructor
Channel(ConfigurationInterface* configuration, uint32_t channel, Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr<AcquisitionInterface> acq,
std::shared_ptr<GNSSBlockInterface> pass_through, std::shared_ptr<AcquisitionInterface> acq,
std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav, std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav,
std::string role, std::string implementation, gr::msg_queue::sptr queue); std::string role, std::string implementation, gr::msg_queue::sptr queue);
//! Virtual destructor //! Virtual destructor
virtual ~Channel(); virtual ~Channel();
void connect(gr::top_block_sptr top_block) override; void connect(gr::top_block_sptr top_block) override; //!< connects the tracking block to the top_block and to the telemetry
void disconnect(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_left_block() override; //!< gets the gnuradio tracking block pointer
gr::basic_block_sptr get_left_block_trk() override; //!< gets the gnuradio tracking block pointer
gr::basic_block_sptr get_left_block_acq() override; //!< gets the gnuradio tracking block pointer
gr::basic_block_sptr get_right_block() override; gr::basic_block_sptr get_right_block() override;
inline std::string role() override { return role_; } inline std::string role() override { return role_; }
@ -88,7 +89,6 @@ public:
private: private:
channel_msg_receiver_cc_sptr channel_msg_rx; channel_msg_receiver_cc_sptr channel_msg_rx;
std::shared_ptr<GNSSBlockInterface> pass_through_;
std::shared_ptr<AcquisitionInterface> acq_; std::shared_ptr<AcquisitionInterface> acq_;
std::shared_ptr<TrackingInterface> trk_; std::shared_ptr<TrackingInterface> trk_;
std::shared_ptr<TelemetryDecoderInterface> nav_; std::shared_ptr<TelemetryDecoderInterface> nav_;

View File

@ -33,8 +33,8 @@
#define GNSS_SDR_CHANNEL_FSM_H #define GNSS_SDR_CHANNEL_FSM_H
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "tracking_interface.h"
#include "telemetry_decoder_interface.h" #include "telemetry_decoder_interface.h"
#include "tracking_interface.h"
#include <gnuradio/msg_queue.h> #include <gnuradio/msg_queue.h>
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>

View File

@ -30,9 +30,9 @@
#include "channel_msg_receiver_cc.h" #include "channel_msg_receiver_cc.h"
#include <glog/logging.h>
#include <gnuradio/gr_complex.h> #include <gnuradio/gr_complex.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <glog/logging.h>
#include <cstdint> #include <cstdint>
using google::LogMessage; using google::LogMessage;

View File

@ -31,7 +31,6 @@
#include "array_signal_conditioner.h" #include "array_signal_conditioner.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <utility> #include <utility>

View File

@ -33,9 +33,9 @@
#define GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_H_ #define GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_H_
#include <string>
#include <gnuradio/msg_queue.h>
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include <gnuradio/msg_queue.h>
#include <string>
class ConfigurationInterface; class ConfigurationInterface;

View File

@ -31,7 +31,6 @@
#include "signal_conditioner.h" #include "signal_conditioner.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <utility> #include <utility>

View File

@ -34,8 +34,8 @@
#include "conjugate_cc.h" #include "conjugate_cc.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#include <gnuradio/blocks/interleaved_char_to_complex.h>
#include <gnuradio/blocks/file_sink.h> #include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/interleaved_char_to_complex.h>
#include <string> #include <string>
class ConfigurationInterface; class ConfigurationInterface;

View File

@ -32,8 +32,8 @@
#define GNSS_SDR_IBYTE_TO_CSHORT_H_ #define GNSS_SDR_IBYTE_TO_CSHORT_H_
#include "conjugate_sc.h" #include "conjugate_sc.h"
#include "interleaved_byte_to_complex_short.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "interleaved_byte_to_complex_short.h"
#include <gnuradio/blocks/file_sink.h> #include <gnuradio/blocks/file_sink.h>
#include <string> #include <string>

View File

@ -33,8 +33,8 @@
#include "conjugate_cc.h" #include "conjugate_cc.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include <gnuradio/blocks/interleaved_short_to_complex.h>
#include <gnuradio/blocks/file_sink.h> #include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/interleaved_short_to_complex.h>
#include <string> #include <string>
class ConfigurationInterface; class ConfigurationInterface;

View File

@ -31,10 +31,10 @@
#include "fir_filter.h" #include "fir_filter.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include <utility>
#include <gnuradio/filter/pm_remez.h>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/filter/pm_remez.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <utility>
using google::LogMessage; using google::LogMessage;

View File

@ -33,16 +33,16 @@
#ifndef GNSS_SDR_FIR_FILTER_H_ #ifndef GNSS_SDR_FIR_FILTER_H_
#define GNSS_SDR_FIR_FILTER_H_ #define GNSS_SDR_FIR_FILTER_H_
#include "gnss_block_interface.h"
#include "complex_byte_to_float_x2.h"
#include "byte_x2_to_complex_byte.h" #include "byte_x2_to_complex_byte.h"
#include "short_x2_to_cshort.h" #include "complex_byte_to_float_x2.h"
#include "cshort_to_float_x2.h" #include "cshort_to_float_x2.h"
#include <gnuradio/gr_complex.h> #include "gnss_block_interface.h"
#include "short_x2_to_cshort.h"
#include <gnuradio/blocks/file_sink.h> #include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/float_to_char.h> #include <gnuradio/blocks/float_to_char.h>
#include <gnuradio/blocks/float_to_complex.h> #include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/float_to_short.h> #include <gnuradio/blocks/float_to_short.h>
#include <gnuradio/gr_complex.h>
#ifdef GR_GREATER_38 #ifdef GR_GREATER_38
#include <gnuradio/filter/fir_filter_blk.h> #include <gnuradio/filter/fir_filter_blk.h>
#else #else

View File

@ -31,12 +31,12 @@
#include "freq_xlating_fir_filter.h" #include "freq_xlating_fir_filter.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include <utility>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/filter/pm_remez.h>
#include <gnuradio/filter/firdes.h>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/filter/firdes.h>
#include <gnuradio/filter/pm_remez.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <utility>
using google::LogMessage; using google::LogMessage;

View File

@ -33,9 +33,9 @@
#ifndef GNSS_SDR_FREQ_XLATING_FIR_FILTER_H_ #ifndef GNSS_SDR_FREQ_XLATING_FIR_FILTER_H_
#define GNSS_SDR_FREQ_XLATING_FIR_FILTER_H_ #define GNSS_SDR_FREQ_XLATING_FIR_FILTER_H_
#include "complex_float_to_complex_byte.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "short_x2_to_cshort.h" #include "short_x2_to_cshort.h"
#include "complex_float_to_complex_byte.h"
#ifdef GR_GREATER_38 #ifdef GR_GREATER_38
#include <gnuradio/filter/freq_xlating_fir_filter.h> #include <gnuradio/filter/freq_xlating_fir_filter.h>
#else #else
@ -43,9 +43,9 @@
#include <gnuradio/filter/freq_xlating_fir_filter_fcf.h> #include <gnuradio/filter/freq_xlating_fir_filter_fcf.h>
#include <gnuradio/filter/freq_xlating_fir_filter_scf.h> #include <gnuradio/filter/freq_xlating_fir_filter_scf.h>
#endif #endif
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/complex_to_float.h>
#include <gnuradio/blocks/char_to_short.h> #include <gnuradio/blocks/char_to_short.h>
#include <gnuradio/blocks/complex_to_float.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/float_to_short.h> #include <gnuradio/blocks/float_to_short.h>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -33,8 +33,8 @@
#ifndef GNSS_SDR_NOTCH_FILTER_H_ #ifndef GNSS_SDR_NOTCH_FILTER_H_
#define GNSS_SDR_NOTCH_FILTER_H_ #define GNSS_SDR_NOTCH_FILTER_H_
#include "notch_cc.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "notch_cc.h"
#include <gnuradio/blocks/file_sink.h> #include <gnuradio/blocks/file_sink.h>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -33,9 +33,9 @@
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/filter/firdes.h> #include <gnuradio/filter/firdes.h>
#include <cmath>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <cmath>
using google::LogMessage; using google::LogMessage;

View File

@ -33,8 +33,8 @@
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <volk/volk.h> #include <volk/volk.h>
#include <cstring>
#include <cmath> #include <cmath>
#include <cstring>
using google::LogMessage; using google::LogMessage;
@ -86,7 +86,7 @@ Notch::~Notch()
void Notch::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) void Notch::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required)
{ {
for (int & aux : ninput_items_required) for (int &aux : ninput_items_required)
{ {
aux = length_; aux = length_;
} }

Some files were not shown because too many files have changed in this diff Show More