This class implements "coding and modulation" using an LDCP codec through the functions modulate and demodulate. The function modulate accepts a vector of bits and generates a vector of complex symbols (e.g. 16QAM symbols). The funcion demodulate conversally takes a vector of noise symbols and calculates the maximum aposteriori estimates of the transmitted bits.
More...
#include <AMC.hpp>
List of all members.
Public Member Functions |
| AMC (void) |
| Constructor without arguments. Call init after construction.
|
void | init (uint32_t code_word_size, bool load_from_file) |
| Initialize an object of type AMC.
|
void | modulate (uint32_t modulation_order, uint32_t codec_ix, bvec message, bvec &transmitted, cvec &symbols, int skip_symbols) |
| Perform modulation.
|
void | encode (uint32_t codec_ix, bvec message, bvec &transmitted) |
| Identical to modulation except fewer inputs and outputs.
|
int | codec_message_size (uint32_t codec_ix) |
| Return code message size i.e. number payload bits per codeword.
|
int | no_of_codecs (void) |
| Number of codecs. Currently 4.
|
double | evm (uint32_t modulation_order, bvec &transmitted, cvec &symbols, int skip_symbols) |
| Calculate error vector magnitude.
|
void | demodulate (const cvec &input_symbols, double noise_variance, uint32_t modulation_order, uint32_t codec_ix, bvec &message_hat, bvec &transmitted_hat) |
| Demodulate a vector of noisy complex symbols (e.g 16QAM).
|
double | noise_variance (const cvec &symbols, uint32_t modulation_order) |
| Estimate noise variance in a set of symbols with known modulation_order.
|
void | randb_thread_safe (int size, bvec &out, uint64_t *seed) |
| As the name suggests, this is a thread safe version of the randb(int size, bvec &out) function in IT++. This function has an additional argument, namely the seed. This argument makes it simple to handle multiple random bit streams.
|
void | randb_thread_safe (int start_ix, int length, bvec &out, uint64_t *seed) |
| Randomizes the bits with index start_ix to start_ix+length in the vector out.
|
void | run_through_all_mcs (void) |
| This function simulates all combinations of coding and modulation parameters for the chose code_word_size and saves the results in the file results.it. The results can be then be read and displayed by the matlab script { plot}.
|
Public Attributes |
bool | only_raw_bits |
Detailed Description
This class implements "coding and modulation" using an LDCP codec through the functions modulate and demodulate. The function modulate accepts a vector of bits and generates a vector of complex symbols (e.g. 16QAM symbols). The funcion demodulate conversally takes a vector of noise symbols and calculates the maximum aposteriori estimates of the transmitted bits.
Definition at line 33 of file AMC.hpp.
Member Function Documentation
void AMC::demodulate |
( |
const cvec & |
input_symbols, |
|
|
double |
noise_variance, |
|
|
uint32_t |
modulation_order, |
|
|
uint32_t |
codec_ix, |
|
|
bvec & |
message_hat, |
|
|
bvec & |
transmitted_hat |
|
) |
| |
Demodulate a vector of noisy complex symbols (e.g 16QAM).
- Parameters:
-
input_symbols | Demodulate the symbols in positions skip_symbols,skip_symbols+1,...,N+skip_symbols-1, where N=code_word_size/log2(modulation_order). The parameter skip_symbols is by default zero but can be changed. |
noise_variance | The variance of the noise in the input symbols. |
modulation_order | Modulation order 4, 16, 64 or 256 (QAM). |
codec_ix | Index of the codec 0,1 and 2, correspond to rate 1/4, 1/2 and 3/4, respectively. |
message_hat | The bit estimates according to the iterative MAP decoder. If only_raw_bits is true, then these estimates are actually not calculated. This is useful to reduce computation time. If the raw symbols are saved of if all data is logged (see save_raw_input_on_file of four_multi) it is often possible to do the decoding offline after the experiements. The boolean only_raw_bits is true by default. |
transmitted_hat | The hard bit estimates. |
Definition at line 103 of file AMC.cpp.
double AMC::evm |
( |
uint32_t |
modulation_order, |
|
|
bvec & |
transmitted, |
|
|
cvec & |
symbols, |
|
|
int |
skip_symbols |
|
) |
| |
Calculate error vector magnitude.
- Parameters:
-
modulation_order. | Modulation order 4, 16, 64 or 256 (QAM). |
Definition at line 78 of file AMC.cpp.
void AMC::init |
( |
uint32_t |
code_word_size, |
|
|
bool |
load_from_file |
|
) |
| |
Initialize an object of type AMC.
- Parameters:
-
code_word_size | Three codes are generated with rate 1/4, 1/2, 3/4 and 5/6. This parameter provides the code word size. |
load_from_file. | If load_from_file=true then the codecs are read from code_data1.it, code_data2.it and code_data3.it, otherwise the codecs are generated. When code_word_size is changed, the codes need to be re-generated. The user is responsible for keeping track of this. |
Definition at line 33 of file AMC.cpp.
void AMC::modulate |
( |
uint32_t |
modulation_order, |
|
|
uint32_t |
codec_ix, |
|
|
bvec |
message, |
|
|
bvec & |
transmitted, |
|
|
cvec & |
symbols, |
|
|
int |
skip_symbols |
|
) |
| |
Perform modulation.
- Parameters:
-
modulation_order | Valid values are 4, 16, 64 and 256. QAM is used. |
code_ix | Index of the codec 0,1 and 2, correspond to rate 1/4, 1/2 and 3/4, respectively. |
message | Input bit vector of length code_word_size*rate or code_message_size, see below. |
transmitted | Generated encoded bit vector of length code_word_size. |
symbols. | Generated vector of complex symbols of length N=code_word_size/log2(modulation_order). The generated symbols are written into positions skip_symbols,skip_symbols+1, ...,N+skip_symbols-1. |
skip_symbols. | See symbols. |
Definition at line 54 of file AMC.cpp.
Estimate noise variance in a set of symbols with known modulation_order.
- Returns:
- Estimated noise_variance.
- Parameters:
-
symbols | Vector of modulation symbols. |
modulation_order | Modulation order of QAM, 4 16, 64 or 256. |
Definition at line 121 of file AMC.cpp.
As the name suggests, this is a thread safe version of the randb(int size, bvec &out) function in IT++. This function has an additional argument, namely the seed. This argument makes it simple to handle multiple random bit streams.
- Parameters:
-
size | Length of out vector. |
out | Output vector of bits. |
seed. | Address to the seed. |
Definition at line 155 of file AMC.cpp.
Randomizes the bits with index start_ix to start_ix+length in the vector out.
- Parameters:
-
start_ix | First index to be modified. |
length | Length of out vector. |
out | Output vector of bits. |
seed. | Address to the seed. |
Definition at line 160 of file AMC.cpp.
Member Data Documentation
Set this public member to false in order to disable the coding (and save time).
Definition at line 116 of file AMC.hpp.
The documentation for this class was generated from the following files: