$30
EE3660 Intro. to Digital Signal Processing
Homework Assignment #4: Chap. 7
I Paper Assignment (50%)
1. (10%) Determine DFS coefficients of the following periodic sequences:
(a) π₯π₯οΏ½[ππ] = 2 cos(ππππ/4)
(b) π₯π₯οΏ½[ππ] = 3 sin(0.25ππππ) + 4cos(0.75ππππ)
2. (10%) Let x[n] be an N-point sequence with an N-point DFT X[k].
(a) If N is even and if x[n] = −x[〈ππ + ππ/2〉ππ] for all n, then show that X[k] = 0 for even k.
(b) Show that if N=4m where m is an integer and if x[n] = −x[〈ππ + ππ/4〉ππ] for all n, then
X[k]=0 for k = 4l , 0 ≤ l ≤ ππ
4 − 1
3. (12%) Let π₯π₯1[n],0 ≤ n ≤ ππ1 − 1, be an ππ1-point sequence and let π₯π₯2[n], 0 ≤ n ≤ ππ2 − 1, be
an ππ2 -point sequence. Let π₯π₯3[n] = π₯π₯1[n] ∗ π₯π₯2[n] and let π₯π₯4[n] = π₯π₯1[n]AβN π₯π₯2[n] , N ≥
max(ππ1, ππ2)
(a) Show that
π₯π₯4[n] = ∑ π₯π₯3 ∞ [n + ππN] ππ=−∞ (7.209)
(b) Let e[n] = π₯π₯4[n] − π₯π₯3[n], show that
e[n] = οΏ½
π₯π₯3[n + N], max(ππ1, ππ2) ≤ ππ < πΏπΏ
0, ππ ≥ πΏπΏ
where L = ππ1 + ππ2 − 1
(c) Verify the results in (a) and (b) for π₯π₯1 = {1ππ=0, 2,3,4}, π₯π₯2 = {4ππ=0, 3,2,1}, and N=5 and N=8
4. (8%) Let π₯π₯οΏ½[ππ] be a periodic sequence with fundamental period N and let πποΏ½[ππ] be its DFS. Let
π₯π₯οΏ½3[ππ] be periodic with period 3N consisting of three periods of π₯π₯οΏ½[ππ] and let οΏ½ππ3[ππ] be its DFS.
Determine οΏ½ππ3[ππ] in terms of πποΏ½[ππ].
5. (10%) The first five values of the 9-point DFT of a real-valued sequence x[n] are given by
{4, 2 − ππ3,3 + ππ2, −4 + ππ6,8 − ππ7}
Without computing IDFT and then DFT but using DFT properties only, determine the
DFT of each of the following sequences:
(a) π₯π₯1[n] = x[〈ππ + 2〉9]
(b) π₯π₯2[n] = 2x[〈2 − ππ〉9]
(c) π₯π₯3[n] = x[n]Aβ9 x[〈−ππ〉9]
(d) π₯π₯4[n] = x2[ππ]
(e) π₯π₯5[n] = x[ππ]e−j4πn/9
II Program Assignment (50%)
1. (8%) Let x[n] = n(0.9)πππ’π’[ππ],
(a) Determine the DTFT πποΏ½(ππππππ) of x[n]. Please write your calculations and answer on
your .mlx file.
(b) Choose first N = 20 samples of x[n] and compute the approximate DTFT πποΏ½ππ(ππππππ) using
the fft function. Plot magnitudes of πποΏ½(ππππππ) and πποΏ½ππ(ππππππ) in one plot and compare your
results.
(c) Repeat part (b) using N = 50.
(d) Repeat part (b) using N = 100.
2. (10%)Let x[n] = π₯π₯1[n] + πππ₯π₯2[n] where sequences π₯π₯1[n] and π₯π₯2[n] are real-valued.
(a) Show that ππ1[k] = ππππππππ[ππ] ππππππ ππππ2[k] = ππππππππ[ππ]. Please write your calculations and
answer on your .mlx file.
(b) Write a MATLAB function
[X1,X2] = tworealDFTs(x1,x2)
that implements the results in part (a).
(c) Verify your function on the following two sequences: π₯π₯1[n] = 0.9ππ, π₯π₯2[n] = (1 − 0.8ππ);
0 ≤ n ≤ 49
3. (9%) Let π₯π₯1[n] = {1ππ=0, 2,3,4,5} be a 5-point sequence and let π₯π₯2[n] = {2ππ=0, −1,1, −1} be a
4-point sequence.
(a) Determine π₯π₯1[n]Aβ5 π₯π₯2[n] using hand calculations. Please write your calculations and
answer on your .mlx file.
(b) Verify your calculations in (a) using the circonv function.
(c) Verify your calculations in (a) by computing the DFTs and IDFT.
4. (8%) Let π₯π₯1[n] be an ππ1-point and π₯π₯2[n] be an ππ2-point sequence. Let N ≥ max(N1,N2). Their
N-point circular convolution is shown to be equal to the aliased version of their linear convolution
in (7.209) in Program Assignment 3. This result can be used to compute the circular convolution
via the linear convolution.
(a) Develop a MATLAB function
y = lin2circonv(x,h)
that implements this approach.
(b) For x[n] = {1ππ=0, 2,3,4} and h[n] = {1ππ=0, −1,1, −1} determine their 4-point circular
convolution using the lin2circonv function and verify using the circonv function.
5. (15%) Let a 2D filter impulse response h[m, n] be given by
h[m,n] = οΏ½
1
2ππππ2 ππ− ππ2+ππ2
2ππ2 , −128 ≤ m, n ≤ 127
0 , ππππβππππππππππππ
where σ is a parameter. For this problem use the “Lena” image.
(a) For σ = 4, determine h[m, n] and compute its 2D-DFT H[k, l] via the fft2 function taking
care of shifting the origin of the array from the middle to the beginning (using the ifftshift
function). Show the log-magnitude of H[k, l] as an image.
(b) Process the “Lena” image in the frequency domain using the above H[k, l]. This will involve
taking 2D-DFT of the image, multiplying the two DFTs and then taking the inverse of the
product. Comment on the visual quality of the resulting filtered image.
(c) Repeat (a) and (b) for σ = 32 and comment on the resulting filtered image as well as the
difference between the two filtered images.
(d) The filtered image in part (c) also suffers from an additional distortion due to a spatialdomain aliasing effect in the circular convolution. To eliminate this artifact, consider both
the image and the filter h[m, n] as 512 × 512 size images using zero-padding in each
dimension. Now perform the frequency-domain filtering and comment on the resulting
filtered image.
(e) Repeat part (b) for σ = 4 but now using the frequency response 1 − H[k, l] for the filtering.
Compare the resulting filtered image with that in (b).