GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
ntlab_file_signal_source.h
Go to the documentation of this file.
1/*!
2 * \file ntlab_file_signal_source.h
3 * \brief Interface of a class that reads signal samples from a file. Each
4 * sample is two bits from multiple channels.
5 *
6 * \author Pedro Pereira, 2025 pereirapedrocp (at) gmail.com
7 *
8 * This class represents a file signal source.
9 *
10 * -----------------------------------------------------------------------------
11 *
12 * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
13 * This file is part of GNSS-SDR.
14 *
15 * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
16 * SPDX-License-Identifier: GPL-3.0-or-later
17 *
18 * -----------------------------------------------------------------------------
19 */
20
21#ifndef GNSS_SDR_NTLAB_FILE_SIGNAL_SOURCE_H
22#define GNSS_SDR_NTLAB_FILE_SIGNAL_SOURCE_H
23
24#include "file_source_base.h"
26#include <cstddef>
27#include <string>
28#include <tuple>
29
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 NTLabFileSignalSource : public FileSourceBase
44{
45public:
46 NTLabFileSignalSource(const ConfigurationInterface* configuration,
47 const std::string& role, unsigned int in_streams,
48 unsigned int out_streams, Concurrent_Queue<pmt::pmt_t>* queue);
49
50 ~NTLabFileSignalSource() = default;
51
52 gr::basic_block_sptr get_left_block() override;
53 gr::basic_block_sptr get_right_block() override;
54
55protected:
56 std::tuple<size_t, bool> itemTypeToSize() override;
57 double packetsPerSample() const override;
58 gnss_shared_ptr<gr::block> source() const override;
59 void create_file_source_hook() override;
60 void pre_connect_hook(gr::top_block_sptr top_block) override;
61 void pre_disconnect_hook(gr::top_block_sptr top_block) override;
62
63private:
64 std::string sample_type_;
65 unpack_ntlab_2bit_samples_sptr unpack_samples_;
66 int n_channels_;
67};
68
69
70/** \} */
71/** \} */
72#endif // GNSS_SDR_NTLAB_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 multichannel 2-bit samples into 4 real-valued floats per input byte.