0% found this document useful (0 votes)
873 views

Wireless Communication Practical File

This is a practical file of subject Wireless communications which is generally taught in 7th semester of Indian Engineering colleges.

Uploaded by

Greedy Boy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
873 views

Wireless Communication Practical File

This is a practical file of subject Wireless communications which is generally taught in 7th semester of Indian Engineering colleges.

Uploaded by

Greedy Boy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 36

AMITY SCHOOL OF ENGINEERING AND

TECHNOLOGY

WIRELESS COMMUNICATION
PRACTICAL FILE

Submitted to: Submitted by:


Mrs. Bindu E Ashish Singh Negi
40110402817

INDEX
S. No Aim of Experiment Date

1 BER analysis of digital communication system 27/08/20


using MATLAB.

2 Simulation of single user and multi-user CDMA 10/09/20


System using MATLAB 

3 Study of knife edge diffraction model using 24/09/20


MATLAB

4 Study of various probability distributions through 24/09/20


simulations using MATLAB 

5 Study of Rayleigh channel model using 08/10/20


MATLAB  

Experiment- 1
Aim- BER analysis of digital communication system using MATLAB.
Software Required- MATLAB
Theory- The BER, or quality of the digital link, is calculated from the number of bits received in
error divided by the number of bits transmitted.
BER = (Bits in Error) / (Total bits received) …. (1)
In digital transmission, the number of bit errors is the number of received bits of a data stream over
a communication channel that has been altered due to noise, interference, distortion or bit
synchronization errors. The BER is the number of bit errors divided by the total number of
transferred bits during a particular time interval. BER is a unit less performance measure, often
expressed as a percentage.
BER can also be defined in terms of the probability of error (POE) and represented by Eq. (2).
POE = 1/ 2 (1 – erf) (Eb/ N0)1/2 ….(2)
Here, ‘erf “is the error function, Eb is the energy in one bit and N0 is the noise power spectral density
(noise power in a 1Hz bandwidth). The error function is different for the each of the various
modulation methods. The POE is a proportional to E b/ N0, which is a form of signal-to-noise ratio.
The energy per bit, Eb, can be determined by dividing the carrier power by the bit rate. As an energy
measure, Eb has the unit of joules. N0 is in power that is joules per second, so, Eb/ N0 is a
dimensionless term, or is a numerical ratio.
Output-
Blue-AWGN
Green-Rayleigh
Red- Rician
Modulation type-PSK

Modulation type-DPSK
Channel type- AWGN
1. Modulation type-psk, modulation order-2; extact0
2. Modulation type-dpsk, modulation order-4; extact1
3. Modulation type-qqpsk, channel coding-convolution; upperbound3
4. Modulation type-pam, modulation order-8; extact4
5. Modulation type-qam, modulation order-16; extact5
6. Modulation type-fsk, modulation order-2, demodulation type-coherent; extact6
7. Modulation type-msk, channel coding-convolution; upperbound7
8. Modulation type-cpfsk, modulation order-4, lowerbound9

Channel type- Rayleigh


1. Modulation type-PSK, MODULATION ORDER-2, Diversity order-5; exact0
2. Modulation type-DPSK, MODULATION ORDER-4, Diversity order-5; exact1
3. Modulation type-QQPSK, Diversity order-2; exact3
4. Modulation type-PAM, MODULATION ORDER-8, Diversity order-5; exact4
5. Modulation type-QAM, MODULATION ORDER-16, Diversity order-3; exact5
6. Modulation type-FSK, MODULATION ORDER-2, Diversity order-3, Demodulation type-non-
coherent; exact6

Channel type-Rician
1. Modulation type-PSK, k factor=1, diversity order-5, modulation order-2; exact0
2. Modulation type-DPSK, k factor=1, diversity order-5, modulation order-4; exact1
3. Modulation type-QQPSK, k factor=1, diversity order-3; exact2
4. Modulation type-PAM, k factor=1, diversity order-5, modulation order-8; exact3
5. Modulation type-QAM, k factor=1, diversity order-5, modulation order-16; exact4
6. Modulation type-FSK, k factor=1, diversity order-5, modulation order-2; exact5

