0% found this document useful (0 votes)
258 views

R. Parekh, Principles of Multimedia: Numerical Examples and Problems

This document contains numerical examples and problems related to principles of multimedia from a textbook. It includes 10 examples and 9 problems related to topics like multimedia overview, text, image, graphics, audio, video, and compression. The examples provide step-by-step solutions and the problems assess reader knowledge and skills, with final answers provided. The content is organized by chapter and covers topics such as monitor specifications, coding techniques, image and audio properties, and compression standards.

Uploaded by

Sonal Sharma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
258 views

R. Parekh, Principles of Multimedia: Numerical Examples and Problems

This document contains numerical examples and problems related to principles of multimedia from a textbook. It includes 10 examples and 9 problems related to topics like multimedia overview, text, image, graphics, audio, video, and compression. The examples provide step-by-step solutions and the problems assess reader knowledge and skills, with final answers provided. The content is organized by chapter and covers topics such as monitor specifications, coding techniques, image and audio properties, and compression standards.

Uploaded by

Sonal Sharma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

R.

Parekh, Principles of Multimedia : Numerical Examples and Problems

01 – Feb - 2017

1
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Preface
This document contains a collection of numerical examples and problems related to the theoretical concepts covered in the book
“Principles of Multimedia”, 2/e (2012). The ‘Examples’ section provides worked out solutions to representative problems while
the ‘Problems’ section, provide practice problems to assess the knowledge and skill levels of the reader. Final answers to the
problems have also been provided for evaluation.

The content has been organized into the corresponding chapters and associated sub-topics :

Chapter 1 : Multimedia an Overview : monitor specifications, waves


Chapter 2 : Text : LZ coding, Huffman coding, Shannon-Fano coding
Chapter 3 : Image : image properties, chromacity values, color model conversions, transformations
Chapter 4 : Graphics splines, transformations, vectors, texture, lighting, projection
Chapter 5 : Audio digital audio, uniform filter, non-uniform filter, wavelet filter
Chapter 6 : Video Y-C formats, NTSC, PAL, chroma sub-sampling
Chapter 8 : Compression DFT, DCT, MPEG

While every effort has been made to ensure correctness of information, readers are urged to point out any errors that might have
crept in by sending a mail to : [email protected]

Ranjan Parekh
School of Education Technology
Jadavpur University, Kolkata 700032
01-February-2017

2
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Chapter 1 : Multimedia an Overview


Examples
1. A 15 inch monitor with aspect ratio 4 : 3 has pixel addressability of 800 by 600. Calculate its resolution and dot-
pitch

Using property of right-angled triangle,


Solving, = 3
Width of monitor W = 12. Resolution R = w/W = 800/12 = 66.67 dpi
Dot pitch = 1/66.67 = 0.015 inch

2. A monitor can display 4 shades of red, 8 shades of green and 16 shades of blue. Find the color depth supported
by the monitor

Each pixel is capable of displaying 4 × 8 × 16 = 512 shades


This requires a color depth of 9-bits (since = 512)

3. A monitor has pixel addressability of 800 by 600 and a color depth of 24-bits. Calculate the minimum amount of
display memory required on its adapter card

Memory for each screen = 800 × 600 × 24 = 1152 × 104 bits


Converting to MB : (1152 × 104)/(1024 × 1024 × 8) ≈ 2 MB

4. A monitor of aspect ratio 4:3 with 900 dots along a vertical column needs to display images with 32768 colors.
Calculate the minimum amount of display memory required in MB. Also calculate the monitor resolution in dpi
for a 20 inch monitor

Height of monitor in pixels h = 900. Aspecr ratio m:n = 4:3


Let width in pixels be w.
Since w/h = m/n hence we have w = (m/n)*h = (4/3)*900 = 1200 pixels
Let bit-depth be b. Since number of colors is 32768 we must have 2^b = 32768 i.e. b = 15
Memory required M = w*h*b = 1200*900*15 ≈ 2 MB
Let the width and height of the monitor in inches be W and H
For size 20 inches and aspect ratio 4:3, we have = i.e.
Physical width W = 4*4 = 16 inches
Resolution R = w/W = 1200/16 = 75 dpi

5. A monitor can display R shades of red, G shades of green and B shades of blue. Show that the color depth
supported by the monitor is ( )

A pixel can display a total of R*G*B shades


Let color depth supported by the monitor be b
Then we must have 2^b = R*G*B i.e.

6. An analog signal containing components with frequency values ranging from 50 Hz to 5 kHz, is to be sampled.
Determine the sampling frequency and the bandwidth of the band-limiting filter

Sampling rate F = 2 × maximum frequency value = 2 × 15 kHz = 10 kHz


Bandwidth of band-limiting filter is 0 to 5 kHz

7. Repeat previous problem if the signal is transmitted over a communication channel with a bandwidth from 100
Hz to 4.5 kHz

In this case the bandwidth of the transmission channel is smaller than that of the source signal
Sampling rate F = 2 × maximum frequency value = 2 × 4.5 kHz = 9 kHz
Bandwidth of band-limiting filter is 0 to 4.5 kHz

3
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

8. A wave of frequency 100 Hz has wavelength of 320 cm. Find its velocity

Velocity v = λ × f = (320)(100) = 320 m/s

9. A body vibrating with a particular frequency generates waves having wavelength 20 cm in a medium A travelling
at 160 m/s. Calculate wavelength of the wave it will generate in another medium B propagating with a velocity
240 m/s

Let be the constant frequency of the wave, generated by the vibrating source.
But when the wave travels in different media, it can have different velocities and hence different wavelengths

Velocity of the wave in the two media are : and

Thus 20 (240/160) = 30 cm

10. The equation of a progressive wave is given by y = 8 sin (140πt – 0.08πx) where x and y are in cm and t in
seconds. Find the amplitude, frequency, wavelength and speed of the wave

Equation of a progressive wave : –


Comparing we get : amplitude a = 8 cm
Also, 2/T = 140 which gives T = 1/70 second. Hence frequency f = 1/T = 70 Hz
Again, 2/ λ = 0.08 which gives λ = 25 cm
So speed = 70 × 25 = 1750 cm/s

11. Frequency of a tuning fork is 512 Hz. During the time the fork makes 30 vibrations, sound travels 20 m. in air.
Determine the wavelength and velocity of sound in air

Frequency of tuning fork f = 512 Hz. So it makes 30 vibrations in 30/512 = 0.0586 s.


Velocity of sound : v = 20/0.0586 = 341.3 m/s
The distance travelled by a wave per second is its velocity i.e.
So wavelength = 341.3/512 = 0.67 m

4
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Problems
1. Frequency of a tuning fork is 600 Hz. During the time the fork makes 60 vibrations sound wave travels 30 meters in air.
Determine the wavelength and velocity of sound in air.
[Ans : 300 m/second, 0.5 m]

2. Equation of the simple harmonic oscillation of a source is cm. (a) Write equation of oscillation of a
point 150 m from the source (b) Write equation of the wave at a time t = 0.04 sec from start. The oscillations propagate
with a velocity of 300 m/s
[Ans : (a) – (b) – ]

3. A progressive wave has an amplitude of 50 cm, velocity 50 cm/sec. and angular frequency 50π rad/sec. (i) Write
equation of oscillation of a point 50 cm from the source (ii) Write equation of the wave at a time t = 1/50 sec. from start
[Ans : (i) – (ii) – ]

4. A 15 inch monitor having aspect ratio 9:5 has 1080 pixels along a row and refresh rate of 60 Hz. What is the horizontal
scan rate?
[Ans : 36 kHz]

5. A monitor of size S has aspect ratio w : h and pixel addressability W × H. Find an expression for its resolution

[Ans : √ ( ) ]

6. A monitor with aspect ratio m:n (m > n) has a refresh rate R and horizontal scan rate H. Find its width in pixels. Also find
its resolution if its size is S.
[Ans : , √ ]

7. A monitor has dimensions H by W inches and supports a total of C colors. Calculate the time taken to transmit N frames of
a video to be displayed on the monitor, over a transmission line having data rate T kbps. Assume that the resolution of
the monitor is R dpi
[Ans : HWNR2. log2C /1000T sec]

8. A monitor has C dots along a column and R dots along a row. The monitor is capable of displaying X, Y and Z shades of the
three primary colors. What should be the minimum video-RAM for the monitor?
[Ans : CR.log2(XYZ) bits ]

9. A monitor of size “S” has “m” number of pixels along a row and “n” number of pixels along a column. Find an expression
for its resolution
[Ans : √ ]

5
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Chapter 2 : Text
Examples
1. Using Lempel-Ziv (LZ) scheme it is observed that the dictionary table contains 1024 entries. Average characters
per word in a document is 5. Calculate compression achieved assuming ASCII coding

As average characters per word is 5, uncompressed length is 5*7 = 35 bits


Since the dictionary contains 1024 entries, row index uses 10 bits since 2^10 = 1024
So compression ratio = 35/10 = 3.5

2. A document contains letters A through F with frequencies as indicated : A(0.25), B(0.1), C(0.2), D(0.15), E(0.26),
F(0.04). (a) Use Huffman coding to derive a code word set. (b) Find average number of bits per codeword (c) Find
the minimum number of bits per character assuming fixed-length code words and hence compression ratio

(a)
Sorting in descending order :

E(0.26), A(0.25), C(0.2), D(0.15), B(0.1) [1], F(0.04) [0]

E(0.26), A(0.25), C(0.2), D(0.15) [1], BF(0.14) [0]

BDF(0.29), E(0.26), A(0.25) [1], C(0.2) [0]

AC(0.45), BDF(0.29) [1], E(0.26) [0]

BDEF(0.55) [1], AC(0.45) [0]

Reading from bottom to top, codewords : A (01), B (1101), C (00), D (111), E (10), F(1100)

(b)
Average number of bits per codeword = (0.25)×2 + (0.1)×4 + (0.2)×2 + (0.15)×3 + (0.26)×2 + (0.04)×4 = 2.43

(c)
Since there are 6 characters, fixed length codewords would require 3 bits as 2^3 = 8
Hence compression ratio = 3/2.43 = 1.234567

3. Find codewords of 5 characters A(16), B(7), C(6), D(6), E(5) using Shannon-Fano(S-F) coding and calculate
compression

Sorting in descending order : A, B, C, D, E, F

Branching into 2 parts such that difference of sums is minimum :

(A, B) [0] (C, D, E) [1]

{A [00], B [01]}, {C [10], (D, E) [11]}

{A [00], B [01]}, {C [10], D [110], E [111]}

Reading from top to bottom, codewords : A (00), B (01), C (10), D (110), E (111)

Without compression five characters would require 3-bit representation


Unencoded size = (16 + 7 + 6 + 6 + 5)*3 = 40*3 = 120 bits
Encoded size = 16*2 + 7*2 + 6*2 + 6*3 + 5*3 = 91 bits
Compression ratio = 120/91 = 3/2.275 = 1.32

4. Solve previous problem using Huffman coding and find which method is more efficient

A (16), B (7), C (6), D (6) [0], E (5) [1]

6
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

A (16), DE (11), B (7) [0], C (6) [1]


A (16), BC (13) [0], DE (11) [1]
BCDE (24) [0], A (16) [1]

Codewords : A (1), B (000), C (100), D (010), E (110)


Encoded size = 16*1 + 7*3 + 6*3 + 6*3 + 5*3 = 88 bits
Compression ratio = 120/88 = 3/2.2 = 1.36
Hence Huffman coding is seen to be more efficient than S-F coding in this case

Problems
1. In a text document A occurs 75% of the times, B occurs 12.5% of the times, C and D each occur 6.25% of the times.
Compress the document using a binary tree and find the codewords and compression ratio.
[Ans : 1.45]

2. Frequencies of 5 characters are as follows : A (0.17), B (0.35), C (0.15), D (0.17), E (0.16). Find code-words using Shanon-
Fano coding scheme and calculate bits per character
[Ans : 2.31 bits/ch]

3. Repeat previous problem using Huffman coding


[Ans : 2.30 bits/ch]

4. It is observed that the dictionary table for an L-Z scheme contains 2000 entries. Average characters per word in a
document, is 6. Calculate the percent ‘space savings’ assuming standard ASCII table
[Ans : 73.8%]

7
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Chapter 3 : Image
Examples
1. A GIF image occupies a rectangular area of A inch by B inch on a monitor screen. The resolution of the monitor is
C dpi. Calculate file size of the image in KB

Width of the image in inches is inches


