Tag Archives: Fading

Fading Model – From Simple to Complex

1. The simplest channel model just scales the input signal by a real number between 0 and 1 e.g. if the signal at the transmitter is s(t) then at the receiver it becomes a*s(t). The effect of channel is multiplicative (the receiver noise on the other hand is additive).

2.   The above channel model ignores the phase shift introduced by the channel. A more realistic channel model is one that scales the input signal as well rotates it by a certain angle e.g. if s(t) is the transmitted signal then the received signal becomes a*exp(jθ)*s(t).

3. In a realistic channel the transmitter, receiver and/or the environment is in motion therefore the scaling factor and phase shift are a function of time e.g. if s(t) is the transmitted signal then the received signal is a(t)*exp(jθ(t))*s(t). Typically in simulation of wireless communication systems a(t) has a Rayleigh distribution and θ(t) has a uniform distribution.

4. Although the above model is quite popular, it can be further improved by introducing temporal correlation in the fading envelope. This can be achieved by the Smith’s simulator which uses a frequency domain approach to characterize the channel. The behavior of the channel is controlled by the Doppler frequency fd. Higher the Doppler frequency greater is the variation in the channel and vice versa [1].

5. Finally the most advanced wireless channel model is one that considers the channel to be an FIR filter where each tap is defined by the process outlined in (4). The channel thus performs convolution on the signal that passes through it. In the context of LTE there are three channel models that are defined namely Extended Pedestrian A (EPA), Extended Vehicular A (EVA) and Extended Typical Urban (UTU) [2].

Note: As an after thought I have realized that this channel model becomes even more complicated with the introduction of spatial correlation between the antennas of a MIMO system [3].

M-QAM Bit Error Rate in Rayleigh Fading

We have previously discussed the bit error rate (BER) performance of M-QAM in AWGN. We now discuss the BER performance of M-QAM in Rayleigh fading. The one-tap Rayleigh fading channel is generated from two orthogonal Gaussian random variables with variance of 0.5 each. The complex random channel coefficient so generated has an amplitude which is Rayleigh distributed and a phase which is uniformly distributed. As usual the fading channel introduces a multiplicative effect whereas the AWGN is additive.

The function “QAM_fading” has three inputs, ‘n_bits’, ‘M’, ‘EbNodB’ and one output ‘ber’. The inputs are the number of bits to be passed through the channel, the alphabet size and the Energy per Bit to Noise Power Spectral Density in dB respectively whereas the output is the bit error rate (BER).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FUNCTION THAT CALCULATES THE BER OF M-QAM IN RAYLEIGH FADING
% n_bits: Input, number of bits
% M: Input, constellation size
% EbNodB: Input, energy per bit to noise power spectral density
% ber: Output, bit error rate
% Copyright RAYmaps (www.raymaps.com)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function[ber]= QAM_fading(n_bits, M, EbNodB)
% Transmitter
k=log2(M);
EbNo=10^(EbNodB/10);
x=transpose(round(rand(1,n_bits)));
h1=modem.qammod(M);
h1.inputtype='bit';
h1.symbolorder='gray';
y=modulate(h1,x);

% Channel
Eb=mean((abs(y)).^2)/k;
sigma=sqrt(Eb/(2*EbNo));
w=sigma*(randn(n_bits/k,1)+1i*randn(n_bits/k,1));
h=(1/sqrt(2))*(randn(n_bits/k,1)+1i*randn(n_bits/k,1));
r=h.*y+w;

% Receiver
r=r./h;
h2=modem.qamdemod(M);
h2.outputtype='bit';
h2.symbolorder='gray';
h2.decisiontype='hard decision';
z=demodulate(h2,r);
ber=(n_bits-sum(x==z))/n_bits
return
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

64-QAM Constellation

M-QAM Bit Error Rate in Rayleigh Fading
M-QAM Bit Error Rate in Rayleigh Fading

The bit error rates of four modulation schemes 4-QAM, 16-QAM, 64-QAM and 256-QAM are shown in the figure above. All modulation schemes use Gray coding which gives a few dB of margin in the BER performance. As with the AWGN case each additional bit per symbol requires about 1.5-2 dB in signal to ratio to achieve the same BER.

Although not shown here similar behavior is observed for higher order modulation schemes such as 1024-QAM and 4096-QAM (the gap in the signal to noise ratio for the same BER is increased to about 5dB).

Lastly we explain some of the terms used above.

Rayleigh Fading

