GNSS-SDR  0.0.13
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  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
10  *
11  * GNSS-SDR is a software defined Global Navigation
12  * Satellite Systems receiver
13  *
14  * This file is part of GNSS-SDR.
15  *
16  * SPDX-License-Identifier: GPL-3.0-or-later
17  *
18  * -----------------------------------------------------------------------------
19  */
20 
21 #ifndef GNSS_SDR_IBYTE_TO_CBYTE_H
22 #define GNSS_SDR_IBYTE_TO_CBYTE_H
23 
24 #include "conjugate_ic.h"
25 #include "gnss_block_interface.h"
27 #include <gnuradio/blocks/file_sink.h>
28 #include <cstdint>
29 #include <string>
30 
32 
33 /*!
34  * \briefAdapts an I/Q interleaved byte (unsigned char) sample stream
35  * into a std::complex<unsigned char> stream
36  */
38 {
39 public:
40  IbyteToCbyte(const ConfigurationInterface* configuration,
41  const std::string& role, unsigned int in_streams,
42  unsigned int out_streams);
43 
44  ~IbyteToCbyte() = default;
45 
46  inline std::string role() override
47  {
48  return role_;
49  }
50 
51  //! Returns "Ibyte_To_Cbyte"
52  inline std::string implementation() override
53  {
54  return "Ibyte_To_Cbyte";
55  }
56 
57  inline size_t item_size() override
58  {
59  return 2 * sizeof(int8_t);
60  }
61 
62  void connect(gr::top_block_sptr top_block) override;
63  void disconnect(gr::top_block_sptr top_block) override;
64  gr::basic_block_sptr get_left_block() override;
65  gr::basic_block_sptr get_right_block() override;
66 
67 private:
68  interleaved_byte_to_complex_byte_sptr ibyte_to_cbyte_;
69  conjugate_ic_sptr conjugate_ic_;
70  gr::blocks::file_sink::sptr file_sink_;
71  std::string dump_filename_;
72  std::string input_item_type_;
73  std::string output_item_type_;
74  std::string role_;
75  unsigned int in_streams_;
76  unsigned int out_streams_;
77  bool inverted_spectrum;
78  bool dump_;
79 };
80 
81 #endif
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.