forked from dimme/cost2100model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCOST2100_Channel.h
82 lines (64 loc) · 2.12 KB
/
COST2100_Channel.h
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
/*
* \file
* \brief COST2100 Channel Model Block
*
* \author K.K.
*/
#ifndef COST2100_CHANNEL_H_
#define COST2100_CHANNEL_H_
#include <itpp/itbase.h>
#include <itpp/itcomm.h>
#include "COST2100_Specification.h"
#include "processblock.h"
#include <string>
namespace penux {
using namespace itpp;
using namespace std;
class COST2100_Channel : public BasicProcessBlock
{
public:
//! Default constructor
COST2100_Channel(string blockNname = "COST2100_Channel",
string fileName = "channel_spec.xml",
int idxBS = 0,
int idxMS = 0,
int numTx = 1,
int numRx = 1,
int numFreqBins = 0,
int numTime = 0,
double SNRdB = 10);
//! Destructor
virtual ~COST2100_Channel();
//! run function of the block
virtual void run(int time);
//! Set SNR in dB scale
inline void setSNRdB(double snrdb){ SNRdB=snrdb; };
//! Load current channel realization
void loadChannel();
//! Get channel matrices
inline Array<cmat> getChannel(){return H;};
//! Get TX antenna numbers
inline int getNumTx(){ return numTx; };
//! Get RX antenna numbers
inline int getNumRx(){ return numRx; };
//! Get number of frequency bins
inline int getNumFreqBins(){ return numFreqBins; };
protected:
vector< InPort<cvec>* > vpDataInPort; //!< input for transmitted symbol streams
vector< OutPort<cvec>* > vpDataOutPort; //!< output streams from channel
InPort<int> controlPort; //!< control port indicate when to create new Channel
string fileName; //!< path of configuration file
int idxBS; //!< BS index of the simulation test
int idxMS; //!< MS index of the simulation test
int numTx; //!< TX antenna numbers
int numRx; //!< RX antenna numbers
int numFreqBins; //!< number of frequency bins
int numTime; //!< number of time snapshots
int currentSnapshot; //!< current snapshot counter
double SNRdB; //!< SNR in dB scale
Channel_Specification channel; //!< COST2100 channel model specification
vector<Array<cmat> > transfer; //!< loaded transfer functions
Array<cmat> H; //!< channel matrix at one snapshot
};
}
#endif /* COST2100_CHANNEL_H_ */