Generating a correlated Rayleigh fading process

In this example we will generate a correlated Rayleigh fading process with a normaized Doppler frequency equal to 0.1. The normalized Doppler is defined as the multiplication of the maximum Doppler frequency by the sampling time (i.e. ).

#include <itpp/itcomm.h>
using namespace itpp;
int main()
{
// Declare my_channel variable as an instance of the Rayleigh_Channel
// class
TDL_Channel my_channel;
// The normalized Doppler frequency is set to 0.1
double norm_dopp = 0.1;
my_channel.set_norm_doppler(norm_dopp);
// Generate nrof_samples of the fading process and store them in ch_coeffs
// matrix
int nrof_samples = 10000;
cmat ch_coeffs;
my_channel.generate(nrof_samples, ch_coeffs);
// Open an output file "rayleigh_test.it"
it_file ff("rayleigh_test.it");
// Save channel coefficients to the output file
ff << Name("ch_coeffs") << ch_coeffs;
// Close the output file
ff.close();
// Exit program
return 0;
}
itpp::Array
General array class.
Definition array.h:105
itpp::Name
Automatic naming when saving.
Definition itfile.h:429
itpp::TDL_Channel
Tapped Delay Line (TDL) channel model.
Definition channel.h:858
itpp::it_file
The IT++ file format reading and writing class.
Definition itfile.h:246
itcomm.h
Include file for the IT++ communications module.
itpp
itpp namespace
Definition itmex.h:37

You can use Matlab or Octave to examine the channel fading process that is stored int the output file `rayleigh_test.it`. Try the followigh code to view a part of the fading process:

itload("rayleigh_test.it")
figure(1); clf;
semilogy(abs(ch_coeffs(1:200)))

Note: Make sure that the folder `$PREFIX/share/itpp` is included your Matlab/Octave path variable (`$PREFIX` is the IT++ installation prefix: `/usr/local` by default).

Generated on Mon Jun 10 2024 11:49:29 for IT++ by Doxygen 1.9.8