Data Compression Solutions
Data Compression Solutions
i=1
P(x
i
) log
2
1
P(x
i
)
M
i=1
P(x
i
) log
2
1
1
= 0
H(X) log
2
M =
M
i=1
P(x
i
) log
2
1
P(x
i
)
M
i=1
P(x
i
) log
2
M
=
M
i=1
P(x
i
)(log
2
1
P(x
i
)
log
2
M)
=
M
i=1
P(x
i
) log
2
1
MP(x
i
)
= E[log
2
1
MP(X)
]
Now we use Jensens inequality which states that if g(X) is a convex
function E[g(X)]
g(E[X]).
E[log
2
1
MP(x
i
)
] log
2
E[
1
MP(X)
]
= log
2
(
M
i=1
P(x
i
)
1
MP(x
i
)
)
= 0
or
H(X) log
2
M
Problem 2.
Without loss of generality we can assume that the source alphabet is 1, 2, , M. Let H
1
represent the rst order entropy and let H be the entropy of the source. Dene
G
K
=
M
i
1
=1
M
i
K
=1
P(X
1
= i
1
, X
2
= i
2
X
K
= i
K
) log
2
P(X
1
= i
1
, X
2
= i
2
X
K
= i
K
)
then by denition
H = lim
K
1
K
G
K
If the X
i
are independent we can write
P(X
1
= i
1
, X
2
= i
2
X
K
= i
K
) = P(X
1
= i
1
)P(X
2
= i
2
) P(X
K
= i
K
)
p
r
a
v
e
n
d
r
a
Chapter 2 2
and
G
K
=
M
i
1
=1
M
i
K
=1
P(X
1
= i
1
)P(X
2
= i
2
) P(X
K
= i
K
)[log
2
P(X
1
= i
1
)
+log
2
P(X
2
= i
2
) + log
2
P(X
K
= i
K
)]
=
M
i
2
=1
P(X
2
= i
2
)
M
i
K
=1
P(X
K
= i
K
)
M
i
1
=1
P(X
1
= i
1
) log
2
P(X
1
= i
1
)
i
1
=1
P(X
1
= i
1
)
M
i
3
=1
P(X
3
= i
3
)
M
i
K
=1
P(X
K
= i
K
)
M
i
2
=1
P(X
2
= i
2
) log
2
P(X
2
= i
2
)
.
.
.
i
1
=1
P(X
1
= i
1
)
M
i
K1
=1
P(X
K1
= i
K1
)
M
i
K
=1
P(X
K
= i
K
) log
2
P(X
K
= i
K
)
The rst summations in each term sum to 1 and the last summation (assuming identical
distributions) are equal to H
1
, and
G
K
= KH
1
Therefore,
H = lim
K
1
K
KH
1
= H
1
Problem 3.
a) 2 bits.
b) 1.75 bits.
c) 1.739818 bits.
Problem 4.
H
Q
H
P
=
m
i=1
q
i
log
2
q
i
+
m
i=1
p
i
log
2
p
i
= q
j1
log
2
q
j1
q
j
log
2
q
j
+p
j1
log
2
p
j1
+p
j
log
2
p
j
Given a function
f
a
(x) = x log x (a x) log(a x)
we can easily show that f
a
(x) is maximum for x =
a
2
Let
p
j1
+p
j
= c
p
r
a
v
e
n
d
r
a
Chapter 2 3
then
q
j1
= q
j
=
c
2
Then
H
Q
H
P
=
c
2
log
2
c
2
c
2
log
2
c
2
+p
j
log
2
p
j
+ (c p
j
) log
2
(c p
j
) (1)
= f
c
(
c
2
) f
c
(p
j
)
0
Therefore H
Q
H
P
.
Problem 7.
a) Start with the list of codewords
0, 01, 11, 111
0 is a prex for 01 generating a dangling sux of 1. 11 is a prex to 111 also generating
a dangling sux of 1. Augment the codeword list with the dangling sux.
0, 01, 11, 111, 1
Now 1 is a prex to 111 generating a dangling sux of 11. As 11 is a codeword the
code is not uniquely decodeable.
b) Start with the list of codewords
0, 01, 110, 111
0 is a prex for 01 generating a dangling sux of 1. Augment the codeword list with
the dangling sux.
0, 01, 110, 111, 1
1 is a prex of 110 and 111 generating the dangling suxes 10 and 11. As neither is
a codeword we augment the list and continue.
0, 01, 110, 111, 1, 10, 11
At this point we can get no new dangling suxes therefore this code is uniquely
decodeable.
c) Start with the list of codewords
0, 10, 110, 111
No codeword is a prex of any other codeword. Therefore, this code is uniquely
decodeable.
d) Start with the list of codewords
1, 10, 110, 111
1 is a prex of 110 which generates a dangling sux of 10 which is a codeword.
Therefore this code is not uniquely decodeable.
p
r
a
v
e
n
d
r
a
Chapter 3 4
Chapter 3
Problem 4.
a)
H =
5
i=1
P(a
i
) log P(a
i
) = 1.817684bits
b) If we sort the probabilities in descending order we can see that the two letters with
the lowest probabilities are a
2
and a
4
. These will become the leaves on the lowest level
of the binary tree. The parent node of these leaves will have a probability of 0.9. If
we consider parent node as a letter in a reduced alphabet the it will be one of the two
letters with the lowest probability: the other one being a
1
. Continuing in this manner
we get the binary tree shown in Figure 1. and the code is
a a a a a
1 2 3 4 5
(0.04)
(0.05) 0.15) (0.26) (0.50)
(0.09)
(0.24)
(0.5)
1
1
1 0
0
0
Figure 1: Human code for the ve letter alphabet.
a
1
110
a
2
1111
a
3
10
a
4
1110
a
5
0
c)
j=
i=
P(x
i
[y
j
)P(y
j
) log P(x
i
[y
j
)
=
j=
i=
f
X|Y
(x
i
[y
j
)f
Y
(y
j
)log f
X|Y
(x
i
[y
j
)
=
j=
i=
f
X|Y
(x
i
[y
j
)f
Y
(y
j
)log f
X|Y
(x
i
[y
j
)
j=
i=
f
X|Y
(x
i
[y
j
)f
Y
(y
j
)log
=
j=
i=
f
X|Y
(x
i
[y
j
)f
Y
(y
j
)log f
X|Y
(x
i
[y
j
) log
(10)
Problem 5.
H(X[Y ) H(X) =
N1
i=0
M1
j=0
P(x
i
, y
j
) log P(x
i
[y
j
) +
N1
i=0
M1
j=0
P(x
i
, y
j
) log P(x
i
)
=
N1
i=0
M1
j=0
P(x
i
, y
j
) log
P(x
i
)
P(x
i
[y
j
)
= E
_
log
P(x
i
)
P(x
i
[y
j
)
_
Now we use Jensens inequality
H(X[Y ) H(X) = E
_
log
P(X)
P(X[Y )
_
log
_
E
_
P(X)
P(X[Y )
__
p
r
a
v
e
n
d
r
a
Chapter 8 34
= log
_
_
N1
i=0
M1
j=0
P(x
i
, y
j
)
P(x
i
)
P(x
i
[y
j
)
_
_
= log
_
_
N1
i=0
M1
j=0
P(y
j
)P(x
i
)
_
_
= 0
where equality is achieved when P(x
i
) = P(x
i
[y
j
) or in other word the random variables X
and Y are independent.
Problem 6
I(X; Y ) =
N1
i=0
M1
j=0
P(x
i
, y
j
) log
P(x
i
[y
j
)
P(x
i
)
=
N1
i=0
M1
j=0
P(x
i
, y
j
) log
P(x
i
, y
j
)
P(x
i
)P(y
j
)
=
N1
i=0
M1
j=0
P(x
i
, y
j
) log
P(y
j
[x
i
)
P(y
j
)
= I(Y ; X)
Problem 7
I(X; Y ) = H(X) H(X[Y )
H(X) = p log p (1 p) log(1 p) = H
b
(p)
H(X[Y ) = P(0[0)P(Y = 0) log P(0[0) P(0[1)P(Y = 1) log P(0[1) P(1[0)P(Y = 0) log P(1[0) P(1[1)P(Y = 1) log P(1[1)
= (1 D)P(Y = 0) log(1 D) DP(Y = 1) log D DP(Y = 0) log D (1 D)P(Y = 1) log(1 D)
= [(1 D) log(1 D)][P(Y = 0) +P(Y = 1)] [Dlog D][P(Y = 0) +P(Y = 1)]
= (1 D) log(1 D) Dlog D
= H
b
(D)
Therefore
I(X; Y ) = H
b
(p) H
b
(D)
p
r
a
v
e
n
d
r
a
Chapter 9 35
Chapter 9
Problem 1. Leibnitz rule is given by
t
_
b(t)
a(t)
f(x, t)dx =
_
b(t)
a(t)
t
f(x, t)dx +f(b(t), t)
t
b(t) f(a(t), t)
t
a(t)
where a(t) and b(t) are monotonic functions of t.
The quantization noise power is given by:
2
q
= 2
M
2
1
i=1
_
i
(i1)
_
x
2i 1
2
_
2
f
X
(x)dx + 2
_
(
M
2
1)
_
x
M 1
2
_
2
f
X
(x)dx
Taking a derivative with respect to and using Leibnitz rule we obtain:
2
q
= 2
M
2
1
i=1
_
2(
(2i 1)
2
)
_
i
(i1)
_
x
2i 1
2
_
f
X
(x)dx +
i
2
4
f
X
(i)
(i 1)
2
4
f
X
((i 1))
_
+
_
2(
(M 1)
2
)
_
(
M
2
1)
_
x
M 1
2
_
f
X
(x)dx
(
M
2
1)
2
4
f
X
((
M
2
1))
_
Setting this to zero and noticing that
M
2
1
i=1
_
i
2
4
f
X
(i)
(i 1)
2
4
f
X
((i 1))
_
=
(
M
2
1)
2
4
f
X
((
M
2
1))
we obtain the desired result.
Problem 6.
Input c(x) Quantize c
1
(x) Uniformly quantized
-0.8 -1.6 -1.5 -0.75 -0.5
1.2 2.13 2.5 1.75 1.5
0.5 1.0 0.5 0.25 0.5
0.6 1.2 1.5 0.75 0.5
3.2 3.47 3.5 3.25 3.5
-0.3 -0.6 -0.5 -0.25 -0.5
p
r
a
v
e
n
d
r
a
Chapter 10 36
Chapter 10
Problem 1
Decrease in mse due to the inclusion of an output point at (, 0) is 0.0038. By symmetry,
the same is true for the inclusion of outputs at the other three points. The increased mse
because of the removal of one of the corner points is 0.00026
2
q,original
= 10
SNR
10
= 0.07178
2
q,new
= 0.05768
SNR
new
= 12.39dB
Therefore the increase in SNR is 0.95 dB
Problem 5
a) Referring to Figure 5:
P
A
=
_
3
2
e
2x
dx
_
4
3
e
2y
dy = 0.00059
P
B
=
_
_
4
3
e
2x
dx
_
2
= 0.00021
Total increase in overload probability is 8P
A
+ 4P
B
= 0.0056.
b)
P
C
=
_
0
1
2
e
2x
dx
_
5
4
1
2
e
2y
dy = 0.00166
Decrease of probability of overload is 8P
C
= 0.01329.
p
r
a
v
e
n
d
r
a
Chapter 10 37
A
A
B
C C
A B
A
C
C
C
C
A
A B
B
A
A
Figure 5: Figure for Problem 5 in Chapter 10.
p
r
a
v
e
n
d
r
a
Chapter 12 38
Chapter 12
Problem 1. Let X = a
1
, a
2
, , a
N
then
V = v : v =
N
i=1
c
i
a
i
, c
i
1
where 1 denotes the set of real numbers.
1a. Let v
1
, v
2
V . Then by denition
v
1
=
N
i=1
i
a
i
, and v
2
=
N
i=1
i
a
i
for
i
,
i
1, and
v
1
+v
2
=
N
i=1
i
a
i
+
N
i=1
i
a
i
=
N
i=1
(
i
+
i
)a
i
Dene
i
=
i
+
i
, then
i
1 and
v
1
+v
2
=
N
i=1
i
a
i
and v
1
+v
2
V
1b. By picking c
i
to be zero for all i, we obtain a vector which by denition is in V and
for which v
i
+ = v
i
for all v
i
V . Thus is the additive identity and it is contained in V .
1c. Let x =
N
i=1
i
a
i
. Dene
x =
N
i=1
(
i
)a
i
If
i
1 then (
i
) 1 and x V
Problem 2. Let F() = T [f(t)] and assume all integrals exist and we can switch the order
of integration.
_
[f(t)[
2
dt =
_
f(t)f
(t)dt
=
_
_
1
2
_
F()e
jt
d
_
f
(t)dt
=
1
2
_
F()
__
(t)e
jt
dt
_
d
=
1
2
_
F()
__
f(t)e
jt
dt
_
d
=
1
2
_
F()F
()d
=
1
2
_
[F()[
2
d
p
r
a
v
e
n
d
r
a
Chapter 12 39
Problem 3. Let F() = T [f(t)].
T
_
f(t)e
jot
_
=
_
f(t)e
jot
e
jt
dt
=
_
f(t)e
j(o)t
dt
= F(
o
)
Problem 4. Let F() = T [f(t)], F
1
() = T [f
1
(t)], and F
2
() = T [f
2
(t)], and assume
that all the integrals exist and we can change the order of integration.
F() =
_
f(t)e
jt
dt
=
_
f
1
()f
2
(t )de
jt
dt
=
_
f
1
()f
2
(t )e
jt
ddt
Let u = t , then t = u + and dt = du.
F() =
_
f
1
()
_
f
2
(u)e
j(u+)
dud
=
_
f
1
()e
j
__
f
2
(u)e
ju
du
_
d
=
_
f
1
()e
j
F
2
()d
= F
1
()F
2
()
Problem 5. We will make use of the fact that as the inverse Fourier transform of the delta
function is given by
T
1
[()] =
1
2
()e
jt
d =
1
2
Therefore, by uniqueness of the Fourier transform
T
_
1
2
_
= ()
We will also make use of the modulation property of the Fourier transform.
First note that f(t) =
n=
(t nT) is a periodic function with period T and therefore
has a Fourier series representation
f(t) =
n=
c
n
e
jnot
,
o
=
2
T
p
r
a
v
e
n
d
r
a
Chapter 12 40
c
n
=
1
T
_ T
2
T
2
n=
(t nT)dt =
1
T
_ T
2
T
2
(t)dt =
1
T
Therefore,
f(t) =
1
T
n=
e
jnot
= =
o
2
n=
e
jnot
=
o
n=
1
2
e
jnot
Now using the fact that T
_
1
2
_
= () and the modulation property
T
_
1
2
e
jnot
_
= ( n
o
)
F() = T [f(t)]
= T
_
n=
1
2
e
jnot
_
=
o
n=
T
_
1
2
e
jnot
_
=
o
n=
(
o
)
Problem 6.
(a).
H(z) =
n=0
2
n
z
n
=
n=0
(2
1
z
1
)
n
=
1
1 2
1
z
1
[2
1
z
1
[ < 1
=
2z
2z 1
[z[ >
1
2
(b).
H(z) =
n=0
(n
2
n)3
n
z
n
p
r
a
v
e
n
d
r
a
Chapter 12 41
=
n=0
n(n 1)3
n
z
n
= 3
2
n=0
n(n 1)(3
1
)
n2
z
n
Setting m = 2 in Example 11.9.2
H(z) =
1
9
2z
(z
1
3
)
2
(c).
H(z) =
n=0
(n2
n
+ 0.6
n
)z
n
=
n=0
n2
n
z
n
+
n=0
0.6
n
z
n
=
1
2
n=0
n(2
1
)
n1
z
n
+
n=0
0.6
n
z
n
=
1
2
z
(z
1
2
)
2
+
z
z 0.6
[z[ > 0.6
Problem 7.
(a).
y
n
= 0.6y
n1
+ 0.5x
n
+ 0.2x
n1
Y (z) = 0.6z
1
Y (z) + 0.5X(z) + 0.2z
1
X(z)
Therefore,
Y (z)(1 0.6z
1
) = (0.5 + 0.2z
1
)X(z)
and
H(z) =
Y (z)
X(z)
=
0.5 + 0.2z
1
1 0.6z
1
=
5z + 2
10z 6
(b).
H(z) =
5z + 2
10z 6
Performing long division we obtain the series
0.5 + 0.5z
1
+ 0.3z
2
+ 0.18z
3
+ 0.108z
4
+ 0.0648z
5
+
p
r
a
v
e
n
d
r
a
Chapter 12 42
At this time we can see the pattern. From the third term on the nth element of the series
is of the form 0.3(0.6)
n2
. Therefore,
h
n
=
_
.5 n = 0, 1
0.3(0.6)
n2
n > 1
Problem 8.
(a)
H(z) =
5
z 2
We have a pole outside the unit circle therefore this is the Z-transform of a left handed
sequence. Therefore, h
n
is of the form
h
0
+h
1
z +h
2
z
2
+
Using the long division method we get the series
5
2
5
4
z
5
8
z
2
5
16
z
3
Therefore,
h
n
=
_
5(2)
(n+1)
n = 0, 1, 2,
0 n = 1, 2, 3,
(b)
H(z) =
z
z
2
0.25
=
z
(z 0.5)(z + 0.5)
Lets expand this using partial fraction expansion:
H(z)
z
=
,z
,z(z 0.5)(z + 0.5)
=
A
1
z 0.5
+
A
2
z + 0.5
To nd the coecients A
1
and A
2
A
1
=
1
z + 0.5
[
z=0.5
= 1
A
2
=
1
z 0.5
[
z=0.5
= 1
Therefore,
H(z) =
z
z 0.5
z
z + 0.5
and
h
n
= 0.5
n
u[n] (0.5)
n
u[n]
p
r
a
v
e
n
d
r
a
Chapter 12 43
(c)
H(z) =
z
z 0.5
By inspection,
h
n
= 0.5
n
u[n]
p
r
a
v
e
n
d
r
a
Chapter 13 44
Chapter 13
Problem 1
[X
1
X
2
[
2
= (X
1
X
2
)
T
(X
1
X
2
)
= (A
T
1
A
T
2
)
T
(A
T
1
A
T
2
)
=
T
1
AA
T
T
1
AA
T
T
2
AA
T
1
+
T
2
AA
T
2
=
T
1
T
1
T
2
1
+
T
2
2
= [
1
2
[
2
Problem 2a.
If we transform
10 11 12 11 12 13 12 11
we obtain the coecients
32.527 -1.281 -1.307 0.450 -1.414 -0.301 0.541 0.255
Notice that the DC coecient has a rather high value while the other coecients have
relatively low values.
When we transform the vector
10 -10 8 -7 8 -8 7 -7
we obtain the coecients
0.354 4.251 0.350 5.046 2.475 8.384 1.769 20.388
This time the higher frequency coecients have larger magnitudes than the low frequency
coecients.
Concatenating the coecients we obtain the plot shown in Figure 6.
Problem 2b. If we concatenate the two vectors and take a 16 point DCT the results are
23.25 21.78 -3.92 -6.96 -0.68 6.04 -3.25 -2.57 0.75 3.16 -6.14 1.61 1.63 5.50 -14.24 13.56
The results are plotted in Figure 7
Problem 2c. Comparing the plots shown in Figures 6 and 7 we can see that we obtain
a larger number of coecients with relatively large magnitudes when we use the 16 point
DCT. This is due to the diering natures of the two vectors. As more large magnitude
coecients mean more bits required, it would be better from a compression perspective to
use two 8 points DCT rather than one 16 point DCT in this example.
p
r
a
v
e
n
d
r
a
Chapter 13 45
0 2 4 6 8 10 12 14 16
15
10
5
0
5
10
15
20
25
30
35
8
p
o
i
n
t
D
C
T
c
o
e
f
f
i
c
i
e
n
t
s
Figure 6: Plot of the 8 point coecients of the two vectors. The rst eight coecients belong
to the rst vector while the second eight coecients are the result of an 8 point DCT of the
second vector.
p
r
a
v
e
n
d
r
a
Chapter 13 46
0 2 4 6 8 10 12 14 16
15
10
5
0
5
10
15
20
25
30
35
1
6
p
o
i
n
t
D
C
T
c
o
e
f
f
i
c
i
e
n
t
s
Figure 7: Plot of the 16 point DCT coecients obtained by taking the 16 point DCT of the
concatenation of the two vectors.
p
r
a
v
e
n
d
r
a
Chapter 13 47
Problem 3
a) By rows:
_
_
10 2 4 0
7 1 3 1
5 1 1 1
4 0 0 0
_
_
Then by columns:
_
_
26 4 8 2
4 2 2 0
8 2 6 0
2 0 0 2
_
_
b) By columns rst:
_
_
10 7 5 4
2 1 1 0
4 3 1 0
0 1 1 0
_
_
Then by rows:
_
_
26 4 8 2
4 2 2 0
8 2 6 0
2 0 0 2
_
_
c) Results of a) and b) are identical.
p
r
a
v
e
n
d
r
a
Chapter 14 48
Chapter 14
Problem 1 The impulse response h
n
of a system is the output when the input is
n
where
n
=
_
1 n = 0
0 otherwise
By the second property if the input to the system is a
n
then the output is y
n
= h
n
.
Lets write this as
n
h
n
n
+x
1
n1
+x
2
n2
+
Using both properties we can see that
x
0
n
x
0
h
n
x
1
n1
x
1
h
n1
x
2
n2
x
2
h
n2
.
.
.
.
.
.
x
M
nM
x
M
h
nM
.
.
.
.
.
.
Adding the left side we obtain the input sequence. By the second property the corresponding
output is the sum of the right side or
y
n
=
x
k
h
nk
Problem 2.
(a) Lets use a very simple impulse response:
h
1,0
=
1
2
, h
1,1
=
1
2
, h
1,2
=
1
2
, h
1,3
=
1
2
This satises the requirement that [h
1,j
[ = [h
1,k
[. Furthermore,
3
i=0
h
2
1,i
= 4
1
4
= 1
and
3
i=0
h
1,i
h
1,i+2
= h
1,0
h
1,2
+h
1,1
h
1,3
=
1
4
1
4
= 0
and the orthonormality requirement is satised.
p
r
a
v
e
n
d
r
a
Chapter 14 49
(b) The magnitude and phase response of this lter are plotted in Figure 8. It is not a very
good lter.
(c) Using Equation (13.23) we obtain the following coecients for the high pass lter:
h
2,0
=
1
2
, h
2,1
=
1
2
, h
1,2
=
1
2
, h
1,3
=
1
2
(d) The magnitude and phase response of th high pass lter are plotted in Figure 9.
Problem 3.
x
0
x
1
x
2
x
3
x
4
x
5
x
6
x
7
x
8
x
9
x
10
1 -1 1 -1 1 -1 1 -1 1 -1 1
(a)
y
n
= h
0
x
n
+h
1
x
n1
=
1
2
x
n
+
1
2
x
n1
y
0
=
1
2
1 +
1
2
0 =
1
2
y
1
=
1
2
(1) +
1
2
1 = 0
y
2
=
1
2
1 +
1
2
(1) = 0
y
3
=
1
2
(1) +
1
2
1 = 0
.
.
.
.
.
.
Or
y
n
=
_
1
2
n = 0
0 n > 0
(b)
w
n
= h
0
x
n
+h
1
x
n1
=
1
2
x
n
2
x
n1
w
0
=
1
2
1
1
2
0 =
1
2
p
r
a
v
e
n
d
r
a
Chapter 14 50
w
1
=
1
2
(1)
1
2
1 =
2
w
2
=
1
2
1
1
2
(1) =
2
w
3
=
1
2
(1)
1
2
1 =
2
.
.
.
.
.
.
Or
w
n
=
_
1
2
n = 0
2(1)
n
n > 0
(c) The lter response in part (a) corresponds to a low pass lter and the lter response in
part (b) corresponds to a high pass lter. After the initial transient the output of the low
pass lter is zero while the output of the high pass lter is an amplied version of the input.
Thus the input is a high pass signal.
Problem 4.
x
0
x
1
x
2
x
3
x
4
x
5
x
6
x
7
x
8
x
9
x
10
1 1 1 1 1 1 1 1 1 1 1
(a)
y
n
= h
0
x
n
+h
1
x
n1
=
1
2
x
n
+
1
2
x
n1
y
0
=
1
2
1 +
1
2
0 =
1
2
y
1
=
1
2
1 +
1
2
1 =
2
y
2
=
1
2
1 +
1
2
1 =
2
y
3
=
1
2
1 +
1
2
1 =
2
.
.
.
.
.
.
Or
y
n
=
_
1
2
n = 0
2 n > 0
p
r
a
v
e
n
d
r
a
Chapter 14 51
(b)
w
n
= h
0
x
n
+h
1
x
n1
=
1
2
x
n
2
x
n1
w
0
=
1
2
1
1
2
0 =
1
2
w
1
=
1
2
1
1
2
1 = 0
w
2
=
1
2
1
1
2
1 = 0
w
3
=
1
2
1
1
2
1 = 0
.
.
.
.
.
.
Or
w
n
=
_
1
2
n = 0
0 n > 0
(c) After the initial transient the output of the high pass lter is zero while the output of
the low pass lter is an amplied version of the input. Thus the input is a low pass signal.
p
r
a
v
e
n
d
r
a
Chapter 14 52
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
400
300
200
100
0
Normalized Frequency ( rad/sample)
P
h
a
s
e
(
d
e
g
r
e
e
s
)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
8
6
4
2
0
2
4
Normalized Frequency ( rad/sample)
M
a
g
n
i
t
u
d
e
(
d
B
)
Figure 8: Magnitude and phase response of a lter with impulse response 0.5,0.5,0.5,-0.5.
p
r
a
v
e
n
d
r
a
Chapter 14 53
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
50
100
150
200
Normalized Frequency ( rad/sample)
P
h
a
s
e
(
d
e
g
r
e
e
s
)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
8
6
4
2
0
2
4
Normalized Frequency ( rad/sample)
M
a
g
n
i
t
u
d
e
(
d
B
)
Figure 9: Magnitude and phase response of a lter with impulse response -0.5,-0.5,0.5,-0.5.
p
r
a
v
e
n
d
r
a
Chapter 15 54
Chapter 15
Problem 1
(a)
f(t) = sin(2t) =
e
j2t
e
j2t
2j
The Fourier transform is given by
F() = T
_
e
j2t
e
j2t
2j
_
=
1
2j
T
_
e
j2t
_
1
2j
T
_
e
j2t
_
by linearity
=
1
2j
[( 2) ( + 2)]
(b)
f
1
(t) =
_
sin(2t) 2 t 2
0 otherwise
F
1
() =
_
2
2
sin(2t)e
jt
dt
=
_
2
2
_
e
j2t
e
j2t
2j
_
e
jt
dt
=
1
2j
__
2
2
e
j(w2)t
dt
_
2
2
e
j(w+2)t
dt
_
=
2
j
_
sin(2( 2))
2( 2)
sin(2( + 2))
2( + 2)
_
(c)
f
2
(t) =
_
(1 + cos(
2
t)) sin(2t) 2 t 2
0 otherwise
F
2
() =
_
2
2
(1 + cos(
2
t)) sin(2t)e
jt
dt
=
_
2
2
sin(2t)e
jt
dt +
_
2
2
cos(
2
t) sin(2t)e
jt
dt
The rst integral is identical to part (b). Evaluating the second integral we obtain
1
j
_
sin(2(w
2
2))
2(w
2
2)
sin(2(w
2
+ 2))
2(w
2
+ 2)
+
sin(2(w +
2
2))
2(w +
2
2)
sin(2(w +
2
+ 2))
2(w +
2
+ 2)
_
p
r
a
v
e
n
d
r
a
Chapter 15 55
(d) The magnitudes of F(), F
1
(), and F
2
() are plotted in Figure 10, Figure 11 and
Figure 12.
While both short term Fourier transforms broaden out the peak, the use of the rectangular
window introduces a number of extraneous peaks of signicant size. The use of the raised
cosine window considerably reduces the size of these extraneous peaks.
Problem 2.
f(t) =
_
1 + sin(2t) 0 t 1
sin(2t) otherwise
(t) =
_
1 0 t <
1
2
1
1
2
t < 1
c
j,k
=
_
f(t)
j,k
(t)dt
and
j,k
(t) = 2
j/2
(2
j
t k)
c
0,0
=
_
1
0
f(t)(t)dt
=
_ 1
2
0
(1 + sin(2t)
_
1
1
2
(1 + sin(2t))dt
=
1
2
[cos(0) + 2 cos(1) cos(2)]
c
0,1
=
_
2
1
f(t)(t 1)dt
=
_ 3
2
1
sin(2t)dt
_
2
3
2
sin(2t))dt
=
1
2
[cos(2) + 2 cos(3) cos(4)]
c
0,2
=
_
3
2
f(t)(t 2)dt
=
_ 5
2
2
sin(2t)dt
_
3
5
2
sin(2t))dt
=
1
2
[cos(4) + 2 cos(5) cos(6)]
We can see a pattern here:
p
r
a
v
e
n
d
r
a
Chapter 15 56
c
0,k
=
1
2
[cos(2k) + 2 cos(2k + 1) cos(2k + 2)]
To nd c
1,k
we use
c
1,k
=
2
_
(2t k)f(t)dt
So
c
1,0
=
2
_ 1
4
0
(1 + sin(2t))dt
2
_ 1
2
1
4
(1 + sin(2t))dt
=
2
2
_
cos(0) + 2 cos(
1
2
cos(1)
_
c
1,1
=
2
_ 3
4
1
2
(1 + sin(2t))dt
2
_
1
3
4
(1 + sin(2t))dt
=
2
2
_
cos(1) + 2 cos(
3
2
cos(2)
_
c
1,2
=
2
_ 5
4
1
sin(2t)dt
2
_ 3
2
5
4
sin(2t)dt
=
2
2
_
cos(2) + 2 cos(
5
2
cos(3)
_
Again, we can see the pattern:
c
1,k
=
2
2
_
cos(k) + cos(
2k + 1
2
) cos(k + 1)
_
Continuing for c
2,k
we nd that
c
2,k
=
2
2
_
cos(
k
2
) + cos(
2k + 1
4
) cos(
k + 1
2
)
_
Looking at the expressions for c
0,k
, c
1,k
and c
2,k
we can see a common pattern:
c
j,k
=
2
j
2
2
_
cos(
2k
2
j
) + 2 cos(
2k + 1
2
j
) cos(
2k + 2
2
j
)
_
Problem 3. We assume the following:
p
r
a
v
e
n
d
r
a
Chapter 15 57
We have a bit budget of 30 bits.
We can send the initial threshold value T
o
separately without eecting the bit budget.
We use the following codes
Zerotree root zr 00
Signicant positive sp 11
Signicant negative sn 01
Isolated zero iz 10
21 6 15 12
-6 3 6 3
3 -3 0 -3
3 0 0 0
T
0
= 16
Dominant Pass:
21 sp [11]
6 zr [00]
6 zr [00]
3 zr [00]
L
s
= 21
Renement Pass:
21 24 = 3 Correction term = 4 [0]
Second Pass:
T
0
= 8
Dominant Pass:
6 iz [10]
6 zr [00]
3 zr [00]
15 sp [11]
12 sp [11]
6 iz [10]
3 iz [10]
L
s
= 21, 15, 12
p
r
a
v
e
n
d
r
a
Chapter 15 58
Renement Pass:
21 20 = 1 Correction term = 2 [1]
15 12 = 3 Correction term = 2 [1]
12 12 = 0 Correction term = 2 [0]
Third Pass:
Pass:
T
0
= 4
Dominant Pass:
6 sp [11]
6 sn [01]
And we have used up thirty bits.
The transmitted bitstream is
110000000100000111110101101101
(b)
The received bitstream is
110000000100000111110101101101
and we begin with knowledge of the initial threshold and size of the image. For sake reference
lets represent the image as
a b e f
c d g h
i j m n
k l o p
T
o
= 16 and the rst codeword is 11 or sp. Therefore
a = 24
The next three codewords are 00 corresponding to a zerotree root. Therefore,
b = c = d = e = f = g = h = i = j = k = l = m = n = o = p = 0
There are no tree roots that are signicant so this is the end of the rst dominant pass. At
the end of this pass L
s
= a. In the renement pass we get a 0 corresponding to a negative
correction for a. Therefore,
a = 24 4 = 20
p
r
a
v
e
n
d
r
a
Chapter 15 59
The next bits are from the second dominant pass.
T
o
= 8 and 10 means an isolated zero. Thus b < T
o
but some of the descendants of b are
greater than T
o
.
The next codeword is 00 therefore, c is a zerotree root.
The next codeword is 00 therefore, d is a zerotree root.
As b was an isolated zero the next bits correspond to its descendants.
11 means e is signicant, therefore, e = 12
11 means f is signicant, therefore, f = 12
10 means g is insignicant, therefore, g = 0
10 means h is insignicant, therefore, h = 0
The signicance list now becomes L
s
= a, e, f
1 means a positive correction, therefore, a = 20 + 2 = 22.
1 means a positive correction, therefore, e = 12 + 2 = 14.
0 means a negative correction, therefore, f = 12 2 = 10.
Now we start the third dominant pass with T
o
= 4.
11 means b is signicant, therefore, b = 6
01 means c is signicant negative, therefore, c = 6.
and we have reached the end of the received bitstream.
The reconstructed image is as follows
22 6 14 10
-6 0 0 0
0 0 0 0
0 0 0 0
Problem 4. We assume the following:
We have a bit budget of 30 bits.
We can send the initial value of n separately without eecting the bit budget.
21 6 15 12
-6 3 6 3
3 -3 0 -3
3 0 0 0
p
r
a
v
e
n
d
r
a
Chapter 15 60
First Pass n = 4
LIP : (0, 0), (0, 1), (1, 0), (1, 1)
LIS : (0, 1)T, (1, 0)T, (1, 1)T
LSP :
First examine the contents of LIP.
(0, 0) 21 [21[ 16 Transmit 11 and move to LSP
(0, 1) 6 [6[ < 16 Transmit 0
(1, 0) 6 [ 6[ < 16 Transmit 0
(1, 1) 3 [3[ < 16 Transmit 0
Now examine the contents of LIS
(0, 1)Tis not signicant Transmit 0
(1, 0)Tis not signicant Transmit 0
(1, 1)Tis not signicant Transmit 0
LSP is empty.
Transmitted bits from the rst pass:
11000000
Second Pass n = 3
LIP : (0, 1), (1, 0), (1, 1)
LIS : (0, 1)T, (1, 0)T, (1, 1)T
LSP : (0, 0)
First examine the contents of LIP.
(0, 0) 21 [21[ 16 Transmit 11 and move to LSP
(0, 1) 6 [6[ < 8 Transmit 0
(1, 0) 6 [ 6[ < 8 Transmit 0
(1, 1) 3 [3[ < 8 Transmit 0
p
r
a
v
e
n
d
r
a
Chapter 15 61
Now examine the contents of LIS
(0, 1)Tis signicant Transmit 1
(0, 2) 15 [15[ 8 Transmit 11 and move to LSP
(0, 3) 12 [12[ 8 Transmit 11 and move to LSP
(1, 2) 6 [6[ < 8 Transmit 0 and move to LIP
(1, 3) 3 [3[ < 8 Transmit 0 and move to LIP
(1, 0)Tis not signicant Transmit 0
(1, 1)Tis not signicant Transmit 0
Finally, for the second pass, examine the contents of LSP
(0, 0) 21 n = 3 Transmit 0
Transmitted bits in the second pass.
0001111100000
Third Pass n = 2
LIP : (0, 1), (1, 0), (1, 1), (1, 2), (1, 3)
LIS : (1, 0)T, (1, 1)T
LSP : (0, 0), (0, 2), (0, 3)
First examine the contents of LIP.
(0, 1) 6 [6[ 4 Transmit 11 and move to LSP
(1, 0) 6 [ 6[ 4 Transmit 10 and move toLSP
(1, 1) 3 [3[ < 4 Transmit 0
(1, 2) 6 [6[ 4 Transmit 11 and move to LSP
(1, 3) 3 [3[ < 4 Transmit 0
Now examine the contents of LIS
(1, 0)Tis not signicant Transmit 0
And we have used up the thirty bits.
p
r
a
v
e
n
d
r
a
Chapter 15 62
The transmitted bits are
110000000001111100000111001100
(b)
The received bits are
110000000001111100000111001100
Begin with n = 4.
LIP : (0, 0), (0, 1), (1, 0), (1, 1)
LIS : (0, 1)T, (1, 0)T, (1, 1)T
LSP :
First LIP
11 (0, 0) 16, move to LSP
0 (0, 1) 0
0 (1, 0) 0
0 (1, 1) 0
Then to LIS
0 (0, 1)T is insignicant
0 (1, 0)T is insignicant
0 (1, 1)T is insignicant
LSP is empty.
Second pass, n = 3.
LIP : (0, 1), (1, 0), (1, 1)
LIS : (0, 1)T, (1, 0)T, (1, 1)T
LSP : (0, 0)
Begin with LIP
0 (0, 1) 0
0 (1, 0) 0
0 (1, 1) 0
p
r
a
v
e
n
d
r
a
Chapter 15 63
Then to LIS
1 (0, 1)T is signicant
11 (0, 2) 8 move to LSP
11 (0, 3) 8 move to LSP
0 (0, 2) 0 move to LIP
0 (0, 2) 0 move to LIP
0 (1, 0)T is insignicant
0 (1, 1)T is insignicant
(11)
On to LSP.
0 (0, 0) 16
Third pass, n = 2.
LIP : (0, 1), (1, 0), (1, 1), (1, 2), (1, 3)
LIS : (1, 0)T, (1, 1)T
LSP : (0, 0), (0, 2), (0, 3)
Begin with LIP
11 (0, 1) 4 move to LSP
10 (1, 0) 4 move to LSP
0 (0, 1) 0
11 (1, 2) 4 move to LSP
0 (1, 3) 0
Now to LIS
0 (1, 0)T is not signicant
We have reached the end of transmission. The reconstructed image is
16 4 8 8
-4 0 4 0
0 0 0 0
0 0 0 0
p
r
a
v
e
n
d
r
a
Chapter 15 64
8 6 4 2 0 2 4 6 8
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
|
F
(
w
)
|
w
Figure 10: Magnitude of the Fourier transform of the function sin(2t).
p
r
a
v
e
n
d
r
a
Chapter 15 65
8 6 4 2 0 2 4 6 8
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
|
F
1
(
w
)
|
w
Figure 11: Magnitude of the short term Fourier transform of the function sin(2t) with a
rectangular window.
p
r
a
v
e
n
d
r
a
Chapter 15 66
8 6 4 2 0 2 4 6 8
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
|
F
2
(
w
)
|
w
Figure 12: Magnitude of the short term Fourier transform of the function sin(2t) with a
raised cosine window.