GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
pulse_blanking_cc.h
Go to the documentation of this file.
1 /*!
2  * \file pulse_blanking_cc.h
3  * \brief Implements a pulse blanking algorithm
4  * \author Javier Arribas (jarribas(at)cttc.es)
5  * Antonio Ramos (antonio.ramosdet(at)gmail.com)
6  * -----------------------------------------------------------------------------
7  *
8  * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
9  *
10  * GNSS-SDR is a software defined Global Navigation
11  * Satellite Systems receiver
12  *
13  * This file is part of GNSS-SDR.
14  *
15  * SPDX-License-Identifier: GPL-3.0-or-later
16  *
17  * -----------------------------------------------------------------------------
18  */
19 
20 #ifndef GNSS_SDR_PULSE_BLANKING_H
21 #define GNSS_SDR_PULSE_BLANKING_H
22 
23 #if GNURADIO_USES_STD_POINTERS
24 #include <memory>
25 #else
26 #include <boost/shared_ptr.hpp>
27 #endif
28 #include <gnuradio/block.h>
29 #include <volk_gnsssdr/volk_gnsssdr_alloc.h> // for volk_gnsssdr::vector
30 #include <cstdint>
31 
32 class pulse_blanking_cc;
33 
34 #if GNURADIO_USES_STD_POINTERS
35 using pulse_blanking_cc_sptr = std::shared_ptr<pulse_blanking_cc>;
36 #else
37 using pulse_blanking_cc_sptr = boost::shared_ptr<pulse_blanking_cc>;
38 #endif
39 
40 pulse_blanking_cc_sptr make_pulse_blanking_cc(
41  float pfa,
42  int32_t length_,
43  int32_t n_segments_est,
44  int32_t n_segments_reset);
45 
46 class pulse_blanking_cc : public gr::block
47 {
48 public:
49  ~pulse_blanking_cc() = default;
50 
51  void forecast(int noutput_items, gr_vector_int &ninput_items_required);
52 
53  int general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
54  gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
55 
56 private:
57  friend pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset);
58  pulse_blanking_cc(float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset);
59  volk_gnsssdr::vector<gr_complex> zeros_;
60  float noise_power_estimation;
61  float thres_;
62  float pfa;
63  int32_t length_;
64  int32_t n_segments;
65  int32_t n_segments_est;
66  int32_t n_segments_reset;
67  int32_t n_deg_fred;
68  bool last_filtered;
69 };
70 
71 #endif // GNSS_SDR_PULSE_BLANKING_H