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

ADC Lab 09 Random Process Autocorrelation PSD

Uploaded by

i222162
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

ADC Lab 09 Random Process Autocorrelation PSD

Uploaded by

i222162
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Analogue and Digital Communication Lab

(EL-3003)

LABORATORY MANUAL

Engr. Fakhar Abbas

Random Process , Autocorrelation & Power Spectral


Density
(LAB # 09)
Student Name: Asma khan

Roll No: 22i-2162 Section: A

____________________________________________________________________________________________________________________________________________________________

NATIONAL UNIVERSITY OF COMPUTER AND EMERGING SCIENCES, ISLAMABAD

Prepared by: Engr. Fakhar Abbas Version: 2.01


Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL3003)
of Computer and Emerging Sciences
Islamabad Fall 2024
09
____________________________________________________________________________________
Lab # 09: Random Process , Autocorrelation & Power Spectral
Density
Learning Objectives:
1. Generation of Noise and Random Process in MATLAB
2. Understanding Power Spectral Density, Autocorrelation of Signals in MATLAB
Equipment Required:
1. PC
2. MATLAB

Introduction
In this lab we will implemet methods for generating random variables and samples of
random processes in MATLAB. We begin with the implementation of a method for
generating random variables with a specified probability distribution function. Then we
will analyze the characterization of a stationary random process by its autocorrelation in
the time domain and by its power spectrum in the frequency domain using MATLAB.
Because linear filters play a very important role in communication systems, we will also
implement the autocorrelation function and the power spectrum of a linearly filtered
random process. At the end of this lab we will analyse the characteristics of lowpass and
bandpass random processes using MATLAB.
Generation of Random Variables:
Random number generators are often used in practice to simulate the effect of noise like
signals and other random phenomena that are encountered in the physical world.Such noise
is present in electronic devices and systems and usually limits our ability to communicate
over large distances and to detect relatively weak signals. By generating such noise on a
computer, we are able to study its effects through simulation of communication systems
and to assess the performance of such systems in the presence ofnoise.
Most computer software libraries include a uniform random number generator.Such a
random number generator generates a number between 0 and 1 with equal probability. We
call the output of the random number generator a random variable. The uniform probability
density function for the random variable A, denoted as𝑓(𝐴) is illustrated in Figure 2.1(a).

_____________________________________________________________________________________________
Page 2 of 9
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL3003)
of Computer and Emerging Sciences
Islamabad Fall 2024
09
____________________________________________________________________________________
We note that the average value or mean value of A, denoted as 𝑚𝐴 , is 𝑚𝐴 = 1/2. The
integral of the probability density function, which represents the area under 𝑓(𝐴) is called
the probability distribution function of therandom variable A and is defined as
𝐴
𝐹(𝐴) = ∫ 𝑓(𝑥)𝑑𝑥
−∞
For any random variable, this area must always be unity, which is the maximum value that
can be achieved by a distribution function. Hence, for the uniform random variableA we
have

𝐴
𝐹(𝐴) = ∫ 𝑓(𝑥)𝑑𝑥 = 1
−∞
and the range of F(A) is 0 < F(A) < 1 for 0 < A < 1. The probability distribution
function is shown in Figure 2.1(b).If we wish to generate uniformly distributed noise in an
interval (b, b + 1), it can be accomplished simply by using the output A of the random
number generator andshifting it by an amount b. Thus a new random variable B can be
defined as
𝐵 =𝐴+𝑏

1
which now has a mean value 𝑚𝐵 = 𝑏 + 2. For example, if b = -0.5, the random variable B
is uniformly distributed in the interval (- 0.5, 0.5), as shown in Figure 2.2(a).Its probability
distribution function F(B) is shown in Figure 2.2(b).A uniformly distributed random
variable in the range (0,1) can be used to generate random variables with other probability
distribution functions. For example, supposethat we wish to generate a random variable C
with probability distribution function F(C), as illustrated in Figure 2.3.

_____________________________________________________________________________________________
Page 3 of 9
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL3003)
of Computer and Emerging Sciences
Islamabad Fall 2024
09
____________________________________________________________________________________
Because the range of 𝐹(𝐶) is the interval (0,1), we begin by generating a uniformly
distributed random variable A in the range (0,1). If we set
𝐹(𝐶) = 𝐴 2.1)
−1
𝐶=𝐹 𝐴 2.2)
Thus we solve the 2.1) for C, and the solution in 2.2) provides the value of C for which
𝐹(𝐶) = 𝐴 . By this means we obtain a new random variable C with probability distribution
function F(C). This inverse mapping from A to C is illustrated inFigure 2.3.
Energy Spectral Density and Power Spectral Density
The energy spectral density of an energy-type signal gives the distribution of energy at various
frequencies of the signal and is given by

In general the energy spectral density and power spectral density are given by

where Rx(t) is the autocorrelation function of x(t), defined as



