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