Professional Documents
Culture Documents
18bec0021 VL2020210102462 Ast02 PDF
18bec0021 VL2020210102462 Ast02 PDF
SYSTEMS
ECE-4001
TASK-2
CHIRAG GAUR
18BEC0021
L39+40
Submitted to Prof.- VELMURUGAN T
1|Page
TITLE: GENERATION AND RECONSTRUCTION OF SIGNAL USING PCM.
TASK NO: 2
DATE: 18-08-2020
AIM :-To plot the wave form of input signal, sampled signal, quantized signal, reconstructed
signal for Pulse code modulation (PCM) using MATLAB .
BLOCK DIAGRAM:
2|Page
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’
f=10;
fs=1000;
a=3
t=0:1/fs:((2/f)-(1/fs));
%Level shifting
x=a+a*sin(2*pi*f*t);
figure(1)
subplot(2,1,1);
plot(t,x);
title('Input Signal');
%Sampled Signal
subplot(2,1,2);
stem(t,x);
title('Sampled Signal');
partition = [-1:1:5];
codebook = [-1:1:6];
[~,q]=quantiz(x,partition,codebook);
%Quantized Signal
figure(2)
subplot(2,1,1);
stairs(t,q);
title('Quantized Signal');
%Encoded Signal
y=dec2bin(q);
%Dequantized Signal
z=bin2dec(y);
[b,a]=butter(2,2*f/fs,'low');
3|Page
k=filter(b,a,z);
subplot(2,1,2)
plot(t,z)
title('Dequantized Signal');
%Reconstructed Signal
figure(3)
plot(t,k)
title('Reconstructed Signal');
4|Page
RESULT: The program for Pulse code modulation has been simulated in MATLAB and
necessary graphs are plotted.
VERIFICATION SIGNATURE:
5|Page