Result- BER analysis of digital communication system using MATLAB has been done successfully.
Experiment- 2
Aim- Simulation of single user and multi user CDMA System using MATLAB.
Software Required- MATLAB
Theory- Code-division multiple access (CDMA) is a channel access method used by
various radio communication technologies. CDMA is an example of multiple access, where several
transmitters can send information simultaneously over a single communication channel. This allows
several users to share a band of frequencies (see bandwidth). To permit this without undue
interference between the users, CDMA employs spread spectrum technology and a special coding
scheme (where each transmitter is assigned a code).
CDMA is used as the access method in many mobile phone standards. IS-95, also called "cdmaOne",
and its 3G evolution CDMA2000, are often simply referred to as "CDMA", but UMTS, the 3G
standard used by GSM carriers, also uses "wideband CDMA", or W-CDMA, as well as TD-CDMA
and TD-SCDMA, as its radio technologies.

Steps in CDMA modulation


CDMA is a spread-spectrum multiple-access technique. A spread-spectrum technique spreads the
bandwidth of the data uniformly for the same transmitted power. A spreading code is a pseudo-
random code that has a narrow ambiguity function, unlike other narrow pulse codes. In CDMA a
locally generated code runs at a much higher rate than the data to be transmitted. Data for
transmission is combined by bitwise XOR (exclusive OR) with the faster code.

Generation of a CDMA signal

The figure shows how a spread –spectrum signal is generated. The data signal with pulse duration of
Tb is XORed with the code signal with pulse duration of T c. Therefore, the bandwidth of data signal
is 1/Tb and the bandwidth of the spread spectrum signal is 1/Tc. Since T c is much smaller than Tb,
the bandwidth of the spread- spectrum signal is much larger than the bandwidth of the original signal
.The ratio Tb/Tc is called the spreading factor or processing gain and determines to a certain extent
the upper limit of the total number of users supported simultaneously by a base station.
Each user in a CDMA system uses a different code to modulate their signal. Choosing the codes
used to modulate the signal is very important in the performance of CDMA systems. The best
performance occurs when there is good separation between the signal of a desired user and the
signals of other users. The separation of the signals is made by correlating the received signal with
the locally generated code of the desired user. If the signal matches the desired user's code, then the
correlation function will be high and the system can extract that signal. If the desired user's code has
nothing in common with the signal, the correlation should be as close to zero as possible (thus
eliminating the signal); this is referred to as cross-correlation. If the code is correlated with the signal
at any time offset other than zero, the correlation should be as close to zero as possible. This is
referred to as auto-correlation and is used to reject multi-path interference
An analogy to the problem of multiple access is a room (channel) in which people wish to talk to
each other simultaneously. To avoid confusion, people could take turns speaking (time division),
speak at different pitches (frequency division), or speak in different languages (code division).
Code and Output-
Result- Simulation of single user and multi user CDMA System using MATLAB has been done
successfully.
Experiment- 3
Aim- Study of Knife Edge Diffraction Model using MATLAB.

Software Required- MATLAB

Theory-
What is Diffraction?
Diffraction is a phenomenon where electromagnetic waves (such as light waves) bend around corners to
reach places which are otherwise not reachable i.e. not in the line of sight. In technical jargon such
regions are also called shadowed regions (the term again drawn from the physics of light). This
phenomenon can be explained by Huygens’s principle which states that “as a plane wave propagates in a
particular direction each new point along the wave front is a source of secondary waves”. This can be
understood by looking at the following figure. However one peculiarity of this principle is that it is
unable to explain why the new point source transmits only in the forward direction.

Diffraction is Difficult to Model


