Professional Documents
Culture Documents
Lab 4
Lab 4
Lab 4
Generation of PCM Line codes and analyzing their
Power Spectral Density.
Marks(10,10)
Students Name:
Reg. No
_________________
____________________
_________________
____________________
_________________
____________________
Date
Signed By
| . The PSD
| ]
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.
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.