IT++ Logo
Public Member Functions | List of all members
itpp::AWGN_Channel Class Reference

Ordinary AWGN Channel for cvec or vec inputs and outputs. More...

#include <itpp/comm/channel.h>

Public Member Functions

 AWGN_Channel (double noisevar=0.0)
 Class constructor. Sets the noise variance (for complex-valued channels the sum of real and imaginary parts) More...
 
void set_noise (double noisevar)
 Set noise variance (for complex-valued channels the sum of real and imaginary parts) More...
 
double get_noise () const
 Get noise variance (for complex-valued channels the sum of real and imaginary parts) More...
 
cvec operator() (const cvec &input)
 Feed the complex input input through the complex-valued AWGN channel. More...
 
vec operator() (const vec &input)
 Feed the input through the real-valued AWGN channel. More...
 

Detailed Description

Ordinary AWGN Channel for cvec or vec inputs and outputs.

For real signals, the input parameter (noisevar) denotes the noise variance per real dimension. Therefore, it should be set to $N_0/2$, where $N_0$ is the noise power spectral density. However, in case of complex signals, the input parameter (noisevar) represents the noise variance per complex dimension, i.e. the sum of the variances in the real and imaginary parts, and thus is equal to $N_0$.

Example:

#include <itpp/itcomm.h>
using namespace itpp;
int main() {
// Initiate the AWGN_Channel class
double noisevar = 0.1;
AWGN_Channel awgn_channel(noisevar);
// Initiate a QPSK-modulator, and generate the transmitted signal
QPSK qpsk;
bvec transmitted_bits = randb(20);
cvec transmitted_signal = qpsk.modulate_bits(transmitted_bits);
// Usage of the member operator ()
cvec received_signal = awgn_channel(transmitted_signal);
// Demodulate the bits
bvec received_bits = qpsk.demodulate_bits(received_signal);
}
AWGN_Channel(double noisevar=0.0)
Class constructor. Sets the noise variance (for complex-valued channels the sum of real and imaginary...
Definition: channel.h:1092
bin randb(void)
Generates a random bit (equally likely 0s and 1s)
Definition: random.h:793
Include file for the IT++ communications module.
itpp namespace
Definition: itmex.h:37

Definition at line 1088 of file channel.h.

Constructor & Destructor Documentation

◆ AWGN_Channel()

itpp::AWGN_Channel::AWGN_Channel ( double  noisevar = 0.0)
inline

Class constructor. Sets the noise variance (for complex-valued channels the sum of real and imaginary parts)

Definition at line 1092 of file channel.h.

Member Function Documentation

◆ set_noise()

void itpp::AWGN_Channel::set_noise ( double  noisevar)
inline

Set noise variance (for complex-valued channels the sum of real and imaginary parts)

Definition at line 1094 of file channel.h.

References itpp::sqrt().

◆ get_noise()

double itpp::AWGN_Channel::get_noise ( ) const
inline

Get noise variance (for complex-valued channels the sum of real and imaginary parts)

Definition at line 1096 of file channel.h.

References itpp::sqr().

◆ operator()() [1/2]

cvec itpp::AWGN_Channel::operator() ( const cvec &  input)

Feed the complex input input through the complex-valued AWGN channel.

Definition at line 1550 of file channel.cpp.

References itpp::Complex_Normal_RNG::sample_vector().

◆ operator()() [2/2]

vec itpp::AWGN_Channel::operator() ( const vec &  input)

Feed the input through the real-valued AWGN channel.

Definition at line 1560 of file channel.cpp.

References itpp::Normal_RNG::sample_vector().


The documentation for this class was generated from the following files:
SourceForge Logo

Generated on Sun Jun 5 2022 21:26:42 for IT++ by Doxygen 1.9.3