Sei sulla pagina 1di 4

COMSATS Institute of Information Technology

Park Road, Islamabad


Department of Electrical Engineering

Course Title: Digital Communications


Course code: EEE353
Semester: BS Electrical (Telecom) Engineering – 6
Course Instructor: Mr. Naeem Maroof, Mr. Safwan Khalid

Lab 4
Generation of PCM Line codes and analyzing their
Power Spectral Density.

Marks(10,10) Student’s Name: Reg. No

( , ) _________________ ____________________

( , ) _________________ ____________________

_________________ ____________________

Date Signed By
Power Spectral Density:
Power Spectral Density (PSD) of a random process is defined as the Fourier transform
of its autocorrelation function. The area under a given frequency band of the PSD
function gives the amount of average power contained in that frequency band which
makes PSD a very strong tool for the analysis of random processes. The PSD of an
Ergodic random process can be expressed in terms of the Fourier transform of one of
its sample function. Let X(t) be an ergodic random process, let x(t,T) be one of its
sample function which is observed in the interval [0,T]. Let X(f,T) be the Fourier
transform of x(t,T). Then the periodogram of x(t,T) is defined as | , | . The PSD

of X(t) can be expressed as


lim | , | ]

Hence average of periodograms can be used to approximate the PSD of a random


process.

PWELCH Function:
The pwelch function in MATLAB is used to approximate the PSD of a signal. The
function divides the input signal into overlapping segments and then computes their
respective periodograms and then finds the average, hence the output is an
approximation of the PSD of the input signal. The syntax of the pwelch function is
[pxx,f ] = pwelch(input_signal,window_size,overlap_size,FFTsize,sampling_freq).
Where pxx is the approximated PSD and f in the frequency vector against which PSD
can be plotted. A possible usage of pwelch maybe
[pxx,f] = pwelch(x,33,[],[],fs). The empty matrix is used so that pwelch may use its
default values for overlap and fft size and 33 specifies the length of the segment.

PCM Line Codes


There are different types of PCM line codes available for transmission of digitized data.
Each line code has its own advantages and disadvantages which make it suitable for
some specific application. In this lab we will generate five different line codes.
Polar NRZ:
In polar NRZ a ‘1’ is represented by a pulse of ‘+V volts’ and a ‘0’ is represented by a
pulse of ‘-V volts’.
Unipolar NRZ:
In unipolar RZ a ‘1’ is represented by a pulse of ‘+V volts’ whereas a ‘0’ is represented
by a pulse of ‘0 volts’.
Unipolar RZ:
In unipolar RZ a ‘1’ is represented by a pulse of ‘+V volts’ for half the bit duration and ‘0
volts’ for the rest of bit duration. A 0 is represented by ‘0 volts’ for complete bit duration.

Manchester Code:
In this type of coding a ‘1’ is represented by a pulse of ‘+V volts’ for first half of bit
duration and ‘-V volts’ for the other half. A ‘0’ is represented by a pulse of ‘-V volts’ and
‘+V volts’ for the other half.

Delay Modulation:
In delay modulation a ‘1’ is represented by a transition at the mid point of the bit
duration whereas a ‘0’ is represented by no transition unless it is followed by another ‘0’,
in that case a transition is placed at the end of bit interval of the first zero.
TASK A:
1. Define a random data of some length >100 containing 1s and 0s. Also define a test data
[1 0 1 1 0 0 0 1 1 0 1].
2. Define a pulse duration say 1msec and a high sampling time to approximate analog
signals say 0.1msec.
3. Convert the random data and test data into the line codes defined above.
4. Plot these line codes for the test data. Verify your implementation.

TASK B:
1. Plot the periodograms of the random data line codes as defined in Task A. Remember to
multiply your fft output with sampling time to make it similar to the analog counterpart.
2. Comment on the relative bandwidth efficiencies of the line codes. It will be difficult to
observe the periodograms of line codes which have a DC component because of the
presence of an impulse in the PSD. Detect the location of the Impulse or Impulses in
such a case.

TASK C
1. Use Pwelch function with a window size say 30 to approximate the PSDs of different line
codes. Comment on there bandwidth efficiencies.
2. Use Pwelch function with different window sizes from 10 to 50 and comment on the
accuracy of the output as compared to the theoretical results.

Potrebbero piacerti anche