What kind of channel do you want to model? For simpler model like ITU models, you can do FFT, then apply frequency-dependant loss and then do inverse FFT (fft and ifft functions come with matlab). For more complex models, for example cost231, you can use this m file: http://www.mathworks.com/matlabcentral/fileexchange/2224-cost231-models
A simple Rayleigh fading channel coefficient with average gain P is generated as h = sqrt(P/2)*(randn(1,1)+1i*randn(1,1)). The variable P can be interpreted as the SNR = transmit power * channel gain / noise power. The channel gain depends on the propagation model. For example, the distant dependent path loss makes it decrease as distance^(-e) where the exponent e typically is in the range 2-4.
Emil gave a very clear explanation. Additionally, you may want to consider your carrier frequency in order to decide the exact path-loss exponent to model your scenario. As a rule of thumb, the lower the carrier frequency is the lower the path-loss exponent becomes (always assuming that there is no obstacle shadowing your receiver, otherwise things get more complicated...). However, please keep in mind that in real life scenarios a path-loss exponent equal to 4 starts being quite an optimistic estimate around the ISM band and above. I would say that if you go beyond 2.4-2.6 GHz, you should consider values path-loss exponents greater than 4. As a consequence, values between 2 and 4 are reasonable below the ISM band.
To simulate a communication channel on a system level basis we need to consider the different parameters of the channel that influence the received power level. These are as follows:
1- Large scale fading due to distance and environment: As receiver travels away from the transmitter received signal power level average drops at a rate of 20 to 40 dB per decade (corresponding to path loss exponent of 2-4). The path loss model L=A+B.Log d, where A and B are parameters that depend on the frequency, the antenna heights, the environment (urban, rural, ...etc) ...etc. You may refer to the appropriate model in your case (COST model,...etc). As you are looking for simple simulation you can simply assume the two values A and B, for example, LdB=128.1+37.8*log10(d) is used in many research papers (but for BS-MS and not BS-BS).
2- Large Scale fading due to shadowing. In any environment, large scale fading due to distance above is average value but can widely vary around that value due to different obstructions. In this case you have to account for such variation which is called Shadowing. Shadowing is described using log normal model. This means you can add to the path loss value (in a dBs ) a random dB value which has a zero mean and Gaussian distribution of standard deviation sd ranging between 3-12. Typically you may assume it 6-8 in you simple simulation. Shadowing values are assumed uncorrelated in most simple situations. But for a more profound simulation of shadowing, shadowing values are distance dependent and two successive shadowing values are correlated and distance dependent. You may forget about this complication in your simple channel modelling.
3- Thirdly, the multipath fading contributes to fast variation around the local value (generated from pathloss+shadowing values). Multipath tapping model in which you specify the number of taps, the gain and delay for each tap. These values are environment dependent and called the "delay profile". Get the delay prfile for the environment of concern, e.g. Urban, Bad Urban, ...etc. In Matlab, you can use the function "rayleighchan" followed by "filter" to generate a series of random values representing the fading channel at given sampling rate, velocity and delay profile for the simulation duration of interest. Please refer to MATLAB help for info. on how to use these functions. A similar "ricianchanl" function also in MATLAB which can be used if you are assuming LOS.
3- The three values in 1,2, 3 above can be added (in dBs) to get the total power loss for single simulation instant.
4- Other values of interest in channel modelling shall be mobility modelling (simple simulations can assume that MU are fixed or pedestrian with velocity around 3Km/h unless you are interested in mobility) and traffic modelling which is dependent on your particular scenario of interest. Of course, not to forget the number of cells to be incorporated in the simulation and how to deal with simulation boundary effects to closely represent real life as possible (usually "wrapping" is assumed in which the mobiles exiting the simulation boundary from one edge is assumed to enter from the opposite other end. Hope this helps. Thanks. @AlDmour.
Dear Ismat, very informative piece of work, I want to ask, can I use this whole procedure as you have mentioned for channel modeling in other Applications like Wireless Body Sensor or Body Area Networks? thanks
1)- As stated earlier, "A simple Rayleigh fading channel coefficient with average gain P is generated as h = sqrt(P/2)*(randn(1,1)+1i*randn(1,1))." I assume that this (1,1) means that fading is assumed to be constant for one frame transmission.
2)- P is normally assumed to be 1. is it o.k to assume P=1?
1) Yes, the channel realization is fixed for a coherence time of a few milliseconds. This can cover one or several frames. Low mobility users have a longer coherence time than high mobility users.
2) There are 3 factors that affect the transmission quality: Power of data signal, channel attenuation and noise variance. You can normalize two of them to 1, but the last one should be selected to make the SNR become whatever you like it to be (e.g., 10 dB or 20 dB).
To be more precise, say that the received signal is y = h * x + n, where h and n were defined before and x is the random data signal with some given power. If we normalize the data signal power to one and noise variance to one, then the variance P of the channel is the one that should be put to P=10 or P=100 to get an SNR of 10 dB or 20 dB, respectively.
It is very easy to model a wireless channel if we understand the physics behind it. Some of us might be surprised if I state that all wireless channels are Gaussian distributed. In fact, I have not come across any wireless channel with any other distribution with those frightening CDF and PDF. And justification is very simple: A wireless channel h is a sum of independent paths (multipaths) i.e. independent random variables. Applying CLT theorem, it is proved that h is Gaussian.
Now I will see three different cases on h:
Case1: If all the multipaths of h are random, mean of h would be zero.
Case2: If one path is not random, mean of h would be non-zero i.e. LOS .
Case3: In third case, we divide all multipaths in a group of m clusters having similar delays.
For mathematical simplicity we assume that real and imaginary component of H (frequency domain representation of h) are independent and identical in variance.
It is now easy to model H in first two cases, and little bit complicated in the third case. I neglect large scale in the modeling but include distance d from BS to MS with loss exponent (depends on severity of obstruction more in urban less in free space ).
Matlab Modeling in Frequency domain:
Case1: H =sqrt(1/2*d^loss_exponent)*(randn(1,1)+1i*randn(1,1)) SISO
(Note: sqrt 2 is used to normalize the variance 1/2 in each dimension while sqrt over d^loss_exponent is due to the fact that 1/d^loss_exponent is variance: See help randn in Matlab. Moreover, if we replace each 1 in randn with M>1 it will create a square MIMO wireless channel with complex Gaussian as entries.)
Case2: H =Power of LOS+sqrt(1/2*d^loss_exponent)*(randn(1,1+1i*randn(1,1))
Here mean is added as line of sigh power. Define K = power of LOS*d^loss_exponent.
Case 3: Difficult to model using randn function. Uses gamma function instead. Can describe in other post.
Since every channel attenuate the signal , we measure attenuation by |H| i.e absolute value of H known as fading channel. I emphasis that we should be very clear in our thought process what we mean by channel H and fading channel |H|. Mixing both might create problems
Distribution of fading channel |H|:
Case 1: For a zero mean Gaussian random variable with identical variance, the distribution of fading channel |H| is Rayleigh (See Papoulis book chapter: two random variable.)
Case2: For a non-zero mean Gaussian random variable with identical variance, the distribution of fading channel |H| is Rician (See Papoulis book: chapter two random variable )
Case3: The fading channel corresponding to this channel treating m grouped clusters is Nakagami-m.
I wanted to distinguish between wireless channel and wireless fading channel.
Thanks for your patience in reading the whole description.
How do we know that what range of complex random values we need to generate for BER vs SNR simulation. I mean to say what is the check if the random number generation is correct. If I check my generated values in MATLAB , my random numbers are complex numbers and some are less than 1 and some are greater than one. please guide
In simplified path loss model we have to multiply a constant factor K (e.g., K=0.001) which represents the antenna characteristics and average channel attenuation. Why we do not incorporate it here in Rayleigh fading model.
I found Rayleigh channel model in the following from:
h = sqrt(var(i)/2)*randn(1,N) + 1i*sqrt(var(i)/2)*randn(1,N);
Please, what is the difference between this form and what Emil and Zafaruddin presented? Notice that it contains the variance in the imaginary part as well. Also, is N the number of antennas, number of samples, or number of users?