Rayleigh Fading is a commonly used term in simulation of Digital Communication Systems but it tends to differ in meaning in different contexts. The term Rayleigh Fading as used above means a single tap channel that varies from one symbol to the next. It has an amplitude which is Rayleigh distributed and a phase which is Uniformly distributed. A single tap channel means that it does not introduce any Inter Symbol Interference (ISI). Such a channel is also referred to as a Flat Fading Channel. The channel can also be referred to as a Fast Fading Channel since each symbol experiences a new channel state which is independent of its previous state (also termed as uncorrelated).

Gray Coding

When using QAM modulation, each QAM symbol represents 2,3,4 or higher number of bits. That means that when a symbol error occurs a number of bits are reversed. Now a good way to do the bit-to-symbol assignment is to do it in a way such that no neighboring symbols differ by more than one bit e.g. in 16-QAM, a symbol that represents a binary word 1101 is surrounded by four symbols representing 0101, 1100, 1001 and 1111. So if a symbol error is made, only one bit would be in error. However, one must note that this is true only in good signal conditions. When the SNR is low (noise has a higher magnitude) the symbol might be displaced to a location that is not adjacent and we might get higher number of bits in error.

Hard Decision

The concept of hard decision decoding is important when talking about channel coding, which we have not used in the above simulation. However, we will briefly explain it here. Hard decision is based on what is called “Hamming Distance” whereas soft decision is based on what it called “Euclidean Distance”. Hamming Distance is the distance of a code word in binary form, such as 011 differs from 010 and 001 by 1. Whereas the Euclidean distance is the distance before a decision is made that a bit is zero or one.  So if the received sequence is 0.1 0.6 0.7 we get a Euclidean distance of 0.8124 from 010 and 0.6782 from 001. So we cannot make a hard decision about which sequence was transmitted based on the received sequence of 011. But based on the soft metrics we can make a decision that 001 was the most likely sequence that was transmitted (assuming that 010 and 001 were the only possible transmitted sequences).

LTE Fading Simulator

As discussed previously an LTE channel can be modeled as an FIR filter. The filter taps are described by the EPA, EVA and ETU channel models.

If x(k) is the original signal then the signal at the output of the FIR filter y(k) is given as:

y(k)=x(k)*c(0)+x(k-1)*c(1)+…..+x(k-L+2)*c(L-2)+x(k-L+1)*c(L-1)

Channel as FIR Filter
Channel as FIR Filter

Since the wireless channel is time varying the channel taps c(0) c(1)…..c(L-1) are also time varying with either Rayleigh or Rician distribution. It is quite easy to generate Rayleigh random variables with the desired power and distribution, however, when these Rayleigh random variables are required to have temporal correlation the process becomes a bit complicated. Temporal correlation of these variables depends upon the Doppler frequency which is turn depends upon the speed of the mobile device. The Doppler frequency is defined as:

fd=v*cos(theta)/lambda

where

fd is the Doppler Frequency in Hz
v is the receiver velocity in m/sec
lambda is the wavelength in m
and theta is the angle between the direction of arrival of the signal and the direction of motion

A simple method for generating Rayleigh random variables with the desired temporal correlation was devised by Smith [1]. His method was based on Clark and Gans fading model and has been widely used in simulation of wireless communication systems.

The method for generating the Rayleigh fading envelope with the desired temporal correlation is given below (modified from Theodore S. Rappaport Text).

1. Define N the number of Gaussian RVs to be generated, fm the Doppler frequency in Hz, fs the sampling frequency in Hz, df the frequency spacing which is calculated as df=(2*fm)/(N-1) and M total number of samples in frequency domain which is calculated as M=(fs/df).

2. Generate two sequences of N/2 complex Gaussian random variables. These correspond to the frequency bins up to fm. Take the complex conjugate of these sequences to generate the N/2 complex Gaussian random variables for the negative frequency bins up to -fm.

3. Multiply the above complex Gaussian sequences g1 and g2 with square root of the Doppler Spectrum S generated from -fm to fm. Calculate the spectrum at -fm and +fm by using linear extrapolation.

4. Extend the above generated spectra from -fs/2 to +fs/2 by stuffing zeros from -fs/2 to -fm and fm to fs/2. Take the IFFT of the resulting spectra X and Y resulting in time domain signals x and y.

5. Add the absolute values of the resulting signals x and y in quadrature. Take the absolute value of this complex signal. This is the desired Rayleigh distributed envelope with the required temporal correlation.

