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

Simulation Exercise 2 - Delta Modulation

This document summarizes a simulation of delta modulation performed in MATLAB. Delta modulation encodes the difference between signal samples as 1s and 0s. The simulation compares a sampled signal to a reconstructed staircase approximation from the encoded output. The approximation follows the signal closely with some minor differences due to granular noise. Greater granular noise from a larger quantization value causes more distortion on signal peaks in the reconstructed signal.

Uploaded by

Kouji Tomas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
196 views

Simulation Exercise 2 - Delta Modulation

This document summarizes a simulation of delta modulation performed in MATLAB. Delta modulation encodes the difference between signal samples as 1s and 0s. The simulation compares a sampled signal to a reconstructed staircase approximation from the encoded output. The approximation follows the signal closely with some minor differences due to granular noise. Greater granular noise from a larger quantization value causes more distortion on signal peaks in the reconstructed signal.

Uploaded by

Kouji Tomas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Simulation Exercise 2: Delta Modulation

Kouji Tomas
Electrical and Electronics Engineering Institute
University of the Philippines Diliman
Quezon City, Philippines

Abstract​—Delta modulation of a sampled signal was simulated II. DOCUMENTATION AND DISCUSSION
in MATLAB . The sampled signal was encoded into a delta
modulated output, and a delta accumulated output staircase Going through each block of code, the first block
approximation of the sampled signal. The signal was recovered performs error checking on the inputs to ensure they can be
using the accumulator output and a low pass filter. properly processed by the code. The inputs must be scalar
I. INTRODUCTION [1] values such that it is clear which value will be used for the
delta modulation. This block is shown below on figure 2.
In this simulation exercise, delta modulation was
performed. Delta modulation is a form of differential pulse
code modulation which encodes the difference between signal
samples. Delta modulation works by checking if the previous
sample is greater or less than the current sample and the
quantizer outputs a 1 or a 0 for greater than or less than
respectively. This exercise focuses on the method of delta Figure 2: Error Checker Block
modulation by means of a staircase approximation.
The next block sets up all the necessary time and
The staircase delta modulator mainly consists of a signal vectors to be used in the delta modulation. The
comparator and an accumulator. The comparator takes in variables necessary are the following
samples of the message as an input and compares the currently
● fs - Message signal analog “sampling” frequency
obtained sample with a previously obtained accumulator
● ta - analog time values
value, which starts at 0. The result of the comparator goes to
● ts - sampled signal time values
the quantizer and assigns a value of 0 or 1, which corresponds
● acc - accumulator vector setup
to a ± ΔV value which is sent to the accumulator and the
● enc - encoder vector setup
encoder. The accumulator is the feedback mechanism and is
● tscc - accumulator time values
the input to the comparator, as mentioned previously. The
● mt - “analog” message signal
accumulator uses the obtained quantized value of the
● mnTs - sampled message signal
comparator and adds it to the previous accumulator value by
using a delay block, essentially, “accumulating.” The encoder, The vectors acc and enc were preallocated as
on the other hand, converts the quantized data to a stream of recommended in MATLAB and acc has length equal to the
bits, each bit representing the sign of the current quantizer message signal +1 and enc has length equal to the message
output. The staircase approximation is the input to the signal. acc has a size length(ts)+1 because it requires an initial
comparator for all relevant time, and the delta modulated value to compare the message signal with. This is initially
output is the encoder output for all relevant time. The system zero as preallocated. The different size of acc is also the
block diagram is shown below on figure 1. reason for tscc. The setup block is shown below on figure 3.

Figure 3: Setup Block


Figure 1: Delta Modulator Block Diagram
were plotted in the last block. The plotter block is shown
below on figure .
The next block performs the accumulator, encoder,
quantizer and comparator loop and is essentially the delta
modulator. The block performs delta modulation by the
following steps. For a given current time index n,
1. Set the previous sample, prev, to be the
accumulator’s current value
2. Set the current sample, curr, to be the current value
of the sampled signal
3. If curr > prev, send DELV to the accumulator and
send 1 to the encoder, else send -DELV and 0
respectively
4. At the end, add DELV to the current accumulator
value and store the sum into the next accumulator
value.
Repetition of this block will perform delta
modulation with a given increments of DELV, and for a time Figure 6: Plotter Block
increment depending on FSAMP. The vector acc contains the
staircase approximation and enc contains the delta-modulated A sample output of a properly delta modulated signal
output. The delta modulator block is shown below on figure 4. with DELV = 0.4 and FSAMP = 100000, is shown below on
figure 7.

Figure 4: Delta Modulator Block

The next block recovers the message signal from the


