gnss-sdr/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.h

90 lines
2.3 KiB
C
Raw Normal View History

2015-02-03 18:41:47 +00:00
/*!
* \file ishort_to_cshort.h
* \brief Adapts a short interleaved sample stream into a std::complex<short> stream
* \author Carles Fernandez-Prades, cfernandez(at)cttc.es
*
2020-07-28 14:57:15 +00:00
* -----------------------------------------------------------------------------
2015-02-03 18:41:47 +00:00
*
2020-07-28 14:57:15 +00:00
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
2015-02-03 18:41:47 +00:00
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* SPDX-License-Identifier: GPL-3.0-or-later
2015-02-03 18:41:47 +00:00
*
2020-07-28 14:57:15 +00:00
* -----------------------------------------------------------------------------
2015-02-03 18:41:47 +00:00
*/
#ifndef GNSS_SDR_ISHORT_TO_CSHORT_H
#define GNSS_SDR_ISHORT_TO_CSHORT_H
2015-02-03 18:41:47 +00:00
2017-11-17 08:21:03 +00:00
#include "conjugate_sc.h"
2015-02-03 18:41:47 +00:00
#include "gnss_block_interface.h"
#include "interleaved_short_to_complex_short.h"
#include <gnuradio/blocks/file_sink.h>
2020-07-03 23:06:32 +00:00
#include <cstdint>
#include <string>
2015-02-03 18:41:47 +00:00
/** \addtogroup Data_Type
* \{ */
/** \addtogroup Data_type_adapters
* \{ */
2015-02-03 18:41:47 +00:00
class ConfigurationInterface;
/*!
* \brief Adapts a short integer (16 bits) interleaved sample stream into a std::complex<short> stream
*
*/
class IshortToCshort : public GNSSBlockInterface
2015-02-03 18:41:47 +00:00
{
public:
IshortToCshort(const ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams,
unsigned int out_streams);
2015-02-03 18:41:47 +00:00
~IshortToCshort() = default;
2015-02-03 18:41:47 +00:00
inline std::string role() override
2015-02-03 18:41:47 +00:00
{
return role_;
}
2015-02-17 01:31:22 +00:00
//! Returns "Ishort_To_Cshort"
inline std::string implementation() override
2015-02-03 18:41:47 +00:00
{
2015-02-17 01:31:22 +00:00
return "Ishort_To_Cshort";
2015-02-03 18:41:47 +00:00
}
inline size_t item_size() override
2015-02-03 18:41:47 +00:00
{
2020-07-03 23:06:32 +00:00
return 2 * sizeof(int16_t);
2015-02-03 18:41:47 +00:00
}
void connect(gr::top_block_sptr top_block) override;
void disconnect(gr::top_block_sptr top_block) override;
gr::basic_block_sptr get_left_block() override;
gr::basic_block_sptr get_right_block() override;
2015-02-03 18:41:47 +00:00
private:
interleaved_short_to_complex_short_sptr interleaved_short_to_complex_short_;
2020-06-25 09:58:01 +00:00
conjugate_sc_sptr conjugate_sc_;
gr::blocks::file_sink::sptr file_sink_;
2015-02-03 18:41:47 +00:00
std::string dump_filename_;
std::string input_item_type_;
std::string output_item_type_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
2017-11-17 08:21:03 +00:00
bool inverted_spectrum;
2020-06-25 09:58:01 +00:00
bool dump_;
2015-02-03 18:41:47 +00:00
};
/** \} */
/** \} */
#endif // GNSS_SDR_ISHORT_TO_CSHORT_H