Height of the image in inches is inches
Let width in pixels be and height in pixels be
Resolution dpi
Now which implies
Similarly which implies
Total number of pixels in the image =
A GIF image has a color depth of = 8 bits
Storage size of image

2. An image of dimensions 640 by 480 and color depth 16 bits. If this image is to be transmitted along a 56 kbps line
from a Web server, calculate how long would it take before the entire image is visible on the screen

Storage size of the image = 640 × 480 × 16 = 4915200 bits


To be transmitted along a 56 kbps line would take (4915200 / 56000) = 87.78 seconds

3. An image has an aspect ratio m:n and bit depth b. The longest diagonal within the image has a size D. Compute
the file size of the image in terms of m, n, b, D.

Let there be pixels along the width and pixels along the height of the image
Length of diagonal = √
Equating to D we have : D = √
Solving for x we have : x = D / √{m^2 + n^2}
Width of image in pixels : w = m.x = mD / √{m^2 + n^2}
Height of image in pixels : h = n.x = nD / √{m^2 + n^2}
Storage size of image S = w.h.b = b.m.n.D^2 / {m^2 + n^2}

4. The sRGB chromacity values for green are (x = 0.3, y = 0.6, z = 0.1) and for white are (x = 0.3127, y = 0.3290, z =
0.3583).
(a) Derive these values using the sRGB to CIE XYZ conversion relations.
(b) Convert the chromacity values back to RGB using CIE XYZ to RGB conversion relations.

(a)
For green, R8 = 0, G8 = 255, B8 = 0
Normalized values : R’ = 0, G’ = 1, B’ = 0
Since R’ < 0.04045, R = R’ / 12.92 = 0
Since B’ < 0.04045, B = B’ / 12.92 = 0
Since G’ > 0.04045, G = {(G’ + 0.055)/1.055 }^2.4 = 1
X = (0.4214)R + (0.3576)G + (0.1805)B = 0.3576
Y= (0.2126)R + (0.7152)G + (0.0722)B = 0.7152
Z = (0.0193)R + (0.1192)G + (0.9505)B = 0.1192

Thus, Tri-stimulus values for green : X = 0.3576, Y = 0.7152, Z = 0.1192


Hence chromacity values are given by,

x = X / (X + Y + Z) = 0.3576 / 1.192 = 0.3


y = Y / (X + Y + Z) = 0.7152 / 1.192 = 0.6
z = Z / (X + Y + Z) = 0.1192 / 1.192 = 0.1

For white, R8 = 255, G8 = 255, B8 = 255


Normalized values : R’ = 1, G’ = 1, B’ = 1
Since R’ > 0.04045, R = {(R’ + 0.055)/1.055 }^2.4 = 1
Since G’ > 0.04045, G = {(G’ + 0.055)/1.055 }^2.4 = 1
Since B’ > 0.04045, B = {(B’ + 0.055)/1.055 }^2.4 = 1

8
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

X = (0.4214)R + (0.3576)G + (0.1805)B = 0.9505


Y = (0.2126)R + (0.7152)G + (0.0722)B = 1
Z = (0.0193)R + (0.1192)G + (0.9505)B = 1.089

Thus, Tri-stimulus values for white : X = 0.9505, Y = 1, Z = 1.089


Hence chromacity values are given by,

x = X / (X + Y + Z) = 0.9505 / 3.0395 = 0.3127


y = Y / (X + Y + Z) = 1 / 3.0395 = 0.3290
z = Z / (X + Y + Z) = 1.089 / 3.0395 = 0.3583

(b)
For green : X = 0.3576, Y = 0.7152, Z = 0.1192
R = (3.2406)X + (−1.5372)Y + (−0.4986)Z = 0
G = (-0.9689)X + (1.8758)Y + (0.0415)Z = 1
B = (0.0557)X + (−0.2040)Y + (1.0570)Z = 0

Since R < 0.0031308, R’ = (12.92)R = 0


Since G > 0.0031308, G’ = (1.055)G^(1/2.4) – 0.055 = 1
Since B < 0.0031308, B’ = (12.92)B = 0
R8 = round(255.R’) = 0, G8 = round(255.G’) = 255, B8 = round(255.B’) = 0

For white : X = 0.9505, Y = 1, Z = 1.089


R = (3.2406)X + (−1.5372)Y + (−0.4986)Z = 1
G = (-0.9689)X + (1.8758)Y + (0.0415)Z = 1
B = (0.0557)X + (−0.2040)Y + (1.0570)Z = 1

Since R > 0.0031308, R’ = (1.055)G^(1/2.4) – 0.055 = 1


Since G > 0.0031308, G’ = (1.055)G^(1/2.4) – 0.055 = 1
Since B > 0.0031308, B’ = (1.055)G^(1/2.4) – 0.055 = 1
R8 = round(255.R’) = 255, G8 = round(255.G’) = 255, B8 = round(255.B’) = 255

5. (a) Convert the XYZ values of green and white obtained in the previous problem to CIE LAB values using the D65
white point illuminant (b) Convert the CIE LAB values back to CIE XYZ

(a)
For green, X = 0.3576, Y = 0.7152, Z = 0.1192
From previous problem tri-stimulus values of white point D65 is : Xn = 0.9505, Yn = 1, Zn = 1.089
XN = X / Xn = 0.3576 / 0.9505 = 0.3762
YN = Y / Yn = 0.7152 / 1 = 0.7152
ZN = Z / Zn = 0.1192 / 1.089 = 0.1095

Since Xn > 0.0089, X’ = (XN)^(1/3) = (0.3762)^(1/3) = 0.7219


Since Yn > 0.0089, Y’ = (Y)^(1/3) = (0.7152)^(1/3) = 0.8943
Since Zn > 0.0089, Z’ = (Z)^(1/3) = (0.1095)^(1/3) = 0.4784

L = 116.Y’ – 16 = 87.7388
a = 500(X’ – Y’) = −86.2
b = 200(Y’ – Z’) = 83.18

For white, X = 0.9505, Y = 1, Z = 1.089


From previous problem tri-stimulus values of white point D65 is : Xn = 0.9505, Yn = 1, Zn = 1.089

XN = X / Xn = 1
YN = Y / Yn = 1
ZN = Z / Zn = 1

Since Xn > 0.0089, X’ = (XN)^(1/3) = 1


Since Yn > 0.0089, Y’ = (Y)^(1/3) = 1
Since Zn > 0.0089, Z’ = (Z)^(1/3) = 1

L = 116.Y’ – 16 = 100
a = 500(X’ – Y’) = 0
b = 200(Y’ – Z’) = 0

9
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

(b)
For green, L = 87.7388, a = −86.2, b = 83.18
Y ’ = (L + 16)/116 = 0.8943
X ‘ = a/500 + Y ‘ = 0.7219
Z ‘ = −b / 200 + Y ‘ = 0.4784

Since X ‘ > 0.2069, X “ = (X ‘ )^3 = 0.3762


Since Y ‘ > 0.2069, Y “ = (Y ‘ )^3 = 0.7152
Since Z ‘ > 0.2069, Z “ = (Z ‘ )^3 = 0.1095

X = Xn.X “ = 0.3576
Y = Yn.Y “ = 0.7152
Z = Zn.Z “ = 0.1192

For white, L = 100, a = 0, b = 0


Y ’ = (L + 16)/116 = 1
X ‘ = a/500 + Y ‘ = 1
Z ‘ = −b / 200 + Y ‘ = 1

Since X ‘ > 0.2069, X “ = (X ‘ )^3 = 1


Since Y ‘ > 0.2069, Y “ = (Y ‘ )^3 = 1
Since Z ‘ > 0.2069, Z “ = (Z ‘ )^3 = 1

X = Xn.X “ = 0.9505
Y = Yn.Y “ = 1
Z = Zn.Z “ = 1.089

6. The AdobeRGB chromacity values for green are (0.21, 0.71, 0.08). (a) Derive these using the AdobeRGB to XYZ
conversion scheme. (b) Convert the chromacity values back to RGB

(a)
For green, R8 = 0, G8 = 255, B8 = 0
R’ = 0, G’ = 1, B’ = 0
R = (R’)^(2.199) = 0
G = (G’)^(2.199) = 1
B = (B’)^(2.199) = 0

X = (0.57667)R + (0.18556)G + (0.18823)B = 0.18556


Y = (0.29734)R + (0.62736)G + (0.07529)B = 0.62736
Z = (0.02703)R + (0.07069)G + (0.99134)B = 0.07069

x = X/(X + Y + Z) = 0.18556/0.88361 = 0.21


y = Y/(X + Y + Z) = 0.62736/0.88361 = 0.71
z = Z/(X + Y + Z) = 0.07069/0.88361 = 0.08

(b)
For green, X = 0.18556, Y = 0.62736, Z = 0.07069

R = (2.04159)X + (-0.56501)Y + (-0.34473)Z = 0


G = (-0.9624)X + (1.87597)Y + (0.04156)Z = 1
R = (0.01344)X + (-0.11836)Y + (1.01517)Z = 0

R’ = R^(0.4547) = 0
G’ = G^(0.4547) = 1
B’ = B^(0.4547) = 0

R8 = round(255.R’) = 0
G8 = round(255.G’) = 255
B8 = round(255.B’) = 0

7. Convert RGB red to CMY

For RGB red, R8 = 255, G8 = 0, B8 = 0


R’ = R8/255 = 1, G’ = G8/255 = 0, B’ = B8/255 = 0
C’ = 1 – R’ = 0, M’ = 1 – G’ = 1, Y’ = 1 – B’ = 1

10
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

C = round(100 . C’) = 0 %
M = round(100.M’) 100 %
Y = round(100.Y’) = 100 %

8. (a) Convert RGB red to HSV (b) Convert back from HSV to RGB

(a)
For red, R8 = 255, G8 = 0, B8 = 0
R’ = R8/255 = 1, G’ = G8/255 = 0, B’ = B8/255 = 0
N = min(R’, G’, B’) = 0
X = max(R’, G’, B’) = 1
D=X–N=1
V’ = X = 1

Since D ≠ 0, S’ = D/X = 1
R” = 0.5 + (X – R’)/6D = 1/2
G” = 0.5 + (X – G’)/6D = 2/3
B” = 0.5 + (X – B’)/6D = 2/3

Since R’ = X = 1, H’ = B” – G” = 0
H = round(360.H’) = 0
S = round(S’) = 1
V = round(V’) = 1

(b)
H = 0, S = 1, V = 1
C = V.S = 1
D=V–C=0
H’ = H / 60 = 0
X = C.(1 − |H’ mod2 – 1 |) = 0
Since H’ = 0, R’ = C = 1, G’ = X = 0, B’ = 0
R” = R’ + D = 1
G” = G’ + D = 0
B” = B’ +D = 0
R8 = round(255.R”) = 255, G8 = round(255.G”) = 0, B8 = round(255.B”) = 0

9. Convert RGB red to HSL

For red, R8 = 255, G8 = 0, B8 = 0


R’ = R8/255 = 1, G’ = G8/255 = 0, B’ = B8/255 = 0
N = min(R’, G’, B’) = 0
X = max(R’, G’, B’) = 1
D=X–N=1
L’ = (N + X) / 2 = 1/2
Since D ≠ 0, L’ = 0.5, S’ = D / (2 – X – N) = 1

R” = 0.5 + (X – R’) / 6D = 1/2


G” = 0.5 + (X – G’) / 6D = 2/3
B” = 0.5 + (X – B’) / 6D = 2/3

Since R’ = X, H’ = B” – G” = 0
Thus H’ = 0, S’ = 1, L’ = 0.5

