2013-07-15 17:07:10 +00:00
|
|
|
/*!
|
|
|
|
* \file galileo_e1b_telemetry_decoder_cc.h
|
2013-11-29 08:38:22 +00:00
|
|
|
* \brief Interface of a Galileo INAV message demodulator block
|
2013-11-17 10:48:27 +00:00
|
|
|
* \author Javier Arribas 2013 jarribas(at)cttc.es,
|
|
|
|
* Mara Branzanti 2013 mara.branzanti(at)gmail.com
|
|
|
|
*
|
2013-07-15 17:07:10 +00:00
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*
|
2015-01-08 18:49:59 +00:00
|
|
|
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
2013-07-15 17:07:10 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is a software defined Global Navigation
|
|
|
|
* Satellite Systems receiver
|
|
|
|
*
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
|
|
|
* GNSS-SDR is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
2015-01-08 18:49:59 +00:00
|
|
|
* (at your option) any later version.
|
2013-07-15 17:07:10 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2013-11-17 10:48:27 +00:00
|
|
|
#ifndef GNSS_SDR_GALILEO_E1B_TELEMETRY_DECODER_CC_H
|
|
|
|
#define GNSS_SDR_GALILEO_E1B_TELEMETRY_DECODER_CC_H
|
2013-07-15 17:07:10 +00:00
|
|
|
|
2018-02-26 02:15:53 +00:00
|
|
|
|
2014-01-12 20:07:38 +00:00
|
|
|
#include "Galileo_E1.h"
|
2013-07-15 17:07:10 +00:00
|
|
|
#include "galileo_navigation_message.h"
|
|
|
|
#include "galileo_ephemeris.h"
|
|
|
|
#include "galileo_almanac.h"
|
|
|
|
#include "galileo_iono.h"
|
|
|
|
#include "galileo_utc_model.h"
|
2018-02-26 02:15:53 +00:00
|
|
|
#include "gnss_satellite.h"
|
2017-05-16 16:26:29 +00:00
|
|
|
#include "gnss_synchro.h"
|
2018-02-26 02:15:53 +00:00
|
|
|
#include <gnuradio/block.h>
|
|
|
|
#include <fstream>
|
|
|
|
#include <string>
|
2013-08-15 15:14:17 +00:00
|
|
|
|
|
|
|
|
2013-07-15 17:07:10 +00:00
|
|
|
class galileo_e1b_telemetry_decoder_cc;
|
|
|
|
|
|
|
|
typedef boost::shared_ptr<galileo_e1b_telemetry_decoder_cc> galileo_e1b_telemetry_decoder_cc_sptr;
|
|
|
|
|
2018-03-03 01:03:39 +00:00
|
|
|
galileo_e1b_telemetry_decoder_cc_sptr galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump);
|
2013-07-15 17:07:10 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief This class implements a block that decodes the INAV data defined in Galileo ICD
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class galileo_e1b_telemetry_decoder_cc : public gr::block
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~galileo_e1b_telemetry_decoder_cc();
|
2018-03-03 01:03:39 +00:00
|
|
|
void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN
|
|
|
|
void set_channel(int channel); //!< Set receiver's channel
|
2013-07-30 16:40:20 +00:00
|
|
|
int flag_even_word_arrived;
|
2015-06-22 14:08:28 +00:00
|
|
|
|
2013-07-15 17:07:10 +00:00
|
|
|
/*!
|
2013-11-17 10:48:27 +00:00
|
|
|
* \brief This is where all signal processing takes place
|
2013-07-15 17:07:10 +00:00
|
|
|
*/
|
2018-03-03 01:03:39 +00:00
|
|
|
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
|
|
|
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
|
2013-11-17 10:48:27 +00:00
|
|
|
|
2013-07-15 17:07:10 +00:00
|
|
|
private:
|
|
|
|
friend galileo_e1b_telemetry_decoder_cc_sptr
|
2018-03-03 01:03:39 +00:00
|
|
|
galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump);
|
|
|
|
galileo_e1b_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump);
|
2013-07-15 17:07:10 +00:00
|
|
|
|
2013-07-17 17:25:40 +00:00
|
|
|
void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
|
|
|
|
|
|
|
|
void deinterleaver(int rows, int cols, double *in, double *out);
|
|
|
|
|
2018-03-03 01:03:39 +00:00
|
|
|
void decode_word(double *symbols, int frame_length);
|
2013-10-30 18:08:25 +00:00
|
|
|
|
2013-07-15 17:07:10 +00:00
|
|
|
unsigned short int d_preambles_bits[GALILEO_INAV_PREAMBLE_LENGTH_BITS];
|
|
|
|
|
2015-12-02 17:25:06 +00:00
|
|
|
int *d_preambles_symbols;
|
2013-07-15 17:07:10 +00:00
|
|
|
unsigned int d_samples_per_symbol;
|
|
|
|
int d_symbols_per_preamble;
|
|
|
|
|
2017-05-16 16:26:29 +00:00
|
|
|
std::deque<Gnss_Synchro> d_symbol_history;
|
|
|
|
|
2013-07-15 17:07:10 +00:00
|
|
|
long unsigned int d_sample_counter;
|
|
|
|
long unsigned int d_preamble_index;
|
|
|
|
unsigned int d_stat;
|
|
|
|
bool d_flag_frame_sync;
|
|
|
|
|
|
|
|
bool d_flag_parity;
|
|
|
|
bool d_flag_preamble;
|
2013-10-30 18:08:25 +00:00
|
|
|
int d_CRC_error_counter;
|
2013-07-15 17:07:10 +00:00
|
|
|
|
|
|
|
// navigation message vars
|
|
|
|
Galileo_Navigation_Message d_nav;
|
|
|
|
|
|
|
|
bool d_dump;
|
|
|
|
Gnss_Satellite d_satellite;
|
|
|
|
int d_channel;
|
|
|
|
|
|
|
|
double d_TOW_at_current_symbol;
|
2014-06-18 09:04:26 +00:00
|
|
|
|
2013-07-15 17:07:10 +00:00
|
|
|
bool flag_TOW_set;
|
2018-03-03 01:03:39 +00:00
|
|
|
double delta_t; //GPS-GALILEO time offset
|
2014-06-13 16:38:16 +00:00
|
|
|
|
2013-07-15 17:07:10 +00:00
|
|
|
std::string d_dump_filename;
|
|
|
|
std::ofstream d_dump_file;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|