GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
four_bit_cpx_file_signal_source.h
Go to the documentation of this file.
1/*!
2 * \file four_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_FOUR_BIT_CPX_FILE_SIGNAL_SOURCE_H
21#define GNSS_SDR_FOUR_BIT_CPX_FILE_SIGNAL_SOURCE_H
22
23#include "file_source_base.h"
24#include "gnss_sdr_timestamp.h"
26#include <gnuradio/blocks/interleaved_short_to_complex.h>
27#include <cstddef>
28#include <string>
29#include <tuple>
30
31/** \addtogroup Signal_Source
32 * \{ */
33/** \addtogroup Signal_Source_adapters
34 * \{ */
35
36
38
39/*!
40 * \brief Class that reads signals samples from a file
41 * and adapts it to a SignalSourceInterface
42 */
43class FourBitCpxFileSignalSource : public FileSourceBase
44{
45public:
46 FourBitCpxFileSignalSource(const ConfigurationInterface* configuration,
47 const std::string& role,
48 unsigned int in_streams,
49 unsigned int out_streams,
51
52 ~FourBitCpxFileSignalSource() = default;
53
54protected:
55 std::tuple<size_t, bool> itemTypeToSize() override;
56 double packetsPerSample() const override;
57 gnss_shared_ptr<gr::block> source() const override;
58 void create_file_source_hook() override;
59 void pre_connect_hook(gr::top_block_sptr top_block) override;
60 void pre_disconnect_hook(gr::top_block_sptr top_block) override;
61
62private:
63 unpack_byte_4bit_samples_sptr unpack_byte_;
64 gr::blocks::interleaved_short_to_complex::sptr inter_shorts_to_cpx_;
65 gnss_shared_ptr<Gnss_Sdr_Timestamp> timestamp_block_;
66 std::string sample_type_;
67 std::string timestamp_file_;
68 double timestamp_clock_offset_ms_;
69 bool reverse_interleaving_;
70};
71
72
73/** \} */
74/** \} */
75#endif // GNSS_SDR_FOUR_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).
std::tuple< size_t, bool > itemTypeToSize() override
Compute the item size, from the item_type(). Subclasses may constrain types that don't make.
gnss_shared_ptr< gr::block > source() const override
Abstracted front-end source. Sub-classes may override if they create specialized chains to decode sou...
Header file of the base class to file-oriented signal_source GNSS blocks.
GNURadio block that adds to sample stream timestamp metadata information stored on a sepparated file.
Unpacks byte samples to 4 bits samples. Packing Order Packing order in Nibble I0 I1 I2 I3 I0 I1 I2 I3...