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
241 virtual void set_time_offset(
int offset);
243 virtual void set_filter_length(
int filter_length);
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);
290#if (!defined(_MSC_VER) || (defined(_MSC_VER) && defined (ITPP_SHARED_LIB)))
307 else is.setstate(std::ios_base::failbit);
313template class ITPP_EXPORT Array<DOPPLER_SPECTRUM>;
314template class ITPP_EXPORT Array<Fading_Generator*>;
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;
403 virtual void set_time_offset(
int offset);
413 virtual void shift_time_offset(
int no_samples);
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);
741 int taps()
const {
return N_taps; }
744 double calc_mean_excess_delay()
const;
746 double calc_rms_delay_spread()
const;
870 void set_channel_profile_uniform(
int no_taps);
872 void set_channel_profile_exponential(
int no_taps);
896 void set_no_frequencies(
int no_freq);
899 void set_time_offset(
int offset);
904 void set_filter_length(
int filter_length);
908 int taps()
const {
return N_taps; }
913 vec get_avg_power_dB()
const;
938 double get_time_offset()
const;
941 double calc_mean_excess_delay()
const;
943 double calc_rms_delay_spread()
const;
956 void filter_known_channel(
const cvec &input, cvec &output,
const cmat &
channel_coeff);
967 void filter(
const cvec &input, cvec &output);
969 cvec
filter(
const cvec &input);
Definition of Array class (container)
Ordinary AWGN Channel for cvec or vec inputs and outputs.
double get_noise() const
Get noise variance (for complex-valued channels the sum of real and imaginary parts)
AWGN_Channel(double noisevar=0.0)
Class constructor. Sets the noise variance (for complex-valued channels the sum of real and imaginary...
void set_noise(double noisevar)
Set noise variance (for complex-valued channels the sum of real and imaginary parts)
T & operator()(int i)
Get the i element.
A Binary Symetric Channel with crossover probability p.
double get_prob() const
Get crossover (bit error) probability.
void set_prob(double in_p)
Set crossover (bit error) probability.
BSC(double in_p=0.0)
Class constructor. Sets the error probability to p.
General specification of a time-domain multipath channel.
vec los_dopp
Relative Rice Doppler for each Rice component.
int N_taps
Number of taps.
virtual ~Channel_Specification()
Destructor.
vec get_LOS_power() const
Get relative power (Rice factor) for each tap.
vec los_power
Relative power for each Rice component.
Array< DOPPLER_SPECTRUM > tap_doppler_spectrum
Doppler spectrum for each tap.
vec a_prof_dB
Power profile in dB.
double get_LOS_power(int tap_number) const
Get relative power (Rice factor) for tap tap_number.
Array< DOPPLER_SPECTRUM > get_doppler_spectrum() const
Get doppler spectrum for tap index.
int taps() const
Return the number of channel taps.
vec d_prof
Delay profile in seconds.
vec get_delay_prof() const
Return delay profile in seconds.
double get_LOS_doppler(int tap_number) const
Get relative Doppler for tap tap_number.
vec get_avg_power_dB() const
Return power profile in dB.
vec get_LOS_doppler() const
Get relative Doppler for each tap.
FIR type Fading generator class.
virtual ~FIR_Fading_Generator()
Destructor.
MA_Filter< std::complex< double >, double, std::complex< double > > fir_filter
Filter used for fading generation.
cvec left_overs
Left-overs from upsampling.
int fir_length
Size of FIR filter.
virtual int get_filter_length() const
Get filter length.
virtual void generate(int no_samples, cvec &output)=0
Generate no_samples values from the fading process.
double get_LOS_power() const
Get relative power of LOS component (Rice factor)
double los_diffuse
Diffuse component: sqrt(1 / (1 + los_power))
bool init_flag
signals if generator is initialized or not
virtual ~Fading_Generator()
Destructor.
double los_direct
Direct component: sqrt(los_power / (1 + los_power))
double los_power
Relative power of LOS component compared to diffuse component (K factor)
virtual void init()=0
Initialize the generator.
IFFT type Fading generator class.
virtual void init()
Initialize the generator.
virtual ~IFFT_Fading_Generator()
Destructor.
IFFT_Fading_Generator(double norm_doppler)
Default constructor.
Independent (random) fading generator class.
Independent_Fading_Generator()
Default constructor.
virtual ~Independent_Fading_Generator()
Destructor.
virtual void init()
Initialize the generator.
Rice type fading generator class.
virtual RICE_METHOD get_rice_method() const
Get calculation method of Doppler frequencies and amplitudes.
DOPPLER_SPECTRUM dopp_spectrum
int Ni
Number of sine waves in a Gaussian process.
RICE_METHOD rice_method
Rice process generation method.
virtual ~Rice_Fading_Generator()
Destructor.
virtual DOPPLER_SPECTRUM get_doppler_spectrum() const
Return Doppler spectrum.
virtual int get_no_frequencies() const
Get number of Doppler frequencies.
Static fading generator class.
double static_sample_re
Static Rayleigh distributed sample.
Static_Fading_Generator()
Default constructor.
virtual ~Static_Fading_Generator()
Destructor.
Tapped Delay Line (TDL) channel model.
double get_LOS_doppler(int tap_number) const
Get relative Doppler (to the maximum Doppler) for tap tap_number.
vec a_prof
Average amplitude of each tap.
CORRELATED_METHOD method
Correlated fading generation method: Rice_MEDS (default), IFFT or FIR.
Array< DOPPLER_SPECTRUM > tap_doppler_spectrum
Doppler spectrum for each tap.
double n_dopp
Normalized Doppler of the correlated fading.
int N_taps
Number of taps.
vec get_LOS_power() const
Get relative power (Rice factor) for each tap.
vec get_LOS_doppler() const
Get relative Doppler (to the maximum Doppler) for each tap.
vec los_power
Relative power for each Rice component.
ivec get_delay_prof() const
Return delay profile in samples.
bool init_flag
Channel ready to produce data.
ivec d_prof
Delay in samples for each tap.
FADING_TYPE fading_type
Fading type: Independent (default), Static or Correlated.
int nrof_freq
Number of sine frequencies in the Rice MEDS fading generator.
CORRELATED_METHOD get_correlated_method() const
Return fading generation method.
Array< Fading_Generator * > fading_gen
Fading generators for each tap.
int taps() const
Return the number of channel taps.
int get_no_frequencies() const
Get the minimum number of frequencies used in Rice MEDS fading generator.
vec los_dopp
Relative LOS Doppler for each Rice component.
double discrete_Ts
Sampling time of discretization.
FADING_TYPE get_fading_type() const
Return fading type.
double get_sampling_time() const
Return channel sampling time (used for discretization)
double get_LOS_power(int tap_number) const
Get relative power (Rice factor) for tap tap_number.
int filter_length
Filter length of FIR fading generator.
double get_norm_doppler() const
Return normalized doppler rate.
Elementary mathematical functions - header file.
Definitions of Filter classes and functions.
vec filter(const vec &b, const vec &a, const vec &input)
ARMA filter function.
vec sqr(const cvec &data)
Absolute square of elements.
vec sqrt(const vec &x)
Square root of the elements.
vec spectrum(const vec &v, int nfft, int noverlap)
Power spectrum calculation.
Matrix Class Definitions.
CORRELATED_METHOD
Correlated fading generation methods: Rice_MEDS (default), IFFT or FIR.
RICE_METHOD
Rice fading generation methods: MEDS.
std::istream & operator>>(std::istream &input, bin &outbin)
Input stream of bin.
CHANNEL_PROFILE
Predefined channel profiles. Includes LOS and Doppler spectrum settings.
FADING_TYPE
Fading generator type: Independent (default), Static or Correlated.
DOPPLER_SPECTRUM
Predefined Doppler spectra.
Definition of classes for random number generators.