You are on page 1of 5

Experiment 5

(a) Perform an experiment to understand the concept of pulse code modulation.


AIM AND OBJECTIVE
The aim and objective of this experiment is to understand the concept pf pulse code Modulation
(PCM).
THEORY:
Pulse Code Modulation (PCM) is a digital modulation technique used to convert analog signals into
digital format for efficient storage, transmission, and processing. PCM involves three main steps:
sampling, quantization, and encoding.
1. Sampling: In the sampling step, the continuous analog signal is discretized into a series of
discrete samples. This process involves taking samples of the analog signal at regular intervals,
typically at a frequency higher than the Nyquist rate (twice the highest frequency component
in the analog signal). The samples represent the amplitude of the analog signal at specific time
points, creating a discrete-time representation.
2. Quantization: After sampling, the continuous amplitude values of the samples need to be
converted into a finite number of discrete levels. This process is known as quantization. It
involves dividing the amplitude range of the samples into a fixed number of levels and assigning
each sample to the closest quantization level. The number of quantization levels determines the
resolution or fidelity of the digital representation.
3. Encoding: Once the samples have been quantized, they are encoded into digital data. Each
quantized sample is represented by a binary code that corresponds to its assigned quantization
level. The number of bits used for encoding determines the precision of the digital
representation. A higher number of bits allows for a greater number of quantization levels and
provides a more accurate representation of the analog signal.
Simulink Model

Setting the parameters


Output
RESULTS :
In this code, the PCM modulation and demodulation processes are performed. Here's a breakdown
of the code:
 Parameters are set, such as the sampling frequency (fs), sampling period (T), and time vector
(t).
 The modulating signal is defined as a sinusoidal signal with a given amplitude (Am) and
frequency (fm).
 Sampling and quantization are performed on the modulating signal. The number of bits for
quantization is defined by bits, and the number of quantization levels is calculated based on
that.
 The modulating signal is divided into equally spaced levels based on the step size determined
by the quantization levels. The values are then rounded to the nearest quantization level.
 The code plots the original modulating signal and the sampled signal.
 PCM demodulation is performed by decoding the sampled signal to obtain the quantized values.
These values are then reconstructed by interpolating between the decoded values.

Questions
1. What are the steps in PCM?
2. What is meant by quantization error?
3.What is meant by Nyquist rate?
(b) Perform Delta Modulation
THEORY
1. Delta Modulation (DM): Delta modulation is a simple form of analog-to-digital conversion
that encodes the difference between consecutive samples of an analog signal. The basic idea
behind DM is to transmit the change (delta) in the signal amplitude rather than the absolute
value. It operates based on the assumption that the signal will not change rapidly. In DM, the
analog signal is approximated using a staircase waveform.
The process of delta modulation involves the following steps:
 At each sampling interval, the difference between the current sample and the previous
predicted sample is determined.
 The difference is quantized into two levels (positive or negative) based on a step size.
 The quantized difference (delta) is transmitted, which represents the change in the signal.
 The receiver reconstructs the signal by integrating the delta values and adding them to the
previous reconstructed sample.
MATLAB CODES
%delta modulation = 1-bit differential pulse code modulation (DPCM)
predictor = [0 1]; % y(k)=x(k-1)
%partition = [-1:.1:.9];codebook = [-1:.1:1];
step=0.2; %SFs>=2pifA
partition = [0];codebook = [-1*step step]; %DM quantizer

t = [0:pi/20:2*pi];
x = 1.1*sin(2*pi*0.1*t); % Original signal, a sine wave
%t = [0:0.1:2*pi];x = 4*sin(t);
%x=exp(-1/3*t);
%x = sawtooth(3*t); % Original signal

% Quantize x(t) using DPCM.


encodedx = dpcmenco(x,codebook,partition,predictor);

% Try to recover x from the modulated signal.


decodedx = dpcmdeco(encodedx,codebook,predictor);
distor = sum((x-decodedx).^2)/length(x) % Mean square error

% plots
figure,subplot(2,2,1);plot(t,x);xlabel('time');title('original
signal');
subplot(2,2,2);stairs(t,10*codebook(encodedx+1),'--
');xlabel('time');title('DM output');
subplot(2,2,3);plot(t,x);hold;stairs(t,decodedx);grid;xlabel('time')
;title('received signal');

OUTPUT
Result:
We have simulated a delta modulated wave.
Questions
1. Explain Delta modulation.
2. How is Delta modulation different from Adaptive delta modulation?
3. What are the disadvantages of delta modulation?

You might also like