Professional Documents
Culture Documents
Digital Communication Systems: ECE-4001 TASK-3
Digital Communication Systems: ECE-4001 TASK-3
Digital Communication Systems: ECE-4001 TASK-3
SYSTEMS
ECE-4001
TASK-3
CHIRAG GAUR
18BEC0021
L39+40
Submitted to Prof.- VELMURUGAN T
TITLE: GENERATION AND RECONSTRUCTION OF SIGNAL USING DM.
TASK NO: 3A
DATE: 25-08-2020
AIM: To plot the wave form of input signal, sampled signal, quantized signal, reconstructed
signal for delta modulation (DM) using MATLAB.
THEORY:
Input signal is oversampled to increase correlation between the samples to permit the use of
simple quantization strategy.
Sampled values are compared to the stair-case approximated (or predicted) values and the
error is calculated
Calculated error is fed into the 1-bit quantizer which has only two levels ± Δ which is then
encoded and transmitted.
o To make sure that Δ is large enough to keep up with the signal (to avoid slope
overload) and small enough to model straight parts (to avoid granular noise) as
required, the following condition must be satisfied: d = (2*pi*fm*A/fs)
BLOCK DIAGRAM: -
a) Transmitter
b.) Receiver
ALGORITHM:
Generate the input signal using sampling frequency fs
Plot the sampled signal using STEM
Quantize the signal using ‘ del’
Modulate the DM signal using for and if condition
Apply butter worth filter to collect the coefficients using ‘butter’
Reconstruct the signal using ‘filter’
x=A+x
subplot(2,1,2)
plot(t,x)
xlabel("time")
ylabel("Amplitude")
title("Shifted signal")
figure(2)
subplot(2,1,1)
stem(t,x)
xlabel("Time")
ylabel("Amplitude")
title("Sampled Signal")
delta=0.005
for n=1:199
if x(n+1)>x(n)
delta(n+1)=1+delta(n)
q(n)=1
else
delta(n+1)=delta(n)-1
q(n)=0
end
end
subplot(2,1,2)
stairs(delta)
xlabel("time")
ylabel("Ampplitude")
title("Quantized Signal")
figure(3)
subplot(2,1,1)
stem(q)
title("Encoded signal")
[b,a]=butter(2,0.002,"low")
y=filter(b,a,delta)
subplot(2,1,2)
plot(t,y)
xlabel("time")
ylabel("Amplitude")
title("Reconstructed Signal")
VERIFICATION SIGNATURE:
TITLE: GENERATION AND RECONSTRUCTION OF SIGNA USING DPCM.
TASK NO: 3B
DATE: 01-09-2020
AIM: To plot the wave form of input signal, sampled signal, quantized signal, reconstructed
signal for Differential pulse code modulation (DPCM) using MATLAB.
THEORY:
Differential pulse-code modulation (DPCM) is a signal encoder that uses the baseline
of pulse-code modulation (PCM) but adds some functionalities based on the
prediction of the samples of the signal. The input can be an analog signal or a digital
signal.
If the input is a continuous-time analog signal, it needs to be sampled first so that a
discrete-time signal is the input to the DPCM encoder.
Option 1: take the values of two consecutive samples; if they are analog samples, quantize
them; calculate the difference between the first one and the next; the output is the difference.
Option 2: instead of taking a difference relative to a previous input sample, take the
difference relative to the output of a local model of the decoder process; in this option, the
difference can be quantized, which allows a good way to incorporate a controlled loss in the
encoding.
Applying one of these two processes, short-term redundancy (positive correlation of nearby
values) of the signal is eliminated; compression ratios on the order of 2 to 4 can be achieved
if differences are subsequently entropy coded because the entropy of the difference signal is
much smaller than that of the original discrete signal treated as independent samples.
BLOCK DIAGRAM:
a) Transmitter and Receiver
ALGORITHM:
Generate the input signal using sampling frequency fs
Plot the sampled signal using STEM
Quantize the signal using ‘ quantiz’
Convert the decimal to binary using ‘dec2bin’ Convert ‘bin2dec’
Apply butter worth filter to collect the coefficients using ‘butter’
Reconstruct the signal using ‘filter’
x1=x+2;
subplot(3,1,2)
plot(t,x1,'');
title("level shifted");
hold on;
t1=0:0.01:1;
x11=2+sin(2*pi*fm*t1);
subplot(3,1,3)
stem(t1,x11)
title('Sampled signal')
for n=1:length(x)
if n==1
e(n)=x(n);
eq(n)=round(e(n));
xq(n)=eq(n);
else
e(n)=x(n)-xq(n-1);
eq(n)=round(e(n));
xq(n)=eq(n)+xq(n-1);
end
end
figure
subplot(5,1,1)
stem(t,eq)
title('eq(n)')
subplot(5,1,2);
plot(t,xq,'');
title('quantized signal');
k=[0,0,0,0,1,1,1,1,1,0,0,0,0,0,0];
subplot(5,1,3)
stem(0:1:14,k);
title("binary representation")
for n=1:length(x)
if n==1
xqr(n)=eq(n);
else
xqr(n)=eq(n)+xqr(n-1);
end
end
subplot(5,1,4);
plot(t,xqr);
title("Reconstructed signal");
%low paas filter
[num den]=butter(2,4*fm/fs);
rec_op=filter(num,den,xqr);
subplot(515);
plot(t,rec_op,'k-');
xlabel('Time');
ylabel('Amplitude');
title('smooth reconstructed signal');
VERIFICATION SIGNATURE: