dc_assignment_1 (1)
dc_assignment_1 (1)
Assignment (CO1)
Name: Mohanapriya K
Reg.No:3122223002076
Consider the first five samples of the source image and represent them
using a line coding format. Specify the disadvantage in it and suggest a
suitable pulse shaping methodology to overcome it.
Note: if you use colour image as input convert that to gray level
image and proceed.
Matlab Code:
% Select the first five samples from the image for NRZ representation
first_five_samples = img(1, 1:5); % Take first five values from the first
row
for i = 1:numel(img)
dpcm_encoded(i) = img(i) - predicted_value;
predicted_value = img(i);
end
for i = 1:numel(img)
if img(i) > dm_signal
dm_encoded(i) = 1;
dm_signal = dm_signal + step_size;
else
dm_encoded(i) = -1;
dm_signal = dm_signal - step_size;
end
end
disp(T);