The Matlab code for generating Rayleigh random sequence with a Doppler frequency of fm Hz is given below.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% RAYLEIGH FADING SIMULATOR BASED UPON SMITH'S METHOD
% N is the number of paths
% M is the total number of points in the frequency domain
% fm is the Doppler frequency in Hz
% fs is the sampling frequency in Hz
% df is the step size in the frequency domain
% Copyright RAYmaps (www.raymaps.com)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all;
close all;                          
 
N=1000;
fm=300;
df=(2*fm)/(N-1);
fs=7.68e6;
M=round(fs/df);
T=1/df;
Ts=1/fs;                                
 
% Generate two sequences of N complex Gaussian random variables 
g=randn(1,N/2)+j*randn(1,N/2);
gc=conj(g);
g1=[fliplr(gc), g];                                  
 
g=randn(1,N/2)+j*randn(1,N/2);
gc=conj(g);
g2=[fliplr(gc), g];                 
 
% Generate Doppler Spectrum S
f=-fm:df:fm;
S=1.5./(pi*fm*sqrt(1-(f/fm).^2));
S(1)=2*S(2)-S(3);
S(end)=2*S(end-1)-S(end-2);   
 
% Multiply the sequences with the Doppler Spectrum S, take IFFT
X=g1.*sqrt(S);
X=[zeros(1,round((M-N)/2)), X, zeros(1,round((M-N)/2))];
x=abs(ifft(X,M));                             
 
Y=g2.*sqrt(S);
Y=[zeros(1,round((M-N)/2)), Y, zeros(1,round((M-N)/2))];
y=abs(ifft(Y,M));                             
 
% Find the resulting Rayleigh faded envelope
z=x+j*y;
r=abs(z);   
r=r/sqrt(mean(r.^2));                    
 
t=0:Ts:T-Ts;
plot(t,10*log10(r),'r')
xlabel('Time(sec)')
ylabel('Envelope (dB)')
axis([0 0.01 -10 5])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The above code generates a Rayleigh random sequence with samples spaced at 0.1302 usec. This corresponds to a sampling frequency of 7.68 MHz which is the standard sampling frequency for a bandwidth of 5MHz. Similarly, the sampling rate for 10 MHz and 20 MHz is 15.36 MHz and 30.72 MHz respectively.  The Doppler frequency can also be changed according to the scenario. LTE standard defines 3 channel models EPA, EVA and ETU with Doppler frequencies of 5 Hz, 70 Hz and 300 Hz respectively. These are also known as Low Doppler, Medium Doppler and High Doppler respectively.

The above code generated Rayleigh sequences of varying lengths for the three cases. But in all the cases it is in excess of 10 msec and can be used as the fading sequence for an LTE frame. Just to recall an LTE frame is of 10 msec duration with 20 time slots of 0.5 msec each. If each slot contains 7 OFDM symbols the total length of a fading sequence is 140 symbols.

Rayleigh Fading 5Hz, 70Hz, 300Hz

Rayleigh Fading Envelope and Phase Distribution

It is seen that the fluctuation in the channel increases with Doppler frequency. The channel is almost static for a Doppler frequency of 5 Hz and varies quite rapidly for a Doppler frequency of 300 Hz. It is also shown above that the envelope of z is Rayleigh distributed and phase of z is Uniformly distributed. However, the range of phase is from 0 to pi/2. This needs to be further investigated. The level crossing rate and average fade duration can also be measured.

This is the process for generating one Rayleigh distributed channel tap. This step would have to be repeated for the number of taps in the channel model which could be 7 or 9 for the LTE channel models. A Ricean distributed channel tap can be generated in a similar fashion. MIMO channel taps can also be generated using the above described method, however, we would need to understand the concept of antenna correlation before we do that.

Level Crossing Rate and Average Fade Duration

Level crossing rate (LCR) is defined as number of times per second the signal envelope crosses a given threshold. This could be either in the positive direction or negative direction. Average fade duration (AFD) is the average duration that the signal envelope remains below a given threshold once it crosses that threshold. Simply it is the average duration of a fading event. The LCR and AFD are interconnected and the product of these two quantities is a constant. The program given below calculates the LCR and AFD of the above generated envelope r.

The program calculates both the simulated and theoretical values of LCR and AFD e.g. for a threshold level of 0.3 (-5.22 dB) the LCR and AFD values calculated for fm=70 Hz and N=32 are:

LCR simulation = 45.16

LCR theoretical = 43.41

AFD simulation = 0.0015 sec

AFD theoretical = 0.0016 sec

