GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
direct_resampler_conditioner_cc.h
Go to the documentation of this file.
1 /*!
2  * \file direct_resampler_conditioner_cc.h
3  *
4  * \brief Nearest neighborhood resampler with
5  * gr_complex input and gr_complex output
6  * \author Luis Esteve, 2011. luis(at)epsilon-formacion.com
7  *
8  * This block takes in a signal stream and performs direct resampling.
9  * The theory behind this block can be found in Chapter 7.5 of the following
10  * book:
11  * R. Lyons, Undestanding Digital Signal Processing, 3rd ed., Pearson Education,
12  * 2010.
13  *
14  * -----------------------------------------------------------------------------
15  *
16  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
17  * This file is part of GNSS-SDR.
18  *
19  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
20  * SPDX-License-Identifier: GPL-3.0-or-later
21  *
22  * -----------------------------------------------------------------------------
23  */
24 
25 #ifndef GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H
26 #define GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H
27 
28 #include "gnss_block_interface.h"
29 #include <gnuradio/block.h>
30 #include <cstdint>
31 
32 /** \addtogroup Resampler
33  * \{ */
34 /** \addtogroup Resampler_gnuradio_blocks resampler_gr_blocks
35  * \{ */
36 
37 
39 
40 using direct_resampler_conditioner_cc_sptr = gnss_shared_ptr<direct_resampler_conditioner_cc>;
41 
42 direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc(
43  double sample_freq_in,
44  double sample_freq_out);
45 
46 /*!
47  * \brief This class implements a direct resampler conditioner for complex data
48  *
49  * Direct resampling without interpolation
50  */
51 class direct_resampler_conditioner_cc : public gr::block
52 {
53 public:
55  inline unsigned int sample_freq_in() const
56  {
57  return d_sample_freq_in;
58  }
59 
60  inline unsigned int sample_freq_out() const
61  {
62  return d_sample_freq_out;
63  }
64 
65  void forecast(int noutput_items, gr_vector_int &ninput_items_required);
66 
67  int general_work(int noutput_items, gr_vector_int &ninput_items,
68  gr_vector_const_void_star &input_items,
69  gr_vector_void_star &output_items);
70 
71 private:
72  friend direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc(
73  double sample_freq_in,
74  double sample_freq_out);
75 
77  double sample_freq_in,
78  double sample_freq_out);
79 
80  double d_sample_freq_in; // Sampling frequency of the input signal
81  double d_sample_freq_out; // Sampling frequency of the output signal
82  uint32_t d_phase;
83  uint32_t d_lphase;
84  uint32_t d_phase_step;
85 };
86 
87 
88 /** \} */
89 /** \} */
90 #endif // GNSS_SDR_DIRECT_RESAMPLER_CONDITIONER_CC_H
This interface represents a GNSS block.
This class implements a direct resampler conditioner for complex data.