staircase approximation by constructing an appropriate filter
from FSAMP using the butter() function. The filter is used to
recover the signal using acc as the input to the filter. Lastly, Figure 7: Properly Delta-Modulated Staircase Approximation and
acc and enc are sent to the output vectors of the function as Recovered Message
specified. The recovery and output block is shown below on
figure 5. The staircase approximation closely follows the
message signal on the first plot as shown, without significant
distortion. The recovered message has some differences to the
original message signal, particularly on the first peak of each
half period, however, generally, the delta modulation
successfully modulated the message signal and recovered it.

The minor difference in the recovered message is


Figure 5: Recovery and Output Block primarily due to the phenomenon of granular noise, which
occurs if there is a stretch of signal which does not differ more
Lastly, the staircase approximation and the recovered than DELV, being contained within an envelope of height
message signal superimposed to the original message signal DELV. This results in a staircase approximation which
alternates from acc(i) and acc(i)+DELV for the time the signal A similar increased peak due to increased integration
remains in the envelope of the staircase approximation, area is seen in the increased granular noise case, as shown
essentially a rectangular pulse train. This results in a below on figure 10.
weighting of the integration done by the low pass filter, since
the area under the curve may slightly increase or decrease,
depending on how the message moves in the staircase
envelope. In the previous proper delta modulation case, the
granular noise results in a slightly increased area, which is
why the recovered message’s first peak is slightly higher than
it was originally. This is shown below on figure 8.

Figure 10: Granular Noise and Distortion in the Extreme Granular


Noise Case

● Purple - DELV = 2, FSAMP = 70000


● Red - DELV = 0.4, FSAMP = 70000
● Yellow - Original message signal
Figure 8: Granular Noise and Distortion in the Properly
Delta-Modulated Staircase Approximation and Recovered Message
Another source of distortion for delta modulation is
For a more extreme case of granular noise, the the phenomenon of slope overload. Slope overload occurs
recovered message can be significantly distorted, and occurs if when the rate of change of the staircase approximation cannot
DELV is too large. If DELV is too large, the delta modulator match the rate of change of the message signal. This is
cannot differentiate between the voltage levels of the message because the staircase approximation has a maximum average
signal, and merely maintains the same alternating values. This rate of change defined by a purely increasing staircase signal
extreme case is shown below on figure 9 for a DELV = 2 and of DELV increments per sample time. Numerically, this is
FSAMP = 70000.
ΔV
Δt = DELV × F SAM P .

If the message signal has a derivative greater than


this value for some amount of time, the delta modulator
cannot catch up until it decreases down to below this value.
This means that if DELV is not sufficiently large, for a given
FSAMP, slope overload will occur. This results in a staircase
approximation which lags below or above the original
message signal for the region of excessive slope. Slope
distortion is shown below on figure 11, for a DELV = 0.25
and a FSAMP = 70000.

Figure 9: Extreme Granular Noise Case Staircase Approximation


and Recovered Message
Figure 12: Low FSAMP Slope Overload Case Staircase
Figure 11: Low DELV Slope Overload Case Staircase Approximation and Recovered Message
Approximation and Recovered Message

The resulting distortion causes a decrease or increase To resolve granular noise, DELV must be made as
in the integrated area at the output, depending on whether or low as possible, but this in turn causes slope overload. But,
not it is a positive or negative slope overload, resulting in a since slope overload is dependent on both FSAMP and
slower increase to the peak or trough than normal. This is DELV, FSAMP can be increased to compensate for the
shown below on figure, which contain the recovered message decrease in DELV. Therefore, in the ideal case, DELV is
signals for and DELV = 0.4 and FSAMP = 70000, the normal infinitesimally small and FSAMP is infinitely large, which
delta modulation, and DELV = 0.25 and a FSAMP = 70000 is, essentially, an analog signal. Delta modulation then
and the original message signal. The slower integration effect becomes more effective with an increased sampling
is shown below on figure 12. frequency and a lower incremental value, but this requires
. faster and faster sampler which is more costly. There are
two trade offs to be considered when using delta
modulation. The first is the trade off of granular noise and
slope overload when changing only DELV, and the next is
the trade off of increased cost and power for increased
FSAMP, and these must be considered accordingly, when
performing delta modulation.

REFERENCES
1. EEE 107 Simulation Exercise 2: Delta Modulation

Figure 12: Distortion Due to Positive Slope Overload

● Purple - DELV = 0.4, FSAMP = 70000


● Red - DELV = 0.25, FSAMP = 70000
● Yellow - Original message signal

Since the rate of change of the staircase


approximation is also dependent on FSAMP, slope overload
can also occur if FSAMP is too low for a given DELV. This is
shown below on figure 12 for a DELV = 0.4, FSAMP =
40000.

You might also like