It can be seen that the theoretical and simulation results match quite well. This gives us confidence that are generated envelope has the desired statistical characteristics.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PROGRAM TO CALCULATE THE LCR and AFD
% Rth: Level to calculate the LCR and AFD
% Rrms: RMS level of the signal r
% rho: Ratio of defined threshold and RMS level
% Copyright RAYmaps (www.raymaps.com)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Rth=0.30;
Rrms=sqrt(mean(r.^2));
rho=Rth/Rrms;

count1=0;
count2=0;

for n=1:length(r)-1
     if r(n) < Rth && r(n+1) > Rth
        count1=count1+1;
     end
    if r(n) < Rth
        count2=count2+1;
    end
end
LCR=count1/(T)
AFD=((count2*Ts)/T)/LCR

LCR_num=sqrt(2*pi)*fm*rho*exp(-(rho^2))
AFD_num=(exp(rho^2)-1)/(rho*fm*sqrt(2*pi))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Note:

1. According to Wireless Communications Principles and Practice by Ted Rappaport "Perform an IFFT on the resulting frequency domain signals from the in-phase and quadrature arms to get two N-length time series, and add the squares of each signal point in time to create an N-point time series. Note that each quadrature arm should be a real signal after IFFT". Now this point about the signal being real after IFFT is not always satisfied by the above program. The condition can be satisfied by playing around with the value of N a bit.

2. Also, we take the absolute value of both the time series after IFFT operation to make sure that we get a real valued sequence. However, taking the absolute value of both the in-phase and quadrature terms  makes z fall in the first quadrant and the phase of z to vary from 0 to pi/2. A better approach might be to use the 'real' function instead of 'abs' function so that the phase can vary from 0 to 2pi.

3. A computationally efficient method of generating Rayleigh fading sequence is given here.

[1] John I. Smith, "A Computer Generated Multipath Fading Simulation for Mobile Radio", IEEE Transactions on Vehicular Technology, vol VT-24, No. 3, August 1975.

LTE Multipath Channel Models

When a wireless signal travels from a transmitter to a receiver it follows multiple paths. The signal may travel directly following the line of sight between the transmitter and receiver, it may bounce off the ground and reach the receiver or it may be reflected by multiple buildings on the way to the receiver. When these copies of the same signal arrive at the receiver they are delayed and attenuated based upon the path length that they have followed and various other factors.

A well known technique to model such a wireless channel is to model it as an FIR (Finite Impulse Response) filter. The wireless channel thus performs the convolution operation on the transmitted signal. The multipath profile of three well known LTE channel models is shown below.

LTE Channel Models
LTE Channel Models

The channel profile quantifies the delays and relative powers of the multipath components. It can be observed that the EPA model has 7 multipath components whereas the EVA and ETU models have 9 multipath components each. However there is a small caveat here. The multipath components described in the above table are not uniformly spaced in the time domain. So if an FIR filter has to perform convolution operation on a signal uniformly sampled at 100 MHz (Ts=10 nsec) the number of filter taps would be much larger. To be exact the FIR filters corresponding to the above channel models would have 42, 252 and 501 filter taps respectively. Most of these taps would have no power so the FIR filter can be efficiently implemented in hardware.

Also, if the channel is time-varying as most wireless channels are, each filter tap can be modeled to have a Rayleigh or Ricean distribution with a mean value described in the table above. Lastly, the variation in the value of a channel tap from one sample to the next depends upon the Doppler frequency which in turn depends upon the speed of the mobile unit. Higher the velocity of a mobile unit higher would be the Doppler frequency and greater would be the variations in the channel. The Doppler frequency is defined as:

fd=v*cos(theta)/lambda

where

‘fd’ is the Doppler Frequency
‘v’ is the receiver velocity
‘lambda’ is the wavelength
and ‘theta’ is the angle between the direction of arrival of the signal and the direction of motion

The exact method of generating Rayleigh distributed channel co-efficients with the desired temporal correlation requires some more explanation and would be the subject of a future post.

Note:
1. The above multipath channel models have a maximum delay of 410 nsec, 2510 nsec and 5000 nsec which is well within the range of a long cyclic prefix of length 16.67 usec (16670 nsec). So the Intersymbol Interference (ISI) would not adversely effect the system performance.
2. If you are doing simulation of a system that operates on individual symbols then temporal correlation between channel co-efficients is not that important. But if the system operates on blocks of symbols or bits (as an interleaver or convolutional encoder does) then temporal correlation plays an important part in determining the system performance.