GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
ibyte_to_cshort.h
Go to the documentation of this file.
1 /*!
2  * \file ibyte_to_cshort.h
3  * \brief Adapts a short interleaved sample stream into a std::complex<short> stream
4  * \author Carles Fernandez-Prades, cfernandez(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_CSHORT_H
18 #define GNSS_SDR_IBYTE_TO_CSHORT_H
19 
20 #include "conjugate_sc.h"
21 #include "gnss_block_interface.h"
23 #include <gnuradio/blocks/file_sink.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 a short integer (16 bits) interleaved sample stream into a std::complex<short> stream
37  *
38  */
40 {
41 public:
42  IbyteToCshort(const ConfigurationInterface* configuration,
43  const std::string& role, unsigned int in_streams,
44  unsigned int out_streams);
45 
46  ~IbyteToCshort() = default;
47 
48  inline std::string role() override
49  {
50  return role_;
51  }
52 
53  //! Returns "Ibyte_To_Cshort"
54  inline std::string implementation() override
55  {
56  return "Ibyte_To_Cshort";
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  interleaved_byte_to_complex_short_sptr interleaved_byte_to_complex_short_;
71  conjugate_sc_sptr conjugate_sc_;
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_CSHORT_H
This interface represents a GNSS block.
This abstract class represents an interface to configuration parameters.
std::string implementation() override
Returns "Ibyte_To_Cshort".
This abstract class represents an interface to GNSS blocks.
Adapts a short integer (16 bits) interleaved sample stream into a std::complex<short> stream...
Conjugate a stream of lv_16sc_t ( std::complex<short> )
Adapts a byte (8-bits) interleaved sample stream into a std::complex<short> stream.