GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
two_bit_cpx_file_signal_source.h
Go to the documentation of this file.
1/*!
2 * \file two_bit_cpx_file_signal_source.h
3 * \brief Interface of a class that reads signals samples from a 2 bit complex sampler front-end file
4 * and adapts it to a SignalSourceInterface.
5 * \author Javier Arribas, 2015 jarribas(at)cttc.es
6 *
7 * This class represents a file signal source.
8 *
9 * -----------------------------------------------------------------------------
10 *
11 * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
12 * This file is part of GNSS-SDR.
13 *
14 * Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
15 * SPDX-License-Identifier: GPL-3.0-or-later
16 *
17 * -----------------------------------------------------------------------------
18 */
19
20#ifndef GNSS_SDR_TWO_BIT_CPX_FILE_SIGNAL_SOURCE_H
21#define GNSS_SDR_TWO_BIT_CPX_FILE_SIGNAL_SOURCE_H
22
23#include "file_source_base.h"
25#include <gnuradio/blocks/interleaved_short_to_complex.h>
26#include <cstddef>
27#include <string>
28#include <tuple>
29
30/** \addtogroup Signal_Source
31 * \{ */
32/** \addtogroup Signal_Source_adapters
33 * \{ */
34
35
37
38/*!
39 * \brief Class that reads signals samples from a file
40 * and adapts it to a SignalSourceInterface
41 */
42class TwoBitCpxFileSignalSource : public FileSourceBase
43{
44public:
45 TwoBitCpxFileSignalSource(const ConfigurationInterface* configuration,
46 const std::string& role,
47 unsigned int in_streams,
48 unsigned int out_streams,
50
51 ~TwoBitCpxFileSignalSource() = default;
52
53protected:
54 std::tuple<size_t, bool> itemTypeToSize() override;
55 double packetsPerSample() const override;
56 gnss_shared_ptr<gr::block> source() const override;
57 void create_file_source_hook() override;
58 void pre_connect_hook(gr::top_block_sptr top_block) override;
59 void pre_disconnect_hook(gr::top_block_sptr top_block) override;
60
61private:
62 unpack_byte_2bit_cpx_samples_sptr unpack_byte_;
63 gr::blocks::interleaved_short_to_complex::sptr inter_shorts_to_cpx_;
64};
65
66
67/** \} */
68/** \} */
69#endif // GNSS_SDR_TWO_BIT_CPX_FILE_SIGNAL_SOURCE_H
This class implements a thread-safe std::queue.
This abstract class represents an interface to configuration parameters.
FileSourceBase(ConfigurationInterface const *configuration, std::string const &role, std::string impl, Concurrent_Queue< pmt::pmt_t > *queue, std::string default_item_type="short")
Constructor.
double packetsPerSample() const override
The number of (possibly unpacked) samples in a (raw) file sample (default=1).
gnss_shared_ptr< gr::block > source() const override
Abstracted front-end source. Sub-classes may override if they create specialized chains to decode sou...
std::tuple< size_t, bool > itemTypeToSize() override
Compute the item size, from the item_type(). Subclasses may constrain types that don't make.
Header file of the base class to file-oriented signal_source GNSS blocks.
Unpacks byte samples to 2 bits complex samples. Packing Order Most Significant Nibble - Sample n Leas...