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

LAB13

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

LAB13

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

Communication Systems Lab 13

Investigate the Pulse Code Modulation Decoding Technique

OBJECTIVES

To understand the decoding of a PCM signal. Determination of the quantizing scheme used at
the encoder. Message reconstruction.

EQUIPMENT REQUIRED

1) Personal computer with appropriate software installed


2) USB cable and power pack
3) DATEx experimental add-in module
4) Two BNC to 2mm banana plug leads
5) Assorted 2mm banana plug patch leads
6) For 2, 1 only: One set of headphones (stereo)

RESUME OF THEORY
A little information about the PCM Decoder module
Like the PCM Encoder module, the PCM Decoder module works with 8-bit binary numbers. For
00000000 the PCM Decoder module outputs -2V and for 11111111 it outputs +2V. For numbers
in between, the output is a proportional voltage between +2V. For example, the number
10000000 is half way between 00000000 and 11111111 and so for this input the module outputs
OV (which is half way between +2V and -2v).
The PCM Decoder module is not self-clocking and so it needs a digital signal on the CLK input
to operate. Importantly, for the PCM Decoder module to correctly decode the PCM data
generated by the PCM Encoder module, it must have the same clock signal. In other words, the
decoder's clock must be "stolen" from the encoder.

Task 1 (a) Setting up the PCM encoder


To experiment with PCM decoding you need PCM data. The first part of the experiment gets you
to set up a PCM encoder
Communication Systems Lab 13

Design a PCM Encoder having Dc value of positive 0V and clock signal is


of 100kHz digital.

Vary the Variable Power Supplies positive output Voltage control left and right (but don't exceed
2.5V).
Task 1 (b) Setting up the PCM encoder
Design a PCM encoder with the following specification
Wave shape: Sine
Frequency: 500Hz
Amplitude: 4Vpp
DC Offset: OV
Clock signal:100kHz digital

Task 2 Decoding the PCM data


Modify the set-up as shown in Figure below.

Figure 13.1
Communication Systems Lab 13

Question 1
What does the PCM Decoder's "stepped" output tell you about the type of signal that it
is?

Compare the sound of the input and output signals.

Question 2
What must be done to the PCM Decoder module's output to reconstruct the message properly?

Task 3 Encoding and decoding speech


Design a circuit that encode and decode the speech signal and compare input output signals
Communication Systems Lab 13

Task 4 Recovering the message


As mentioned earlier, the message can be reconstructed from the PCM Decoder module's
output signal using a low-pass filter. Modify the set-up as shown in Figure below.

Figure 13.2

Add the Amplifier module to the set-up.

Question3
Even though the two signals look and sound the same, why isn't the reconstructed message a
perfect copy of the original message?
Communication Systems Lab 13
Communication Systems Lab 13
Communication Systems Lab 13
Communication Systems Lab 13

n=input('Enter for n-bit PCM system : ');


%Encodebook Bit Length n1=input('Enter Sampling Frequency : ');
%Sampling Frequency L = 2^n;
%Number of Quantisation Levels
Vmax = 8; x = 0:pi/n1:4*pi;
%Construction of Signal ActualSignl=Vmax*sin(x);
%Actual input subplot(3,1,1); plot(ActualSignl);
title('Analog Signal'); subplot(3,1,2);
Communication Systems Lab 13
%Sampled Version stem(ActualSignl);grid on;
title('Sampled Sinal'); %% Now perform the Quantization Process Vmin=-Vmax;
%Since the Signal is sine StepSize=(Vmax-Vmin)/L; %
Diference between each quantisation level QuantizationLevels=Vmin:StepSize:Vmax;
% Quantisation Levels - For comparison codebook=Vmin-
(StepSize/2):StepSize:Vmax+(StepSize/2);
% Quantisation Values - As Final Output of qunatiz
[ind,q]=quantiz(ActualSignl,QuantizationLevels,codebook);
% Quantization process NonZeroInd = find(ind ~= 0); ind(NonZeroInd) =
ind(NonZeroInd) - 1;
% MATLAB gives indexing from 1 to N.But we need indexing from 0, to convert it
into binary codebook BelowVminInd = find(q == Vmin-(StepSize/2));
q(BelowVminInd) = Vmin+(StepSize/2); %This is for correction, as signal values
cannot go beyond Vmin %But quantiz may suggest it, since it return the Values
lower than Actual %Signal Value subplot(3,1,3);
stem(q);grid on;
% Display the Quantize values title('Quantized Signal');
Having Quantised the values, we perform the Encoding Process figure
TransmittedSig = de2bi(ind,'left-msb');
% Encode the Quantisation Level SerialCode = reshape(TransmittedSig',[1
size(TransmittedSig,1)*size(TransmittedSig,2)]); subplot(2,1,1); grid on;
stairs(SerialCode);
% Display the SerialCode Bit Stream axis([0 100 -2 3]);
title('Transmitted Signal'); %% Now we perform the Demodulation Of PCM signal
RecievedCode=reshape(SerialCode,n,length(SerialCode)/n);
%Again Convert the SerialCode into Frames of 1 Byte index =
bi2de(RecievedCode','left-msb');
%Binary to Decimal Conversion q = (StepSize*index); %Convert into
Voltage Values q = q + (Vmin+(StepSize/2)); % Above step gives a DC shfted
version of Actual siganl %Thus it is necessary to bring it to zero level
subplot(2,1,2); grid on; plot(q);
% Plot Demodulated signal title('Demodulated Signal')

You might also like