3_HW3Solutions

# 3_HW3Solutions - EE 211A Fall Quarter 2011 Instructor John Villasenor Digital Image Processing I Handout 12 Homework 3 Solutions Textbook problems

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EE 211A Fall Quarter, 2011 Instructor: John Villasenor Digital Image Processing I Handout 12 Homework 3 Solutions Textbook problems: 4.3 The spectrum of 4 cos 2π 2 x has delta functions of strength 2 at u = ± 2 and is described by F (u, v) = 2δ (u ± 2, v) : v u 1 The spectrum of cos 2π 3 y is described by F (u, v) = δ (u, v ± 3) : 2 v u The spectrum of the product 4 cos 2π 2 x cos 2π 3 y is the convolution of the spectra above and is described by F (u, v) = δ (u ± 2, v ± 3) : v u 1 Reconstruction cases: (1) Sampling at Δx = Δy = 0.5 is a sampling frequency of 2, so the spectrum F (u, v) will be replicated at intervals of 2, 2 in u, v. The reconstruction filter will only let through those frequencies with |u|, |v| ≤ 1. This gives a spectrum for the reconstructed signal: v u Thus, (2) ~ f ( x, y ) = 8 cos 2πy. Sampling at Δx = Δy = 0.2 ⇒ Fs = 5, cutoff for reconstruction is Fc = ±2.5. This gives a reconstructed spectrum: v u Stated in another way, F (u, v) = δ (u − 2, v − 2) + δ (u + 2, v − 2) + δ (u − 2, v + 2) + δ (u + 2, v + 2) ~ f ( x, y ) = 2 cos 2π (2 x + 2 y ) + 2 cos 2π (2 x − 2 y ) = 4 cos 4πx cos 4πy 4.9 We know, from p.85, that comb ( x, y, Δx, Δy ) = ∑m ∑n δ ( x − mΔx, y − nΔy ) ⎛ྎ 11 1 1 ⎞ྏ 1 1 comb ⎜ྎ u , v, , ⎟ྏ = ⎜ྎ Δx Δ y Δx Δy ⎟ྏ Δx Δy ⎝ྎ ⎠ྏ The function whose transform we want is: has Fourier Transform ⎛ྎ k l ⎞ྏ ∑ ∑ δ ⎜ྎ u − Δx , v − Δy ⎟ྏ . ⎜ྎ ⎟ྏ k l ⎝ྎ ⎠ྏ g ( x, y) = ∑m ∑n δ ( x − 2m, y − 2n) + ∑m ∑n δ ( x − 2m − 1, y − 2n − 1) = g1 ( x, y ) + g 2 ( x, y) 2 1 k l ⎞ྏ ⎛ྎ ∑k ∑l δ ⎜ྎ u − 2 , v − 2 ⎟ྏ = G1 (u, v) 4 ⎝ྎ ⎠ྏ g 2 ( x, y) = g1 ( x − 1, y − 1) 1 k l ⎞ྏ ⎛ྎ g1 ( x − 1, y − 1) ↔ e − j 2π (u +v ) ∑k ∑l δ ⎜ྎ u − , v − ⎟ྏ 4 2 2 ⎠ྏ ⎝ྎ g 1 ( x, y ) ↔ ⎛ྎ k l ⎞ྏ − j 2π ⎜ྎ + ⎟ྏ 1 k l ⎞ྏ ⎛ྎ = ∑k ∑l e ⎝ྎ 2 2 ⎠ྏδ ⎜ྎ u − , v − ⎟ྏ = G2 (u, v) 4 2 2 ⎠ྏ ⎝ྎ −j 2π ( k +l ) When k + l is odd, then e 2 = −1. In this case, G2 (u, v) = −G1 (u, v) and the sum G1 + G2 = 0. When k + l is even, e − jπ ( k +l ) = 1, G2 = G1 , and G1 + G2 = 2G1 . ⇒ G (u, v) = 1 ∑ 2 k +l ⎛ྎ even k l ⎞ྏ ∑ δ ⎜ྎ u − 2 , v − 2 ⎟ྏ ⎝ྎ ⎠ྏ Note that this result can be verified intuitively since g ( x, y ) is a rectangular grid with o 2 and a rotation of 45 . Its transformation is, as expected, a rectangular 1 grid at 45o with spacing . 2 spacing 1. The matrices associated with the functions h(m, n) and x ʹȃ(m, n) are: ⎡ྎ2 0 0⎤ྏ ⎡ྎ 1 1 ⎤ྏ h = ⎢ྎ0 1 0⎥ྏ , x ʹȃ = ⎢ྎ ⎥ྏ . ⎢ྎ ⎥ྏ ⎣ྏ− 1 − 1⎦ྏ ⎢ྎ1 − 1 1⎥ྏ ⎣ྏ ⎦ྏ a. The column vector X is then ⎡ྎ 1 ⎤ྏ ⎢ྎ −1⎥ྏ ⎡ྎ X ⎤ྏ ⎢ྎ ⎥ྏ = ⎢ྎ 0 ⎥ྏ . ⎢ྎ 1 ⎥ྏ ⎢ྎ X 1 ⎥ྏ ⎢ྎ ⎥ྏ ⎣ྏ ⎦ྏ ⎣ྏ −1⎦ྏ b. Since h has 3 columns, there are 3 matrices H n , each with 2 columns (since x ʹȃ has 2 rows) and 4 rows (since y has 3 + 2 – 1 = 4 rows) 3 ⎡ྎ2 ⎢ྎ0 H 0 = ⎢ྎ ⎢ྎ1 ⎢ྎ ⎣ྏ0 0⎤ྏ 0 ⎤ྏ ⎡ྎ 0 ⎡ྎ0 ⎥ྏ ⎢ྎ 1 ⎥ྏ ⎢ྎ0 2⎥ྏ 0 ⎥ྏ , H 1 = ⎢ྎ , H 2 = ⎢ྎ ⎢ྎ− 1 1 ⎥ྏ ⎢ྎ1 0⎥ྏ ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ 1 ⎦ྏ ⎣ྏ 0 − 1⎦ྏ ⎣ྏ0 0⎤ྏ 0⎥ྏ ⎥ྏ . 0⎥ྏ ⎥ྏ 1 ⎦ྏ c. The output y will have 4 columns, therefore ⎡ྎ y 0 ⎤ྏ ⎡ྎ H [0] ⎤ྏ ⎢ྎ ⎥ྏ ⎢ྎ 0 ⎥ྏ ⎢ྎ y1 ⎥ྏ ⎢ྎ H 1 H 0 ⎥ྏ ⎡ྎ X 0 ⎤ྏ . ⎢ྎ y ⎥ྏ = ⎢ྎ H H 1 ⎥ྏ ⎢ྎ X 1 ⎥ྏ ⎣ྏ ⎦ྏ ⎢ྎ 2 ⎥ྏ ⎢ྎ 2 ⎥ྏ ⎢ྎ y ⎥ྏ ⎣ྏ[0] H 2 ⎦ྏ ⎣ྏ 3 ⎦ྏ d. ⎡ྎ 2 0 ⎢ྎ 0 2 ⎢ྎ ⎢ྎ 1 0 ⎢ྎ ⎢ྎ 0 1 ⎢ྎ 0 0 ⎢ྎ 0 ⎢ྎ 1 ⎢ྎ− 1 1 ⎢ྎ ⎢ྎ 0 − 1 Hx = ⎢ྎ 0 0 ⎢ྎ ⎢ྎ 0 0 ⎢ྎ 0 ⎢ྎ 1 ⎢ྎ 0 1 ⎢ྎ 0 ⎢ྎ 0 ⎢ྎ 0 0 ⎢ 0 ⎢ྎ 0 ⎢ྎ 0 0 ⎣ྏ 0 0 ⎤ྏ 0 0 ⎥ྏ ⎥ྏ 0 0 ⎥ྏ ⎥ྏ 0 0 ⎥ྏ 2 0 ⎥ྏ ⎥ྏ 0 2 ⎥ྏ 1 0 ⎥ྏ ⎥ྏ 0 1 ⎥ྏ 0 0 ⎥ྏ ⎥ྏ 1 0 ⎥ྏ ⎥ྏ − 1 1 ⎥ྏ 0 − 1⎥ྏ ⎥ྏ 0 0 ⎥ྏ 0 0 ⎥ྏ ⎥ྏ 1 0 ⎥ྏ 0 1 ⎥ྏ ⎦ྏ 4 ⎡ྎ 2 ⎤ྏ ⎢ྎ− 2⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ 1 ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ − 1 ⎥ྏ ⎢ྎ 2 ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ − 1 ⎥ྏ ⎢ྎ − 1 ⎥ྏ ⎡ྎ 1 ⎤ྏ ⎢ྎ ⎥ྏ ⎢ྎ− 1⎥ྏ ⎢ྎ ⎥ྏ = ⎢ྎ 0 ⎥ྏ = y ⎢ྎ 0 ⎥ྏ ⎢ྎ 1 ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ 1 ⎥ྏ − 1⎦ྏ ⎣ྏ ⎢ྎ ⎥ྏ ⎢ྎ − 1 ⎥ྏ ⎢ྎ 0 ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ 0 ⎥ྏ ⎢ྎ 0 ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ 1 ⎥ྏ ⎢ྎ − 1 ⎥ྏ ⎣ྏ ⎦ྏ 2 0 0 ⎤ྏ ⎡ྎ 2 ⎢ྎ− 2 − 1 1 0 ⎥ྏ ⎥ྏ ⇒ y (m, n) = ⇒ y = ⎢ྎ ⎢ྎ 1 − 1 − 1 1 ⎥ྏ ↑ ⎢ྎ ⎥ྏ ⎣ྏ − 1 0 0 − 1⎦ྏ 0 0 1 −1 0 1 −1 0 2 −1 −1 0 2 −2 −1 1 → e. 0 0 n↑ 0 1 1 −1 2 0 1 n↑ * 1 → −1 1 −1 → m m 001 0 0 −1 0 1 −1 0 −1 1 = 0 1 −1 + + 0 −1 1 + 201 − 2 0 −1 20 1 0 − 2 0 −1 0 00 00 1 0 0 −1 0 n↑ 1 −1 0 = 0 1 −1 0 2 2 −1 −1 0 − 2 1 −1 → m ⇒ the two methods agree. 5 2. This function is separable, with u(m, n) = u1 (m)u2 (n) , where − p + 1 ≤ m ≤ p − 1, ⎧ྏ1, u1 (m) = ⎨ྏ N N ⎩ྏ0, − + 1 ≤ m ≤ − p, p ≤ m ≤ . 2 2 and u 2 (n) is identical to u1 (with n replacing m). This function is a square pulse containing 2 p − 1nonzero values. Since it is even, the DFT will be real. One way to get the DFT is to take the DFT of ⎧ྏ1, 0 ≤ m ≤ 2 p − 2 u 3 (m) = ⎨ྏ ⎩ྏ0, otherwise. and then to discard the complex phase factor. v3 ( k ) = = = 1 2 p −2 − j 2π km / N 1 1 − e− j 2π k (2 p −1) / N e = ∑ − j 2π k / N N m−0 N 1− e 1 e− jπ k ( 2 p −1) / N (e jπ k (2 p −1) / N − e− jπ k (2 p −1) / N ) e− jπ k / N (e jπ k / N − e− jπ k / N ) N 1 − jπ k ( 2 p −2) / N sin π k (2 p − 1) / N = v3 ( k ) e sin π k / N N The desired 2D transform is therefore v( k , l ) = 1 sin(π k (2 p − 1) / N ) sin(π l (2 p − 1) / N ) . N sin(π k / N ) sin(π l / N ) 6 sin(π k (2 p − 1) / N ) sin(*) becomes 2 p − 1. Consider . For sin(π k / N ) s in(*) large N, this expression can be written as For k = 0 or l = 0 , the sin π k (2 p − 1) / N sin π k (2 p − 1) / N = (2 p − 1) = (2 p − 1) sinc (k (2 p − 1) / N ) πk / N π k (2 p − 1) / N Therefore, v(k , l ) |large (2 p − 1) 2 sinc(k(2p-1)/N)sinc(l(2p-1)/N) N= N 7 ...
View Full Document

## This note was uploaded on 12/27/2011 for the course EE211A 211A taught by Professor Villasenor during the Fall '11 term at UCLA.

Ask a homework question - tutors are online