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.
).
int main()
{
double norm_dopp = 0.1;
int nrof_samples = 10000;
my_channel.
generate(nrof_samples, ch_coeffs);
ff <<
Name(
"ch_coeffs") << ch_coeffs;
ff.close();
return 0;
}
Mat< std::complex< double > > cmat
Default Complex Matrix Type.
Automatic naming when saving.
Tapped Delay Line (TDL) channel model.
void set_norm_doppler(double norm_doppler)
Set normalized Doppler rate. A Correlated fading type will be used.
void generate(int no_samples, Array< cvec > &channel_coeff)
Generate no_samples values of the channel.
The IT++ file format reading and writing class.
Include file for the IT++ communications module.
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)))
bin abs(const bin &inbin)
absolute value of bin
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).