Energy and Power Spectral Densities

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Energy and Power Spectral Densities

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 counter-part 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
E x =∫ |x ( t )| d t (5.1)
−∞


2
E x =∫ |X ( f )| df (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 x ( t )
or the frequency domain specification X ( f ) of the same signal.
The correlation of a signal with itself is called the Autocorrelation. The Autocorrelation R x ( τ )
of a real signal x(t) is defined as

R x ( τ )=∫ ( x (t) x( t+ τ))d t (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:
ψ x ( f )=¿ X ( f )∨¿2 ¿ (5.4)
The energy, energy spectral density and autocorrelation function of energy signals are related
and have the following property:

E x =∫ ψ x ( f ) df (5.5)
−∞

4.2.2 Power Spectral Density (PSD)


The power of a signal x(t) is
+T 0
1 2
P x = lim ∫ |x ( t )| d t (5.6)
T 0 →+∞ 2 T 0 −T 0

The correlation of a signal with itself is called the Autocorrelation. The Autocorrelation R x ( τ )
of a real signal x(t) is defined as
+T
1
0

R x ( τ )= lim ∫ (x (t) x(t+ τ)) d t (5.7)


T →+∞ 2 T 0 −T
0
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) looks 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:
+∞
S x ( f )= ∫ Rx ( τ ) exp(− j2 πf τ)¿ ¿ d τ (5.8)
−∞
The Power, power spectral density and autocorrelation function of power signals are related
and have the following property:

P x =∫ S x ( f ) df (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:
ωN
sin
2
X ( ω )= (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 the all the
points of the Autocorrelation function y[n]. Therefore, for writing the code for
Autocorrelation function y[n] we need to generate a timing vector twice that of the signal
x[n] itself.

Figure 4-1: Signal x[n]


n=[-2:1:2];
x=[1,1,1,1,1];
y=xcorr(x,x);
ny=[-4:1:4];
stem(ny,y)
axis([-5 5 0 6])
title ('Auto correlation Function y[Tau]')
xlabel Tau
ylabel Amplitude

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]')

Figure 4-3: Fourier Transform of Signal y[Tau]


After plotting the Fourier Transform F[f] of the Autocorrelation Function y[n], find out the
Energy Spectral Density E[f] of the signal x[n] using its Fourier Transform. The Energy
Spectral Density E[f] of a signal is the magnitude square of its Fourier Transform. The
following piece of code finds out the Energy Spectral Density E[f].
N=5;
M=20;
i =1;
for k=-M/2:M/2
w=(2*pi/M)*k ;
if k==0
X(i)=N;
else
X(i)=sin(w*N/2)/sin(w/2);
end
i=i +1;
end
ESD=(abs(X)).^2 ;
w=(2*pi/M)*[-M/2:M/2];
stem(w,ESD)
axis([-4 4 0 30])
title ('ESD of Actual Signal')
Figure 5.3 representing the Fourier Transform F[f] of the Autocorrelation Function y[n] and
Energy Spectral Density E[f] of the signal x[n] represented by Figure 5.4 are similar to each
other thus showing that the Energy Spectral Density(ESD) of a periodic signal is equal to the
Fourier Transform of Autocorrelation of the signal.

Figure 4-4: Energy Spectral Density of Actual Signal


Plot all the figures on the same window using the subplot command for the ease of
comparison. Vary the period and range of the sampling points separately to observe their
effects in Matlab.

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('Auto Correlation') ;
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');

Figure 4-5: Gate-Function, Auto-correlation & Energy Spectral Density

4.4 Lab Tasks


Task-1: [2 Marks]
Whether or not ESD/PSD exists for below mentioned signals?
Signals:
x ( t )=100 cos (100 πt +90) , t: 0<t<100
x ( t )=exp (−t ) u(t) , t: 0<t<50
x ( t )=( t ) u(t ) , t: 0<t<10
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');

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
Assessment Rubrics
EE365: Communication Systems – Lab __
Method: Lab reports and instructor observation during lab sessions

Outcome Assessed:

a. Ability to conduct experiments, as well as to analyze and interpret data (P).


b. Ability to function on multi-disciplinary teams (A).
c. Ability to use the techniques, skills, and modern engineering tools necessary for
engineering practice (P).

Exceeds expectation Meets expectation Does not meet


Performance Marks
(4-5) (3-2) expectation (1)

Selects relevant Needs guidance to Incapable of


equipment to the select relevant selecting relevant
experiment, develops equipment to the equipment to
setup diagrams of experiment and to conduct the
1. Realization of equipment develop equipment experiment,
Experiment [a, c] connections or wiring. connection or wiring equipment
diagrams. connection or wiring
diagrams are
Actively engages and Cooperates with other Distracts or
cooperates with other group members in a discourages other
group members in an reasonable manner. group members
2. Teamwork [b] effective manner. from conducting the
experiment.

Does proper Calibrates equipment, Unable to calibrate


calibration of examines equipment appropriate
equipment, carefully moving parts, and equipment, and
examines equipment operates the equipment equipment operation
3. Conducting moving parts, and with minor error. is substantially
Experiment [a, c] ensures smooth wrong.
operation and process.

Respectfully and Observes safety rules Disregards safety


carefully observes and procedures with rules and
4. Laboratory safety rules and minor deviation. procedures.
Safety Rules [a] procedures
Exceeds expectation Meets expectation Does not meet
Performance Marks
(5-4) (3-2) expectation (1)
Plans data collection to Plans data collection Does not know how to
achieve experimental to achieve plan data collection to
5. Data objectives, and experimental achieve experimental
conducts an orderly objectives, and goals; data collected is
Collection [a] and a complete data collects complete data incomplete and
collection. with minor error. contain errors.

Accurately conducts Conducts simple Unable to conduct


simple computations computations and simple statistical
and statistical analysis statistical analysis analysis on collected
using collected data; using collected data data; no attempt to
correlates with minor error; correlate experimental
experimental results to reasonably correlates results with known
6. Data Analysis known theoretical experimental results to theoretical values;
[a] values; accounts for known theoretical incapable of
measurement errors values; attempts to explaining
and parameters that account for measurement errors or
affect experimental measurement errors parameters that affect
results. and parameters that the experimental
affect experimental results.
results.
Uses computer to Uses computer to Does not know how to
7. Computer collect and analyze collect and analyze use computer to
Use [a] data effectively. data with minor error. collect and analyze
data.

Total

Lab Engineer:

Tawahaa Ahmed
Name:

Signature:

Date:

You might also like