GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
ibyte_to_complex.h
Go to the documentation of this file.
1 /*!
2  * \file ibyte_to_complex.h
3  * \brief Adapts an I/Q interleaved byte integer sample stream to a gr_complex (float) stream
4  * \author Javier Arribas, jarribas(at)cttc.es
5  *
6  * -----------------------------------------------------------------------------
7  *
8  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
9  * This file is part of GNSS-SDR.
10  *
11  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
12  * SPDX-License-Identifier: GPL-3.0-or-later
13  *
14  * -----------------------------------------------------------------------------
15  */
16 
17 #ifndef GNSS_SDR_IBYTE_TO_COMPLEX_H
18 #define GNSS_SDR_IBYTE_TO_COMPLEX_H
19 
20 #include "conjugate_cc.h"
21 #include "gnss_block_interface.h"
22 #include <gnuradio/blocks/file_sink.h>
23 #include <gnuradio/blocks/interleaved_char_to_complex.h>
24 #include <cstdint>
25 #include <string>
26 
27 /** \addtogroup Data_Type
28  * \{ */
29 /** \addtogroup Data_type_adapters
30  * \{ */
31 
32 
34 
35 /*!
36  * \brief Adapts an I/Q interleaved byte integer sample stream to a gr_complex (float) stream
37  *
38  */
40 {
41 public:
42  IbyteToComplex(const ConfigurationInterface* configuration,
43  const std::string& role, unsigned int in_streams,
44  unsigned int out_streams);
45 
46  ~IbyteToComplex() = default;
47 
48  inline std::string role() override
49  {
50  return role_;
51  }
52 
53  //! Returns "Ibyte_To_Complex"
54  inline std::string implementation() override
55  {
56  return "Ibyte_To_Complex";
57  }
58 
59  inline size_t item_size() override
60  {
61  return 2 * sizeof(int8_t);
62  }
63 
64  void connect(gr::top_block_sptr top_block) override;
65  void disconnect(gr::top_block_sptr top_block) override;
66  gr::basic_block_sptr get_left_block() override;
67  gr::basic_block_sptr get_right_block() override;
68 
69 private:
70  gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex_;
71  conjugate_cc_sptr conjugate_cc_;
72  gr::blocks::file_sink::sptr file_sink_;
73  std::string dump_filename_;
74  std::string input_item_type_;
75  std::string output_item_type_;
76  std::string role_;
77  unsigned int in_streams_;
78  unsigned int out_streams_;
79  bool inverted_spectrum;
80  bool dump_;
81 };
82 
83 
84 /** \} */
85 /** \} */
86 #endif // GNSS_SDR_IBYTE_TO_COMPLEX_H
std::string implementation() override
Returns "Ibyte_To_Complex".
This interface represents a GNSS block.
This abstract class represents an interface to configuration parameters.
Conjugate a stream of gr_complex.
Adapts an I/Q interleaved byte integer sample stream to a gr_complex (float) stream.
This abstract class represents an interface to GNSS blocks.