𝑅𝑥 (𝑡) = ∫ 𝑥(𝑡)𝑥(𝑡 + 𝜏)𝑑𝑡
−∞
for real valued signals.For power-type signals we define the time-average autocorrelation function
as
1 ∞
𝑅𝑥 (𝑡) = lim ∫ 𝑥(𝑡)𝑥(𝑡 + 𝜏)𝑑𝑡
𝑇→∞ 𝑇 −∞

The total power is the integral of the power-spectral density given by



𝑃𝑥 = ∫ 𝑆𝑥 (𝑓)𝑑𝑓
−∞
For the special case of a periodic signal x(t) with period T0 and Fourier series
coefficients 𝑥𝑛 , the power-spectral density is given by

𝑛
𝑆𝑥 (𝑓) = ∑ |𝑥𝑛 |2 𝛿 (𝑓 − )
𝑇0
𝑛=−∞
which means all the power is concentrated at the harmonics of the fundamental
frequency, and the power at the nth harmonic (𝑛/𝑇0 ) is |𝑥𝑛 |2 ; that is, the magnitude
square of the corresponding Fourier series coefficient.
When the signal x(t) passes through a filter with transfer function H(f), the output

_____________________________________________________________________________________________
Page 4 of 9
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL3003)
of Computer and Emerging Sciences
Islamabad Fall 2024
09
____________________________________________________________________________________
energy spectral density, or power-spectral density, is obtained via

TASK 01:
Problem 01:
 Generate 10 Natural Random Numbers between 10 & 20 inclusive using rand()
command and plot the histogram. Comment on the results.
 Generate 10, 100 and 1000 random numbers using rand and randn command and
plot the histogram. Comment on the results.

_____________________________________________________________________________________________
Page 5 of 9
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL3003)
of Computer and Emerging Sciences
Islamabad Fall 2024
09
____________________________________________________________________________________

Problem 02:
A bandlimited random process 𝑋(𝑡) has the power spectrum

Plot the PSD 𝑆𝑋 (𝑓) and autocorrelation 𝑅𝑥 (𝜏) for the random process mentioned
above. Let B = 2; N0 = 1; Hint: Take inverse fourier transfomr to compute
autocorrelation function from PSD. Let −30 ≤ 𝑓 ≤ 30. Consider 𝐹𝑠 = 60. Your graphs
should look like as

_____________________________________________________________________________________________
Page 6 of 9
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL3003)
of Computer and Emerging Sciences
Islamabad Fall 2024
09
____________________________________________________________________________________

Problem 03:
Suppose that a white random process 𝑋(𝑡) with power spectrum 𝑆𝑋 (𝑓) for all 𝑓 excites a linear
𝑒 −𝑏𝑡 , 𝑡 ≥ 0
filter with impulse response ℎ(𝑡) = {
0, 𝑥 < 0
If 𝑋(𝑡) = 𝑠𝑖𝑛𝑐(10𝑡) ∗ cos(2𝜋15𝑡), then Plot the power s pectrum of 𝑆𝑋 (𝑓), 𝑆𝐻 (𝑓) and
1
𝑆𝑌 (𝑓). Note:- Fourier Transform of 𝑒 −𝑏𝑡 𝑢(𝑡) is 𝑗2𝜋𝑓+𝑏 , 𝑏 > 0; Let b = 5, vary b to 10
& 20 to see the effect of filter and show all comparison plots. Let −10 ≤ 𝑡 ≤ 10.
Consider 𝐹𝑠 = 60. Normalize all values so that we can see the amplitude between 0 and
1.Your output graph should look like as follows

_____________________________________________________________________________________________
Page 7 of 9
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL3003)
of Computer and Emerging Sciences
Islamabad Fall 2024
09
____________________________________________________________________________________

Problem 04:
Suppose that a white random process with samples {X{n)} with power spectrum 𝑆𝑋 (𝑓)
= 1 for all 𝑓 , excites a linear filter with impulse response

Determine the power spectrum of the output process {Y(n)}. Let −10 ≤ 𝑛 ≤ 10.
Consider 𝐹𝑠 = 100. Normalize all values so that we can see the amplitude between 0 and 1.
Following should be the expected graph.

_____________________________________________________________________________________________
Page 8 of 9
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL3003)
of Computer and Emerging Sciences
Islamabad Fall 2024
09
____________________________________________________________________________________

Assessment Rubric
LLO Statement Assessment Exemplary Proficient Developing Beginning Worst
Method (20%) (20%) (20%) (20%) Performance
(20%)
2 Examine the Practical Skill Able to attempt Able to Able to attempt 75% Able to attempt Able to attempt
performance of Observation complete lab with attempt to of the lab tasks 50% of the lab 25% of the lab
analog and digital during proper 100% of the tasks tasks
modulation experimentati labeling/explanatio lab tasks
schemes using on & Lab n of results and without
MATLAB Reports proper commenting proper
of the code labeling/expl
anation of
results and
proper
commenting
of the code

_____________________________________________________________________________________________
Page 9 of 9

You might also like