combinepdf_removed_compressed.pdf
Document Details
Uploaded by ResoluteHeliotrope7100
Tags
Full Transcript
Q.1. What is multimedia? State some of multimedia applications. Multi → Many, Multiple, Media → Tools that are used to represent or do a certain thing. Text, graphic, voice, images, music etc. Multimedia: A combination of text, graphic, sound, animation, and video, these...
Q.1. What is multimedia? State some of multimedia applications. Multi → Many, Multiple, Media → Tools that are used to represent or do a certain thing. Text, graphic, voice, images, music etc. Multimedia: A combination of text, graphic, sound, animation, and video, these components Delivered to the user by electronic means. Multimedia applications: Business, Education, Entertainment, Home, Public places. Q.2. Explain briefly the elements of multimedia. 1) Text: Source: keyboard, speech input, data stored on disk, Used in contents, menus, navigational buttons. 2) Graphic: Could be produced manually (by drawing, painting, etc.) or by computer graphics technology, A color image is a 2-D array of (R, G, B) integer triplets. 3) Audio: Audio could come in the form of speech and sound effects. 4) Video: Real-time moving pictures, Technology of capturing, recording, processing of moving. 5) Animation: Illusion of motion created by the consecutive display of images of static elements. Animation is used to enhance the user understanding of the information conveyed to them. 1|Page Q.3. Discuss the difference between linear and non-linear multimedia projects. Linear: It is not interactive Users have no control over the content. Example: a movie Non-linear: It is interactive. Users have control over the content. Example: games. Q.4. Define the following: Hypertext and Hypermedia. Hypertext: is a text contains links to other texts. Hypertext: is therefore usually non-linear. Hypermedia: is a combination of hypertext, graphics, audio, video. Hypermedia: is not constrained to be text-based. Hypermedia: can include other media, e.g., graphics, images. Q.5. What is multimedia system, stat its Characteristics? A Multimedia System: is a system capable of processing multimedia data and applications. Multimedia system characteristics: 1) Must be computer controlled and integrated. 2) The information must be represented digitally. 3) The interface of media is usually interactive. Components of a Multimedia System: Capture devices, Audio Microphone, Storage, Communication Networks, Computer Systems, Display Devices. 2|Page Q.6. What is authoring tools, Give an example. Use to merge multimedia elements: text, audio, graphic, animation, video into a project. E.g., Adobe after effect. Q.7. Choose true or false for the following: 1) Multimedia is a combination of text, graphic, sound, animation and video. [True] 2) Multimedia components area delivered to the user by non- electronic means. [False] 3) A color image is a 1-D array of (R, G, B ) integers. [False] 4) Audio is processed by vibration, as perceived by the sense of hearing. [True] 5) In multimedia, audio could come in the form of speech, sound effects and music score. [True] 6) The illusion of motion created by the consecutive display of images of static elements is called hypermedia. [False] 7) In multimedia, animation is used to enhance the user understanding of the information conveyed to them. [True] 8) Video is the technology of capturing, recording processing, transmitting, and reconstructing moving pictures. [True] 9) A multimedia project is identified as linear when it is interactive. [False]. 10) A multimedia project is identified as non-linear when it is not interactive. [False] 3|Page 11) Hypertext is a text which contains links to other texts. [True] 12) Hypermedia is a constrained to be text-based. [False] 13) HTTP stands for hyper Text Transfer Protocol. [True] 14) HTTP used for transmitting hypermedia, and support transmission of any file type. [True] 15) HTML stands for Hypertext Markup Language. [True] 19.XML stands for extensible Markup Language. [True] 16) HTML A language for publishing hypermedia on the World Wide Web. [True] 17) XML a markup language for www. [True] 18) SMIL stands for Synchronized Multimedia Integration Language. [True] 19) SMIL Able to publish multimedia presentations using a markup language. [True] 4|Page Q.1. What is sound? Sound is a continuous wave that travels through the air. The wave is made up of pressure differences. [True] Sound is phenomenon caused by vibration of material. [True] Ear: receive 1-D waves. [True] Cochlea will translate these changes in wave to sound. The wave form occurs repeatedly at regular interval. [True] The unit of regularity is called a cycle (Hertz) [True] One cycle = 1 Hz [True] A kHz describes 1000 oscillations per second or 1000 Hz. Frequency (or pitch): How many vibrations occur in one second. The frequency range is divided into: Infrasonic: 0 to 20 Hz Audio-sonic: 20Hz to 20 kHz (Human hearing frequency) Ultrasonic: 20kHz to 1 GHz Hypersonic: 1GHz to 10 THz Amplitude (or loudness): Amplitude is the maximum displacement of a wave from an equilibrium position. 1|Page Q.2. Describe how to get audio signal into a computer. To get audio signal into a computer, we must digitize it. Sound pressure in the real world is continuous (analog) in time and real-valued in amplitude. [True] Computers require a discrete (noncontinuous) representation in both time and amplitude. [True] Analog to digital conversion: Sampling: to get discrete time values. Quantization: to get discrete amplitude values. Sampling: divide the horizontal axis (time). Quantization: divide the vertical axis (Voltage). 8-bit quantization divides vertical axis into (28)256 levels. 16 bit gives you (216) 65536 levels. 2|Page Q.3. What is Nyquist Theorem? For correct sampling we must use a sampling rate equal to at least twice the maximum frequency content in the signal. Q.4. Draw an Analog to Digital Conversation block diagram. For recording: Convert audio signal from analog to digital (A/D or ADC). Q.5. Draw a digital to analog conversation block diagram. For playback: Convert the audio signal from digital to analog (D/A or DAC ). Q.6. Calculate the signal to noise ratio (SNR) using the following data: V(signal)= 5 volts, V(noise)=0.1 volts. 3|Page Q.7. Calculate the signal to noise ratio (SNR) if the signal amplitude A signal is 10 times the A noise. Q.8. What is SQNR? The quality of the quantization can be measured by the Signal to Quantization Noise Ratio (SQNR). The quantization error (or quantization noise) is the difference between the actual value of the analog signal at the sampling time and the nearest quantization interval value. Q.9. Calculate the signal to quantization noise ratio (SQNR) when using: 8 bits per sample, 16 bits per sample. Q.10. Choose true or false for the following. 1) Sound wave made up of pressure difference. [TRUE] 2) Microphones and video cameras produce digital signals. [TRUE] 3) Frequency (pitch): How many vibrations occur in one second. [TRUE] 4) Amplitude (loudness): maximum displacement of a wave. (Pressure waves) [TRUE] 5) To get audio or video into a computer, we must digitize it. [TRUE] 6) Sampling divides the horizontal axis (time dimension) into discrete pieces. [TRUE] 7) Quantization – divide the vertical axis (signal strength) into pieces. [TRUE] 4|Page 8) Computers require a continuous representation in both time and amplitude. [FALSE] 9) 16-bit quantization divides the vertical axis 256 levels. [FALSE] 10) Digitization means conversion to a stream of numbers. [TRUE] 11) For correct sampling, we must use a sampling rate equal to at least twice maximum frequency content in the signal. [TRUE] 12) For recording: need to convert the audio signal from analog to digital. [TRUE] 13) For playback: need to convert the audio signal from digital to analog. [TRUE] 14) Musical instrument Digital Interface (MIDI): A protocol that enables computer, keyboards, and other musical devices to communicate with each other. [TRUE] 5|Page Q.1. What is an image? State the three major issues for image acquisition. The image is a projection of a 3D scene into a 2D projection plane. f(x, y) represents the intensity of light at each point. Three major issues for image acquisition Sensing, Representation, Digitization. Q.2. What is the digitization process for an image? Sampling: Spatial Quantization 1) The image is sampled at (m x n) points. 2) Each sample is called a picture cell (pixel). 3) Pixels is the smallest addressable area of a display. 4) We refer to a pixel by the number of its row and column. 5) Resolution number of pixels in a digital image. 6) Resolution of an image is described as the number of pixels horizontally times the number of pixels vertically. 1|Page Amplitude Quantization 1) Each pixel is assigned a numerical code. 7) The code represents the intensity at that point. 8) Quantization: divide the vertical axis into pieces. 2) 8-bit quantization divides the vertical axis into 256. → (28) Q.3. What is gray scale? 3) The set of the gray levels ranging from black to white is called the gray scale of the system. 4) Choose number of gray levels according to number of assigned bits. 5) The number of gray levels is usually an integral power of 2, such that: black = 0 white =2L – 1 Where L is an integer and there are 2L gray levels in the gray scale. 2|Page Q.4. Define each of the following. Pixels: picture elements in digital images Image Resolution: number of pixels in a digital image: Resolution = width x height File size = width x height x #ofBytesPerPixel. Bitmap: The two-dimensional array of pixel values that represent the graphics/image data. Raster formats(bitmapped): Use square cells to model reality(pixels) Q.5. What is digital image, and state it types. Is a representation of a two-dimensional image as a set of digital values, called pixels. 1) Black& white images: ✓ Binary images (1-bit images) → Monochrome ✓ Grayscale images (8-bit gray-level images) 2) Color images: ✓ 24-bit color images. ✓ 8-bit color images. Q.6. Discuss binary images? Each pixel is stored as a single bit (0 or 1). Also called a 1-bit monochrome image since it contains no color. File size calculation: Resolution: 640 x 480 File size = 640 x 480 x 1/8 = 38400 bytes = 38.5 kB 3|Page Q.7. Discuss gray-scale image. Each pixel has a gray-value between 0 and 255. The high values correspond to bright pixels and the low values correspond to dark pixels. We use one byte of memory for each pixel. The whole image is described by an array of numbers called matrix. File size calculation: Resolution: 640 x 480 File size = 640 x 480 x 1 = 307 200 Bytes = 300 kB Q.8. How to obtain a binary from gray scale images? A Threshold value, T, is used to partition the image into pixels with just two values, such that : ✓ IF f (x,y) >= T THEN g (x,y) = 1 ✓ IF f (x,y) < T THEN g (x,y) = 0 Q.9. Discuss 24-bit color image. The primary colors red, green and blue. A color image is described by three matrices. (R, G, B). In the RGB color space, a color is represented by a triplet (R, G, B) Pixels are represented by three numbers. Red 0-255 Blue 0-255 Green 0-255 Each pixel is represented by three bytes. File size = 640 x 480 x 3 = 921600 Bytes Most image formats use some compression. Compression techniques can be classified into either lossless or lossy. 4|Page Q.10. Discuss indexed image. 8-bit color Used in 8-bit color images is to store only the index, for each pixel. One byte for each pixel. Each code is an index into a table with 3-byte values that specify the color for a pixel with that lookup table index. Look-Up Tables (LUTs) used to store color information. Q.11. Image of size 300 by 500 pixels, the dynamic range of gray levels is [0, 127]. Find the number of bits required to represent a pixel and size of the image in bytes. 256 128 64 32 16 8 4 2 1 Number of bits required to represent a pixel: 7 bits. Size: 300 x 500 x 7/8 = 131250 Bytes /1024 = 128.173 KB. Q.12. The following image has integer intensities in the range between 0 and 63. Find the number of bits required to represent a pixel and size of the image in bytes. 256 128 64 32 16 8 4 2 1 Number of bits required to represent a pixel: 6 bits. Size: 30 x 10 x 6/8 = 225 Bytes 5|Page Q.13. Identify two types of popular image file formats; lists the main specifications (format name, Extension, Type, Color, depth) for each. (GIF, JPEG, TIFF, Bitmap, PNG, WMF, PCX, Microsoft Windows BMP) Q.14. Choose true or false for the following: 1) Image resolution is the number of pixels digital image. [TRUE] 2) Lower resolution always yields better quality. [FALSE] 3) File size = width x height. [FALSE] 4) Bitmap is the picture elements in digital images. [FALSE] 5) Each pixel is represented by a single bit for gray- level images. [FALSE] 6) 24-bit Color Image uses the concept of a lookup table to store color information. [FALSE] 6|Page Q.1. Identify the different color models in images and video. Color Models in images: RGB color model for CRT (Cathode-ray tube) displays. CMY Color (Complementary of RGB) used in printing devices. Color Models in Video: YUV Color Model: Y (Black and white "luminance"). U and V (color difference "Chrominance"). U = B’- Y’ V = R’- Y’ YIQ Color Model: Y (luminance), I and Q the color difference. YCbCr Color Model: Y is the luminance and Cb and Cr are chroma components. Used in JPEG image compression and MPEG video compression. Cb = ((B - Y)/ 2) + 0.5 Cr = ((R - Y) / 1.6) + 0.5 Q.2. Choose true or false for the following: 1) Visible light is an electromagnetic wave in the 400 nm- 700 nm range. [True] 2) Most light we see is one wavelength. [False] 3) The color of the light is not characterized by the wavelength of the light. [False] 4) Short wavelengths produce a red sensation, long wavelengths produce a blue one. [False] 5) Human retina consists of an array of rods (Detect gray-level information) and three kinds of cones (detect R, G, B) [True] 6) The color image is a 1-D array of (R, G, B) integer triplets. [False] 7) Cyan, Magenta, and yellow (CMY) are complementary colors of RGB. [True] 1|Page 8) CMY model is mostly used in CRT displays. [False] 9) YCbCr model is used in JPEG image compression and MPEG video compression. [True] Q.3. Discuss the Component Video type of Video signals. Three wires connecting to camera or other devices to TV or monitor. Three separate video signals (Red, Green, Blue). Giving the best color reproduction: No crosstalk between the different channels. Requiring more bandwidth and good synchronization. Q.4. Compare composite-Video(1-signal) and S-Video of Video signals. Composite Video: Uses only one wire. Color (chrominance) and intensity (luminance signals) are mixed into a single carrier wave. Some interference between the luminance and chrominance. Chrominance is a composition of two-color components (I and Q, or U and V) S-Video: Uses two wires, one for luminance and another for chrominance signals. There is less crosstalk between the color information and the gray-scale information. 2|Page Q.5. What is analog video? Analog video is represented as a continuous (time varying) signal. Progressive scanning traces through a complete picture (a frame) for each time interval. CRT Monitor (85Hz above) (Interlaced) in TV. Q.6. Explain the advantages of digital representation of video signal. 1) Digital video is represented as a sequence of digital images. 2) Video can be stored on digital devices or in memory. 3) Ready to be processed (noise removal, cut and paste, etc.) 4) Integrated to various multimedia applications. 5) Repeated recording does not degrade image quality. 6) Ease of encryption. Q.7. Choose true or false for the following. 7) Digital video is represented as a sequence of digital images. [True] 8) Component video type uses two wires connecting to camera. [False] 9) Composite video uses only one wire and video color signals are mixed. [True] 10) S-Video uses three wires, one for luminance and two for a composite chrominance signal. [False] 11)In TV, and in some monitors and multimedia standards as well, another system, called “progressive “scanning is used [False] [Interlaced] 12) Humans see color with much less spatial resolution than they see black and white. [True] 13) 4:2:2 color subsampling is used, there will be 1 byte for Y samples, ½ byte for Cr and ½ byte for Cb samples 33% reduction. 3|Page Q1. Define the following: Compression: » Process of coding to reduce the number of bits needed for information. » Two main categories: 1. Lossless: Input message = Output message. 2. Lossy: Input message Output message. Lossless Compression: » Is a method of reducing the size of computer files without losing any information. Compression Ratio: » Compression ratio = B0 / B1. » B0: number of bits before compression. » B1: number of bits after compression. Q2. Draw a General Data compression Scheme? Q3. What is entropy , why we define entropy? A measure of information contained in a source used to find the optimal code. Specifies lower bound for the average number l of bits to code. l 1 Q4. What is RLC, using RLC to encode the "ABBCCDDDDDDDDDEEFGGGGG"? Run-length Coding: code one such symbol and the length of the group. ABBCCD#9EEFG#5 Before compression 22 Characters, after compression 14 Characters. 22-14/22=36% reduction. Q5. What is Variable Length coding? Techniques based on the entropy ideas. Two techniques: Shannon-Fano and Huffman coding. Variable length coding creates a binary tree. To read the codes, start from the root. Add a '0' when go left to a child, Add a '1' when go right. The code for the character 'b' is 01 The code for 'd' is 110. Q6. Construct the Shannon- Fano tree to encode the next characters, then calculate the average number of bits needed for each character. Calculate the entropy of the characters. Calculate the Compression ratio. Solution = 0.4 x 1.32 + 0.2x 2.32 + 0.2 x 2.32 + 0.2 x 2.32 = 1.92 Average bits= 10/5 = 2 bits Compression ratio = B0 / B1 » B0: number of bits before compression= 5 × 8= 40 » B1: number of bits after compression = 10 » Compression ratio = B0 / B1 = 40 / 10 = 4 2 Q7. Suppose eight characters have a distribution A:(1), B:(1), C:(2), D:(4), E:(4), F:(4), G:(8), H:(8). a) Draw a Shannon-Fano tree for this distribution. Symbol Count log2(1/pi) Code Subtotal (# of bits) b) Complete the above table. c) Calculate the average number of bits needed for each character. d) Calculate the entropy of the characters. e) Calculate the Compression ratio. a) b) Pi Symbol count log2(1/pi) Code # of bits 1/32=0.031 A 1 5.0115 11110 5 1/32=0.031 B 1 5.0115 11111 5 2/32=0.0625 C 2 4 1110 8 4/32=0.125 D 4 3 110 12 4/32=0.125 E 4 3 100 12 4/32=0.125 F 4 3 101 12 8/32=0.25 G 8 2 00 16 8/32=0.25 H 8 2 01 16 86 c) Average bits = 86/32 = 2.685 bits d) = 0,031 x 5.0115 + 0,031 x 5.0115 +0.0625 x 4+ 0.125x3+ 0.125x3+ 0.125x3+0.25 x 2 + 0.25 x 2 = 2.310 e) C.R = B0 / B1 >> B0 = 32 x 8 = 256 >> B1 = 86 C.R = 256 / 86 = 2.976 3 Q8. Suppose five characters have the following distribution? Symbol A B C D E Count 15 7 6 6 5 a) Construct the Shannon-Fano tree to encode the above characters. b) Show the resulting code for each character value. c) What is the average number of bits needed for each character? d) What is the entropy of the characters? Pi Symbol count log2(1/pi) Code # of bits 15/39=0.384 A 15 1.380 00 30 7/39=0.179 B 7 2.4819 10 14 6/39=0.153 C 6 2.708 110 18 6/39=0.153 D 6 2.708 111 18 5/39=0.128 E 5 2.965 01 10 90 » Average bits = 90/39 = 2.307 bits » = 0.384 x 1.380 + 0.179 x 2.4819 + 0.153 x 2.708 + 0.153 x 2.708 + 0.128 x 2.965= 2.182 » C.R = B0 / B1 >> B0 = 39 x 8 = 312 >> B1 = 90 C.R = 312 / 90 = 3.466 4 Q9. What is the entropy of the image below, where numbers (0, 20, 50, 99 ) denote the gray-level intensities? Q10. Draw a Huffman tree for the next distribution. Q11. Suppose eight characters have a distribution A:(1), B:(1), C:(2), D:(4), E:(4), F:(4), G:(8), H:(8). Draw a Huffman tree for this distribution. Symbol count Log2(1/pi) code Subtotal(# of bits ) » Complete the above table. » Calculate the average number of bits needed for each character. » Calculate the entropy of the characters. 5 Q1. Discuss the properties of dictionary-based coding. » LZW uses fixed-length code word to represent variable-length strings of characters that commonly occur together. » The LZW encoder and decoder build up the same dictionary dynamically while receiving the data. » LZW places longer and longer repeated entries into a dictionary, and then emits the code for an element, rather than the string itself, if the element has already been placed in the dictionary. Q2. Mention LZW Compression Algorithm. 1 Q3. Consider the dictionary- based LZW Compression algorithm, suppose initially the dictionary is the following (A=1, B=2, C=3). Show the dictionary (symbol sets plus associated codes) and output for LZW compression of the input: “ABABBABCABABBA”. Solution » The input string is "ABABBABCABABBA" » The output codes are: 1 2 4 5 2 3 4 6 1. » Compression ratio = 14/9 = 1.56. 2 Q4. Consider the dictionary-based LZW compression algorithm. Suppose initially the dictionary is the following (Z=1, W=2). Show the dictionary (symbol sets plus associated codes) and output for LZW compression of the input: (ZWZWWZW). Find the compression ratio. Solution » The input string is "ZWZWWZW “ » The output codes are: 1 2 3 4 2. » Compression ratio = 7/5 = 1.4. Q5. Consider the dictionary- based LZW Compression algorithm, Suppose initially the dictionary is the following (A=1, B=2, C=3). Show the dictionary (symbol sets plus associated codes) and output for LZW compression of the input: “ABABBABC”. 3 Q6. Mention LZW Decompression Algorithm. Q7. Consider the dictionary-based LZW decompression algorithm. Suppose initially the dictionary is the following (A=1,B=2,C=3).Show the dictionary (symbol sets plus associated codes ) and output for LZW decompression of the input (1 2 4 5 2 3 4 6 1). Output string is: ABABBABCABABBA 4 Q8. Consider the dictionary-based LZW lossless decompression algorithm. Suppose initially the dictionary is containing 2 characters, with codes as follows: ((Z=1, W=2). Show the dictionary output for Decompression of the input code: " 1 2 3 4 2" Output is: ZWZWWZW Q9. Suppose the alphabet is (A, B, C), and the probability distribution show on the next table. How many bits are needed to encode the message ( BCA ) by Arithmetic coding? Find the compression ratio. Solution: 5 ► After the first symbol B: » low=0+1.0x0.4=0.4 high=0+1.0x0.7=0.7 range= 0.3 ► After the second symbol C: » low=0.4+0.3x0.7=0.61 high=0.4+0.3x0.9=0.67 range=0.06 ► After the third symbol A: » low=0.61+0.06x0.0=0.61 high=0.61+0.06x0.4=0.634 range = 0.024 ► Range of Code sent: 0.610 -0.634 ► Code generated is 0.101 which is 2-1 + 0 +2-3 = 0.625 ► [ low=0.61 < 0.625 < high=0.67 ] Q10. Write Arithmetic code algorithm. And Generating Code word for Encoder. 6 Q11. Suppose the alphabet is [A, B, C, D, E, F, $] in which $ is used to terminate the message. Probability distribution of symbols as follows: How many bits are needed to encode the message ("CAEE$") by using Arithmetic coding Encoder? » Code is 0.01010101 which is 2-2 +2-4 +2-6 +2-8 =0.33203125 7 Q12. Suppose the code 0.101 generate message by using Arithmetic coding Decoder. Probability distribution of symbols as follows: ► Since 0.4 < 0.625