The electromagnetic field in the shadowed region can be calculated by combining vectorially the
contributions of all of these secondary sources, which is a difficult task.
Secondly, the geometry is usually much more complicated than shown in the above figure. For example
consider a telecom tower transmitting electromagnetic waves from a rooftop and a pedestrian using a
Knife Edge Model
The path loss due to diffraction in the knife edge model is controlled by the Fresnel
Diffraction Parameter which measures how deep the receiver is within the shadowed region.
A negative value for the parameter shows that the obstruction is below the line of sight and if
the value is below -1 there is hardly any loss. A value of 0 (zero) means that the transmitter, receiver and
tip of the obstruction are all in line and the Electric Field Strength is reduced by half or the power is
reduced to one fourth of the value without the obstruction i.e. a loss of 6dB.  As the value of the Fresnel
Diffraction Parameter increases on the positive side the path loss rapidly increases reaching a value of
27 dB for a parameter value of 5. Sometimes the exact calculation is not needed and only an
approximate calculation, as proposed by Lee in 1985, is sufficient.
Fresnel Diffraction Parameter (v) is defined as:

v=h√(2(d1+d2)/(λ d1 d2))

Where
d1 is the distance between the transmitter and the obstruction along the line of sight
d2 is the distance between the receiver and the obstruction along the line of sight
h is the height of the obstruction above the line of sight
and λ is the wavelength

17
The electrical length of the path difference between a diffracted ray and a LOS ray is equal to φ=(π/2)
(v²) and the normalized electric field produced at the receiver, relative to the LOS path is e-jφ.
Performing a summation of all the exponentials above the obstruction (from v to positive infinity) gives
us the Fresnel Integral, F(v).

Knife Edge Diffraction Model Using Huygens Principle

Code and Output-

18
Result- Study of knife edge diffraction model has been done successfully.

19
Experiment- 4

Aim- Study of various probability distributions through simulations using MATLAB.

Software Required- MATLAB

Theory-
RAYLEIGH DISTRIBUTION-
In probability theory and statistics, the Rayleigh distribution is a continuous probability distribution for
nonnegative-valued random variables. It is essentially a chi distribution with two degrees of freedom.
A Rayleigh distribution is often observed when the overall magnitude of a vector is related to its
directional components.
The probability density function of the Rayleigh distribution is

Where σ is the scale parameter of the distribution. The cumulative distribution function is

NAKAGAMI DISTRIBUTION

The Nakagami distribution or the Nakagami-m distribution is a probability distribution related to


the gamma distribution. The family of Nakagami distributions has two parameters: a shape parameter
m≥1/2 and a second parameter controlling spread Ω>0.

Its probability density function (pdf) is

Its cumulative distribution function is

Where P is the regularized (lower) incomplete gamma function.

LOG-NORMAL DISTRIBUTION

In probability theory, a log-normal (or lognormal) distribution is a continuous probability distribution of


a random variable whose logarithm is normally distributed. Thus, if the random variable X is log-
normally distributed, then Y = ln(X) has a normal distribution. Equivalently, if Y has a normal

20
distribution, then the exponential function of Y, X = exp(Y), has a log-normal distribution. A random
variable which is log-normally distributed takes only positive real values.

A positive random variable X is log-normally distributed ,if the logarithm of X is normally distributed
with mean µ and variance σ2:

Let ϕ and φ be respectively the cumulative probability distribution function and the probability density
function of the N(0,1) distribution, then we have that

The cumulative distribution function is

Where ϕ is the cumulative distribution function of the standard normal distribution (i.e., N(0,1)).
This may also be expressed as follows:

GAMMA DISTRIBUTION
In probability theory and statistics, the gamma distribution is a two-parameter family of
continuous probability distributions. The exponential distribution, Erlang distribution, and chi-squared
distribution are special cases of the gamma distribution. There are three different parametrizations in
common use:

1. With a shape parameter k and a scale parameter θ.


2. With a shape parameter α = k and an inverse scale parameter β = 1/θ, called a rate parameter.
3. With a shape parameter k and a mean parameter μ = kθ = α/β.
In each of these three forms, both parameters are positive real numbers.

