mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-10-30 14:53:03 +00:00
Write public interface first, then private members in class definitions
This commit is contained in:
@@ -77,6 +77,57 @@ rtklib_pvt_gs_sptr rtklib_make_pvt_gs(uint32_t nchannels,
|
||||
*/
|
||||
class rtklib_pvt_gs : public gr::sync_block
|
||||
{
|
||||
public:
|
||||
~rtklib_pvt_gs(); //!< Default destructor
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of GPS ephemeris from PVT block
|
||||
*/
|
||||
std::map<int, Gps_Ephemeris> get_gps_ephemeris_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of GPS almanac from PVT block
|
||||
*/
|
||||
std::map<int, Gps_Almanac> get_gps_almanac_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of Galileo ephemeris from PVT block
|
||||
*/
|
||||
std::map<int, Galileo_Ephemeris> get_galileo_ephemeris_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of Galileo almanac from PVT block
|
||||
*/
|
||||
std::map<int, Galileo_Almanac> get_galileo_almanac_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of BeiDou DNAV ephemeris from PVT block
|
||||
*/
|
||||
std::map<int, Beidou_Dnav_Ephemeris> get_beidou_dnav_ephemeris_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of BeiDou DNAV almanac from PVT block
|
||||
*/
|
||||
std::map<int, Beidou_Dnav_Almanac> get_beidou_dnav_almanac_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Clear all ephemeris information and the almanacs for GPS and Galileo
|
||||
*/
|
||||
void clear_ephemeris();
|
||||
|
||||
/*!
|
||||
* \brief Get the latest Position WGS84 [deg], Ground Velocity, Course over Ground, and UTC Time, if available
|
||||
*/
|
||||
bool get_latest_PVT(double* longitude_deg,
|
||||
double* latitude_deg,
|
||||
double* height_m,
|
||||
double* ground_speed_kmh,
|
||||
double* course_over_ground_deg,
|
||||
time_t* UTC_time) const;
|
||||
|
||||
int work(int noutput_items, gr_vector_const_void_star& input_items,
|
||||
gr_vector_void_star& output_items); //!< PVT Signal Processing
|
||||
|
||||
private:
|
||||
friend rtklib_pvt_gs_sptr rtklib_make_pvt_gs(uint32_t nchannels,
|
||||
const Pvt_Conf& conf_,
|
||||
@@ -169,57 +220,6 @@ private:
|
||||
bool d_show_local_time_zone;
|
||||
std::string d_local_time_str;
|
||||
boost::posix_time::time_duration d_utc_diff_time;
|
||||
|
||||
public:
|
||||
~rtklib_pvt_gs(); //!< Default destructor
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of GPS ephemeris from PVT block
|
||||
*/
|
||||
std::map<int, Gps_Ephemeris> get_gps_ephemeris_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of GPS almanac from PVT block
|
||||
*/
|
||||
std::map<int, Gps_Almanac> get_gps_almanac_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of Galileo ephemeris from PVT block
|
||||
*/
|
||||
std::map<int, Galileo_Ephemeris> get_galileo_ephemeris_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of Galileo almanac from PVT block
|
||||
*/
|
||||
std::map<int, Galileo_Almanac> get_galileo_almanac_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of BeiDou DNAV ephemeris from PVT block
|
||||
*/
|
||||
std::map<int, Beidou_Dnav_Ephemeris> get_beidou_dnav_ephemeris_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Get latest set of BeiDou DNAV almanac from PVT block
|
||||
*/
|
||||
std::map<int, Beidou_Dnav_Almanac> get_beidou_dnav_almanac_map() const;
|
||||
|
||||
/*!
|
||||
* \brief Clear all ephemeris information and the almanacs for GPS and Galileo
|
||||
*/
|
||||
void clear_ephemeris();
|
||||
|
||||
/*!
|
||||
* \brief Get the latest Position WGS84 [deg], Ground Velocity, Course over Ground, and UTC Time, if available
|
||||
*/
|
||||
bool get_latest_PVT(double* longitude_deg,
|
||||
double* latitude_deg,
|
||||
double* height_m,
|
||||
double* ground_speed_kmh,
|
||||
double* course_over_ground_deg,
|
||||
time_t* UTC_time) const;
|
||||
|
||||
int work(int noutput_items, gr_vector_const_void_star& input_items,
|
||||
gr_vector_void_star& output_items); //!< PVT Signal Processing
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,18 +47,18 @@ class Pvt_Solution;
|
||||
*/
|
||||
class GeoJSON_Printer
|
||||
{
|
||||
private:
|
||||
std::ofstream geojson_file;
|
||||
bool first_pos;
|
||||
std::string filename_;
|
||||
std::string geojson_base_path;
|
||||
|
||||
public:
|
||||
GeoJSON_Printer(const std::string& base_path = ".");
|
||||
~GeoJSON_Printer();
|
||||
bool set_headers(const std::string& filename, bool time_tag_name = true);
|
||||
bool print_position(const std::shared_ptr<Pvt_Solution>& position, bool print_average_values);
|
||||
bool close_file();
|
||||
|
||||
private:
|
||||
std::ofstream geojson_file;
|
||||
bool first_pos;
|
||||
std::string filename_;
|
||||
std::string geojson_base_path;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,19 +47,19 @@ class Rtklib_Solver;
|
||||
*/
|
||||
class Gpx_Printer
|
||||
{
|
||||
private:
|
||||
std::ofstream gpx_file;
|
||||
bool positions_printed;
|
||||
std::string gpx_filename;
|
||||
std::string indent;
|
||||
std::string gpx_base_path;
|
||||
|
||||
public:
|
||||
Gpx_Printer(const std::string& base_path = ".");
|
||||
~Gpx_Printer();
|
||||
bool set_headers(const std::string& filename, bool time_tag_name = true);
|
||||
bool print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values);
|
||||
bool close_file();
|
||||
|
||||
private:
|
||||
std::ofstream gpx_file;
|
||||
bool positions_printed;
|
||||
std::string gpx_filename;
|
||||
std::string indent;
|
||||
std::string gpx_base_path;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -48,14 +48,6 @@
|
||||
*/
|
||||
class Hybrid_Ls_Pvt : public Ls_Pvt
|
||||
{
|
||||
private:
|
||||
int count_valid_position;
|
||||
bool d_flag_dump_enabled;
|
||||
std::string d_dump_filename;
|
||||
std::ofstream d_dump_file;
|
||||
int d_nchannels; // Number of available channels for positioning
|
||||
double d_galileo_current_time;
|
||||
|
||||
public:
|
||||
Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file);
|
||||
~Hybrid_Ls_Pvt();
|
||||
@@ -75,6 +67,14 @@ public:
|
||||
|
||||
Gps_CNAV_Iono gps_cnav_iono;
|
||||
Gps_CNAV_Utc_Model gps_cnav_utc_model;
|
||||
|
||||
private:
|
||||
int count_valid_position;
|
||||
bool d_flag_dump_enabled;
|
||||
std::string d_dump_filename;
|
||||
std::ofstream d_dump_file;
|
||||
int d_nchannels; // Number of available channels for positioning
|
||||
double d_galileo_current_time;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,6 +46,13 @@ class Rtklib_Solver;
|
||||
*/
|
||||
class Kml_Printer
|
||||
{
|
||||
public:
|
||||
Kml_Printer(const std::string& base_path = std::string("."));
|
||||
~Kml_Printer();
|
||||
bool set_headers(const std::string& filename, bool time_tag_name = true);
|
||||
bool print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values);
|
||||
bool close_file();
|
||||
|
||||
private:
|
||||
std::ofstream kml_file;
|
||||
std::ofstream tmp_file;
|
||||
@@ -55,13 +62,6 @@ private:
|
||||
std::string tmp_file_str;
|
||||
unsigned int point_id;
|
||||
std::string indent;
|
||||
|
||||
public:
|
||||
Kml_Printer(const std::string& base_path = std::string("."));
|
||||
~Kml_Printer();
|
||||
bool set_headers(const std::string& filename, bool time_tag_name = true);
|
||||
bool print_position(const std::shared_ptr<Rtklib_Solver>& position, bool print_average_values);
|
||||
bool close_file();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,12 +41,6 @@
|
||||
*/
|
||||
class Ls_Pvt : public Pvt_Solution
|
||||
{
|
||||
private:
|
||||
/*!
|
||||
* \brief Computes the Lorentz inner product between two vectors
|
||||
*/
|
||||
double lorentz(const arma::vec& x, const arma::vec& y);
|
||||
|
||||
public:
|
||||
Ls_Pvt();
|
||||
|
||||
@@ -59,6 +53,12 @@ public:
|
||||
* \brief Computes the Weighted Least Squares position solution
|
||||
*/
|
||||
arma::vec leastSquarePos(const arma::mat& satpos, const arma::vec& obs, const arma::vec& w_vec);
|
||||
|
||||
private:
|
||||
/*!
|
||||
* \brief Computes the Lorentz inner product between two vectors
|
||||
*/
|
||||
double lorentz(const arma::vec& x, const arma::vec& y);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -44,32 +44,6 @@
|
||||
*/
|
||||
class Pvt_Solution
|
||||
{
|
||||
private:
|
||||
double d_rx_dt_s; // RX time offset [s]
|
||||
|
||||
double d_latitude_d; // RX position Latitude WGS84 [deg]
|
||||
double d_longitude_d; // RX position Longitude WGS84 [deg]
|
||||
double d_height_m; // RX position height WGS84 [m]
|
||||
double d_speed_over_ground_m_s; // RX speed over ground [m/s]
|
||||
double d_course_over_ground_d; // RX course over ground [deg]
|
||||
|
||||
double d_avg_latitude_d; // Averaged latitude in degrees
|
||||
double d_avg_longitude_d; // Averaged longitude in degrees
|
||||
double d_avg_height_m; // Averaged height [m]
|
||||
|
||||
bool b_valid_position;
|
||||
|
||||
std::deque<double> d_hist_latitude_d;
|
||||
std::deque<double> d_hist_longitude_d;
|
||||
std::deque<double> d_hist_height_m;
|
||||
|
||||
bool d_flag_averaging;
|
||||
int d_averaging_depth; // Length of averaging window
|
||||
|
||||
arma::vec d_rx_pos;
|
||||
boost::posix_time::ptime d_position_UTC_time;
|
||||
int d_valid_observations;
|
||||
|
||||
public:
|
||||
Pvt_Solution();
|
||||
|
||||
@@ -111,46 +85,73 @@ public:
|
||||
arma::vec rotateSatellite(double traveltime, const arma::vec &X_sat);
|
||||
|
||||
/*!
|
||||
* \brief Conversion of Cartesian coordinates (X,Y,Z) to geographical
|
||||
* coordinates (d_latitude_d, d_longitude_d, d_height_m) on a selected reference ellipsoid.
|
||||
*
|
||||
* \param[in] X [m] Cartesian coordinate
|
||||
* \param[in] Y [m] Cartesian coordinate
|
||||
* \param[in] Z [m] Cartesian coordinate
|
||||
* \param[in] elipsoid_selection. Choices of Reference Ellipsoid for Geographical Coordinates:
|
||||
* 0 - International Ellipsoid 1924.
|
||||
* 1 - International Ellipsoid 1967.
|
||||
* 2 - World Geodetic System 1972.
|
||||
* 3 - Geodetic Reference System 1980.
|
||||
* 4 - World Geodetic System 1984.
|
||||
*
|
||||
*/
|
||||
* \brief Conversion of Cartesian coordinates (X,Y,Z) to geographical
|
||||
* coordinates (d_latitude_d, d_longitude_d, d_height_m) on a selected reference ellipsoid.
|
||||
*
|
||||
* \param[in] X [m] Cartesian coordinate
|
||||
* \param[in] Y [m] Cartesian coordinate
|
||||
* \param[in] Z [m] Cartesian coordinate
|
||||
* \param[in] elipsoid_selection. Choices of Reference Ellipsoid for Geographical Coordinates:
|
||||
* 0 - International Ellipsoid 1924.
|
||||
* 1 - International Ellipsoid 1967.
|
||||
* 2 - World Geodetic System 1972.
|
||||
* 3 - Geodetic Reference System 1980.
|
||||
* 4 - World Geodetic System 1984.
|
||||
*
|
||||
*/
|
||||
int cart2geo(double X, double Y, double Z, int elipsoid_selection);
|
||||
|
||||
/*!
|
||||
* \brief Tropospheric correction
|
||||
*
|
||||
* \param[in] sinel - sin of elevation angle of satellite
|
||||
* \param[in] hsta_km - height of station in km
|
||||
* \param[in] p_mb - atmospheric pressure in mb at height hp_km
|
||||
* \param[in] t_kel - surface temperature in degrees Kelvin at height htkel_km
|
||||
* \param[in] hum - humidity in % at height hhum_km
|
||||
* \param[in] hp_km - height of pressure measurement in km
|
||||
* \param[in] htkel_km - height of temperature measurement in km
|
||||
* \param[in] hhum_km - height of humidity measurement in km
|
||||
*
|
||||
* \param[out] ddr_m - range correction (meters)
|
||||
*
|
||||
*
|
||||
* Reference:
|
||||
* Goad, C.C. & Goodman, L. (1974) A Modified Hopfield Tropospheric
|
||||
* Refraction Correction Model. Paper presented at the
|
||||
* American Geophysical Union Annual Fall Meeting, San
|
||||
* Francisco, December 12-17
|
||||
*
|
||||
* Translated to C++ by Carles Fernandez from a Matlab implementation by Kai Borre
|
||||
*/
|
||||
* \brief Tropospheric correction
|
||||
*
|
||||
* \param[in] sinel - sin of elevation angle of satellite
|
||||
* \param[in] hsta_km - height of station in km
|
||||
* \param[in] p_mb - atmospheric pressure in mb at height hp_km
|
||||
* \param[in] t_kel - surface temperature in degrees Kelvin at height htkel_km
|
||||
* \param[in] hum - humidity in % at height hhum_km
|
||||
* \param[in] hp_km - height of pressure measurement in km
|
||||
* \param[in] htkel_km - height of temperature measurement in km
|
||||
* \param[in] hhum_km - height of humidity measurement in km
|
||||
*
|
||||
* \param[out] ddr_m - range correction (meters)
|
||||
*
|
||||
*
|
||||
* Reference:
|
||||
* Goad, C.C. & Goodman, L. (1974) A Modified Hopfield Tropospheric
|
||||
* Refraction Correction Model. Paper presented at the
|
||||
* American Geophysical Union Annual Fall Meeting, San
|
||||
* Francisco, December 12-17
|
||||
*
|
||||
* Translated to C++ by Carles Fernandez from a Matlab implementation by Kai Borre
|
||||
*/
|
||||
int tropo(double *ddr_m, double sinel, double hsta_km, double p_mb, double t_kel, double hum, double hp_km, double htkel_km, double hhum_km);
|
||||
|
||||
private:
|
||||
double d_rx_dt_s; // RX time offset [s]
|
||||
|
||||
double d_latitude_d; // RX position Latitude WGS84 [deg]
|
||||
double d_longitude_d; // RX position Longitude WGS84 [deg]
|
||||
double d_height_m; // RX position height WGS84 [m]
|
||||
double d_speed_over_ground_m_s; // RX speed over ground [m/s]
|
||||
double d_course_over_ground_d; // RX course over ground [deg]
|
||||
|
||||
double d_avg_latitude_d; // Averaged latitude in degrees
|
||||
double d_avg_longitude_d; // Averaged longitude in degrees
|
||||
double d_avg_height_m; // Averaged height [m]
|
||||
|
||||
bool b_valid_position;
|
||||
|
||||
std::deque<double> d_hist_latitude_d;
|
||||
std::deque<double> d_hist_longitude_d;
|
||||
std::deque<double> d_hist_height_m;
|
||||
|
||||
bool d_flag_averaging;
|
||||
int d_averaging_depth; // Length of averaging window
|
||||
|
||||
arma::vec d_rx_pos;
|
||||
boost::posix_time::ptime d_position_UTC_time;
|
||||
int d_valid_observations;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -88,18 +88,6 @@
|
||||
*/
|
||||
class Rtklib_Solver : public Pvt_Solution
|
||||
{
|
||||
private:
|
||||
rtk_t rtk_;
|
||||
std::string d_dump_filename;
|
||||
std::ofstream d_dump_file;
|
||||
bool save_matfile();
|
||||
|
||||
bool d_flag_dump_enabled;
|
||||
bool d_flag_dump_mat_enabled;
|
||||
int d_nchannels; // Number of available channels for positioning
|
||||
std::array<double, 4> dop_;
|
||||
Monitor_Pvt monitor_pvt;
|
||||
|
||||
public:
|
||||
Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk);
|
||||
~Rtklib_Solver();
|
||||
@@ -139,6 +127,17 @@ public:
|
||||
std::map<int, Beidou_Dnav_Almanac> beidou_dnav_almanac_map;
|
||||
|
||||
int count_valid_position;
|
||||
|
||||
private:
|
||||
rtk_t rtk_;
|
||||
std::string d_dump_filename;
|
||||
std::ofstream d_dump_file;
|
||||
bool save_matfile();
|
||||
bool d_flag_dump_enabled;
|
||||
bool d_flag_dump_mat_enabled;
|
||||
int d_nchannels; // Number of available channels for positioning
|
||||
std::array<double, 4> dop_;
|
||||
Monitor_Pvt monitor_pvt;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,15 +47,15 @@ channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<Channe
|
||||
*/
|
||||
class channel_msg_receiver_cc : public gr::block
|
||||
{
|
||||
public:
|
||||
~channel_msg_receiver_cc(); //!< Default destructor
|
||||
|
||||
private:
|
||||
std::shared_ptr<ChannelFsm> d_channel_fsm;
|
||||
bool d_repeat; // todo: change FSM to include repeat value
|
||||
friend channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat);
|
||||
void msg_handler_events(pmt::pmt_t msg);
|
||||
channel_msg_receiver_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat);
|
||||
|
||||
public:
|
||||
~channel_msg_receiver_cc(); //!< Default destructor
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,15 +47,14 @@ interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte();
|
||||
*/
|
||||
class interleaved_byte_to_complex_byte : public gr::sync_decimator
|
||||
{
|
||||
private:
|
||||
friend interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte();
|
||||
|
||||
public:
|
||||
interleaved_byte_to_complex_byte();
|
||||
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte();
|
||||
interleaved_byte_to_complex_byte();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,15 +46,14 @@ interleaved_byte_to_complex_short_sptr make_interleaved_byte_to_complex_short();
|
||||
*/
|
||||
class interleaved_byte_to_complex_short : public gr::sync_decimator
|
||||
{
|
||||
private:
|
||||
friend interleaved_byte_to_complex_short_sptr make_interleaved_byte_to_complex_short();
|
||||
|
||||
public:
|
||||
interleaved_byte_to_complex_short();
|
||||
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend interleaved_byte_to_complex_short_sptr make_interleaved_byte_to_complex_short();
|
||||
interleaved_byte_to_complex_short();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // GNSS_SDR_INTERLEAVED_BYTE_TO_COMPLEX_SHORT_H_
|
||||
|
||||
@@ -46,15 +46,14 @@ interleaved_short_to_complex_short_sptr make_interleaved_short_to_complex_short(
|
||||
*/
|
||||
class interleaved_short_to_complex_short : public gr::sync_decimator
|
||||
{
|
||||
private:
|
||||
friend interleaved_short_to_complex_short_sptr make_interleaved_short_to_complex_short();
|
||||
|
||||
public:
|
||||
interleaved_short_to_complex_short();
|
||||
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend interleaved_short_to_complex_short_sptr make_interleaved_short_to_complex_short();
|
||||
interleaved_short_to_complex_short();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // GNSS_SDR_INTERLEAVED_SHORT_TO_COMPLEX_SHORT_H_
|
||||
|
||||
@@ -43,17 +43,15 @@ beamformer_sptr make_beamformer();
|
||||
*/
|
||||
class beamformer : public gr::sync_block
|
||||
{
|
||||
private:
|
||||
friend beamformer_sptr
|
||||
make_beamformer_sptr();
|
||||
|
||||
gr_complex *weight_vector;
|
||||
|
||||
public:
|
||||
beamformer();
|
||||
~beamformer();
|
||||
int work(int noutput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend beamformer_sptr make_beamformer_sptr();
|
||||
gr_complex *weight_vector;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,9 +47,19 @@ notch_sptr make_notch_filter(float pfa, float p_c_factor,
|
||||
/*!
|
||||
* \brief This class implements a real-time software-defined multi state notch filter
|
||||
*/
|
||||
|
||||
class Notch : public gr::block
|
||||
{
|
||||
public:
|
||||
Notch(float pfa, float p_c_factor, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset);
|
||||
|
||||
~Notch();
|
||||
|
||||
void forecast(int noutput_items, gr_vector_int &ninput_items_required);
|
||||
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
float pfa;
|
||||
float noise_pow_est;
|
||||
@@ -67,17 +77,6 @@ private:
|
||||
float *angle_;
|
||||
float *power_spect;
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft;
|
||||
|
||||
public:
|
||||
Notch(float pfa, float p_c_factor, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset);
|
||||
|
||||
~Notch();
|
||||
|
||||
void forecast(int noutput_items, gr_vector_int &ninput_items_required);
|
||||
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
};
|
||||
|
||||
#endif //GNSS_SDR_NOTCH_H_
|
||||
#endif // GNSS_SDR_NOTCH_H_
|
||||
|
||||
@@ -46,9 +46,19 @@ notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int32_t leng
|
||||
/*!
|
||||
* \brief This class implements a real-time software-defined multi state notch filter light version
|
||||
*/
|
||||
|
||||
class NotchLite : public gr::block
|
||||
{
|
||||
public:
|
||||
NotchLite(float p_c_factor, float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff);
|
||||
|
||||
~NotchLite();
|
||||
|
||||
void forecast(int noutput_items, gr_vector_int &ninput_items_required);
|
||||
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
int32_t length_;
|
||||
int32_t n_segments;
|
||||
@@ -70,17 +80,6 @@ private:
|
||||
float angle2;
|
||||
float *power_spect;
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft;
|
||||
|
||||
public:
|
||||
NotchLite(float p_c_factor, float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff);
|
||||
|
||||
~NotchLite();
|
||||
|
||||
void forecast(int noutput_items, gr_vector_int &ninput_items_required);
|
||||
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
};
|
||||
|
||||
#endif //GNSS_SDR_NOTCH_LITE_H_
|
||||
#endif // GNSS_SDR_NOTCH_LITE_H_
|
||||
|
||||
@@ -44,6 +44,16 @@ pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int32_t length_, int32_
|
||||
|
||||
class pulse_blanking_cc : public gr::block
|
||||
{
|
||||
public:
|
||||
pulse_blanking_cc(float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset);
|
||||
|
||||
~pulse_blanking_cc();
|
||||
|
||||
void forecast(int noutput_items, gr_vector_int &ninput_items_required);
|
||||
|
||||
int general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
int32_t length_;
|
||||
int32_t n_segments;
|
||||
@@ -55,16 +65,6 @@ private:
|
||||
float thres_;
|
||||
float pfa;
|
||||
gr_complex *zeros_;
|
||||
|
||||
public:
|
||||
pulse_blanking_cc(float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset);
|
||||
|
||||
~pulse_blanking_cc();
|
||||
|
||||
int general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
|
||||
|
||||
void forecast(int noutput_items, gr_vector_int &ninput_items_required);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // GNSS_SDR_PULSE_BLANKING_H_
|
||||
|
||||
@@ -38,9 +38,10 @@
|
||||
class direct_resampler_conditioner_cb;
|
||||
using direct_resampler_conditioner_cb_sptr = boost::shared_ptr<direct_resampler_conditioner_cb>;
|
||||
|
||||
direct_resampler_conditioner_cb_sptr
|
||||
direct_resampler_make_conditioner_cb(double sample_freq_in,
|
||||
direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb(
|
||||
double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a direct resampler conditioner for std::complex<signed char>
|
||||
*
|
||||
@@ -48,20 +49,6 @@ direct_resampler_make_conditioner_cb(double sample_freq_in,
|
||||
*/
|
||||
class direct_resampler_conditioner_cb : public gr::block
|
||||
{
|
||||
private:
|
||||
friend direct_resampler_conditioner_cb_sptr
|
||||
direct_resampler_make_conditioner_cb(double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
double d_sample_freq_in;
|
||||
double d_sample_freq_out;
|
||||
uint32_t d_phase;
|
||||
uint32_t d_lphase;
|
||||
uint32_t d_phase_step;
|
||||
|
||||
direct_resampler_conditioner_cb(double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
public:
|
||||
~direct_resampler_conditioner_cb();
|
||||
|
||||
@@ -80,6 +67,21 @@ public:
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb(
|
||||
double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
direct_resampler_conditioner_cb(
|
||||
double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
double d_sample_freq_in;
|
||||
double d_sample_freq_out;
|
||||
uint32_t d_phase;
|
||||
uint32_t d_lphase;
|
||||
uint32_t d_phase_step;
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CS_H */
|
||||
|
||||
@@ -43,9 +43,11 @@
|
||||
#include <volk/volk.h>
|
||||
|
||||
class direct_resampler_conditioner_cc;
|
||||
|
||||
using direct_resampler_conditioner_cc_sptr = boost::shared_ptr<direct_resampler_conditioner_cc>;
|
||||
direct_resampler_conditioner_cc_sptr
|
||||
direct_resampler_make_conditioner_cc(double sample_freq_in,
|
||||
|
||||
direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc(
|
||||
double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
/*!
|
||||
@@ -55,18 +57,6 @@ direct_resampler_make_conditioner_cc(double sample_freq_in,
|
||||
*/
|
||||
class direct_resampler_conditioner_cc : public gr::block
|
||||
{
|
||||
private:
|
||||
friend direct_resampler_conditioner_cc_sptr
|
||||
direct_resampler_make_conditioner_cc(double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
double d_sample_freq_in; //! Specifies the sampling frequency of the input signal
|
||||
double d_sample_freq_out; //! Specifies the sampling frequency of the output signal
|
||||
uint32_t d_phase;
|
||||
uint32_t d_lphase;
|
||||
uint32_t d_phase_step;
|
||||
direct_resampler_conditioner_cc(double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
public:
|
||||
~direct_resampler_conditioner_cc();
|
||||
inline unsigned int sample_freq_in() const
|
||||
@@ -84,6 +74,21 @@ public:
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc(
|
||||
double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
direct_resampler_conditioner_cc(
|
||||
double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
double d_sample_freq_in; // Sampling frequency of the input signal
|
||||
double d_sample_freq_out; // Sampling frequency of the output signal
|
||||
uint32_t d_phase;
|
||||
uint32_t d_lphase;
|
||||
uint32_t d_phase_step;
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H */
|
||||
|
||||
@@ -38,9 +38,10 @@
|
||||
class direct_resampler_conditioner_cs;
|
||||
using direct_resampler_conditioner_cs_sptr = boost::shared_ptr<direct_resampler_conditioner_cs>;
|
||||
|
||||
direct_resampler_conditioner_cs_sptr
|
||||
direct_resampler_make_conditioner_cs(double sample_freq_in,
|
||||
direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs(
|
||||
double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a direct resampler conditioner for std::complex<short>
|
||||
*
|
||||
@@ -48,20 +49,6 @@ direct_resampler_make_conditioner_cs(double sample_freq_in,
|
||||
*/
|
||||
class direct_resampler_conditioner_cs : public gr::block
|
||||
{
|
||||
private:
|
||||
friend direct_resampler_conditioner_cs_sptr
|
||||
direct_resampler_make_conditioner_cs(double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
double d_sample_freq_in;
|
||||
double d_sample_freq_out;
|
||||
uint32_t d_phase;
|
||||
uint32_t d_lphase;
|
||||
uint32_t d_phase_step;
|
||||
|
||||
direct_resampler_conditioner_cs(double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
public:
|
||||
~direct_resampler_conditioner_cs();
|
||||
|
||||
@@ -80,6 +67,21 @@ public:
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs(
|
||||
double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
direct_resampler_conditioner_cs(
|
||||
double sample_freq_in,
|
||||
double sample_freq_out);
|
||||
|
||||
double d_sample_freq_in;
|
||||
double d_sample_freq_out;
|
||||
uint32_t d_phase;
|
||||
uint32_t d_lphase;
|
||||
uint32_t d_phase_step;
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CS_H */
|
||||
|
||||
@@ -60,11 +60,19 @@ using signal_generator_c_sptr = boost::shared_ptr<signal_generator_c>;
|
||||
* constructor is private. signal_make_generator_c is the public
|
||||
* interface for creating new instances.
|
||||
*/
|
||||
signal_generator_c_sptr
|
||||
signal_make_generator_c(std::vector<std::string> signal1, std::vector<std::string> system, const std::vector<unsigned int> &PRN,
|
||||
const std::vector<float> &CN0_dB, const std::vector<float> &doppler_Hz,
|
||||
const std::vector<unsigned int> &delay_chips, const std::vector<unsigned int> &delay_sec, bool data_flag, bool noise_flag,
|
||||
unsigned int fs_in, unsigned int vector_length, float BW_BB);
|
||||
signal_generator_c_sptr signal_make_generator_c(
|
||||
std::vector<std::string> signal1,
|
||||
std::vector<std::string> system,
|
||||
const std::vector<unsigned int> &PRN,
|
||||
const std::vector<float> &CN0_dB,
|
||||
const std::vector<float> &doppler_Hz,
|
||||
const std::vector<unsigned int> &delay_chips,
|
||||
const std::vector<unsigned int> &delay_sec,
|
||||
bool data_flag,
|
||||
bool noise_flag,
|
||||
unsigned int fs_in,
|
||||
unsigned int vector_length,
|
||||
float BW_BB);
|
||||
|
||||
/*!
|
||||
* \brief This class generates synthesized GNSS signal.
|
||||
@@ -74,23 +82,46 @@ signal_make_generator_c(std::vector<std::string> signal1, std::vector<std::strin
|
||||
*/
|
||||
class signal_generator_c : public gr::block
|
||||
{
|
||||
public:
|
||||
~signal_generator_c(); // public destructor
|
||||
|
||||
// Where all the action really happens
|
||||
int general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
// The friend declaration allows gen_source to
|
||||
// access the private constructor.
|
||||
friend signal_generator_c_sptr signal_make_generator_c(
|
||||
std::vector<std::string> signal1,
|
||||
std::vector<std::string> system,
|
||||
const std::vector<unsigned int> &PRN,
|
||||
const std::vector<float> &CN0_dB,
|
||||
const std::vector<float> &doppler_Hz,
|
||||
const std::vector<unsigned int> &delay_chips,
|
||||
const std::vector<unsigned int> &delay_sec,
|
||||
bool data_flag,
|
||||
bool noise_flag,
|
||||
unsigned int fs_in,
|
||||
unsigned int vector_length,
|
||||
float BW_BB);
|
||||
|
||||
/* Create the signal_generator_c object*/
|
||||
friend signal_generator_c_sptr
|
||||
signal_make_generator_c(std::vector<std::string> signal1, std::vector<std::string> system, const std::vector<unsigned int> &PRN,
|
||||
const std::vector<float> &CN0_dB, const std::vector<float> &doppler_Hz,
|
||||
const std::vector<unsigned int> &delay_chips, const std::vector<unsigned int> &delay_sec, bool data_flag, bool noise_flag,
|
||||
unsigned int fs_in, unsigned int vector_length, float BW_BB);
|
||||
|
||||
signal_generator_c(std::vector<std::string> signal1, std::vector<std::string> system, const std::vector<unsigned int> &PRN,
|
||||
std::vector<float> CN0_dB, std::vector<float> doppler_Hz,
|
||||
std::vector<unsigned int> delay_chips, std::vector<unsigned int> delay_sec, bool data_flag, bool noise_flag,
|
||||
unsigned int fs_in, unsigned int vector_length, float BW_BB);
|
||||
signal_generator_c(
|
||||
std::vector<std::string> signal1,
|
||||
std::vector<std::string> system,
|
||||
const std::vector<unsigned int> &PRN,
|
||||
std::vector<float> CN0_dB,
|
||||
std::vector<float> doppler_Hz,
|
||||
std::vector<unsigned int> delay_chips,
|
||||
std::vector<unsigned int> delay_sec,
|
||||
bool data_flag,
|
||||
bool noise_flag,
|
||||
unsigned int fs_in,
|
||||
unsigned int vector_length,
|
||||
float BW_BB);
|
||||
|
||||
void init();
|
||||
|
||||
void generate_codes();
|
||||
|
||||
std::vector<std::string> signal_;
|
||||
@@ -106,7 +137,6 @@ private:
|
||||
unsigned int num_sats_;
|
||||
unsigned int vector_length_;
|
||||
float BW_BB_;
|
||||
|
||||
std::vector<unsigned int> samples_per_code_;
|
||||
std::vector<unsigned int> num_of_codes_per_vector_;
|
||||
std::vector<unsigned int> data_bit_duration_ms_;
|
||||
@@ -116,28 +146,15 @@ private:
|
||||
std::vector<signed int> current_data_bit_int_;
|
||||
std::vector<signed int> data_modulation_;
|
||||
std::vector<signed int> pilot_modulation_;
|
||||
|
||||
boost::scoped_array<gr_complex *> sampled_code_data_;
|
||||
boost::scoped_array<gr_complex *> sampled_code_pilot_;
|
||||
//gr::random *random_;
|
||||
gr_complex *complex_phase_;
|
||||
|
||||
unsigned int work_counter_;
|
||||
std::random_device r;
|
||||
std::default_random_engine e1;
|
||||
std::default_random_engine e2;
|
||||
std::uniform_int_distribution<int> uniform_dist;
|
||||
std::normal_distribution<float> normal_dist;
|
||||
|
||||
public:
|
||||
~signal_generator_c(); // public destructor
|
||||
|
||||
// Where all the action really happens
|
||||
|
||||
int general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_SIGNAL_GENERATOR_C_H */
|
||||
|
||||
@@ -45,42 +45,6 @@
|
||||
|
||||
class Gr_Complex_Ip_Packet_Source : virtual public gr::sync_block
|
||||
{
|
||||
private:
|
||||
boost::mutex d_mutex;
|
||||
pcap_t *descr; //ethernet pcap device descriptor
|
||||
|
||||
char *fifo_buff;
|
||||
|
||||
int fifo_read_ptr;
|
||||
int fifo_write_ptr;
|
||||
int fifo_items;
|
||||
int d_sock_raw;
|
||||
int d_udp_port;
|
||||
struct sockaddr_in si_me;
|
||||
std::string d_src_device;
|
||||
std::string d_origin_address;
|
||||
int d_udp_payload_size;
|
||||
bool d_fifo_full;
|
||||
|
||||
int d_n_baseband_channels;
|
||||
int d_wire_sample_type;
|
||||
int d_bytes_per_sample;
|
||||
size_t d_item_size;
|
||||
bool d_IQ_swap;
|
||||
|
||||
boost::thread *d_pcap_thread;
|
||||
/*!
|
||||
* \brief
|
||||
* Opens the ethernet device using libpcap raw capture mode
|
||||
* If any of these fail, the fuction retuns the error and exits.
|
||||
*/
|
||||
bool open();
|
||||
|
||||
void demux_samples(gr_vector_void_star output_items, int num_samples_readed);
|
||||
void my_pcap_loop_thread(pcap_t *pcap_handle);
|
||||
void pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet);
|
||||
static void static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet);
|
||||
|
||||
public:
|
||||
typedef boost::shared_ptr<Gr_Complex_Ip_Packet_Source> sptr;
|
||||
static sptr make(std::string src_device,
|
||||
@@ -101,15 +65,46 @@ public:
|
||||
bool IQ_swap_);
|
||||
~Gr_Complex_Ip_Packet_Source();
|
||||
|
||||
// Called by gnuradio to enable drivers, etc for i/o devices.
|
||||
bool start();
|
||||
|
||||
// Called by gnuradio to disable drivers, etc for i/o devices.
|
||||
bool stop();
|
||||
|
||||
// Where all the action really happens
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
// Called by gnuradio to enable drivers, etc for i/o devices.
|
||||
bool start();
|
||||
// Called by gnuradio to disable drivers, etc for i/o devices.
|
||||
bool stop();
|
||||
private:
|
||||
boost::mutex d_mutex;
|
||||
pcap_t *descr; //ethernet pcap device descriptor
|
||||
char *fifo_buff;
|
||||
int fifo_read_ptr;
|
||||
int fifo_write_ptr;
|
||||
int fifo_items;
|
||||
int d_sock_raw;
|
||||
int d_udp_port;
|
||||
struct sockaddr_in si_me;
|
||||
std::string d_src_device;
|
||||
std::string d_origin_address;
|
||||
int d_udp_payload_size;
|
||||
bool d_fifo_full;
|
||||
int d_n_baseband_channels;
|
||||
int d_wire_sample_type;
|
||||
int d_bytes_per_sample;
|
||||
size_t d_item_size;
|
||||
bool d_IQ_swap;
|
||||
boost::thread *d_pcap_thread;
|
||||
void demux_samples(gr_vector_void_star output_items, int num_samples_readed);
|
||||
void my_pcap_loop_thread(pcap_t *pcap_handle);
|
||||
void pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet);
|
||||
static void static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet);
|
||||
/*
|
||||
* Opens the ethernet device using libpcap raw capture mode
|
||||
* If any of these fail, the fuction retuns the error and exits.
|
||||
*/
|
||||
bool open();
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H */
|
||||
|
||||
@@ -42,16 +42,34 @@ class labsat23_source;
|
||||
|
||||
using labsat23_source_sptr = boost::shared_ptr<labsat23_source>;
|
||||
|
||||
labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector, gr::msg_queue::sptr queue);
|
||||
labsat23_source_sptr labsat23_make_source_sptr(
|
||||
const char *signal_file_basename,
|
||||
int channel_selector,
|
||||
gr::msg_queue::sptr queue);
|
||||
|
||||
/*!
|
||||
* \brief This class implements conversion between Labsat2 and 3 format byte packet samples to gr_complex
|
||||
*/
|
||||
class labsat23_source : public gr::block
|
||||
{
|
||||
public:
|
||||
~labsat23_source();
|
||||
|
||||
int general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector, gr::msg_queue::sptr queue);
|
||||
labsat23_source(const char *signal_file_basename, int channel_selector, gr::msg_queue::sptr queue);
|
||||
friend labsat23_source_sptr labsat23_make_source_sptr(
|
||||
const char *signal_file_basename,
|
||||
int channel_selector,
|
||||
gr::msg_queue::sptr queue);
|
||||
|
||||
labsat23_source(const char *signal_file_basename,
|
||||
int channel_selector,
|
||||
gr::msg_queue::sptr queue);
|
||||
|
||||
std::string generate_filename();
|
||||
void decode_samples_one_channel(int16_t input_short, gr_complex *out, int type);
|
||||
int getBit(uint8_t byte, int position);
|
||||
@@ -65,13 +83,6 @@ private:
|
||||
uint8_t d_ref_clock;
|
||||
uint8_t d_bits_per_sample;
|
||||
gr::msg_queue::sptr d_queue;
|
||||
|
||||
public:
|
||||
~labsat23_source();
|
||||
int general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -75,7 +75,8 @@ class unpack_2bit_samples;
|
||||
|
||||
using unpack_2bit_samples_sptr = boost::shared_ptr<unpack_2bit_samples>;
|
||||
|
||||
unpack_2bit_samples_sptr make_unpack_2bit_samples(bool big_endian_bytes,
|
||||
unpack_2bit_samples_sptr make_unpack_2bit_samples(
|
||||
bool big_endian_bytes,
|
||||
size_t item_size,
|
||||
bool big_endian_items,
|
||||
bool reverse_interleaving = false);
|
||||
@@ -87,12 +88,25 @@ unpack_2bit_samples_sptr make_unpack_2bit_samples(bool big_endian_bytes,
|
||||
*/
|
||||
class unpack_2bit_samples : public gr::sync_interpolator
|
||||
{
|
||||
private:
|
||||
friend unpack_2bit_samples_sptr
|
||||
make_unpack_2bit_samples_sptr(bool big_endian_bytes,
|
||||
public:
|
||||
~unpack_2bit_samples();
|
||||
|
||||
unpack_2bit_samples(bool big_endian_bytes,
|
||||
size_t item_size,
|
||||
bool big_endian_items,
|
||||
bool reverse_interleaving);
|
||||
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend unpack_2bit_samples_sptr make_unpack_2bit_samples_sptr(
|
||||
bool big_endian_bytes,
|
||||
size_t item_size,
|
||||
bool big_endian_items,
|
||||
bool reverse_interleaving);
|
||||
|
||||
bool big_endian_bytes_;
|
||||
size_t item_size_;
|
||||
bool big_endian_items_;
|
||||
@@ -100,18 +114,6 @@ private:
|
||||
bool swap_endian_bytes_;
|
||||
bool reverse_interleaving_;
|
||||
std::vector<int8_t> work_buffer_;
|
||||
|
||||
public:
|
||||
unpack_2bit_samples(bool big_endian_bytes,
|
||||
size_t item_size,
|
||||
bool big_endian_items,
|
||||
bool reverse_interleaving);
|
||||
|
||||
~unpack_2bit_samples();
|
||||
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -49,15 +49,15 @@ unpack_byte_2bit_cpx_samples_sptr make_unpack_byte_2bit_cpx_samples();
|
||||
*/
|
||||
class unpack_byte_2bit_cpx_samples : public gr::sync_interpolator
|
||||
{
|
||||
private:
|
||||
friend unpack_byte_2bit_cpx_samples_sptr make_unpack_byte_2bit_cpx_samples_sptr();
|
||||
|
||||
public:
|
||||
unpack_byte_2bit_cpx_samples();
|
||||
~unpack_byte_2bit_cpx_samples();
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend unpack_byte_2bit_cpx_samples_sptr make_unpack_byte_2bit_cpx_samples_sptr();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,16 +45,15 @@ unpack_byte_2bit_samples_sptr make_unpack_byte_2bit_samples();
|
||||
*/
|
||||
class unpack_byte_2bit_samples : public gr::sync_interpolator
|
||||
{
|
||||
private:
|
||||
friend unpack_byte_2bit_samples_sptr
|
||||
make_unpack_byte_2bit_samples_sptr();
|
||||
|
||||
public:
|
||||
unpack_byte_2bit_samples();
|
||||
~unpack_byte_2bit_samples();
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend unpack_byte_2bit_samples_sptr make_unpack_byte_2bit_samples_sptr();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,15 +47,15 @@ unpack_byte_4bit_samples_sptr make_unpack_byte_4bit_samples();
|
||||
*/
|
||||
class unpack_byte_4bit_samples : public gr::sync_interpolator
|
||||
{
|
||||
private:
|
||||
friend unpack_byte_4bit_samples_sptr make_unpack_byte_4bit_samples_sptr();
|
||||
|
||||
public:
|
||||
unpack_byte_4bit_samples();
|
||||
~unpack_byte_4bit_samples();
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend unpack_byte_4bit_samples_sptr make_unpack_byte_4bit_samples_sptr();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,16 +45,15 @@ unpack_intspir_1bit_samples_sptr make_unpack_intspir_1bit_samples();
|
||||
*/
|
||||
class unpack_intspir_1bit_samples : public gr::sync_interpolator
|
||||
{
|
||||
private:
|
||||
friend unpack_intspir_1bit_samples_sptr
|
||||
make_unpack_intspir_1bit_samples_sptr();
|
||||
|
||||
public:
|
||||
unpack_intspir_1bit_samples();
|
||||
~unpack_intspir_1bit_samples();
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend unpack_intspir_1bit_samples_sptr make_unpack_intspir_1bit_samples_sptr();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,11 +41,13 @@
|
||||
#include <cstddef> // for size_t
|
||||
#include <cstdint>
|
||||
|
||||
boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item,
|
||||
boost::shared_ptr<gr::block> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
gr::msg_queue::sptr queue);
|
||||
|
||||
boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item,
|
||||
boost::shared_ptr<gr::block> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
gr::msg_queue::sptr queue,
|
||||
bool stop_flowgraph);
|
||||
@@ -56,29 +58,34 @@ boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item,
|
||||
*/
|
||||
class Gnss_Sdr_Valve : public gr::sync_block
|
||||
{
|
||||
friend boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item,
|
||||
public:
|
||||
void open_valve();
|
||||
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend boost::shared_ptr<gr::block> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
gr::msg_queue::sptr queue);
|
||||
friend boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item,
|
||||
|
||||
friend boost::shared_ptr<gr::block> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
gr::msg_queue::sptr queue,
|
||||
bool stop_flowgraph);
|
||||
|
||||
Gnss_Sdr_Valve(size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
gr::msg_queue::sptr queue, bool stop_flowgraph);
|
||||
|
||||
uint64_t d_nitems;
|
||||
uint64_t d_ncopied_items;
|
||||
gr::msg_queue::sptr d_queue;
|
||||
bool d_stop_flowgraph;
|
||||
bool d_open_valve;
|
||||
|
||||
public:
|
||||
Gnss_Sdr_Valve(size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
gr::msg_queue::sptr queue, bool stop_flowgraph);
|
||||
void open_valve();
|
||||
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
};
|
||||
|
||||
#endif /*GNSS_SDR_GNSS_SDR_VALVE_H_*/
|
||||
|
||||
@@ -41,11 +41,6 @@
|
||||
*/
|
||||
class Rtl_Tcp_Dongle_Info
|
||||
{
|
||||
private:
|
||||
char magic_[4]{};
|
||||
uint32_t tuner_type_;
|
||||
uint32_t tuner_gain_count_;
|
||||
|
||||
public:
|
||||
enum
|
||||
{
|
||||
@@ -77,6 +72,11 @@ public:
|
||||
{
|
||||
return tuner_gain_count_;
|
||||
}
|
||||
|
||||
private:
|
||||
char magic_[4]{};
|
||||
uint32_t tuner_type_;
|
||||
uint32_t tuner_gain_count_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -47,6 +47,15 @@
|
||||
*/
|
||||
class Tracking_2nd_DLL_filter
|
||||
{
|
||||
public:
|
||||
void set_DLL_BW(float dll_bw_hz); //!< Set DLL filter bandwidth [Hz]
|
||||
void set_pdi(float pdi_code); //!< Set Summation interval for code [s]
|
||||
void initialize(); //!< Start tracking with acquisition information
|
||||
float get_code_nco(float DLL_discriminator); //!< Numerically controlled oscillator
|
||||
Tracking_2nd_DLL_filter(float pdi_code);
|
||||
Tracking_2nd_DLL_filter();
|
||||
~Tracking_2nd_DLL_filter();
|
||||
|
||||
private:
|
||||
// PLL filter parameters
|
||||
float d_tau1_code = 0.0;
|
||||
@@ -57,15 +66,6 @@ private:
|
||||
float d_old_code_error = 0.0;
|
||||
float d_old_code_nco = 0.0;
|
||||
void calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k);
|
||||
|
||||
public:
|
||||
void set_DLL_BW(float dll_bw_hz); //! Set DLL filter bandwidth [Hz]
|
||||
void set_pdi(float pdi_code); //! Set Summation interval for code [s]
|
||||
void initialize(); //! Start tracking with acquisition information
|
||||
float get_code_nco(float DLL_discriminator); //! Numerically controlled oscillator
|
||||
Tracking_2nd_DLL_filter(float pdi_code);
|
||||
Tracking_2nd_DLL_filter();
|
||||
~Tracking_2nd_DLL_filter();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,28 +46,25 @@
|
||||
*/
|
||||
class Tracking_2nd_PLL_filter
|
||||
{
|
||||
private:
|
||||
// PLL filter parameters
|
||||
float d_tau1_carr = 0.0;
|
||||
float d_tau2_carr = 0.0;
|
||||
float d_pdi_carr = 0.0;
|
||||
|
||||
float d_pllnoisebandwidth = 0.0;
|
||||
float d_plldampingratio = 0.0;
|
||||
|
||||
float d_old_carr_error = 0.0;
|
||||
float d_old_carr_nco = 0.0;
|
||||
|
||||
void calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k);
|
||||
|
||||
public:
|
||||
void set_PLL_BW(float pll_bw_hz); //! Set PLL loop bandwidth [Hz]
|
||||
void set_pdi(float pdi_carr); //! Set Summation interval for code [s]
|
||||
void set_PLL_BW(float pll_bw_hz); //!< Set PLL loop bandwidth [Hz]
|
||||
void set_pdi(float pdi_carr); //!< Set Summation interval for code [s]
|
||||
void initialize();
|
||||
float get_carrier_nco(float PLL_discriminator);
|
||||
Tracking_2nd_PLL_filter(float pdi_carr);
|
||||
Tracking_2nd_PLL_filter();
|
||||
~Tracking_2nd_PLL_filter();
|
||||
|
||||
private:
|
||||
// PLL filter parameters
|
||||
float d_tau1_carr = 0.0;
|
||||
float d_tau2_carr = 0.0;
|
||||
float d_pdi_carr = 0.0;
|
||||
float d_pllnoisebandwidth = 0.0;
|
||||
float d_plldampingratio = 0.0;
|
||||
float d_old_carr_error = 0.0;
|
||||
float d_old_carr_nco = 0.0;
|
||||
void calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,6 +36,13 @@
|
||||
*/
|
||||
class Tracking_FLL_PLL_filter
|
||||
{
|
||||
public:
|
||||
void set_params(float fll_bw_hz, float pll_bw_hz, int order);
|
||||
void initialize(float d_acq_carrier_doppler_hz);
|
||||
float get_carrier_error(float FLL_discriminator, float PLL_discriminator, float correlation_time_s);
|
||||
Tracking_FLL_PLL_filter();
|
||||
~Tracking_FLL_PLL_filter();
|
||||
|
||||
private:
|
||||
// FLL + PLL filter parameters
|
||||
int d_order;
|
||||
@@ -49,13 +56,6 @@ private:
|
||||
float d_pll_w0p2;
|
||||
float d_pll_b3;
|
||||
float d_pll_w0p;
|
||||
|
||||
public:
|
||||
void set_params(float fll_bw_hz, float pll_bw_hz, int order);
|
||||
void initialize(float d_acq_carrier_doppler_hz);
|
||||
float get_carrier_error(float FLL_discriminator, float PLL_discriminator, float correlation_time_s);
|
||||
Tracking_FLL_PLL_filter();
|
||||
~Tracking_FLL_PLL_filter();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -43,6 +43,27 @@
|
||||
*/
|
||||
class Tracking_loop_filter
|
||||
{
|
||||
public:
|
||||
float get_noise_bandwidth(void) const;
|
||||
float get_update_interval(void) const;
|
||||
bool get_include_last_integrator(void) const;
|
||||
int get_order(void) const;
|
||||
|
||||
void set_noise_bandwidth(float noise_bandwidth);
|
||||
void set_update_interval(float update_interval);
|
||||
void set_include_last_integrator(bool include_last_integrator);
|
||||
void set_order(int loop_order);
|
||||
|
||||
void initialize(float initial_output = 0.0);
|
||||
float apply(float current_input);
|
||||
|
||||
Tracking_loop_filter(float update_interval, float noise_bandwidth,
|
||||
int loop_order = 2,
|
||||
bool include_last_integrator = false);
|
||||
|
||||
Tracking_loop_filter();
|
||||
~Tracking_loop_filter();
|
||||
|
||||
private:
|
||||
// Store the last inputs and outputs:
|
||||
std::vector<float> d_inputs;
|
||||
@@ -71,27 +92,6 @@ private:
|
||||
|
||||
// Compute the filter coefficients:
|
||||
void update_coefficients(void);
|
||||
|
||||
public:
|
||||
float get_noise_bandwidth(void) const;
|
||||
float get_update_interval(void) const;
|
||||
bool get_include_last_integrator(void) const;
|
||||
int get_order(void) const;
|
||||
|
||||
void set_noise_bandwidth(float noise_bandwidth);
|
||||
void set_update_interval(float update_interval);
|
||||
void set_include_last_integrator(bool include_last_integrator);
|
||||
void set_order(int loop_order);
|
||||
|
||||
void initialize(float initial_output = 0.0);
|
||||
float apply(float current_input);
|
||||
|
||||
Tracking_loop_filter(float update_interval, float noise_bandwidth,
|
||||
int loop_order = 2,
|
||||
bool include_last_integrator = false);
|
||||
|
||||
Tracking_loop_filter();
|
||||
~Tracking_loop_filter();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user