1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
/* -*- c++ -*- */
/*
* Copyright 2009,2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_CHANNELS_CHANNEL_MODEL_H
#define INCLUDED_CHANNELS_CHANNEL_MODEL_H
#include <channels/api.h>
#include <gr_hier_block2.h>
#include <gr_types.h>
namespace gr {
namespace channels {
/*!
* \brief channel simulator
* \ingroup misc_blk
*
* This block implements a basic channel model simulator that can
* be used to help evaluate, design, and test various signals,
* waveforms, and algorithms. This model allows the user to set
* the voltage of an AWGN noise source, a (normalized) frequency
* offset, a sample timing offset, and a noise seed to randomize
* the AWGN noise source.
*
* Multipath can be approximated in this model by using a FIR
* filter representation of a multipath delay profile..
*/
class CHANNELS_API channel_model : virtual public gr_hier_block2
{
public:
// gr::channels::channel_model::sptr
typedef boost::shared_ptr<channel_model> sptr;
/*! \brief Build the channel simulator.
*
* \param noise_voltage The AWGN noise level as a voltage (to be
* calculated externally to meet, say, a
* desired SNR).
* \param frequency_offset The normalized frequency offset. 0 is
* no offset; 0.25 would be, for a digital
* modem, one quarter of the symbol rate.
* \param epsilon The sample timing offset to emulate the
* different rates between the sample clocks of
* the transmitter and receiver. 1.0 is no difference.
* \param taps Taps of a FIR filter to emulate a multipath delay profile.
* \param noise_seed A random number generator seed for the noise source.
*/
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);
virtual void set_noise_voltage(double noise_voltage) = 0;
virtual void set_frequency_offset(double frequency_offset) = 0;
virtual void set_taps(const std::vector<gr_complex> &taps) = 0;
virtual void set_timing_offset(double epsilon) = 0;
virtual double noise_voltage() const = 0;
virtual double frequency_offset() const = 0;
virtual std::vector<gr_complex> taps() const = 0;
virtual double timing_offset() const = 0;
};
} /* namespace channels */
} /* namespace gr */
#endif /* INCLUDED_CHANNELS_CHANNEL_MODEL_H */
|