Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem Description: In order to transmit data across a cable, a sender transmits a series of high and low voltages which a receiver may
Problem Description: In order to transmit data across a cable, a sender transmits a series of high and low voltages which a receiver may interpret as 1 s and 0 s . This may be further abstracted by dividing the stream into discrete chunks, then calling these chunks a representation of something (like letters, numbers, frequencies, amplitudes, etc.). One of the most familiar examples of this is video signals, where each pixel P in a frame is transmitted one after another along the wire. SENDER -> PN -> P..j -> P3 -> P -> P -> P -> RECEIVER But if the pixels are all lined up, how are they interpreted as an image? In one strategy, the display merely places the pixels as one might place letters when writing a book, from the top left, in horizontal lines, to the bottom right. Each row is referred to as a scanline , and the display is specified by the width and height in pixels. Currently, a high quality display (colloquially termed 4K ) might have a resolution up to 3840 x 2160 (width x height). This is sometimes also called 2160p , or 2160 line resolution. Task 1/3 (Question 2: Video Streams): Assuming a 52 x 27 (width x height) display and a transmission schema as described above, parse the following signal stream representing one frame of the display: -/XMMMM:: MMMMMMMM- MX- MMMX:X::- :/X:MMnnM: MMMMMMn-- --!nMMMM:- --MMMMMMMMMMMMMMMMMMMMMX: : : - !nMMMMMM!!! --MMMMMMX::: MMMMMMMMMMMMMnM--:- ----!nMMMMMMMMMMMnXMMnMX: MMMn! XnnMn! ---- -/XXMMn!- MMn!! !! MMMMMMMMMMMMMMMMMMMMM ! - Your result will be a form of ASCII art. -! !nMMMMMMMMMMM!! ----/XnMM! MMMMM: -!!!! MMMMMX- -MMMMMMMMMMMMMMMMMMM:::: --MMMMMMMMMMMMMMMMMMMMM: ---- -nMMMMX: -- ! MMMMMMMMXMXnnnMMMMMMMMMM! -/::X:M! n-:- -:!!nn: XIM --: - ! MMM -MMMMMMMMMM -MMMMMMXMMMMMMMMMMM nnnXnnnXXn! --- - ! nMMMMMMXMXXMMXnnMXXnnnnX - !nMMMMMMMMMMMMMMMM!! Task 2/3 (Question 2: Video Streams): However, while accurate from a hardware perspective, representing an image as a stream is less intuitive to humans (we like our Cartesian coordinates). Write a program to pack the first scanline (52 characters) into an array of size 52, then print that scanline back to console. ./main -/XMMMM:: Fig. 2.3-Sample code execution Task 3/3 (Question 2: Video Streams): Finally, modify your code from part 2 to process and represent the whole image. For an extra challenge, rotate the output 90 degrees clockwise. ./main /XMMMM:: -/XnMM! MMMMM: /X:MMnnM: MMMMMMn- [...] -/::X:M! -/XXMMn! !!!
Step by Step Solution
★★★★★
3.32 Rating (149 Votes )
There are 3 Steps involved in it
Step: 1
Okay got it Heres the complete solution to the problem Task 13 Question 2 Video Streams Assuming a 52 x 27 width x height display and a transmission s...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started