Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
BITS-WIPRO
Collaborative Programme
QUESTION - 1
4
1
0
2
NEW
1
2
Solution:
After another
b
NEW
a
6
After another
a
6
3b
NEW
After c
NEW
After another c
NEW
QUESTION - 2
10
ss = size(wav,1); % 16000
fadesize = fix(ss/5);
fadefnc = ( (1:fadesize)/fadesize ) ;
fadefnc2 = (fliplr(fadefnc));
wavoutp = wav;
intro = wav(1:fadesize).*fadefnc;
outro = wav((ss-fadesize+1):ss).*fadefnc2;
wavoutp(1:fadesize) = intro;
wavoutp((ss-fadesize+1):ss) = outro;
plot(wav)
plot(wavoutp)
wavwrite(wavoutp,
resources_exercises/chap13/coffeefade.wav);
12
QUESTION - 3
13
15
16
17
19
20
21
QUESTION - 4
22
23
QUESTION - 5
25
2N
2N
C() = 2 2 for = 0
1 otherwise
Given f(i, j) as below, show your work for deriving all pixel
values of F2(u, v). (That is, show the result of applying
DCT-2 to the image below.)
26
[cos
F2(0, 1) = 2
. 100 +
2
cos
. (-100)
4
= 2 . 2 . 4 . 100
2
= 200
28
F2(u, v):
0 200 0 200 0 200 0 200
0 200 0 200 0 200 0 200
0 200 0 200 0 200 0 200
0 200 0 200 0 200 0 200
0 200 0 200 0 200 0 200
0 200 0 200 0 200 0 200
0 200 0 200 0 200 0 200
0 200 0 200 0 200 0 200
0 200 0 200 0 200 0 200
29
QUESTION - 6
30
6. The MPEG-1 standard introduced B-frames, and the motionvector search range has accordingly been increased from
[15, 15] in H.261 to [512, 511.5]. Why was this
necessary?
Calculate the number of B-frames between consecutive Pframes that would justify this increase.
Solution :
The range of [512, 511.5] is used for half-pixel precision. For
full-pixel precision it is actually specified as [1, 024, 1,
023].
Both are upper bounds, and may never be used. Note, the
larger search window is not only due to the introduction of Bframes. In fact, it is partly made necessary because higher
spatial resolution is now supported in MPEG-1 video frames.
If we simply assume that B-frame is the only cause, then the
calculation would suggest that up to 512/15 34 B-frames
could be in-between consecutive P-frames.
31
QUESTION - 7
32
Entropy
0.0 0.2 0.4 0.6 0.8 1.0
Solution :
0.0
0.2
0.4
0.6
Prob of A
0.8
1.0
33
If x = 1/ 2, = 1/ 2 + 1/ 2 = 1.
If x = 1/ 4, = 1/ 4 2 + 3/ 4 (log2 (4) log2 (3))
= 1/ 2 + 3/ 4 (2 1.6) = 1/ 2 + 0.3 = .8
If x = 3/ 4, same.
If x = 1/ 8, = 1/ 8 3 + 7/ 8 log2 (8/ 7)
=3/ 8 + 7/ 8 (3 log2 (7))
=3/ 8 + 7/ 8 (3 2.8)
=3/ 8 + 7/ 8 (.2)
=.375 + .175 = .55
If x = 0, do not count that symbol; = 1 log2 (1)
=0
%matlab script: x =
(0:0.01:1);
ss = size(x,1); x(1) =
0.000001;
x(ss) = 1.0-0.000001;
y = enf(x);
plot(x,y); xlabel(Prob of
A); ylabel(Entropy);
print -depsc
entropyplot.eps
34
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
function theentropy = enf(x)
theentropy = ( x.*log(1.0./x) + (1-x).*log(1.0./(1-x)) )...
/log(2);
(b) Discuss why it must be the case that if the probability of
the two symbols are 1/ 2+s and 1/ 2s, with small s, the
entropy is less than the maximum.
Solution:
H = i pi lg(1/p i ) and i pi = 1, so that if all probabilities are
equal, then pi = 1/N
H = . i 1/N lg(N ) = lg(N ). E.g., if N=256, H=8.
Now if probabilities not all equal, then suppose e.g. that one
is a little smaller than 1/N, and one is a little bigger.
35