21
The gamma distribution can be parameterized in terms of a shape parameter α = k and an inverse scale
parameter β = 1/θ, called a rate parameter. A random variable X that is gamma-distributed with
shape α and rate β is denoted

The corresponding probability density function in the shape-rate parametrization is

The cumulative distribution function is the regularized gamma function:

If α is a positive integer (i.e., the distribution is an Erlang distribution), the cumulative distribution


function has the following series expansion:

  GAUSSIAN DISTRIBUTION

In probability theory, a normal (or Gaussian or Gauss or Laplace–Gauss) distribution is a type


of continuous probability distribution for a real-valued random variable. The general form of
its probability density function is

The parameter µ is the mean or expectation of the distribution (and also its median and mode), while the
parameter σ is its deviation The variance of the distribution is σ2 A random variable with a Gaussian
distribution is said to be normally distributed, and is called a normal deviate.
The cumulative distribution function (CDF) of the standard normal distribution, usually denoted with the
capital Greek letter  ϕ (phi) is the integral

22
LOGISTIC DISTRIBUTION

In probability theory and statistics, the logistic distribution is a continuous probability distribution.


Its cumulative distribution function is the logistic function, which appears in logistic
regression and feedforward neural networks. It resembles the normal distribution in shape but has
heavier tails (higher kurtosis). The logistic distribution is a special case of the Tukey lambda
distribution.
When the location parameter μ is 0 and the scale parameter s is 1, then the probability density
function of the logistic distribution is given by

The logistic distribution receives its name from its cumulative distribution function, which is an instance
of the family of logistic functions. The cumulative distribution function of the logistic distribution is also
a scaled version of the hyperbolic tangent.

In this equation, x is the random variable, μ is the mean, and s is a scale parameter proportional to


the standard deviation.

RICIAN DISTRIBUTION

In probability theory, the Rice distribution or Rician distribution (or, less commonly, Ricean


distribution) is the probability distribution of the magnitude of a circularly-symmetric bivariate normal
random variable, possibly with non-zero mean (non-centrally).

The probability density function is

Where I0(z) is the modified Bessel function of the first kind with order zero.

WEIBULL DISTRIBUTION

In probability theory and statistics, the Weibull distribution is a continuous probability distribution. It is


named after Swedish mathematician Waloddi Weibull, who described it in detail in 1951, although it

23
was first identified by Fréchet (1927) and first applied by Rosin & Rammler (1933) to describe a particle
size distribution.
The probability density function of a Weibull random variable is:

Where k > 0 is the shape parameter and λ > 0 is the scale parameter of the distribution.


Its complementary cumulative distribution function is a stretched exponential function. The Weibull
distribution is related to a number of other probability distributions; in particular, it interpolates between
the exponential distribution (k = 1) and the Rayleigh distribution .

Code and Output-

%EXPERIMENT 4 – PROBABILITY DISTRIBUTIONS

% Matlab sample codes are given below. Students need to write


%the complete theory with equations and
%plot the results corresponding to these dostributions.

1. Plot Rayleigh pdf and CDF.

close all; clear all; clf;


sig=linspace(0.5,1,5);
clr=['-.-','-.-','-+-','--','-x-'];
x=[0:.001:4];

for i=1:length(sig)
fX=x/sig(i)^2.*exp(-x.^2/(2*sig(i)^2));
subplot(121),plot(x,fX,clr(i),'LineWidth',3);
grid on; hold on;
end;
xlabel('X'); ylabel('f_{X}(x)');
title('The Rayleigh pdf');
legend('\sigma = 0.5','\sigma = 0.625',...
'\sigma = 0.75','\sigma = 0.875',...
'\sigma = 1.0');
for i=1:length(sig)
FX=1-exp(-x.^2/(2*sig(i)^2));
subplot(122),plot(x,FX,clr(i),'LineWidth',2);
grid on; hold on;
end;
xlabel('X'); ylabel('F_{X}(x)');
title('The Rayleigh CDF');
legend('\sigma = 0.5','\sigma = 0.625',...
'\sigma = 0.75','\sigma = 0.875',...
'\sigma = 1.0');
hold off;

