Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A 128 x 128 image with 16 grey levels has been coded row-by-row using B1 coding,

ID: 3797503 • Letter: A

Question

A 128 x 128 image with 16 grey levels has been coded row-by-row using B1 coding, and the result has been stored as a continuous bitstream in a 1 x 66484 binary character array of 0's and 1's. This array is called "bitstream' and is in the CA1_1617_B1coding.mat file, which is available in the module content in Blackboard. The 16 grey level values and their frequencies in the 128 x 128 image are shown below: Write a (short) Matlab program to decode the binary bitstream. Display the resulting image.

Explanation / Answer

M = {'Hello','Goodbye'}; % Now encode each message: Mb = cellfun(@(x)reshape(dec2bin(x,7).',[],1),M,'Un',0); % Now decode each message: mess = cellfun(@(x)char(bin2dec(reshape(x,7,[]).').'),Mb,'Un',0)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote