38 #include <itpp/itexports.h> 194 ITU_Vehicular_A, ITU_Vehicular_B, ITU_Pedestrian_A, ITU_Pedestrian_B,
195 COST207_RA, COST207_RA6,
196 COST207_TU, COST207_TU6alt, COST207_TU12, COST207_TU12alt,
197 COST207_BU, COST207_BU6alt, COST207_BU12, COST207_BU12alt,
198 COST207_HT, COST207_HT6alt, COST207_HT12, COST207_HT12alt,
199 COST259_TUx, COST259_RAx, COST259_HTx
213 Jakes = 0, J = 0, Classic = 0, C = 0,
214 GaussI = 1, Gauss1 = 1, GI = 1, G1 = 1,
215 GaussII = 2, Gauss2 = 2, GII = 2, G2 = 2
237 void set_LOS_power(
double relative_power);
239 virtual void set_LOS_doppler(
double relative_doppler);
241 virtual void set_time_offset(
int offset);
243 virtual void set_filter_length(
int filter_length);
245 virtual void set_norm_doppler(
double norm_doppler);
249 virtual void set_no_frequencies(
int no_freq);
256 virtual double get_LOS_doppler()
const;
258 virtual double get_time_offset()
const;
260 virtual int get_filter_length()
const;
262 virtual double get_norm_doppler()
const;
266 virtual int get_no_frequencies()
const;
271 virtual void shift_time_offset(
int no_samples);
274 virtual void init() = 0;
277 virtual void generate(
int no_samples, cvec &output) = 0;
279 cvec generate(
int no_samples);
290 #if (!defined(_MSC_VER) || (defined(_MSC_VER) && defined (ITPP_SHARED_LIB))) 307 else is.setstate(std::ios_base::failbit);
337 virtual void init() { init_flag =
true; }
342 virtual void generate(
int no_samples, cvec& output);
369 virtual void generate(
int no_samples, cvec& output);
374 double static_sample_im;
399 virtual void set_norm_doppler(
double norm_doppler);
401 virtual void set_LOS_doppler(
double relative_doppler);
403 virtual void set_time_offset(
int offset);
413 virtual void shift_time_offset(
int no_samples);
416 virtual void init() = 0;
421 virtual void generate(
int no_samples, cvec& output) = 0;
429 void add_LOS(
int idx, std::complex<double>& sample);
479 virtual void set_no_frequencies(
int no_freq);
496 virtual void generate(
int no_samples, cvec &output);
506 vec f1, f2, c1, c2, th1,
th2;
545 virtual void set_filter_length(
int filter_length);
555 virtual void generate(
int no_samples, cvec &output);
574 vec Jakes_filter(
double norm_dopp,
int order = 100);
612 virtual void init() { init_flag =
true; }
617 virtual void generate(
int no_samples, cvec &output);
621 void generate_Jakes(
int no_samples, cvec &output);
707 void set_channel_profile(
const vec &avg_power_dB,
const vec &delay_prof);
717 void set_LOS(
int tap_number,
double relative_power,
double relative_doppler = 0.7);
719 void set_LOS(
const vec& relative_power,
const vec& relative_doppler =
"");
722 void get_channel_profile(vec &avg_power_dB, vec &delay_prof)
const;
736 double get_LOS_power(
int tap_number)
const {
return los_power(tap_number); }
741 int taps()
const {
return N_taps; }
744 double calc_mean_excess_delay()
const;
746 double calc_rms_delay_spread()
const;
861 TDL_Channel(
const vec &avg_power_dB =
"0",
const ivec &delay_prof =
"0");
868 void set_channel_profile(
const vec &avg_power_dB,
const ivec &delay_prof);
870 void set_channel_profile_uniform(
int no_taps);
872 void set_channel_profile_exponential(
int no_taps);
882 void set_norm_doppler(
double norm_doppler);
885 void set_LOS(
const vec& relative_power,
const vec& relative_doppler =
"");
887 void set_LOS_power(
const vec& relative_power);
889 void set_LOS_doppler(
const vec& relative_doppler);
896 void set_no_frequencies(
int no_freq);
899 void set_time_offset(
int offset);
901 void shift_time_offset(
int no_samples);
904 void set_filter_length(
int filter_length);
908 int taps()
const {
return N_taps; }
911 void get_channel_profile(vec &avg_power_dB, ivec &delay_prof)
const;
913 vec get_avg_power_dB()
const;
930 double get_LOS_power(
int tap_number)
const {
return los_power(tap_number); }
938 double get_time_offset()
const;
941 double calc_mean_excess_delay()
const;
943 double calc_rms_delay_spread()
const;
949 void generate(
int no_samples,
Array<cvec> &channel_coeff);
951 void generate(
int no_samples, cmat &channel_coeff);
954 void filter_known_channel(
const cvec &input, cvec &output,
const Array<cvec> &channel_coeff);
956 void filter_known_channel(
const cvec &input, cvec &output,
const cmat &channel_coeff);
961 void filter(
const cvec &input, cvec &output, cmat &channel_coeff);
965 cvec
filter(
const cvec &input, cmat &channel_coeff);
967 void filter(
const cvec &input, cvec &output);
969 cvec
filter(
const cvec &input);
972 void operator()(
const cvec &input, cvec &output,
Array<cvec> &channel_coeff);
974 void operator()(
const cvec &input, cvec &output, cmat &channel_coeff);
976 cvec operator()(
const cvec &input,
Array<cvec> &channel_coeff);
978 cvec operator()(
const cvec &input, cmat &channel_coeff);
980 cvec operator()(
const cvec &input);
986 void calc_frequency_response(
const Array<cvec> &channel_coeff,
Array<cvec> &frequency_response,
const int fft_size);
988 void calc_frequency_response(
const cmat &channel_coeff, cmat &frequency_response,
const int fft_size);
1014 void discretize(
const vec &delay_profile);
1041 BSC(
double in_p = 0.0) : u(0.0, 1.0) { p = in_p; };
1047 bvec operator()(
const bvec &input);
1098 cvec operator()(
const cvec &input);
1100 vec operator()(
const vec &input);
1111 #endif // #ifndef CHANNEL_H vec los_dopp
Relative LOS Doppler for each Rice component.
void set_prob(double in_p)
Set crossover (bit error) probability.
virtual ~Independent_Fading_Generator()
Destructor.
CHANNEL_PROFILE
Predefined channel profiles. Includes LOS and Doppler spectrum settings.
General specification of a time-domain multipath channel.
RICE_METHOD rice_method
Rice process generation method.
IFFT_Fading_Generator(double norm_doppler)
Default constructor.
RICE_METHOD
Rice fading generation methods: MEDS.
virtual void init()
Initialize the generator.
bool init_flag
signals if generator is initialized or not
vec get_avg_power_dB() const
Return power profile in dB.
int taps() const
Return the number of channel taps.
Normal distributionNormal (Gaussian) random variables, using a simplified Ziggurat method...
double get_norm_doppler() const
Return normalized doppler rate.
Definitions of Filter classes and functions.
cvec left_overs
Left-overs from upsampling.
double discrete_Ts
Sampling time of discretization.
DOPPLER_SPECTRUM dopp_spectrum
virtual ~Channel_Specification()
Destructor.
Rice type fading generator class.
vec d_prof
Delay profile in seconds.
double los_direct
Direct component: sqrt(los_power / (1 + los_power))
virtual ~Fading_Generator()
Destructor.
double get_LOS_power() const
Get relative power of LOS component (Rice factor)
virtual int get_filter_length() const
Get filter length.
virtual ~IFFT_Fading_Generator()
Destructor.
vec a_prof_dB
Power profile in dB.
DOPPLER_SPECTRUM
Predefined Doppler spectra.
virtual DOPPLER_SPECTRUM get_doppler_spectrum() const
Return Doppler spectrum.
virtual ~Static_Fading_Generator()
Destructor.
int get_no_frequencies() const
Get the minimum number of frequencies used in Rice MEDS fading generator.
FADING_TYPE
Fading generator type: Independent (default), Static or Correlated.
CORRELATED_METHOD
Correlated fading generation methods: Rice_MEDS (default), IFFT or FIR.
Definition of Array class (container)
vec get_LOS_power() const
Get relative power (Rice factor) for each tap.
vec get_LOS_power() const
Get relative power (Rice factor) for each tap.
Static fading generator class.
vec los_power
Relative power for each Rice component.
vec a_prof
Average amplitude of each tap.
BSC(double in_p=0.0)
Class constructor. Sets the error probability to p.
double get_LOS_power(int tap_number) const
Get relative power (Rice factor) for tap tap_number.
double get_noise() const
Get noise variance (for complex-valued channels the sum of real and imaginary parts) ...
int nrof_freq
Number of sine frequencies in the Rice MEDS fading generator.
Array< DOPPLER_SPECTRUM > get_doppler_spectrum() const
Get doppler spectrum for tap index.
double los_power
Relative power of LOS component compared to diffuse component (K factor)
Matrix Class Definitions.
void set_noise(double noisevar)
Set noise variance (for complex-valued channels the sum of real and imaginary parts) ...
ivec d_prof
Delay in samples for each tap.
vec los_power
Relative power for each Rice component.
double get_LOS_doppler(int tap_number) const
Get relative Doppler (to the maximum Doppler) for tap tap_number.
Moving Average Filter Base Class.This class implements a moving average (MA) filter according to whe...
vec filter(const vec &b, const vec &a, const vec &input)
ARMA filter functionThese functions implements a autoregressive moving average (ARMA) filter accordin...
int filter_length
Filter length of FIR fading generator.
FIR type Fading generator class.
bool init_flag
Channel ready to produce data.
double get_sampling_time() const
Return channel sampling time (used for discretization)
vec spectrum(const vec &v, int nfft, int noverlap)
Power spectrum calculation.
vec get_LOS_doppler() const
Get relative Doppler for each tap.
IFFT type Fading generator class.
virtual void generate(int no_samples, cvec &output)=0
Generate no_samples values from the fading process.
vec get_LOS_doppler() const
Get relative Doppler (to the maximum Doppler) for each tap.
vec get_delay_prof() const
Return delay profile in seconds.
virtual ~FIR_Fading_Generator()
Destructor.
Array< DOPPLER_SPECTRUM > tap_doppler_spectrum
Doppler spectrum for each tap.
vec sqr(const cvec &data)
Absolute square of elements.
vec los_dopp
Relative Rice Doppler for each Rice component.
AWGN_Channel(double noisevar=0.0)
Class constructor. Sets the noise variance (for complex-valued channels the sum of real and imaginary...
Independent (random) fading generator class.
virtual void init()
Initialize the generator.
Independent_Fading_Generator()
Default constructor.
virtual ~Rice_Fading_Generator()
Destructor.
int N_taps
Number of taps.
double n_dopp
Normalized Doppler of the correlated fading.
vec sqrt(const vec &x)
Square root of the elements.
CORRELATED_METHOD get_correlated_method() const
Return fading generation method.
virtual int get_no_frequencies() const
Get number of Doppler frequencies.
Array< DOPPLER_SPECTRUM > tap_doppler_spectrum
Doppler spectrum for each tap.
Definition of classes for random number generators.
virtual RICE_METHOD get_rice_method() const
Get calculation method of Doppler frequencies and amplitudes.
int taps() const
Return the number of channel taps.
Tapped Delay Line (TDL) channel model.
int N_taps
Number of taps.
Array< Fading_Generator * > fading_gen
Fading generators for each tap.
std::istream & operator>>(std::istream &input, bin &outbin)
Input stream of bin.
FADING_TYPE get_fading_type() const
Return fading type.
Elementary mathematical functions - header file.
Ordinary AWGN Channel for cvec or vec inputs and outputs.
double static_sample_re
Static Rayleigh distributed sample.
double get_LOS_doppler(int tap_number) const
Get relative Doppler for tap tap_number.
Static_Fading_Generator()
Default constructor.
FADING_TYPE fading_type
Fading type: Independent (default), Static or Correlated.
CORRELATED_METHOD method
Correlated fading generation method: Rice_MEDS (default), IFFT or FIR.
double get_LOS_power(int tap_number) const
Get relative power (Rice factor) for tap tap_number.
double los_diffuse
Diffuse component: sqrt(1 / (1 + los_power))
int fir_length
Size of FIR filter.
ivec get_delay_prof() const
Return delay profile in samples.
A Binary Symetric Channel with crossover probability p.
double get_prob() const
Get crossover (bit error) probability.