24
End of rayleigh.m

2. Plot Nakagami-m pdf and CDF.

close all; clear all; clf;


m=[0.5,1,1,1,2,2,5];
o=[2,1,2,3,1,2,1];
x=[0:.001:3];
clr=['-.-','-.-','-+-','-x-','..','+-'];
for i=1:length(m)
fX= 2*m(i)^m(i)/(gamma(m(i))*o(i)^m(i))...
*x.^(2*m(i)-1).*exp(-(m(i)/o(i))*x.^2);
subplot(121),plot(x,fX,clr(i),'LineWidth',3);
grid on;hold on;
end;
xlabel('X'); ylabel('f_{X}(x)');
title('The Nakagami-m pdf');
legend('\mu = 0.5, \omega=2', '\mu = 1, \omega=1',...
'\mu = 1, \omega=2','\mu = 1, \omega=3',...
'\mu = 2, \omega=1','\mu = 2, \omega=2',...
'\mu = 5, \omega=1');
for i=1:length(m)
FX= gammainc((m(i)/o(i))*x.^2,m(i));
subplot(122),plot(x,FX,clr(i),'LineWidth',3);
grid on; hold on;
end;
xlabel('X'); ylabel('F_{X}(x)');
title('The Nakagami-m CDF');
legend('\mu = 0.5, \omega=2', '\mu = 1, \omega=1',...
'\mu = 1, \omega=2','\mu = 1, \omega=3',...
'\mu = 2, \omega=1','\mu = 2, \omega=2',...
'\mu = 5, \omega=1');
hold off;

End of nakagami.m

3. Plot Log-normal pdf and CDF.

close all; clear all; clf;


mu=0;
sig=[0.125, 0.25, 0.5, 1, 2];
x=[0:.001:3];
clr=['-.-','-.-','-+-','--','-*-'];
for i=1:length(sig)
fX= 1./(x*sig(i)*sqrt(2*pi)).*exp(-(log(x)...
-mu^2).^2/(2*sig(i)^2));
subplot(121),plot(x,fX,clr(i),'LineWidth',2);
grid on;hold on;
end;
xlabel('X'); ylabel('f_{X}(x)');

25
title('The Log-normal pdf');
legend('\sigma = 0.125', '\sigma = 0.25',...
'\sigma = 0.5', '\sigma = 1','\sigma = 2');
for i=1:length(sig)
FX=0.5+0.5*erf( (log(x)-mu)/(sig(i)*sqrt(2)));
subplot(122),plot(x,FX,clr(i),'LineWidth',2);
grid on;hold on;
end;
xlabel('X'); ylabel('F_{X}(x)');
title('The Log-normal CDF');
legend('\sigma = 0.125', '\sigma = 0.25',...
'\sigma = 0.5', '\sigma = 1','\sigma = 2');
hold off;

End of log-normal.m

4. Plot Gamma pdf and CDF.

close all; clear all; clf;


b=linspace(0.2,2,5);
c=linspace(2,10,5);
x=[0:.001:25];
clr=['-.-','-.-','-+-','--','-x-'];
for i=1:length(b)
fX= (x/b(i)).^(c(i)-1).*exp(-x/b(i))/...
(b(i)*gamma(c(i)));
subplot(121),plot(x,fX,clr(i),'LineWidth',2);
grid on;hold on;
end;
xlabel('X'); ylabel('f_{X}(x)');
title('The Gamma pdf');
legend('b = 0.2, c = 2', 'b = 0.65, c = 4',...
'b = 1.1, c = 6', 'b = 1.55, c = 8', ...
'b = 2, c = 10');
for i=1:length(b)
FX= gammainc(x/b(i),c(i));
subplot(122),plot(x,FX,clr(i),'LineWidth',2);
grid on;hold on;
end;
xlabel('X'); ylabel('F_{X}(x)');
title('The Gamma CDF');
legend('b = 0.2, c = 2', 'b = 0.65, c = 4',...
'b = 1.1, c = 6', 'b = 1.55, c = 8', ...
'b = 2, c = 10');
hold off;

