GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
cshort_to_grcomplex.h
Go to the documentation of this file.
1/*!
2 * \file cshort_to_grcomplex.h
3 * \brief Adapts an 16-bits complex sample stream to a float complex stream
4 * \author Carles Fernandez Prades, 2014 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-2024 (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_CSHORT_TO_GRCOMPLEX_H
18#define GNSS_SDR_CSHORT_TO_GRCOMPLEX_H
19
22#include <gnuradio/blocks/file_sink.h>
23#include <cstdint>
24#include <string>
25
26/** \addtogroup Data_Type Data Type Adapters
27 * Classes for data type conversion
28 * \{ */
29/** \addtogroup Data_type_adapters data_type_adapters
30 * Wrap GNU Radio data type adapter blocks with a GNSSBlockInterface
31 * \{ */
32
33
35
36/*!
37 * \brief Adapts an 16-bits complex sample stream to a float complex stream
38 *
39 */
40class CshortToGrComplex : public GNSSBlockInterface
41{
42public:
43 CshortToGrComplex(const ConfigurationInterface* configuration,
44 std::string role, unsigned int in_streams,
45 unsigned int out_streams);
46
47 ~CshortToGrComplex() = default;
48
49 inline std::string role() override
50 {
51 return role_;
52 }
53
54 //! Returns "Cshort_To_Gr_Complex"
55 inline std::string implementation() override
56 {
57 return "Cshort_To_Gr_Complex";
58 }
59
60 inline size_t item_size() override
61 {
62 return 2 * sizeof(float);
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
70private:
71 cshort_to_gr_complex_sptr cshort_to_gr_complex_;
72 gr::blocks::file_sink::sptr file_sink_;
73 std::string dump_filename_;
74 std::string role_;
75 unsigned int in_streams_;
76 unsigned int out_streams_;
77 bool dump_;
78};
79
80
81/** \} */
82/** \} */
83#endif // GNSS_SDR_CSHORT_TO_GRCOMPLEX_H
This abstract class represents an interface to configuration parameters.
std::string implementation() override
Returns "Cshort_To_Gr_Complex".
This abstract class represents an interface to GNSS blocks.
Adapts a complex short (16 + 16 bits) sample stream into a std::complex<float> stream (32 + 32 bits).
This interface represents a GNSS block.