10. Convert the color Chocolate (#D2691E) to (a) CMY (b) CMYK

D2(base 16) = 210 (base 10), 69 (base 16) = 105 (base 10), 1E (base 16) = 30 (base 10)
RGB = (210, 105, 30)
R'G'B' = (0.823, 0.412, 0.117)

(a)
C' = 1 - R' = 0.177, M' = 1 - G' = 0.588, Y' = 1 - B' = 0.883
CMK = (18%, 59%, 88%)

(b)
K = 1 - max(R', G', B') = 1 - 0.823 = 0.177

11
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

C = (1 - R' - K) / (1 - K) = (1 - 0.823 - 0.177)/(1 - 0.177) = 0


M = (1 - G' - K) / (1 - K) = (1 - 0.412 - 0.177)/(1 - 0.177) = 0.5
Y = (1 - B' - K) / (1 - K) = (1 - 0.117 - 0.177)/(1 - 0.177) = 0.858

11. For the above color, derive (a) CMYK from CMY (b) CMY from CMYK

(a)
CMY = (18%, 59%, 88%)
C'M'Y' = (0.177, 0.588, 0.883)
K = min(C', M', K') = 0.177
C = (C' - K)/(1 - K) = (0.177 - 0.177)/(1 - 0.177) = 0
M = (M' - K)/(1 - K) = (0.588 - 0.177)/(1 - 0.177) = 0.5
Y = (Y' - K)/(1 - K) = (0.883 - 0.177)/(1 - 0.177) = 0.858
CMYK = (0%, 50%, 86%, 18%)

(b)
C" = C'(1 - K) + K = (0)*(1 - 0.177) + 0.177 = 0.177
M" = M'(1 - K) + K = 0.5(1 - 0.177) + 0.177 = 0.588
Y" = Y'(1 - K) + K = 0.858(1 - 0.177) + 0.177 = 0.883

12. Convert the color DarkForestGreen CMYK = (80%, 45%, 90%, 50%) to (a) CMY (b) RGB

(a)
C' = 0.8, M' = 0.45, Y' = 0.9, K' = 0.5
C" = C'(1 – K') + K' = (0.8)(0.5) + 0.5 = 0.9
M” = M’(1 – K’) + K’ = (0.45)(0.5) + 0.5 = 0.725
Y” = Y’(1 – K’) + K’ = (0.9)(0.5) + 0.5 = 0.95
CMY = (90%, 73%, 95%)

(b)
R = 255(1 - C')(1 - K') = 255(1 - 0.8)(1 - 0.5) = 26
G = 255(1 - M')(1 - K') = 255(1 - 0.45)(1 - 0.5) = 70
B = 255(1 - Y')(1 - K') = 255(1 - 0.9)(1 - 0.5) = 13
RGB = (26, 70, 13)

13. Show that normalized HSV (0,1,1) is equivalent to normalized RGB (1,0,0)

H = 0, S = 1, V = 1
C = V*S = 1, D = V – C = 0
H’ = H/60 = 0
X = C(1 - |H’ mod 2 – 1|) = 0
Since H’ = 0, hence R’ = C = 1, G’ = X = 0, B’ = 0
R” = R’ + D = 1
G” = G’ + D = 0
B” = B’ + D = 0

14. Consider the color orange #FFA500. Convert to XYZ, LAB

RGB decimal : R = 255, G = 165, B = 000


Normalized RGB values : R’ = 1, G’ = 0.647, B’ = 0
Since R’ > 0.04, R = {(R’ + 0.055)/1.055}^2.4 = 1
Since G’ > 0.04, G = {(G’ + 0.055)/1.055}^2.4 = 0.376
Since B’ < 0.04, B = B’/12.92 = 0
X = (0.4124)R + (0.3576)G + (0.1805)B = (0.4124)(1) + (0.3576)(0.376) + (0.1805)(0) = 0.5468
Y = (0.2126)R + (0.7152)G + (0.0722)B = (0.2126)(1) + (0.7152)(0.376) + (0.0722)(0) = 0.4815
Z = (0.0193)R + (0.1192)G + (0.9505)B = (0.0193)(1) + (0.1192)(0.376) + (0.9505)(0) = 0.0641
x = X/(X+Y+Z) = 0.5468/1.0924 = 0.5, y = Y/(X+Y+Z) = 0.4815/1.0924 = 0.44, z = Z/(X+Y+Z) = 0.0586

15. For an image with rows and columns, Q1 and Q3 are swapped and Q2 and Q4 are swapped. Find correspond-
ing translation amounts. Assume origin at top-left corner, X-axis from left to right, Y-axis top to bottom

Translation of Q1 : ∆x = +c/2, ∆y = +r/2


Translation of Q3 : ∆x = -c/2, ∆y = -r/2
Translation of Q2 : ∆x = -c/2, ∆y = +r/2
Translation of Q4 : ∆x = +c/2, ∆y = -r/2

12
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

16. For image of width height , consider origin at center of image, X-axis left to right, Y-axis bottom to top, and
top-left corner Find its new location after CCW and CW rotations of 90°

(a) CCW : θ = 90°


x2 = x1.cos(θ) – y1.sin(θ) = (-w/2).(0) – (h/2).(1) = -h/2
y2 = x1. sin(θ) + y1.cos(θ) = (-w/2).(1) + (h/2).(0) = -w/2

(b) CW : θ = – 90°
x2 = x1.cos(θ) – y1.sin(θ) = (-w/2).(0) – (h/2).(-1) = h/2
y2 = x1. sin(θ) + y1.cos(θ) = (-w/2).(-1) + (h/2).(0) = w/2

17. For the previous problem, find the new location of A after the image isscaled-down by 30% along X-axis and
scaled-up by 40% along Y-axis directions

Let scaling factors be Sx and Sy along X and Y directions


In this case Sx = 0.7 and Sy = 1.4
Thus : x2 = 0.7*x1 = 0.7(-w/2) = -0.35w
Also, y2 = 1.4*y1 = 1.4(h/2) = 0.7h
New coordinates of A : (-0.35w, 0.7h)

18. A square having vertices (-1,-1), (1,-1), (1,1), (-1,1) is translated by amounts (2, -3), then scaled by amounts (1,
2), and finally rotated by angle 30° CCW around the origin. Find its new vertices

Original coordinate matrix : [ ]

Translation matrix : [ ] , scaling matrix [ ], rotation matrix [ ]

Composite transformation : [ ]

Original coordinate matrix : [ ]

New coordinates : (4.87, -6.43), (2.87, -2.96), (4.59, -1.96), (6.59, -5.43)

19. A square image having vertices at (-1,-1), (1,-1), (1,1), (-1,1) is rotated by angle 30° CCW around its vertex
P(-1, -1). Find its new vertices

Translate P to origin : T(1, 1)


Rotate about origin by 30° : R(30)
Translate back to original location : T(-1, -1)

Composite transformation : M = T(-1, -1)*R(30)*T(1, 1) = [ ]

Original coordinate matrix : [ ]

New coordinate matrix : [ ]

New coordinates : (-1, -1), (-2, 0.73) , (-0.27, 1.73) , (0.73, 0)

13
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

20. Compute the R, G, B histograms of the image consisting of 50% red and 50% yellow. Also express the histogram
as normalized vectors

Let total number of colors be N

R G B Amount
255 0 0 N/2
255 255 0 N/2
-----------------------------------------------
Adding columnwise, 2-bin histograms are as follows :

HR : N @ 255
HG : N/2 @ 0 , N/2 @ 255
HB : N@0

Normalized 2-element vectors :

nHR = [0, 1]
nHG = [0.5, 0.5]
nHB = [1, 0]

Problems
1. An image has an aspect ratio A:B, a file size of F and a diagonal length of L. Find an expression for its color depth C
[Ans : C = F(A^2 + B^2) / ABL^2 ]

2. A GIF image of A × B inches and resolution C dpi is to be transmitted over a network of data rate D kbps. How much time
T does it take to transmit the entire image?
[Ans : ABC^2/(125D) sec]

3. A rectangle of width and height has its center at the origin such that the bottom-left corner is (-w/2, -h/2). Find the
new location of its bottom-left corner after the horizontal dimension is reduced by 20%, vertical dimension is reduced by
30% and then the rectangle is rotated by angle 60° clockwise
[Ans : (-w/5 - 0.345h, 0.348w – 0.175h)]

4. Derive a transformation matrix for rotation by angle θ about the point where is a constant

[Ans : [ ]

5. Obtain a transformation that maps one image A with corners at (2, 3) & (4, 4) onto another image B with corners at (1, 1)
& (2, 3)

[Ans : [ ]

6. A square having vertices at (-1,-1), (1,-1), (1,1), (-1,1) is translated so that its lower left corner coincides with the origin
and then rotated by angle 30° CCW about the origin. Find new locations of its vertices
[Ans : (0,0), (1.74, 1), (0.74, 2.74), (-1, 1.74)]

7. A 400 × 400 square image contains a smaller square 200 × 200 at the center. The smaller square is filled with the color
SpringGreen (#00FF7F) while the remaining area of the image is filled with the color DeepSkyBlue (#00BFFF). Draw the
R, G and B color histograms for the image, assuming that each histogram consist of 5-bins with centers at (0, 63, 127, 191,
255). Also represent the three histograms using 5-element normalized vectors.
[Ans : HR = [1, 0, 0, 0, 0], HG = [0, 0, 0, 0.75, 0.25], HB = [0, 0, 0.25, 0, 0.75] ]

8. An image consists of equal portions of four colors : pure-red (255, 0, 0), light-red (255, 128, 0), dark-red (128, 0, 0) and
white (255, 255, 255). (a) Draw the 3-bin (0, 128, 255) R, G, B global histograms of the image. Also write down the vector
representations of the histograms normalized within range [0, 1]. (b) How will the vectors change if white is replaced by
pink (255, 128, 128)?
[Ans : (a) HR = [0, 0.25, 0.75], HG = [0.5, 0.25, 0.25], HB = [0.75, 0, 0.25]
(b) HR = [0, 0.25, 0.75], HG = [0.5, 0.5, 0], HB = [0.75, 0.25, 0] ]

14
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

9. Draw and explain R, G, B histograms of an image with N pixels consisting of 50% un-staturated red (#8B0000) and 50%
un-saturated yellow (#F0F000).
[Ans : H_R = [0@0, 0.5@139, 0.5@240, 0@255], H_G = [0.5@0, 0@139, 0.5@240, 0@255],
H_B = [1@0, 0@139, 0@240, 0@255] ]

10. Consider the color orange #FFA500. Convert to CMY, HSV


[Ans : (a)C = 0%, M = 35.3% = 35% , Y = 100% (b) HSV = (39°, 100%, 100%) ]

11. The color DarkOliveGreen is represented by H = 82°, S = 56%, B = 42%. Convert to RGB 8-bit values and CMYK percent
values
[Ans : (a) RGB = (85, 107, 47) (b) CMYK = (21%, 0%, 56%, 58%) ]

12. Convert the color Coral #FF7F50 to XYZ and LAB


[Ans : (a) XYZ = (0.5028, 0.3701, 0.1208) (b) Lab = (67.27, 45.4, 47.5) ]

13. Derive chromacity values for saturated yellow


[Ans : ]

14. A 24-bit image has dimensions of 1024 by 768 pixels. Calculate the time taken to transmit the image using a 64 kbps line
and its file size in MB
[Ans : 2.25 MB, 4.9 min ]

15. Derive the chromacity values of gold (#FFD700). Use the following relations and transformation matrix for the purpose :
k = k'/12.92 for k'<0.04 and k = {(k' + 0.055)/1.055}^2.4 for k' > 0.04, where k' is a normalized R, G or B value and [X ; Y ;
Z] = T.[R ; G ; B] where T = [0.42, 0.36, 0.18 ; 0.21, 0.71, 0.07 ; 0.02, 0.12, 0.95]
[Ans : ]

15
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Chapter 4 :Graphics
Examples
1. Find the equation of a line through points (–1, 1) and (4, 3).

Choose starting equation of degree 1 : [ * +

Substitute given points in the equation

Write in matrix form Y = C.A : * + * +* +

Solve the matrix equation A = inv(C).Y : * + * + * + * +

Substitute the coefficient values in starting equation

2. Find the parametric equation of a line passing through points (-1, 1) and (4, 3)

Choose starting equation of degree 1 : [ * +

Substitute given points in the equation remembering initial point corresponds to t = 0 and final point corresponds to t = 1

Write equations in matrix form G = C.A where G is called the geometry matrix

* + * +* +

Solve the equation for A i.e. A = inv(C).G = B.G

* + * + * + * +

Substitute the coefficient values in starting equation : [ * +

Expanding : [ [

The required parametric equations are obtained by separating out the x and y components

3. Find the equation of a quadratic curve passing through three points (-1, 1), (1, 2.5) and (4, 3)

Choose starting equation of degree 2 : [ [ ]

Substitute given points in the equation

16
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Write equations in matrix form Y = C.A :

[ ] [ ][ ]

Solve for A : A = inv(C).Y : [ ] [ ] [ ] [ ]

Substituting in starting equation :

4. Find the parametric equation of a quadratic curve passing through three points (-1, 1), (1, 2.5) and (4, 3) with
sub-division ratio

Choose starting oarametric equation of degree 2 : [ [ ]

Substitute given values in starting equation

Write equations in matrix form G = C.A

[ ] [ ][ ]

Solving for A and substituting in starting equation

5. Find the equation of a cubic spline passing through four points (-1, 2), (0, 0), (1, -2), (2, 0).

Choose starting equation of degree 3 : [ [ ]

Substitute given conditions in starting equations and writing in matrix form Y = C.A

[ ] [ ][ ]

Solving for A and substituting in starting equation

6. Find the blending functions of a cubic spline having sub-division ratios of and

[ ] [ ]

Basis matrix B is given by :

17
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

[ ] [ ]

Blending function matrix is given by :

[ [

Simplifying :

7. Find piecewise parametric cubic equation of a curve passing through P1(0,1), P2(2,2), P3(5,0) and P4(8,0).
Slopes at first and last points are 2 and 1 respectively. Assume linear relation between and and a cubic
relation between and

Here

For relations, let starting equations be :


Let curve segments be denoted by A, B, C

Substitute starting conditions :

A(t = 0) = A(x = 0) : =0
A(t = 1) = A(x = 2) : =2
B(t = 0) = B(x = 2) : =2
B(t = 1) = B(x = 5) : =3
C(t = 0) = C(x = 5) : =5
C(t = 1) = C(x = 8) : =3

Substituting in starting equations :

For relations, let starting equations be :

Segment equations are specified as follows :

Derivatives of the starting equations :

( )

Additional complications : slopes are in spatial domain, but equations need to be computed in parametric domain. Hence
a conversion between spatial and parametric domains are required

By chain rule of differentiation :

18
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

( ) ( ) ( )

The above serve as scaling factors for conversion between spatial and parametric domains

continuity conditions : Different segments pass through the control points and hence physically meet at common
points

A passes through P1 and P2, B passes through P2 and P3, C passes through P3 and P4

A(t = 0) = A(y = 1) : 1 =
A(t = 1) = A(y = 2) : + + =1 ... (1)
B(t = 0) = B(y = 2) : 2 =
B(t = 1) = B(y = 0) : + + = -2 ... (2)
C(t = 0) = C(y = 0) : 0 =
C(t = 1) = C(y = 0) : + + =0 ... (3)

continuity conditions : Different curve segments should have same slopes at their common points

Taking derivatives of curve equations :

Slope of A at P2 = Slope of B at P2 and Slope of B at P3 = Slope of C at P3

A’(t = 1) = B’(t = 0) [in spatial domain]


( + + ).{1/(2 - 0)} = .{1/(5 - 2)}
3. + 6. + 9. - 2. =0 ... (4)

B’(t = 1) = C’(t = 0) [in spatial domain]


( + + ).{1/(5 - 2)} = .{1/(8 - 5)}
+ + - =0 ... (5)

continuity conditions : Different curve segments should have same curvatures at their common points

Taking double derivatives of curve equations :

Curvature of A at P2 = Curvature of B at P2 and Curvature of B at P3 = Curvature of C at P3

A"(t = 1) = B"(t = 0) [in spatial domain]

... (6)

B"(t = 1) = C"(t = 0) [in spatial domain]

... (7)

Start and end point slopes of the curves need to be known

19
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Let slopes be and respectively


= A'(t = 0) : 2 = .{1/(2 - 0)}
=4 ... (8)

= C'(t = 1) : 1 = ( +2 +3 ).{1/(8 - 5)}


+2 +3 =3 ... (9)

Write all 9 equations in the form YY = CC.AA

[ ] [ ][ ]

Solve for AA and substituting in starting equations :

8. A point P(1,2,3) in 3D space is to be rotated around an axis of rotation joining two points O(0,0,0) and A(12,3,4)
by 90 degrees in CCW direction. Find the final coordinates of the point

Let
Then √ √

Rotation CCWby angle α about X-axis so that the axis of rotation lies on the X-Z plane :

[ ] [ ]

Rotation CW by angle φ about Y-axis so that the axis of rotation coincides with the Z-axis :

[ ] [ ]

Rotation CCW by angle θ = 90 about Z-axis :

[ ] [ ]

Reverse rotation corresponding to R2 :

[ ] [ ]

20
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Reverse rotation corresponding to R1 :

[ ] [ ]

Combined transformation matrix M :

[ ]

New coordinates of the point P :

[ ][ ] [ ]

Verification : the transformation matrix for aligning the line OA along with the Z-axis is given by :

[ ][ ] [ ]

By multiplying S with the point A we find its transformed coordinate is A’(0, 0, 13) which is as expected since the length
of the line OA is 13.

[ ][ ] [ ]

9. Find the critical points for the cubic curve :

Here

Setting the roots are :

Let be a small increment to the left and right of the roots

Since the gradient transition is from negative to positive, this corresponds to a minimum point

Since the gradient transition is from positive to negative, this corresponds to a maximum point

Alternatively, we can verify that rate of change of gradient i.e. should be positive for a minimum and negative for a
maximum point

Minimum point is at :
Maximum point is at :

For finding the point of inflection (POI), we calculate the point where curvature is zero

21
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Setting the root is :


Sign of
Sign of

Since signs are opposite, there is a POI at

10. Find equation of a quadratic Bezier spline with control points (1, -1), (4, 3) and (5, -2)

The parametric equation of a quadratic Bezier curve is given by Bernstein polynomials

Separating out the and components

Verification : Since at start point and at end point we can verify the following

11. A cubic Bezier curve goes through (1,-1), (1,1), (4,3),(5,-2). Find its component curves corresponding to a
fraction of 0.4 for sub-division

Let original control points : * + * + * + * +

Sub-division fraction
New control points are computed as follows :

First generation points :

* + * + * +

* + * + * +

22
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

* + * + * +

Second generation points :

* + * + * +

* + * + * +

Third generation point :

* + * + * +

The Blending functions for a cubic Bezier curve are as follows :

First curve equation :

* + * + * + * +

[ ] [ ]

Second curve equation :

* + * + * + * +

[ ] [ ]

12. FInd blending functions and equation of a uniform linear B-spline with and

Degree of the curve :


Number of control points : , say
Number of blending functions :
Number of curve segments :
Number of elements in the knot vector (KV) :
Let the KV be chosen as

23
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Let curve segments be chosen as A, B, C, D


Let blending functions be :
Then equation of curve :

Blending functions are computed using Cox de Boor algorithm as shown below :

First order terms will be either 0 or 1 depending on :

Second order terms are computed using Cox de Boor algorthm as follows :

Segment

Segment

Segment

Segment

Equation of curve :

Considering blending functions for each segment :

24
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Rearranging :

(segment A)
(segment B)
(segment C)
(segment D)

Substituting values :

(segment A)
(segment B)
(segment C)
(segment D)

Blending functions :

13. A square having vertices (-1,-1), (1,-1), (1,1), (-1,1) is translated by amounts (2, -3), then scaled by amounts (1,2)
and finally rotated by angle 30° CCW around the origin. Find its new vertices

Original coordinate matrix C :

[ ] [ ]

Translation matrix T :

[ ] [ ]

Scaling matrix S :

[ ] [ ]

Rotation matrix R :

[ ] [ ]

Composite transformation matrix M :

[ ]

New coordinates matrix D :

[ ]

New coordinates : (4.87, -6.46), (6.61, -5.46), (4.61, -1.98), (2.87, -2.98)

14. Find the equation of a straight line in the coordinate system if it results from a 90° rotation of
the coordinate system

25
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Two points on the original line and

To transform points from system to system, the latter has to be rotated by to coincide with
system

Here rotation matrix is with :

[ ] [ ]

New coordinates of P : [ ][ ] [ ]

New coordinates of Q : [ ][ ] [ ]

Equation of line connecting P’Q’ :

Simplifying :
( ) ( )

15. Find the length of the curve between and

Here
Length of the curve is given by :

∫√ ( ) ∫√ [ √ ] √

16. Find the area between and from and

Area A is given by :

∫| | ∫| | | |

17. A triangle having vertices (2, 4), (4, 7), (5, 6), is projected on to the line . Find its new coordinates

Given line L :

26
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Original coordinates C : [ ]

Angle of inclination = 26.56 deg. Intercept on Y-axis : 2

Translate line to origin T(0, -2) : [ ]

Rotate line to coincide with X-axis R(26.56) : [ ]

Project on X-axis : [ ]

Reverse rotation corresponding to R : [ ]

Reverse translation corresponding to T : [ ]

Composite transformation M : [ ]

New coordinate matrix D : [ ]

New coordinates : (2.4, 3.2), (5.2, 4.6), (5.6, 4.8)

Verification : It may be verified that the new coordinates satisfy line equation L

18. A straight line passes through points (6, 3, -5) and (2, 1, -4). Find its equation in vector form and Cartesian form

Points in vector form :

Direction vector along QP :

Vector equation :

Now,

Cartesian equation :

19. Vector equation of a plane is , where – , – ,


and are scalars. Find the normal vector and the normal distance from the origin and Cartesian equation
of the plane

Let the Cartesian equation of the plane be


Let be any point on the plane with
Let be normal vector of the plane
Then

Magnitude | | √

27
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Unit vector
| |

Hence for the plane


Now for any point we must have

Hence

Thus Cartesian Equation of the plane :

20. A parametric surface is translated using and then rotated about the Z-axis
by 90 degrees. Find the parametric representation of the resulting surface

Translation matrix corresponding to T(2,3,4) : [ ]

Rotation matrix corresponding to Rz(90) : [ ]

Composite transformation : [ ]

Original curve : [ ]

Transformed curve : [ ][ ] [ ]

Problems : 2D
1. Find the equation of a line through points (-1, 1) and having slope 2.
[Ans : ]

2. Find the equation of a quadratic spline passing through three points (3, 2), (8, -4), (6, 5).
[Ans : ]

3. Find the equation of a quadratic curve through (0, 2), (-2, 0) and (2, -2) in parametric form with
[Ans : ]

4. Derive parametric equations of a quadratic curve which goes through the three point (-2, 1), (-1, 2), (2, -1) in such a way
that the middle point divides the curve in the ratio 1:2
[Ans : ]

5. Find the equation of a quadratic curve in the form which passes through the three points
, where is a constant
[Ans : ]

6. Find equation of a cubic spline passing through four points (3, 2), (8, -4), (6, 5), (1, 0)
[Ans : ]

7. Find the equation of a cubic spline passing through four points (3, 2), (8, -4), (6, 5) and (1,0), in parametric form, with
sub-division ratios
[Ans : , ]

28
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

8. Find the parametric equation of a cubic Hermite spline through points (1, 1) and (4, 3) and having parametric slopes (3,
6) and (1, -1) at these points
[Ans : ]

9. For a cubic Hermite spline – – having equal slopes at start and end points, find a relation
between constants ‘ ’ and ‘ ’
[Ans : ( ) ]

10. Find the parametric equation of a cubic C-R spline associated with points (0, -1), (1, 1), (4, 3), (5, -2)
[Ans : ]

11. Find the parametric equation of a cubic Cardinal spline associated with points (0, -1), (1, 1), (4, 3), (5, -2) and having
shape parameter
[Ans : ]

12. Find equations of a Cardinal spline through (1, – 1), (1, 1), (4, 3) and (5, -2) with shape parameter (i) s = 0.1 (ii) s = 0.9
[Ans : (i) (ii)
]

13. Find piecewise cubic equation of a curve passing through (3, 2), (8, -4), (6, 5) and (1,0). Slopes at first and last points are
2 and 1 respectively
[Ans : ; ;
]

14. Find piecewise cubic equation of a curve passing through (0,1), (2,2), (5,0) and (8,0). Slopes at first and last points are -3
and 5 respectively
[Ans : ; ;
]

15. For what value(s) of will two curve segments having equations and
satisfy the C1 continuity condition at point where is a constant?
[Ans : ]

16. Find critical points of the curve : –


[Ans : Min : , Max : , POI : ]

17. Determine length of (a) between and (b) for


[Ans : (a) 12.41 (b) 6π ]

18. Find the area between – and the x-axis between the values – and
[Ans : 18]

19. Find the area between the X-axis and first period of the cycloid – , – for from 0 to 2π
[Ans : 3π]

20. Find the blending functions of a linear spline


[Ans : ]

21. Find the blending functions of a quadratic spline having sub-division ratio of
[Ans : ]

22. Find the blending functions of a cubic Hermite spline


[Ans : ]

23. Find the blending functions of a cubic C-R spline


[Ans : ]

24. Find the blending functions of a cubic cardinal spline with shape parameter
[Ans : ]
25. A cubic curve has the following blending functions, where are constants : ,
, , . Find its basis matrix.

29
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

[Ans : [ ]]

26. Find equation of a cubic Bezier spline with control points (1, -1), (1, 1), (4, 3) and (5, -2)
[Ans : ]

27. A quadratic Bezier curve is associated with following control points : (3, -1), (-2, 1), (2, -3). Find its equation
[Ans : ]

28. Find equation of a uniform quadratic B-spline with and and knot-vector T = {0, 1, 2, 3, 4, 5, 6}
[Ans : P(t) = {PA, PB, PC, PD, PE, PF} where
PA = P0.[(1/2)(t)(t)], 0≤t<1
PB = P0.[(1/2)(t)(2 – t) + (1/2)(3 – t)(t – 1)] + P1.[(1/2)(t – 1)(t – 1)], 1≤t<2
PC = P0.[(1/2)(3 – t)(3 – t)] + P1.[(1/2)(t – 1)(3 – t) + (1/2)(4 – t)(t – 2)] + P2.[(1/2)(t – 2)(t – 2)], 2 ≤ t < 3
PD = 1.[(1/2)(4 – t)(4 – t)] + P2.[(1/2)(t – 2)(4 – t) + (1/2)(5 – t)(t – 3)] + P3.[(1/2)(t – 3)(t – 3)], 3 ≤ t < 4
PE = P2.[(1/2)(5 – t)(5 – t)] + P3.[(1/2)(t – 3)(5 – t) + (1/2)(6 – t)(t – 4)], 4≤t<5
PF = P3.[(1/2)(6 – t)(6 – t), 5≤t<6

29. Find equation of an open uniform quadratic B-spline with d = 3 and n = 3and knot-vector T = {1, 1, 1, 2, 3, 3, 3}
[Ans : P(t) = {PA, PB, PC, PD, PE, PF} where
PA = 0, 0≤t<1
PB = 0, 1 ≤ t < 2
PC = P0.[(2 – t)(2 – t)] + P1.[(t – 1)(2 – t) + (1/2)(3 – t)(t – 1)] + P2.[(1/2)(t – 1)(t – 1)],2 ≤ t < 3
PD = P1.[(1/2)(3 – t)(3 – t)] + P2.[(1/2)(t – 1)(3 – t) + (3 – t)(t – 2)] + P3.[(t – 2)(t – 2)],3 ≤ t < 4
PE = 0, 4 ≤ t < 5
PF = 05 ≤ t < 6

30. Find equation of a non uniform quadratic B-spline with d = 3 and n = 3 and knot-vector T = [0, 1, 3, 5, 6, 8, 9]
[Ans : P(t) = {PA, PB, PC, PD, PE, PF} where
PA = P0.[(1/3)(t)(t)], 0≤t<1
PB = P0.[(1/6)(t)(3 – t) + (1/8)(5 – t)(t – 1)] + P1.[(1/8)(t – 1)(t – 1)], 1≤t<2
PC = P0.[(1/8)(5 – t)(5 – t)] + P1.[(1/8)(5 – t)(t – 1) + (1/6)(t – 3)(6 – t)] + P2.[(1/6)(t – 3)(t – 3)], 2 ≤ t < 3
PD = = P1.[(1/3)(6 – t)(6 – t)] + P2.[(1/3)(t – 3)(6 – t) + (1/3)(8 – t)(t – 5)] + P3.[(1/3)(t – 5)(t – 5)], 3 ≤ t < 4
PE = P2.[(1/6)(8 – t)(8 – t)] + P3.[(1/6)(t – 5)(8 – t) + (1/6)(9 – t)(t – 6)], 4≤t<5
PF = P3.[(1/3)(9 – t)(9 – t)], 5 ≤ t < 6]

31. A uniform B-spline has degree 1 and is associated with 3 control points P0, P1, P2. Derive equation of the second curve
segment using Cox de Boor algorithm, if knot vector is of the form = [0, 0.4, 0.5, 0.8, … ]
[Ans : PB = P0.(5 - 10t) + P1.(10t – 4) ]

32. A B-spline has degree 2 and is associated with 4 control points. Find an expression for the first blending function B03 for
the first two curve segments A and B, using Cox de Boor algorithm, if the knot vector is of the form t=[0, 0.2, 0.5, 0.7,…]
[Ans : B03A = 10 , B03B = (2/0.3)( )]

33. Find equation of a uniform cubic B-spline with d=4 & n=4
[Ans : P(t) = {PA, PB, PC, PD, PE, PF, PG, PH} where T = {0,1,2,3,4,5,6,7,8} and
PA = P0.[(1/6)(t)(t)(t)], )], 0≤t<1
PB = P0.[(1/6)(t)(t)(2–t) + (1/6)(t)(3–t)(t–1) + (1/6)(4 – t)(t – 1)(t – 1)] + P1.[(1/6)(t – 1)(t – 1)(t – 1)], 1 ≤ t < 2
PC = P0.[(1/6)(t)(3 – t)(3 – t) + (1/6)(4 – t)(t – 1)(3 – t) + (1/6)(4 – t)(4 – t)(t – 2)] +
P1.[(1/6)(t – 1)(t – 1)(3 – t) + (1/6)(t – 1)(4 – t)(t – 2) + (1/6)(5 – t)(t – 2)(t – 2)] +
P2.[(1/6)(t – 2)(t – 2)(t – 2)], 2≤t<3
PD = P0.[(1/6)(4 – t)(4 – t)(4 – t)] +
P1.[(1/6)(t – 1)(4 – t)(4 – t) + (1/6)(5 – t)(t – 2)(4 – t) + (1/6)(5 – t)(5 – t)(t – 3)] +
P2.[(1/6)(t – 2)(t – 2)(4 – t) + (1/6)(t – 2)(5 – t)(t – 3) + (1/6)(6 – t)(t – 3)(t – 3)] +
P3.[(1/6)(t – 3)(t – 3)(t – 3)], 3≤t<4
PE = P1.[(1/6)(5 – t)(5 – t)(5 – t)] +
P2.[(1/6)(t – 2)(5 – t)(5 – t) + (1/6)(6 – t)(t – 3)(5 – t) + (1/6)(6 – t)(6 – t)(t – 4)] +
P3.[(1/6)(t – 3)(t – 3)(5 – t) + (1/6)(t – 3)(6 – t)(t – 4) + (1/6)(7 – t)(t – 4)(t – 4)] +
P4.[(1/6)(t – 4)(t – 4)(t – 4)])], 4≤t<5
PF = P2.[(1/6)(6 – t)(6 – t)(6 – t)] +
P3.[(1/6)(t – 3)(6 – t)(6 – t) + (1/6)(7 – t)(t – 4)(6 – t) + (1/6)(7 – t)(7 – t)(t – 5)] +
P4.[(1/6)(t – 4)(t – 4)(6 – t) + (1/6)(t – 4)(7 – t)(t – 5) + (1/6)(8 – t) (t – 5)(t – 5)], 5≤t<6

30
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

PG = P3.[(1/6)(7 – t)(7 – t)(7 – t)] +


P4.[(1/6)(t – 4)(7 – t)(7 – t) + (1/6)(8 – t)(t – 5)(7 – t) + (1/6)(8 – t)(8 – t)(t – 6)], 6≤t<7
PH = P4.[(1/6)(8 - t)(8 - t)(8 - t)], 7 ≤ t < 8]

34. FInd the equation and BFs of a uniform linear B-spline with d = 2 and n = 3
[Ans : P(t) = {PA, PB, PC, PD, PE} where T = {0, 1, 2, 3, 4, 5} and
PA = P0.(t), 0≤t<1
PB = P0.(2 – t) + P1. (t – 1), 1≤ t < 2
PC = P1.(3 – t) + P2.(t – 2), 2≤t<3
PD = P2.(4 – t) + P3.(t – 3), 3≤t<4
PE = P3.(5 – t), 4≤t<5
BFs :
B0 = t (0 ≤ t < 1), 2 – t (1 ≤ t < 2)
B1 = t – 1 (1 ≤ t < 2), 3 – t (2 ≤ t < 3)
B2 = t – 2 (2 ≤ t < 3), 4 – t (3 ≤ t < 4)
B3 = t – 3 (3 ≤ t < 4), 5 – t (4 ≤ t < 5)
]

35. Consider a C-R spline through (1, -1), (1, 1), (4, 3), (5, -2). Convert it to a Bezier spline and find its new CPs
[Ans : , CPs : (1, 1) , (1.5, 1.67), (3.33, 3.5) , (4, 3) ]

36. Convert a cubic interpolating spline with CPs (3,−4), (2, 3), (−2,−3), (1, 0) and sub-division ratios 0.3 and 0.5 into a
cardinal spline with shape factor 0.4
[Ans : CPs : (5.4545, -6.195), (3, -4),(14.072, -14.62) , (59.742, -58.675) ]

37. A square having vertices (-1,-1), (1,-1), (1,1), (-1,1) is rotated by angle 30° CCW about the origin. Find its new vertices
[Ans : (-0.37, -1.37), (1.37, -0.37), (0.37, 1.37), (-1.37, 0.37)]

38. A square having vertices at (-1,-1), (1,-1), (1,1), (-1,1) is scaled by amounts (-2, 3) about the fixed point (-1, -1). Find its
new vertices
[Ans (-1, -1), (-5, -1), (-5, 5), (-1, 5)]

39. A square having vertices (-1,-1), (1,-1), (1,1), (-1,1) is translated by amounts (2, -3), then scaled by amounts (1, 2), and
finally rotated by angle 30° CCW around the origin. Find its new vertices
[Ans : (4.87, -6.43), (6.59, -5.43), (4.59, -1.96), (2.87, -6.43) ]

40. A triangle having vertices at (1, 2), (3, 2), (3, 4), is reflected about the X-axis, Y-axis and the origin. Find its new
coordinates
[Ans : (a) (1, -2), (3, -2), (3, -4) (b) (-1, 2), (-3, 2), (-3, 4) (c) (-1, -2), (-3, -2), (-3, -4)]

41. A triangle having vertices (2, 4), (4, 7), (5, 6), is reflected about the line . Find its new coordinates
[Ans : (2.8, 2.4), (6.4, 2.2), (6.2, 3.6)]

42. A square having vertices at (-1,-1), (1,-1), (1,1), (-1,1) is subjected to a shear of (1.5, 2) along the X-axis. Find its new
vertices
[Ans : (-3.5, -1), (-0.5, -1), (3.5, 1), (0.5, 1) ]

43. Show that a reflection about the line is equivalent to a reflection relative to the x-axis followed by a counter-
clockwise rotation of 90°

44. Determine transformation matrix of reflection about line

[Ans : [ ] where ]

45. Obtain a transformation that reduces rectangle ABCD formed from points A(0,0), B(5,0), C(5,4), D(0,4) to half its size
keeping the point D fixed

[Ans : [ ]]

46. Obtain the transformed coordinates of the vertices of a triangle ABC : A(0,0), B(1,1), C(5,2) after reflection about the
point (-1,-1)
[Ans : (-2, -2), (-3, -3), (-7, -4) ]

31
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

47. What transformation maps triangle ABC : A(0,0), B(5,0), C(5,4) onto a single point C ?

[Ans : [ ]]

48. Find the equation of a straight line in the coordinate system if the coordinate system results
from a 90° rotation of the coordinate system
[Ans : ( ) ( ) ]

49. What is the composite transformation if one shear is followed by another shear , where
and are constants

[Ans : [ ]]

50. Obtain a transformation that maps a window whose lower left corner is at A(1, 1) and upper right corner at C(3, 5) onto a
viewport that has a lower left corner at P(0,0) and upper right corner at Q(0.5, 0.5)

[Ans : [ ]]

Problems : 3D
51. Find the magnitude and unit vector in the direction of a specified vector –
[Ans : | | ]

52. Find direction cosines and angles the vector makes with coordinate axes
[Ans : (a) 0.4867, 0.8111, -0.3244 (b) 60.87°, 35.79°, 108.93° ]

53. (a) Find if vectors – and – – are perpendicular to each other


(b) Find if vectors – and – are parallel to each other
(c) Find angle between vectors – and –
[Ans : (a) perpendicular (b) parallel (c) 83.98° ]

54. Find the vector perpendicular to both the vectors – and – –


[Ans : ]

55. Find the transformation for aligning the following vectors with the positive X-axis. Also find the new vector after
alignment. (a) (b)

[Ans : (a)[ ], (b) [ ], ]

56. Find relation between the vector and


[Ans : is the unit vector along ]

57. Consider two lines – – and , where & are scaling


factors. For what values of and do the lines intersect?
[Ans : ]

58. Find Cartesian equation of a line with vector equation – –


[Ans : – ]

59. A straight line passes through points (9, 3, -2) and (4, 5, -1) . Find its equation in Cartesian form and vector form
[Ans : , – – ]

60. Consider the plane 3x + 4y + 5z = 12. Find the Cartesian equation of the line going through the point of intersection of the
plane with the X- and Y-axis. Also find coordinates of another point on the line
[Ans : – , ]

32
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

61. A point C(1, 1, 1) is to be rotated by 180° around a line parallel to the Y-axis joining points P(5, 2, 3) and Q(5, 0, 3). Find
new coordinates
[Ans : (9, 1, 5) ]

62. (a) A point with coordinates (2,2,2) is to be rotated by 45° about the Y-axis and then by 60° about the Z-axis. Find its new
coordinates. (b) Check if the final position of the point is same or different if it is first rotated by 60° about the Z-axis and
then by 45° about the Y-axis
[Ans : (a) (-0.32 , 4.22 , 0) (b) (0.89 , 2.74 , 1.95 )

63. A point P(1, 2, 3) is to be rotated by 77° CW about a line joining points M (2, 1, 0) and N (3, 3, 1). Calculate the new
coordinates of the point
[Ans : (4,28, 0.67, 2.38) ]

64. A line is parallel to the Y-axis and joins point and where is a constant. Derive the transformation
matrix for rotation by angle θ about the line. Assume sin(θ) = 0.76 and cos(θ) = 0.65

[Ans : [ ]]

65. A cube with center at origin and vertices at (-1,1,1), (1,1,1), (1,-1,1), (-1,-1,1), (-1,1,-1), (1,1,-1), (1,-1,-1), (-1,-1,-1) is
translated by amounts (-2, -1, 3). Find its new vertices
[Ans : (-3,0,4), (-1,0,4), (-1,-2,4), (-3,-2,4), (-3,0,2), (-1,0,2), (-1,-2,2), (-3,-2,2) ]

66. A cube with center at origin and vertices at (-1,1,1), (1,1,1), (1,-1,1), (-1,-1,1), (-1,1,-1), (1,1,-1), (1,-1,-1), (-1,-1,-1) is
scaled by amounts (2, 1, 3). Find its new vertices
[Ans : (-2,1,3), (2,1,3), (2,-1,3), (-2,-1,3), (-2,1,-3), (2,1,-3), (2,-1,-3), (-2,-1,-3) ]

67. A cube with center at origin and vertices at (-1,1,1), (1,1,1), (1,-1,1), (-1,-1,1), (-1,1,-1), (1,1,-1), (1,-1,-1), (-1,-1,-1) is
rotated by 45° about the X-axis. Find its new vertices
[Ans : (-1, 0, √2), (1, 0, √2), (1, -√2, 0), (-1, -√2, 0), (-1, √2, 0), (1, √2, 0), (1, 0, √2), (-1, 0, -√2) ]

68. A cube with center at origin and vertices at (-1,1,1), (1,1,1), (1,-1,1), (-1,-1,1), (-1,1,-1), (1,1,-1), (1,-1,-1), (-1,-1,-1) is
scaled by amounts (2, 1, 3) with respect to its vertex (-1,-1,-1). Find its new vertices
[Ans : (-1, 1. 5), (3, 1, 5), (3, -1, 5), (-1, -1, 5), (-1, 1, -1) , (3, 1, -1), (3, -1, -1), (-1, -1, -1)]

69. A cube with center at origin and vertices at (-1,1,1), (1,1,1), (1,-1,1), (-1,-1,1), (-1,1,-1), (1,1,-1), (1,-1,-1), (-1,-1,-1) is
rotated by 45° with respect to its vertex (-1,-1,-1) around Z-axis. Find its new vertices
[Ans : (-2.41, 0.41, 1), (-1, 1.83, 1), (0.41, 0.41, 1), (-1, -1, 1), (-2.41, 0.41, -1), (-1, 1.83, -1), (0.41, 0.41, -1), (-1, -1, -1) ]

70. A cube with center at origin and vertices at (-1,1,1), (1,1,1), (1,-1,1), (-1,-1,1), (-1,1,-1), (1,1,-1), (1,-1,-1), (-1,-1,-1) is
rotated by 45° CCW around an arbitrary line joining points (2, 1, -2) and (3, 3, 2) along a plane perpendicular to the line.
Find its new vertices.
[Ans : (0.92, -1.07), (2.37, 0.23), (3.55, -1.30), (2.10, -2.59), (0.18, -0.98), (1.64, 0.31), (2.82, -1.22), (1.36, -2.51) ]

71. A cube with center at origin and vertices at (-1,1,1), (1,1,1), (1,-1,1), (-1,-1,1), (-1,1,-1), (1,1,-1), (1,-1,-1), (-1,-1,-1) is to be
reflected about a plane z=3 parallel to the X-Y plane along the Z-axis. Find the required transformation.

[Ans : [ ] ]

72. Find transformation matrix of reflection with respect to the plane : – –

[Ans : [ ] ]

73. Consider a cube with a vertex at the origin and length of side 1. It is first subjected to a shear and then to
another shear where and . Find the final coordinates of the vertices of the cube
[Ans : (2, 7, 1), (2, 7, 0), (3, 10, 0), (3, 10, 1), (0, 0, 1), (0, 0, 0), (1, 3, 0), (1, 3, 1) ]

74. Derive transformation matrix for rotation by angle θ around a line parallel to the Z-axis joining points and

33
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

[Ans : [ ][ ][ ]]

75. Derive transformation matrix for rotation by angle θ around a line parallel to the X-axis joining points and

[Ans : [ ][ ][ ]]

76. Find transformation matrix of reflection with respect to the plane passing through the origin and having normal vector

[Ans : [ ]]

77. Show that new coordinates of a point √ when rotated about Y-axis by 30° and then about Z-axis by -30° is
given by the following, where is a constant : √

78. Find the equation of a bi-linear Bezier surface using the following CPs : P00=(0,0,1), P01=(1,1,1), P10=(1,0,0),
P11=(0,1,0)
[Ans : ]

79. A bi-quadratic Bezier surface has following control points : P00 = (7, -3, -5), P01 = (7, -2, -6), P02 = (8, -1, -4), P10 = (4, -3,
-2), P11 = (5, -1, -4), P12 = (4, 0, -3), P20 = (1, -4, 1), P21 = (0, -2, 0), P22 = (1, -3, 1). Find the -coordinate of its equation.
[Ans : ]

80. Find point(s) of intersection between the hyperboloid surface – and the line
– )
[Ans : (16.5, 22.75, 11.25), (-1.83, -4.75, 2.08) ]

81. Find the extruded surface produced from the generating curves :
(a) (b)
[Ans : (a) (b) ]

82. Determine the surface given by the parametric representation :


[Ans : Cone along X-axis ]

83. A parametric surface is translated using T(1,0,-1) and then scaled using S(-1, 0, 1). Find the parametric
representation of the resulting surface
[Ans : ]

84. Find the parametric representation of the elliptic paraboloid – that is in front of the YZ-plane
[Ans : ]

85. Find the area of the surface generated when the curve √ for is rotated completely about the X-axis
[Ans : 8.28 ]

86. Show that the area of the part of the cone √ which lies between the cylinders and is
equal to √

87. Find the equation to the tangent plane and the normal vector to the surface at point (2, 2, 3)
[Ans : – – ]

88. A texture is defined by the function where is the intensity at position in texture space. A
quadrilateral on screen has vertices at P1(5,5), P2(15,30), P3(50,50), P4(40,10). Assumethe following values at the
vertices : P1(0,0), P2(0,1), P3(1,1), P4(1,0), and find and at point Q(30,30) using a linear interpolation

34
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

[Ans : ]

89. A rectangular 1 × 2 texture image is mapped onto a cylindrical surface of height 3, as shown. The short
sides of the map should align with the straight edges of the surface. Find linear relations between and
[Ans : ( ) ( ) ]

90. Consider a situation where – – . Here is the normal to a surface, is


the incident light ray, is the angle of viewing of the observer. Assuming the following coefficients of reflection for the
surface (ambient), (diffuse), (specular), index of specular reflection 5, find
intensity of reflected light. Assume light source as 10 times more intense than ambient light.
[Ans : 8.68 ]

91. Light along direction – falls on a surface with normal . Calculate the reflected ray . If the
viewing direction is – find the angle between and
[Ans : ]

92. A cube with center at origin and vertices at (-1,1,1), (1,1,1), (1,-1,1), (-1,-1,1), (-1,1,-1), (1,1,-1), (1,-1,-1), (-1,-1,-1). Derive
a parallel projection of the cube onto the z = 3 plane in a direction parallel to the Z-axis
[Ans : (-1,1,3), (1,1,3), (1,-1,3), (-1,-1,3), (-1,1,3), (1,1,3), (1,-1,3), (-1,-1,3) ]

93. A cube with center at origin and vertices at (-1,1,1), (1,1,1), (1,-1,1), (-1,-1,1), (-1,1,-1), (1,1,-1), (1,-1,-1), (-1,-1,-1). Derive
an axonometric projection of the cube onto the plane having normal vector along and passing through the point
(0, 0, 3)
[Ans : (-0.76, 1.24, 1.24), (0.577, 0.577, 0.577), (1.244, -0.756, 1.244), (-0.089, -0.089, 1.911), (-0.089, 1.911, -0.089),
(1.244, 1.244, -0.756), (1.911, -0.089, -0.089), (0.577, 0.577, 0.577) ]

94. Find the foreshortening factors for the plane whose normal vector is
[Ans : 0.97, 0.95, 0.38 ]

95. A cube with center at origin and vertices at (-1,1,1), (1,1,1), (1,-1,1), (-1,-1,1), (-1,1,-1), (1,1,-1), (1,-1,-1), (-1,-1,-1) is
projected on the plane z = 3 using perspective projection with the reference point at z = 5. Find its new vertices.
[Ans : (-0.71, 0.71, 3), (0.71, 0.71, 3), (0.71, -0.71, 3), (-0.71, -0.71, 3), (-0.56, 0.56, 3), (0.56, 0.56, 3), (0.56, -0.56, 3), (-0.56,
-0.56, 3)

96. A cube with center at origin and vertices at (-1,1,1), (1,1,1), (1,-1,1), (-1,-1,1), (-1,1,-1), (1,1,-1), (1,-1,-1), (-1,-1,-1) is
projected on the plane z = 0 using oblique projection with φ = 0° and using (a) α = 30° (b) α = 45° (c) α = 60° (d) α = 90°
(orthogonal). Find its new vertices.
[Ans : (a) (0.732, 1, 0), (2.732, 1, 0), (2.732, -1, 0), (0.732, -1, 0), (-2.732, 1, 0), (-0.732, 1, 0), (-0.732, -1, 0), (-2.732, -1, 0) ]

97. A light source positioned at (0, 10, 20) is shining on the surface for .
Determine the incident ray and the reflected ray at point P = (1/2, 1/2, -1/2 ) on the surface.
[Ans : (-0.02, 0.42, 0.91), (0.89, 0.45, -0.04) ]

98. Let equation of four planes be (1) (2) (3) (4) Let the incident light
be along and viewing direction be . Calculate intensity at P using Flat shading
model. Take m = 2, Ia = 1, Ip = 10, ks = 0.8, kd = 0.15, ka = 0.15.

[Ans : 2.42 ]

99. Repeat previous problem using Gouraud shading model. Ratio of lengths : AQ/AB = 0.5, BR/BC = 0.6, QP = PR.
[Ans : 1.59 ]

100. Repeat previous problem using Phong shading model


[Ans : 4.23 ]

35
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Chapter 5 :Audio
Examples
1. An audio signal is digitized at a sampling rate of 44.1 kHz, a bit depth of 16 and in stereo mode. Calculate the
space occupied by 1 minute of the audio and its data rate for playback

Here F = 44100 Hz, b = 16, c = 2, T = 60 seconds


Data rate = F.b.c = (44100)(16)(2) = 1411200 bps = 1.4 Mbps
File size S = D.t = 10.09 MB

2. An audio signal is recorded on a computer in stereo mode using a bit depth of such that its data rate is KB/s.
Find an expression for the average frequency of the signal.

Let the average frequency be f and sampling rate be


By Nyquist Sampling Theorem
Since the audio is in stereo mode number of channels
Data rate
Equating to R we get Hz

3. An audio clip has a duration of 8 minutes. The highest frequency in the sound wave is 15 kHz. This is to be
sampled using 8 bits per sample and in stereo mode. Estimate the minimum data rate in KB/s required to
playback the digital file and the file size in MB

Data rate : D = 2*15000*8*2 / (8*1024) = 58.6 KB/sec


File size : D*8*60/1024 = 27.46 MB
Assumption : Sampling rate = 2 times wave frequency (Nyquist theorem)

4. Consider an audio signal with 5 sample values [ . It is to be filtered with a uniform filter
[ Find the output

Output :

5. Consider an audio signal with 5 sample values [ . It is to be filtered with a non-uniform filter
[ [ . Find the output

Output :

6. The Bartlett window is defined by the following : [ –| – | – . Find


points of the Bartlett window for and hence deduce its shape

w(0) = (2/6){(6/2) –|0 – 6/2|} = (1/3){3 – 3} = 0


w(1) = (2/6){(6/2) – |1 – 6/2|} = (1/3){3 – 2} = 1/3
w(2) = (2/6){(6/2) – |2 – 6/2|} = (1/3){3 – 1} = 2/3
w(3) = (2/6){(6/2) – |3 – 6/2|} = (1/3){3 – 0} = 1
w(4) = (2/6){(6/2) – |4 – 6/2|} = (1/3){3 – 1} = 2/3
w(5) = (2/6){(6/2) – |5 – 6/2|} = (1/3){3 – 2} = 1/3
w(6) = (2/6){(6/2) – |6 – 6/2|} = (1/3){3 – 3} = 0

The shape of the window is triangular

36
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

7. Consider the signal x = [9, 7, 3, 5]. Find the components L, H, A, D, y using a Haar Wavelet filter having coefficients
a = b = 1/√2

w = (1/√2)[9, 9+7, 7+3, 3+5, 5] = (1/√2) [9, 16, 10, 8, 5]


z = (1/√2)[– 9, 9 – 7, 7 – 3, 3 – 5, 5] = (1/√2) [– 9, 2, 4, – 2, 5]
wd = (1/√2) [16, 8] = L
zd = (1/√2) [2, – 2] = H
wu = (1/√2) [0, 16, 0, 8]
zu = (1/√2) [0, 2, 0, – 2]
wf = (1/2) [0, 16+0, 0+16, 8+0, 8] = (1/2) [0, 16, 16, 8, 8] = [0, 8, 8, 4, 4] = A
zf = (1/2) [0, 2 – 0, 0 – 2, – 2 – 0, 2] = (1/2) [0, 2, – 2, – 2, 2] = [0, 1, – 1, – 1, 1] = D
y = wf + zf = [0, 8, 8, 4, 4] + [0, 1, – 1, – 1, 1] = [9, 7, 3, 5]

8. Derive 6 sample values from the sinusoidal function for . Use a 3rd order filter
with coefficients [ – to calculate the predicted signal and find the error

– –


– – – –
– – – – – – –
– – – – – – – –

– – – – – – – – –

– = [0, 0.9749, 0.4339, – 0.7818, – 0.7818, 0.4339] – [0, 0, 0.2024, – 0.4856, – 0.4433, 0.2883]
= [0, 0.9749, 0.2315, – 0.2962, – 0.3385, 0.1456]

Problems
1. An audio wave is a composite of three elementary tones with frequencies F1, F2, F3 such that F1 < F2 < F3. The audio is
digitized and recorded onto a CD of capacity C such that at least T minutes of the audio can be stored. What should be its
bit-depth?.
[Ans : ]

2. analog sound of frequency is digitized using a bit-depth of bits and number of channels . What would be the file size
formed in KB, by recording hours of the audio?
[Ans : ]

3. An audio signal of frequency is recorded on a computer stereo mode such that its data rate becomes KB/sec. Find the
bit-depth using which it was recorded.
[Ans : ]

4. An audio signal is represented by a sinusoidal function Derive 6 sample values from the function for
, and subject them to a uniform filter [ – What is the filtered output?
[Ans :
]

5. For the previous problem, if a non-uniform filter [ [ is used, find the output
[Ans : ]

6. For the signal [ – – find the signals L, H, A, D when passed through a band-pass filter with coefficients
. Verify whether the output is same as the input.
[Ans :
]

7. When the signal [ – – is passed through a second-order LPC filter [ – , what is the
predicted signal and error ?
[Ans : – ]

8. For a band-pass filter to function properly, what relation must be satisfied by its coefficients ‘ ’ and ‘ ’ ?
[Ans : ]

37
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

9. Consider an audio signal with five sample values [1, –2, 3, –4, 5]. It is to be filtered with a uniform filter [ – . Find
the filtered output.
[Ans : ]

10. A sequence [ – is passed through low-frequency and high-frequency Wavelet filters with coefficients
√ and √ . Calculate the signal components L and H.
[Ans : ( ) ]
√ √ √ √

11. Two audio signals have energy contents E1 dB and E2 dB. Find an expression for the ratio of their amplitudes.
[Ans : 10{(E1-E2)/20}]

12. An audio wave is a composite of three elementary tones of frequencies > > KHz. It is to be sampled at a bit-depth
of B in stereo mode. What is the file size of T minutes of the recorded file?
[Ans : bits ]

13. An audio clip has a duration of 8 minutes. The highest frequency in the sound wave is 15 KHz. This is to be sampled using
8 bits per sample and in stereo mode. Estimate the minimum data rate in KB/sec required to playback the digital file, and
the file size in MB. Mention any assumptions made.
[Ans : 58.6 KB/sec, 27.46 MB ]

14. An analog sound during digitization is sampled at 48 kHz and at a bit depth of 20 bits. Calculate the size of the digital
audio file produced from 5 minutes of recording. Assume the sound is stereo in nature.
[Ans : 68.66 MB ]

15. Consider a section of an audio signal [ . It is to be filtered with a uniform filter with coefficient [
Find the filtered output.
[Ans : ]

16. An audio clip has the highest frequency of 15 KHz. This is to be sampled using 10 bits per sample and in 5 channel mode.
Find out whether the digital audio can be played back from an audio CD.
[Ans : No]

38
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Chapter 6 :Video
Examples
1. Consider a TV camera where the maximum intensity of a color signal is represented
by 1 volt. An unsaturated magenta signal is formed by mixing 70% R, 20% G and 60% B. What is the luminance
output voltage for the signal? What would this value if the magenta color is saturated.

Maximum output value of a color signal is assumed to be 1 volt.


For unsaturated magenta, R = 0.7 volt, G = 0.2 volt, B = 0.6 volt.
Henve Y = 0.3(0.7) + 0.59(0.2) + 0.11(0.6) = 0.394 volt.
Since 0.5 volt represents a middle gray shade, the unsaturated magenta color would be represented by a dark gray shade
(39.4% gray)
Saturated magenta consists of 100% red and 100% blue, i.e., R = 1 volt, B = 1 volt.
Hence, Y = 0.3(1) + 0.1(1) = 0.4 volt (40% gray)

2. Calculate the bit rate and memory required to store a 1-hour movie in NTSC formats, assuming 4:2:2 chroma-
subsampling, according to CCIR-601 recommendations.

NTSC format has 720 ×480 pixels at 30 frames/second.


Since sub-sampling scheme is 4:2:2, in one frame there are 720 ×480 pixels of Y and 360 ×480 pixels each of Cb and Cr .
As per CCIR-601, sampling rate is 13.5 MHz for Y and 6.75 MHz for each of C components, with 8 bits per sample.
Hence, bit rate is [13.5 ×106 + 2(6.75 ×106)] × 8 = 216 Mbps
Memory required per line: (24 ×360) + (8 ×360) = 11520 bits or 1440 bytes
Memory required per frame each made of 480 lines: 1440 ×480 = 691.2 KB
Memory required to store 1 hour of movie: 691.2 ×30 frames/s ×3600 s = 112 GB

3. An NTSC encoded video clip has a frame size of 480 × 720 pixels and is digitized using a bit-depth of 8 bits for
each of Y, Cb and Cr, and a chroma sub-sampling scheme of 4:2:2. Calculate the file size of 1 minute of the video
assuming 30fps frame rate, and the time taken for it to be transmitted over a 2 Mbps transmission line

The frame size of the NTSC encoded video is 720 × 480 pixels, and frame rate is 30 fps.
Chroma sub-sampling scheme is 4:2:2, and bit depth is 8 bits for each of Y, Cb and Cr.
In a single line of the video frame, 360 pixels have 24 bits (Y+Cb+Cr) and 360 pixels have 8 bits (Y).
Memory required per line = (24 ×360) + (8 ×360) = 11520 bits = 1440 bytes
Memory required per frame = 1440 × 480 = 691200 bytes = 11520 × 480 = 5529600 bits
Memory required to store one second of video = 5529600 × 30 fps = 165888000 bits = 19.77 MB
Memory required to store one minute of video = 165888000 × 60 = 9953280000 bits = 1186.2 MB
Time taken to transmit over 2 Mbps line = (9953280000/2000000) sec = 4976.64 sec = 1.38 hours

4. Repeat the previous problem if the chroma sub-sampling of scheme 4:2:0

The frame size of the NTSC encoded video is 720 × 480 pixels, and frame rate is 30 fps.
Chroma sub-sampling scheme is 4:2:0, and bit depth is 8 bits for each of Y, Cb, and Cr.
There are two types of video lines: those with C information and those without C information
For the first type, 360 pixels have 24 bits (Y + Cb + Cr) and 360 pixels have 8 bits (Y)
Memory required per line = (24 × 360) + (8 × 360) = 11520 bits = 1440 bytes
For the second type, 720 pixels have 8 bits (Y)
Memory required per line = (8 × 720) = 5760 bits = 720 bytes
Memory required per frame = (1440 × 240) + (720 × 240) = 518400 bytes (since there are 240 lines of eachtype) =
4147200 bits
Memory required to store one second of the video = 518400 × 30 frames/second = 15552000 bytes = 14.83 MB =
124416000 bits
Memory required to store one minute of the video = 14.83 × 60 = 889.8 MB = 7464960000 bits
Time taken to transmit over 2 Mbps line = (7464960000/2000000) sec = 3732.48 sec = 1.04 hours

39
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Problems
1. A PAL encoded video has 720 pixels along a single row and 576 visible lines on the screen. If it is transmitted using a
chroma sub-sampling scheme of 4:2:2 what is the storage requirement for 1 hour of the video assuming a bit depth of 8
bits
[Ans : 69.52 GB]

2. A YC encoded video clip having frame rate F and frame size H by W is digitized using a bit depth D bits for each of Y, Cb,
Cr. Find an expression for the data rate of the video for a chroma sub-sampling scheme of (a) 4 : 2 : 2 (b) 4 : 2 : 0
[Ans : (a) 2DWHF bits (b) 1.5DWHF bits ]

3. An NTSC video clip has a frame size of 480 × 720 pixels. Chroma sub-sampling scheme is 4:a:b (a ≠ b) and bit-depth is 8
bits for each of Y, Cb, Cr. Derive an expression for the space required to store each frame of the video. Hence calculate the
value for a 4:2:0 scheme.
[Ans : 691200(4+a+b) bits, 4147200 bits ]

4. Convert the color brown (#A52A2A) to NTSC and PAL color spaces
[Ans : YIQ = (78.77, 73.35, 25.91), YUV = (78.77, -18.08, 75.64) ]

5. Assuming Y = 0.299R + 0.587G + 0.114B, R = Y + Cr, B = Y + Cb, find a relation between G and Y, Cb, Cr
[Ans : G = Y – 0.1942Cb – 0.5094Cr ]

6. A Y-C encoded video clip has a frame rate F, frame size of A (height) × B (width) and is digitized using a bit-depth of 8 bits
for each of Y, Cb and Cr, with a chroma sub-sampling scheme of 4:2:2. Find an expression for the data rate of the video
[Ans : 2ABF bytes ]

7. A PAL encoded video clip having frame dimension W × H pixels is digitized using B bits for each of Y, Cb, Cr using a
chroma sub-sampling scheme of 4:2:0. Find an expression for the file size of T seconds of the video.
[Ans : 37.5BHTW bits ]

8. A video has frame dimensions of P by Q (P>Q). It is to be transmitted in YCbCr format with B bits allotted to each and a
chroma sub-sampling scheme of 4:1:1. Calculate file size of N frames of the video.
[Ans :3BNPQ/2 ]

9. A PAL encoded video clip has a frame size of W by H and digitized with 8 bits for each of Y, Cb, Cr, using a chroma sub-
sampling scheme of 4:2:0. Calculate file size of one minute of the video.
[Ans :18000HW bits]

10. A YC encoded video clip has a frame rate of F, frame size of X × Y pixels and is digitized using a bit-depth of D bits for each
of Y, Cb, Cr, with a chroma subsampling scheme of A:B:B. Find an expression for the file size of T seconds of the video.
[Ans : DFTXY(2B+A)/A bits ]

11. A YC encoded video clip has a frame rate of F, frame size of X × Y pixels and is digitized using a bit-depth of D bits for each
of Y, Cb and Cr, with a chroma sub-sampling scheme of 4:2:2. Calculate time taken to transmit 1 minute of the video over
an M kbps transmission line.
[Ans : 0.12DXYF/M sec ]

12. A PAL encoded video clip has a frame size of W by H (W > H) and to be transmitted in YCbCr format with 7 bits allotted to
each. Calculate the file size of one minute of the video if the chroma sub-sampling scheme used is 4:2:1
[Ans : 2.243HW KB ]

40
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Chapter 8 :Compression
Examples
1. A 1-D signal has four sample values [9, 7, 3, 5]. Calculate its frequency domain representation using DFT

Here [ [ number of terms .


Let be the corresponding frequency domain representation.
If be the real part and the imaginary part then – –

∑{ ( )}

∑{ ( )} ( ) ( ) ( )

∑{ ( )} ( ) ( ) ( )

∑{ ( )} ( ) ( ) ( )

Thus, [

∑{ ( )}

∑{ ( )} ( ) ( ) ( )

∑{ ( )} ( ) ( ) ( )

∑{ ( )} ( ) ( ) ( )

Thus, [

Combining, [

41
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

2. For the previous problem, calculate time domain signal from its frequency domain signal

Here [ number of terms


Now [ [

∑{ ( )}

∑{ ( )} ( ) ( ) ( )

∑{ ( )} ( ) ( ) ( )

∑{ ( )} ( ) ( ) ( )

Thus, [

∑{ ( )}

∑{ ( )} ( ) ( ) ( )

∑{ ( )} ( ) ( ) ( )

∑{ ( )} ( ) ( ) ( )

Thus, [

Combining, [ [

3. For the previous problem, find the basis functions, Hence show that the original signal can be represented as a
combination of DFT coefficients and basis functions

Here
Let denote the cosine basis functions and denote the sine basis functions

⋃ ( )

⋃ [

42
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

⋃ ( ) [ ( ) ( ) ( )] [

⋃ ( ) [ ( ) ( ) ( )] [

⋃ ( ) [ ( ) ( ) ( )] [

⋃ ( )

⋃ [

⋃ ( ) [ ( ) ( ) ( )] [

⋃ ( ) [ ( ) ( ) ( )] [

⋃ ( ) [ ( ) ( ) ( )] [

The time domain signal can now be represented as a product of coefficients and basis functions

Real part : [ [ [ [
[ [ [ [

Imaginary part : [ [ [ [
[ [ [ [

Combining : [

4. A discrete time domain signal has four sample values [9, 7, 3, 5]. (a) Compute the DCT of the signal. (b) From the
DCT representation, retrieve back the time domain signal. (c) Show that the original signal can be represented as
a combination of DCT coefficients and basis functions

(a)
Here [ [ number of terms .
Let be the corresponding frequency domain representation.

∑[ { }] √ √

√ ∑[ { }]

√ ∑[ { }] { ( ) ( ) ( ) ( )}

43
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

√ ∑[ { }] { ( ) ( ) ( ) ( )}

√ ∑[ { }] { ( ) ( ) ( ) ( )}

Thus [

(b) Here [ , number of terms


Let be the corresponding time domain representation

∑ [ { }] √ √

∑ [ { }] √ √ ( ) √ ( ) √ ( )

∑ [ { }] √ √ ( ) √ ( ) √ ( )

∑ [ { }] √ √ ( ) √ ( ) √ ( )

∑ [ { }] √ √ ( ) √ ( ) √ ( )

The time domain signal has therefore been retrieved back : [ [

(c)

Basis functions are given by :

⋃ { }

⋃ { } [

⋃ { } [ ( ) ( ) ( ) ( )] [

⋃ { } [ ( ) ( ) ( ) ( )] [

⋃ { } [ ( ) ( ) ( ) ( )] [

44
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

The time domain signal can now be represented as a product of scaled coefficients and basis functions

[ [

√ [ [

√ [ [

√ [ [

√ [ [

Adding up : [ [ [ [ [

5. Find the 2D DCT of the 8 by 8 image shown below and (a) Compute the DC coefficient F0,0 (b) First AC coefficient
F0,1

(a) The image matrix P is shown below, where 0 denotes black and 1 denotes white.

0 0 0 1 0 0 0 0
0 0 1 0 1 0 0 0
 
0 0 1 0 1 0 0 0
 
0 0 1 0 1 0 0 0
P
0 1 0 0 0 1 0 0
 
0 1 1 1 1 1 0 0
0 1 0 0 0 1 0 0
 
0 1 0 0 0 1 0 0 

(a) For

√ ∑ ∑ √ ∑∑

(b) For

√ ∑ ∑ { } √ { }

45
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

6. An MPEG-1 video has a frame sequence : IBBPBBPBBPBBI… (a) Determine the size of the GOP and the
transmission sequence of the frames. (b) The average compression ratios of 10:1 (I), 20:1 (P) and 50:1 (B) derive
average bit rate generated by the encoder for PAL format (assume frame size 352 by 288 and chroma scheme
4:2:2).

(a) Frame sequence = IBBPBBPBBPBBI…


The GOP is the number of frames between two successive I frames. Here size of a GOP is 12.
The transmission sequence of frames is : IPBBPBBPBBIBB

(b) The GOP size is 12 out of which there are 1 I-frame, 3 P-frames, 8 B-frames
Net compression factor : 1(1/10)+3(1/20)+8(1/50) = 0.1+0.15+0.16 = 0.41
Average compression factor/ frame : 0.41/12 = 0.034
Data per row without compression : (24)(352/2)+(8)(352/2) = 5632 bits
Data per frame without compression : (5632)(288) = 1622016 bits
Data per frame with compression : (1622016)(0.034) = 55148.5 bits/frame
Bit rate at 25 fps : (55148.5 bits/frame)(25) = 1.378 Mbps

7. Calculate DFT and IDFT of the sequence using a transformation matrix

Let

Forward DFT : If is a transformation matrix such that then it can be shown that is given by the following :

[ ]

Here ( ) ( )
Also

[ ] [ ]

[ ][ ] [ ]

Inverse DFT : From above relation, . It can be shown that ( ) where is complex conjugate of

[ ][ ] [ ]

8. Calculate DCT and IDCT of the sequence using a transformation matrix

Forward DCT : If is a transformation matrix such that then it can be shown that term of is given
by the following

√ , -
{

In this case :

46
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

√ √ √ √

√ ( ) √ ( ) √ ( ) √ ( )
[ ]
√ ( ) √ ( ) √ ( ) √ ( )

√ ( ) √ ( ) √ ( ) √ ( )
[ ]

[ ][ ] [ ]

Inverse DCT : : From above relation, . It can be shown that where is the transpose of

[ ][ ] [ ]

Problems
1. A curve has following sample values [2.2, 3.8, 5.1, 5.1, 3.8, 2.2]. Find the value of the DFT coefficients
[Ans : ]

2. Calculate time domain signal from its frequency domain signal : (– – – – ) using IDFT
[Ans : ]

3. A curve has the following sample values ; x = [2.2, 3.8, 5.1, 5.1, 3.8, 2.2]. Find the value of the second DCT coefficient X1
[Ans : ]

4. A triangular waveform has samples values [1, 2, 3, 2, 1]. Compute first 3 DCT coefficients
[Ans : ]

5. Calculate the first two time domain terms of a spectral signal X = [– 1.5, 8, 1.5, – 8] using IDCT.
[Ans : ]

6. For the five element time domain signal x = [1, 2, 3, 4, 5] find the first two DFT coefficients.
[Ans : ]

7. Calculate the first two time domain terms from the four element frequency signal X = [–1, 1.9, –2, 4.6] using inverse DCT
[Ans : ]

8. Find the first two cosine and first two sine basis functions for a digital audio signal with number of samples N = 5, which
has been converted to frequency domain using DFT
[Ans : ]

9. The following string is transmitted using Huffman coding : CADCBCACBCBABAAADCBA. Derive the Huffman codewords
and determine space savings over normal ASCII coding
[Ans : ]

10. A unit step function has values [0, 1, 1, 1, 0]. Calculate DFT coefficients.
[Ans : ]

47
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

11. A stored MPEG-1 video sequence is “IBBPBBPBBPBI”. What should be the transmission sequence? Calculate the average
compression ratio for a transmitted GOP, if average compression ratios for I-frame, P-frame, B-frame are 10:1, 16:1, 25:1
respectively
[Ans : IPBBPBBPBBIB, 18.95 : 1 ]

12. During JPEG encoding, a 4 × 4 image block after DCT stage is shown : [128, 32, 64, 160 ; 32, 16, 12, 32 ; 128, 64, 46, 128 ;
4, 31, 40, 32]. Find the vector after zigzag scan assuming a constant quantization value of 32.

[Ans : 4 1 1 4 0 2 5 0 2 0 0 1 1 4 1 1 ]

13. Find which of the following Arithmetic codes is of minimum length (6-bits) : 0.2656, 0.26565, 0.265625. Compare the
compression achieved with Huffman coding.
[Ans : 1.5 bits/ch vs. 1.9 bits/ch ]

14. A stored MPEG-1 video sequence is IBBPBBPBBPI. If the average compression ratios for I-frame, P-frame, B-frame are 11,
15, 17 respectively, find the average space savings for a GOP.
[Ans : 35.6 %]

15. A multimedia presentation must be delivered over a network at the rate 1.5 Mbps. The presentation consists of digitized
audio and video. The audio has an average bit rate of 300 kbps. The digitized video is in PAL format compressed using
MPEG-1 standard. Assuming a frame sequence of IBBPBBPBBPBBI … and average compression ratios of 10 : 1, 20 : 1 for
I-frame and P-frame what is the compression ratio required for B-frame to ensure the desired delivery rate? Assume PAL
frame size as 352 × 288, chroma sub-sampling at 4:2:0, refresh rate at 25 Hz. Also allow 15% temporal overheads for
multiplexing and packetization of MPEG-1 video.
[Ans : 50 : 1]

48
R. Parekh, Principles of Multimedia : Numerical Examples and Problems

Chapter 9 :CD / DVD Technology


Examples
1. Digital audio is recorded on a CD-DA using 44.1 kHz, 16-bit, stereo mode. Calculate data rate.

Audio data rate for a CD-DA = 44100 samples/sec * 16 bits/sample * 2 channels = 172.3 KB/s

2. A CD ROM contains 333000 blocks . Calculate the capacity of the CD and its data rate if its operates in mode-1

Capacity = 333000 block * 2048 bytes/block = 660 MB


Data rate = 75 blocks/sec * 2048 bytes/block = 150 KB/s

3. An analog sound signal of frequency F is digitized using a bit-depth of 20 in stereo mode. If the resulting file has
the same data rate as an audio CD find the value of F

Size of audio file = 2F * 20 * 2/8 = 10*F bytes


Data rate for an audio CD = 2352 * 75 bytes = 176400 bytes/s
Equating , F = 17.64 kHz

Problems
1. For a CD-DA recording is done at 48 KHz, 15-bit, stereo mode. Calculate the data rate in KB/sec. If 70 minutes of the
audio can be recorded onto the CD, what is its capacity in MB?
[Ans : 176 KB/s, 720 MB ]

2. A CD-ROM contains B blocks to be played back in T seconds. Calculate the data rate and capacity of the CD-ROM in MB
when operating in (a) mode-1 and (b) mode-2
[Ans : (a) 2(B/T) KB/sec, 8.67(B/T) MB (b) 2.28(B/T) KB/sec, 9.89(B/T) MB ]

3. An analog sound signal of frequency F is digitized using a bit-depth of 24 in stereo mode. If the resulting file has the same
data rate as an audio CD, find the value of F
[Ans : 14.7 kHz]

4. An analog sound signal of frequency 48 kHz is digitized using a bit-depth of B in stereo mode. If the resulting data has the
same data rate as a CD-ROM operating in mode-2 what is the value of B?
[Ans : 7 bits]

5. An audio clip has the highest frequency of 12 KHz. This is to be sampled using 8 bits per sample and in 5 channel mode.
Find out whether the digital audio can be played back from an audio CD
[Ans : Yes]

49

You might also like