End of gamma pdf.m

5. Plot Gaussian pdf and CDF.

26
close all; clear all; clf;
sig=sqrt(linspace(0.16,1,5));
m=linspace(-4,4,5);
clr=['-','-','-','-','-'];
x=[-10:.05:10];
for i=1:length(sig)
fX=1/(sqrt(2*pi*sig(i)^2))*exp(-(x-m(i)).^2/(2*sig(i)^2));
subplot(121),plot(x,fX,clr(i),'LineWidth',2);
grid on;hold on;
end;
xlabel('X'); ylabel('f_{X}(x)');
title('The Gaussian pdf');
legend('\mu = -4, \sigma = 0.4','\mu = -2, \sigma = 0.61',...
'\mu = 0, \sigma = 0.76','\mu = 2, \sigma = 0.89',...
'\mu = 4, \sigma = 1.0');
for i=1:length(sig)
% FX=0.5*erfc(-x/sqrt(2));
FX=normcdf(x,m(i),sig(i));
% The normcdf(.) is available only in
% Statistics Toolbox of MATLAB....
subplot(122),plot(x,FX,clr(i), 'LineWidth',2);
grid on; hold on;
end;
xlabel('X'); ylabel('F_{X}(x)');
title('The Gaussian CDF');
legend('\mu = -4, \sigma = 0.4','\mu = -2, \sigma = 0.61',...
'\mu = 0, \sigma = 0.76','\mu = 2, \sigma = 0.89',...
'\mu = 4, \sigma = 1.0');
hold off;

End of gausspdf.m

6. Plot Logistic pdf and CDF.

close all; clear all; clf;


a=1;
b=[1,2,4,8,16];
x=[0:.001:2];
clr=['bk','r','b','g','m'];
for i=1:length(b)
fX= b(i)*x.^(b(i)-1)./(1+x.^b(i)).^2;
subplot(121),plot(x,fX,clr(i),'LineWidth',2);
hold on;
end;
xlabel('X'); ylabel('f_{X}(x)');
title('The Log-logistic pdf');
legend('\beta = 1','\beta = 2','\beta = 4',...
'\beta = 8','\beta =16');
for i=1:length(b)
FX= x.^b(i)./(1+x.^(b(i)));

27
subplot(122),plot(x,FX,clr(i),'LineWidth',2);
hold on;
end;
xlabel('X'); ylabel('F_{X}(x)');
title('The Logistic CDF');
legend('\beta = 1','\beta = 2','\beta = 4',...
'\beta = 8','\beta =16');
hold off;

7. Plot Rician pdf.

close all; clear all; clf;


sig=0.9;
a=linspace(0.5,2,5);
x=[0:.001:4];
clr=['-.-','-.-','-+-','--','-x-'];
for i=1:length(a)
fX=x/sig^2.*exp(-(x.^2+a(i)^2)/...
(2*sig^2)).*besselj(1,a(i)*x/sig^2);
plot(x,fX,clr(i),'LineWidth',3);
grid on; hold on;
end;
xlabel('X'); ylabel('f_{X}(x)');
title('The Rician pdf');
legend('a = 0.5', 'a = 0.875',...
'a = 1.25', 'a = 1.625', 'a = 2');
hold off;

End of rician.m

8. Plot Weibull pdf and CDF.

close all; clear all; clf;


