18-793 Image and Video Processing
Submission instructions.
Fall 2020
• Submissions are due on Thursday 10/15 at 10.00pm ET
• Please upload scans of your solution in GradeScope (via Canvas)
fined as
N−1 π 1 d[k]=2x[m]cos Nk m+2 .
Homework 6
Instructions
• Please solve all non-MATLAB problems using only paper and pen, without resorting to
a computer.
• Please show all necessary steps to get the final answer. However, there is no need to be overly elaborate. Crisp and complete answers.
• For all MATLAB problems, include all code written to generate solutions.
• Please post all questions on the discussion board on the Piazza course website.
• If you feel some information is missing, you are welcome to make reasonable assumptions and proceed. Sometimes the omissions are intentional. Needless to say, only reasonable assumptions will be accepted.
1. (Inverse DCT-II) The DCT-II transform takes a selection of N numbers {x[0], x[1], . . . , x[N − 1]} to produce N DCT-II coefficients {d[0], d[1], . . . , d[N − 1]}, de-
m=0
Derive the expressions for the inverse DCT-II transform that takes as input
{d[0],…,d[N −1]} and outputs the signal {x[0],…,x[N −1]}. Hint: Reverse the steps taken in class to derive the DCT2.
2. Let x[n] be a N0-length DT signal. Let d[k] be its DCT-II transform defined as
N0−1 πk 1 d[k]=2x[n]cos N n+2 .
n=0 0 Derive an expression for the energy of x[n]
N0 −1
|x[n]|2 n=0
in terms of its DCT-II coefficients d[k].
2 3.
Homework 6
We are going to explore effectiveness of DFT and DCT for simple signals. (Part a) Consider the signals x1 and x2 defined as follows.
n = linspace(0, 0.999, 1000);
x1 = cos(2*pi*10*n);
x2 = cos(2*pi*10.45*n);
stem(n, x);
Compute the DFT of the signals x1 and x2.
Suppose you are allowed to retain K coefficients in the transform domain, you will pick the
largest coefficients by magnitude. Once you do that you can use inverse DFT to compute
an approximation x1K of the signal x1 (and similarly for x2). You can measure error in
SNR as
∥x∥2 e(K) = 20 log10 ∥x − xK ∥2
Deliverable: Plot e(K) as a function of K for both signals. (as usual, your code needs to be submitted). Explain why you see such a different profile in e(K) for the two signals.
(Part b) Repeat Part a using the DCT instead of the DFT.
Problems below wont be graded. We wont release solutions as well. We are happy to verify yours, if you post on piazza, and discuss them
4. (DCT of a slightly modified signal) Suppose that the signal x = {x[0], . . . , x[n], . . . , x[N − 1]} has DCT-II coefficients d = {d[0], . . . , d[k], . . . , d[N − 1]}.
Let
that is, x[n] = x[N − 1 − n].
x = {x[N − 1], x[N − 2], …, x[1], x[0]} , Compute the DCT-II coefficients of x in terms of d.
5. We will study a different approach to derive DCT-II in this problem.
Let x[n], n = 0, . . . , N − 1 be a N -length signal and let d[k] be its DCT-II coefficients. Lets construct a new signal y[n], of length 2N such that
x[n] 0 ≤ n < N y[n]= x[2N−1−n] N≤n<2N
Let Y [k] be the 2N-length DFT of y[n], given as Y [k] = 2N−1 y[n]e−j2πkn/(2N). n=0
(Part a) Relate Y [k] to d[k].
(Part b) Derive expressions to invert the DCT-II coefficients using Y [k] as an intermedi- ary.