Agora  1.2.0
Agora project
channel.h
Go to the documentation of this file.
1 
5 #ifndef CHANNEL_H_
6 #define CHANNEL_H_
7 
8 #include <algorithm>
9 #include <cassert>
10 #include <cmath>
11 #include <ctime>
12 #include <iomanip>
13 #include <numeric>
14 
15 #include "armadillo"
16 #include "config.h"
17 #include "gettime.h"
18 #include "memory_manage.h"
19 #include "message.h"
20 #include "signal_handler.h"
21 #include "symbols.h"
22 #include "utils.h"
23 
24 class Channel {
25  public:
26  Channel(const Config* const config, std::string& channel_type,
27  double channel_snr);
28  ~Channel();
29 
30  // Dimensions of fmat_src: ( bscfg->sampsPerSymbol, uecfg->UE_ANT_NUM )
31  void ApplyChan(const arma::cx_fmat& fmat_src, arma::cx_fmat& mat_dst,
32  const bool is_downlink, const bool is_newChan);
33 
34  // Additive White Gaussian Noise. Dimensions of src: ( bscfg->sampsPerSymbol,
35  // uecfg->UE_ANT_NUM )
36  void Awgn(const arma::cx_fmat& fmat_src, arma::cx_fmat& fmat_dst) const;
37 
38  /*
39  * From "Study on 3D-channel model for Elevation Beamforming
40  * and FD-MIMO studies for LTE"
41  * 3GPP TR 36.873 V12.7.0 (2017-12)
42  * Note: FD-MIMO Stands for Full-Dimension MIMO
43  * Currenlty implements the 3D-UMa scenario only. This
44  * corresponds to an Urban Macro cell with high UE density
45  * indoor and outdoor. This scenario assumes Base Stations
46  * are above surrounding buildings.
47  *
48  */
49  void Lte3gpp(const arma::cx_fmat& fmat_src, arma::cx_fmat& fmat_dst);
50 
51  private:
52  const Config* const cfg_;
53 
55  size_t bs_ant_;
56  size_t ue_ant_;
57  size_t n_samps_;
58 
59  std::string sim_chan_model_;
63 
64  arma::cx_fmat h_;
65 };
66 
67 #endif // CHANNEL_H_
sqrt
2 sqrt()
kPrintChannelOutput
static constexpr bool kPrintChannelOutput
Definition: channel.cc:9
Channel
Definition: channel.h:24
Config::UeAntNum
size_t UeAntNum() const
Definition: config.h:41
Config::SampsPerSymbol
size_t SampsPerSymbol() const
Definition: config.h:234
fmt::v8::printf
auto printf(const S &fmt, const T &... args) -> int
Definition: printf.h:631
channel.h
Implementation file for the channel class.
Channel::kAwgn
@ kAwgn
Definition: channel.h:62
memory_manage.h
Config::BsAntNum
size_t BsAntNum() const
Definition: config.h:35
signal_handler.h
Channel::kRan3Gpp
@ kRan3Gpp
Definition: channel.h:62
Channel::ApplyChan
void ApplyChan(const arma::cx_fmat &fmat_src, arma::cx_fmat &mat_dst, const bool is_downlink, const bool is_newChan)
Definition: channel.cc:41
mean
static double mean(const std::vector< double > in_vec)
Definition: timer.h:103
Channel::noise_samp_std_
double noise_samp_std_
Definition: channel.h:61
snr
snr
Definition: inspect_agora_results.m:118
fmt::v8::detail::abs
constexpr std::chrono::duration< Rep, Period > abs(std::chrono::duration< Rep, Period > d)
Definition: chrono.h:1488
kPrintSNRCheck
static constexpr bool kPrintSNRCheck
Definition: channel.cc:10
Channel::ChanModel
ChanModel
Definition: channel.h:62
message.h
Self defined functions for message storage and passing.
Channel::h_
arma::cx_fmat h_
Definition: channel.h:64
Catch::cout
std::ostream & cout()
Channel::bs_ant_
size_t bs_ant_
Definition: channel.h:55
Channel::Channel
Channel(const Config *const config, std::string &channel_type, double channel_snr)
Definition: channel.cc:13
kMeanChannelGain
static constexpr double kMeanChannelGain
Definition: channel.cc:11
symbols.h
Channel::channel_
Channel * channel_
Definition: channel.h:54
Channel::channel_snr_db_
double channel_snr_db_
Definition: channel.h:60
Channel::chan_model_
enum Channel::ChanModel chan_model_
Channel::Lte3gpp
void Lte3gpp(const arma::cx_fmat &fmat_src, arma::cx_fmat &fmat_dst)
Definition: channel.cc:115
Channel::~Channel
~Channel()
Channel::Awgn
void Awgn(const arma::cx_fmat &fmat_src, arma::cx_fmat &fmat_dst) const
Definition: channel.cc:84
Channel::ue_ant_
size_t ue_ant_
Definition: channel.h:56
Config
Definition: config.h:26
std
Definition: json.hpp:5213
Channel::cfg_
const Config *const cfg_
Definition: channel.h:52
zeros
N_SC, NUM_UE, NUM_UE zeros()
Channel::n_samps_
size_t n_samps_
Definition: channel.h:57
noise
noise
Definition: generate_data_dl.m:131
config.h
Declaration file for the configuration class which importants json configuration values into class va...
gettime.h
Utils::PrintMat
static void PrintMat(const arma::cx_fmat &c, const std::string &ss)
Definition: utils.cc:452
Channel::kRayleigh
@ kRayleigh
Definition: channel.h:62
Channel::sim_chan_model_
std::string sim_chan_model_
Definition: channel.h:59