lam=[0.5,1,1.5,3];
k=[2,2,3,4];
x=[0:.001:5];
clr=['-.-','-.-','-+-','-x-'];
for i=1:length(k)
fX=k(i)/lam(i)*(x/lam(i)).^(k(i)-1).*exp(-(x/lam(i))).^k(i);
subplot(121),plot(x,fX,clr(i),'LineWidth',3);
grid on;hold on;
end;
xlabel('X'); ylabel('f_{X}(x)');
title('The Weibull pdf');
legend('\lambda = 0.5, k=2', '\lambda = 1.0, k=2', ...
'\lambda = 1.5, k=3', '\lambda = 3.0, k=4');
for i=1:length(k)
FX=1-exp(-(x/lam(i)).^k(i));
subplot(122),plot(x,FX,clr(i),'LineWidth',3);

28
grid on;hold on;
end;
xlabel('X'); ylabel('F_{X}(x)');
title('The Weibull CDF');
legend('\lambda = 0.5, k=2', '\lambda = 1.0, k=2', ...
'\lambda = 1.5, k=3', '\lambda = 3.0, k=4');
hold off;

29
30
31
Result- Study of various probability distributions has been performed successfully.

32
Experiment- 5

Aim- Study of Rayleigh channel model using MATLAB.

Software Required- MATLAB

Theory- The Rayleigh probability distribution function defines the LTE channel.  This type of
channel has an impulse response given by a delta which weighted has a power distribution
function of Rayleigh:

Where
σ is the RMS of the received signal.
2
r /2 is the instantaneous power
σ2 is the mean power of the received signal
The characteristic power distribution function envelope of a received signal with fading is:

While the mobile station is in motion, the received signal fades away and the weight of the delta
function also changes according to the Rayleigh distribution. If the mobile station suffers a deep
fade, the weight of the delta is small and when the received signal is improved, the weight of the
delta is large.
Recall a Gaussian channel can be represented as an impulse response with a delta of constant

33
weight; an ideal channel plus a source of AWGN (Additive White Gaussian Noise). The noise of
this channel is AWGN.
A multipath channel can be expressed as a linear filter and time varying, the same which can be
deduced as the sum of different paths with their own delay and complex amplitude:

Note that this model is used to characterize the rapid variations of the received signal strength
due to changes in phases when a mobile terminal moves over small distances close to a few
wavelengths or over short time durations on the order of seconds. Since the mean power
remains constant over these small distances, small scale fading can be considered as
superimposed on large scale fading for large scale models.

Code and Output-

% EXP-5 RAYLEIGH CHANNEL –Tx and Rx


DATA=round(rand(1,10000));
TX=[];
a=1;
%Let the bandwidth of the complex base band signal be W/2
W=2;
N0=0.01;
N0W=(N0/2)*W;
for i=1:1:length(DATA)
if(DATA(i)==0)
TX=[TX a 0];
else
TX=[TX 0 a];
end
end
%Gaussian noise with variance 0.01
g=sqrt(N0W)*randn(1,20000)+j*sqrt(N0W)*randn(1,20000);

34
%Flat-fading rayleigh channel with impulse response r
r=sqrt(0.1)*randn(1,20000)+j*sqrt(0.1)*randn(1,20000);
RX=r.*TX+g;
figure
subplot(2,2,1)
stem(TX(1:1:200))
title('Typical transmitted samples')
subplot(2,2,2)
[a,b]=hist(sqrt(abs(r)),100)
plot(b,a)
title('histogram of the rayleigh distributed noise')
subplot(2,2,3)
plot(real(RX(1:1:200)))
title('Real part of the received samples')
subplot(2,2,4)
plot(imag(RX(1:1:200)))
title('Imaginary part of the received samples')
%detection
DETDATA=[];
for i=1:2:200
temp=[RX(i) RX(i+1)];
O=abs(temp(1))-abs(temp(2));
if(O>0)
DETDATA=[DETDATA 0];
else
DETDATA=[DETDATA 1];
end
end
figure
subplot(2,1,1)
stem(DATA(1:1:100))
title('Transmitted data')
subplot(2,1,2)
stem(DETDATA,'r')
title('Corresponding detected data')

35
Result- Rayleigh channel model using MATLAB has been studied successfully.

36

You might also like