| CS225 | September 23, 2008 |
| Youssef |
Problem 1: (20 points)
Consider an array x[0..n-1] of ascii characters. The Burrows-Wheeler Transform (BWT) of x works as follows:
a) Apply BWT on the string ``baccaccb'', and also on the string ``the style of the cable'', where the blank character ' ' is less than any alphabetic character. Note that you can use Matlab ``sortrows'' command to sort the rows of A.
b) Give a general algorithm that constructs B from (y,L).
c) Give an algorithm to reconstruct x from (y,L) using the algorithm in (b).
d) illustrate how the reconstruction algorithm works on the (y,L) produced in part (a) for ``baccaccb''.
Problem 2: (20 points)
Let
and
be two vectors of 32 components each where
(k)=(k3+k)/2, and
(k) = cos (k pi/32),
for k=0,1,...,31.
a)
Compute the Fourier transform
of
and
of
.
b) Compute the absolute values |
| and |
|
(i.e., magnitudes) of
and
(that is, |
(k)| and |
(k)| for all k).
c)
Identify the 17 smallest values in |
|
and the 17 smallest values in |
|.
d)
Let
be derived from
by replacing each of the 17 smallest
elements of
by 0, and leaving the other elements intact. Define
similarly. Define by
the inverse Fourier transform of
,
and
the inverse Fourier transform of
. Compute
and
.
e) Plot
and
in one figure, and
and
in another figure.
Problem 3: (20 points)
Let
and
be as in Problem 2. Let
be the DCT of
, and
the DCT of
. Let
be derived from
by replacing the last 17
elements of
by zeros while keeping the first 15 elements the same,
and define
similarly from
. Finally, let
be
the inverse DCT of
, and
the inverse DCT of
.
a) Compute
,
,
, and
.
b) Plot
and
in one figure, and
and
in another figure.
Problem 4: (20 points)
a) Same as Problem 2 with 3 exceptions:
(1) the transform is Haar,
(2)
is derived from
by zeroing
out the 17 smallest-magnitude elements of
,
and (3)
is derived from
by zeroing
out the 17 smallest-magnitude elements of
.
b) Same problem as (a) except that the Transform is the Walsh-Hadamard transform. Use the Matlab ``hadamard'' command to generate the Hadamard matrix.
Problem 5: (25 points)
a) Put in one figure the plots of
and the 4
's
of the last three problems.
b) For each of the four
's, compute the mean square
error relative to
.
c) Which of the four
's is the best reconstruction
of
?
d) Repeat (a), (b) and (c) for
and its four
's.