GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
channel_model.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2009,2012 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDED_CHANNELS_CHANNEL_MODEL_H
12#define INCLUDED_CHANNELS_CHANNEL_MODEL_H
13
16#include <gnuradio/types.h>
17
18namespace gr {
19namespace channels {
20
21/*!
22 * \brief Basic channel simulator.
23 * \ingroup channel_models_blk
24 *
25 * \details
26 * This block implements a basic channel model simulator that can
27 * be used to help evaluate, design, and test various signals,
28 * waveforms, and algorithms.
29 *
30 * This model allows the user to set the voltage of an AWGN noise
31 * source (\p noise_voltage), a (normalized) frequency offset (\p
32 * frequency_offset), a sample timing offset (\p epsilon), and a
33 * seed (\p noise_seed) to randomize or make reproducible the AWGN
34 * noise source.
35 *
36 * Multipath can be approximated in this model by using a FIR
37 * filter representation of a multipath delay profile with the
38 * parameter \p taps.
39 *
40 * To simulate a channel with time-variant channel, use
41 * gr::channels::channel_model2.
42 */
44{
45public:
46 // gr::channels::channel_model::sptr
47 typedef std::shared_ptr<channel_model> sptr;
48
49 /*! \brief Build the channel simulator.
50 *
51 * \param noise_voltage The AWGN noise level as a voltage (to be
52 * calculated externally to meet, say, a
53 * desired SNR).
54 * \param frequency_offset The normalized frequency offset. 0 is
55 * no offset; 0.25 would be, for a digital
56 * modem, one quarter of the symbol rate.
57 * \param epsilon The sample timing offset to emulate the
58 * different rates between the sample clocks of
59 * the transmitter and receiver. 1.0 is no difference.
60 * \param taps Taps of a FIR filter to emulate a multipath delay profile.
61 * \param noise_seed A random number generator seed for the noise source.
62 * \param block_tags If true, tags will not be able to propagate through this block.
63 */
64 static sptr make(double noise_voltage = 0.0,
65 double frequency_offset = 0.0,
66 double epsilon = 1.0,
67 const std::vector<gr_complex>& taps = std::vector<gr_complex>(1, 1),
68 double noise_seed = 0,
69 bool block_tags = false);
70
71 virtual void set_noise_voltage(double noise_voltage) = 0;
72 virtual void set_frequency_offset(double frequency_offset) = 0;
73 virtual void set_taps(const std::vector<gr_complex>& taps) = 0;
74 virtual void set_timing_offset(double epsilon) = 0;
75
76 virtual double noise_voltage() const = 0;
77 virtual double frequency_offset() const = 0;
78 virtual std::vector<gr_complex> taps() const = 0;
79 virtual double timing_offset() const = 0;
80};
81
82} /* namespace channels */
83} /* namespace gr */
84
85#endif /* INCLUDED_CHANNELS_CHANNEL_MODEL_H */
Basic channel simulator.
Definition: channel_model.h:44
virtual void set_timing_offset(double epsilon)=0
virtual std::vector< gr_complex > taps() const =0
virtual void set_noise_voltage(double noise_voltage)=0
std::shared_ptr< channel_model > sptr
Definition: channel_model.h:47
virtual void set_taps(const std::vector< gr_complex > &taps)=0
virtual double timing_offset() const =0
virtual double frequency_offset() const =0
static sptr make(double noise_voltage=0.0, double frequency_offset=0.0, double epsilon=1.0, const std::vector< gr_complex > &taps=std::vector< gr_complex >(1, 1), double noise_seed=0, bool block_tags=false)
Build the channel simulator.
virtual void set_frequency_offset(double frequency_offset)=0
virtual double noise_voltage() const =0
Hierarchical container class for gr::block's and gr::hier_block2's.
Definition: hier_block2.h:34
#define CHANNELS_API
Definition: gr-channels/include/gnuradio/channels/api.h:18
static constexpr float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
GNU Radio logging wrapper.
Definition: basic_block.h:29