EC21B1005 TharakL5
EC21B1005 TharakL5
EC21B1005 TharakL5
E THARAKA RAM(EC21B1005)
March 11, 2024
Aim
• To perform Delta Modulation using MATLAB.
5
Software Used
00
Latest Version of MATLAB.
Delta Modulation
B1
Theory
Delta modulation (DM) is an extended method of Digital Pulse Coded Modulation (DPCM)
used to digitally represent sampled analog signals. It finds application in the transmission
of voice information, involving both analog-to-digital and digital-to-analog signal conversions.
21
DM simplifies DPCM by encoding the difference between consecutive signal samples into n-bit
data streams, ultimately minimizing transmitted data to a 1-bit stream.
In DM, the modulation type entails a high sampling rate and a smaller step size after
quantization. This approach takes advantage of oversampled input to maximize signal cor-
EC
relation and adheres to the Nyquist Theorem, ensuring the sample frequency exceeds twice
the bandwidth of the message signal. Encoding in DM follows a simple rule: positive errors
denote an increasing signal, while negative errors signify a decreasing signal. The quantized
message signal is obtained by comparing the current sample with the expected value at the
previous sample.
DM introduces two types of noise: Slope Overload Noise and Granular Noise, arising from
the step-size approximation. To address this, a demodulator receives a binary sequence as
input and produces a stair-case approximated output, which is then filtered by a low pass
filter (LPF). The LPF serves to eliminate noise, particularly granular noise, which accounts
for step-size errors. In the absence of noise, the demodulator output mirrors the modulator
input.
Given the message signal m(t), the quantized message signal is mq(n). The error in the
modulation comparing the nth sample value with the expected value at the (n − 1)th sample
is represented as:
1
1. Slope Overload Noise:
∆ > ∆max
2. Granular Noise:
0 ≤ ∆ ≤ ∆max
where ∆max is the maximum step size.
05
m_t = Am*cos(2*pi*fm*t);
del = 0.9;
% Error Signals
eq = zeros(1,length(m_t));
err = zeros(1,length(m_t));
m_tq = zeros(1,length(m_t));
encode = zeros(1,length(m_t));
e = zeros(1,length(m_t));
0
B1
err(1) = m_t(1);
eq(1) = del*sign(err(1));
m_tq(1) = del;
encode(1) = 1;
reconst = zeros(1,length(m_t));
21
for i=2:length(m_t)
% e[n] = m[n] - mq[n-1]
err(i)=m_t(i)-m_tq(i-1);
% Deciding the step size
eq(i)=del*sign(err(i));
EC
m_tq(i)=eq(i)+m_tq(i-1);
if eq(i)==del
encode(i)=1;
else
encode(i)=0;
end
if encode(i) == 1
e(i) = del;
elseif encode(i) == 0
e(i) = -1 * del;
end
end
% encoded sequence is encode(n)
mq_decoded = zeros(1,length(m_tq));
mq_decoded(1)=e(1);
for k=2:length(e)
mq_decoded(k)=eq(k)+mq_decoded(k-1);
2
end
% Filter - Averager
wc=2*pi*fm/fs;
n=-10:10;
num=(wc/pi)*sinc(wc*n);
dec=filter(num,1,mq_decoded);
figure; sgtitle("Delta Modulation");
subplot(4,1,1);
plot(t,m_t);
title(’Message and Delta Modulated Message’);
xlabel(’time’);
ylabel(’amplitude’);
hold on;
stairs(t,m_tq);
hold off;
subplot(4,1,2);
5
stem(t,encode);
title(’Encoded signal’);
00
xlabel(’time’);
ylabel(’amplitude’);
subplot(4,1,3);
stairs(t,mq_decoded);
B1
title(’Decoded Quantised Message’);
xlabel(’time’);
ylabel(’amplitude’);
subplot(4,1,4);
plot(t,dec);
title(’Demodulated Signal’);
21
xlabel(’time’);
ylabel(’amplitude’);
EC
3
5
00
Figure 2: For Slope Overload Distortion ∆ = 10
B1
21
EC
4
Inference
If the step size in delta modulation is chosen too small, the encoded signal may fail to accurately
represent steep-sloped signals. Conversely, selecting a higher step size can introduce excessive
noise in flat-spaced signals. Adjusting the step size correctly is crucial for mitigating Slope
Overload Distortion, ensuring an accurate representation especially when strong slopes are
present in the input signal.
To minimize quantization errors, adaptive delta modulation algorithms dynamically adjust
the step size based on the dynamic range of the input signal. This adaptation helps in
maintaining fidelity to the original signal despite variations in amplitude.
Addressing granular noise, also known as idle noise, requires maintaining a modest step
size. Granular noise arises due to fluctuations in the input signal, and reducing the step size
through adaptive delta modulation techniques can help mitigate this noise effectively.
Results
5
The Delta modulation techniques and the demodulation of these modulated signals were ob-
served and the outputs were noted and verified by respective TAs.
00
B1
21
EC