Department of Electrical Engineering EE365L: Communication Systems
Department of Electrical Engineering EE365L: Communication Systems
Signature: ____________________________
Energy and Power Spectral Densities
4.1 Introduction
The energy spectral density and autocorrelation function of energy signals are important tools for
the characterization of energy signals. The other important class of signals we will study is the
power signals. Power signals are infinite in time, they remain finite as time t approaches infinity
and so, their energy is infinite.
Power signals are very important in communications, since they include:
• Periodic signals
• Channel white noise
• Most transmitted digital or analog signals (they are approximated as power signals, and they
can be considered infinite, since their duration is in general much longer than the inverse of the
bandwidth).
Therefore, it is desirable to have a counterpart of the energy spectral density and autocorrelation
function of energy signals for power signals. They are called power spectral density (PSD) and
autocorrelation function of power signals.
Objective
The purpose of this lab experiment is to:
Analyze the Energy Spectral Density (ESD) of an Energy signal using Matlab.
Analyze the Power Spectral Density (PSD) of a Power signal using Matlab.
4.2 Background
4.2.1 Energy Spectral Density (ESD)
The energy of a signal x(t) is
∞
2
𝐸𝑥 = ∫ |𝑥(𝑡)| 𝑑𝑡 (5.1)
−∞
∞
2
𝐸𝑥 = ∫ |𝑋(𝑓)| 𝑑𝑓 (5.2)
−∞
The equation (5.1) and equation (5.2) shows the same result and this is Parseval’s theorem,
which allows us to determine the signal energy from either the time domain specification 𝑥(𝑡) or
the frequency domain specification 𝑋(𝑓) of the same signal.
The correlation of a signal with itself is called the Autocorrelation. The Autocorrelation 𝑅𝑥(τ) of
a real signal x(t) is defined as
∞
𝑅𝑥(τ) = ∫ (𝑥(𝑡)𝑥(𝑡 + τ))𝑑𝑡 (5.3)
−∞
It is a measure of the similarity of a signal with a delayed copy of itself. The Energy Spectral
Density (ESD) is defined as the energy contributed by the spectral component of frequency f of
the signal x(t) and is written as:
2
ψ𝑥(𝑓) = |𝑋(𝑓)| (5.4)
The energy, energy spectral density and autocorrelation function of energy signals are related and
have the following property:
∞
𝐸𝑥 = ∫ ψ𝑥(𝑓)𝑑𝑓 (5.5)
−∞
The correlation of a signal with itself is called the Autocorrelation. The Autocorrelation 𝑅𝑥(τ) of
a real signal x(t) is defined as
+𝑇0
1
𝑅𝑥(τ) = 2𝑇0
∫ (𝑥(𝑡)𝑥(𝑡 + τ))𝑑𝑡 (5.7)
−𝑇0
It is a measure of the similarity of a signal with a delayed copy of itself.
The equation (5.3) and equation (5.7) look similar but the main difference is normalization of
equation (5.7) with T0, for finding signal power.
The Power Spectral Density (PSD) is defined as the power contributed by the spectral
component of frequency f of the signal x(t) and is written as:
+∞
𝑆𝑥(𝑓) = ∫ 𝑅𝑥(τ)𝑒𝑥𝑝(− 𝑗2π𝑓τ))𝑑τ (5.8)
−∞
The Power, power spectral density and autocorrelation function of power signals are related and
have the following property:
∞
𝑃𝑥 = ∫ 𝑆𝑥(𝑓)𝑑𝑓 (5.9)
−∞
4.3 Description
Consider the following Figure 5.1 of signal x(n) which shows a discrete time rectangular signal
with length N=5. The magnitude of the Fourier Transform of this signal is given below:
ω𝑁
sin𝑠𝑖𝑛
𝑋( ω ) = 2
ω (5.10)
sin𝑠𝑖𝑛 2
Plot the discrete time domain signal x(n) in Matlab using the following piece of code.
n=[-2:2] ;
x=[1 1 1 1 1 ] ;
stem(n , x ) ;
axis([-5 5 0 2])
title ('Discrete Signal in Time Domain')
xlabel Time
ylabel Amplitude
The output graph produced should be similar to one in Figure 5.1. Using the signal x[n], Find out
the Autocorrelation y[n] of the signal by using the Matlab function xcorr(x,x). An important
point to observe here is that the first sampling instant of Autocorrelation function y[n] should be
twice the first sampling instant of the signal x[n] itself. It is true for all the points of the
Autocorrelation function y[n]. Therefore, for writing the code for the Autocorrelation function
y[n] we need to generate a timing vector twice that of the signal x[n] itself.
The Autocorrelation function y[n] should be similar to the Figure 5.2. In order to plot the Fourier
Transform F[n] of the Autocorrelation function y[n] the following piece of code is used.
Figure 4-2: Autocorrelation of Signal x[n]
M=20;
k=-M/2:M/2;
ny=[-4:1:4];
n=[-2:1:2];
x=[1,1,1,1,1];
y=xcorr(x,x);
w=(2*pi/M)*k ;
Y=y*(exp(-2*i*pi/M)).^(ny'*k) ;
stem(w,abs(Y))
axis([-4 4 0 30])
title ('Fourier Transform F[f]')
n=[-2:1:2];
x=[1,1,1,1,1];
subplot (3,1,1);
stem(n,x)
axis([-3 3 0 1.5]);
title('Gate Function');
y=xcorr(x,x);
ny=[-4:1:4];
subplot (3,1,2);
stem(ny,y)
axis([-5 5 0 6]);
title('Autocorrelation') ;
M=20;
k=-M/2:M/2;
w=(2*pi/M)*k;
Y=y*(exp(-2*j*pi/M)).^(ny'*k);
subplot (3,1,3);
stem(w,Y)
title ('Energy Spectral Density');
(a)
The ESD/PSD exists for the function x = 100cos(100πt+ 90).
t = 0:0.01:100;
x = 100*cos((100*pi.*t)+ 90);
N = length(x);
Ns = 64;
PSD = abs(fft(x,Ns)).^2/N;
stem((0:(Ns-1))/Ns,PSD);
title('64-point PSD of the signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
(b)
The ESD/PSD exists for the function x = exp(-t)u(t).
t = 0:0.01:50;
x = exp(-t);
N = length(x);
Ns = 128;
PSD = abs(fft(x,Ns)).^2/N;
stem((0:(Ns-1))/Ns,PSD);
title('128-point PSD of the signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
(c)
The ESD/PSD exists for the function u(t).
t = 0:0.01:10;
x = t;
N = length(x);
Ns = 64;
PSD = abs(fft(x,Ns)).^2/N;
stem((0:(Ns-1))/Ns,PSD);
title('64-point PSD of the signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
Task-2: [4 Marks]
Explain the Whiteness property of AWGN which states that noise PSD is a rect() function. You
have to find fft of signal and then find fft of noisy signal and then justify about the whiteness
property of AWGN [Use below mentioned signal]
{Whiteness Property: the uniform distribution of noise is the whiteness property of AWGN}
t = (0:0.1:10)';
x = sawtooth(t);
y = awgn(x,10,'measured');
t = (0:0.1:10);
x = sawtooth(t);
y = awgn(x,10,'measured');
X = fft(x);
Y = fft(y);
subplot(2,1,1), stem(t,abs(X));
title('FFT of the signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
subplot(2,1,2), stem(t,abs(Y));
title('FFT of the noisy signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
stem(t,abs(X));
hold on
stem(t,abs(Y));
title('FFTs of the signal and noisy signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
Task-3: [4 Marks]
Below Figure shows a random binary pulse train g(t). The pulse width is Tb/2, and one binary
digit is transmitted every Tb seconds. A binary 1 is transmitted by the positive pulse, and a binary
0 is transmitted by the negative pulse. The two symbols are equally likely and occur randomly.
Determine the autocorrelation and PSD of the g(t).
Use: [pulstran(t,pulseperiods,@rectpuls,pulsewidth)]
Figure 4-6
T = 10;
t = 0:0.001:T-0.001;
n = randi([0,1],1,T);
L = length(n);
for i = 1:L
if(n(i) == 0)
n(i) = -1;
end
end
pperiods = [1:1:T;n]';
pulsewidth = 1/2;
g = pulstran(t,pperiods,@rectpuls,pulsewidth);
plot(t,g);
y = xcorr(g,g);
t = 0:0.001:2*(T-0.001);
stem(t,y);
title('Autocorrelation of g(x)');
xlabel('Time(sec)');
PSD = periodogram(g);
t = (0:length(PSD)- 1)’;
plot(t,PSD);
title('PSD of g(x)');
xlabel('Time(sec)');
Assessment Rubrics
EE365: Communication Systems – Lab __
Method: Lab reports and instructor observation during lab sessions
Outcome Assessed:
Total
Lab Engineer:
Name:
Signature:
Date: