GNSS-SDR  0.0.13
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  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
9  *
10  * GNSS-SDR is a software defined Global Navigation
11  * Satellite Systems receiver
12  *
13  * This file is part of GNSS-SDR.
14  *
15  * SPDX-License-Identifier: GPL-3.0-or-later
16  *
17  * -----------------------------------------------------------------------------
18  */
19 
20 #ifndef GNSS_SDR_IBYTE_TO_CSHORT_H
21 #define GNSS_SDR_IBYTE_TO_CSHORT_H
22 
23 #include "conjugate_sc.h"
24 #include "gnss_block_interface.h"
26 #include <gnuradio/blocks/file_sink.h>
27 #include <cstdint>
28 #include <string>
29 
30 
32 
33 /*!
34  * \brief Adapts a short integer (16 bits) interleaved sample stream into a std::complex<short> stream
35  *
36  */
38 {
39 public:
40  IbyteToCshort(const ConfigurationInterface* configuration,
41  const std::string& role, unsigned int in_streams,
42  unsigned int out_streams);
43 
44  ~IbyteToCshort() = default;
45 
46  inline std::string role() override
47  {
48  return role_;
49  }
50 
51  //! Returns "Ibyte_To_Cshort"
52  inline std::string implementation() override
53  {
54  return "Ibyte_To_Cshort";
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_short_sptr interleaved_byte_to_complex_short_;
69  conjugate_sc_sptr conjugate_sc_;
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
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.