Você está na página 1de 11

EECS 16B Designing Information Devices and Systems II

Fall 2017 Miki Lustig and Michel Maharbiz Homework 13


This homework is optional but in scope.

1. DFT

(a) Compute the DFT coefficients of x1 [n] = cos( 2π


6 n) where n ∈ {0, 1, . . . , 5}.
Solution:
 
2π 1 2π 1 2π
cos n = e j 6 n + e− j 6 n (1)
6 2 2
1 2π
uk [n] = √ e j 6 kn (2)
6

6
~x1 = (~
u1 + u~5 ) (3)
2

√
 6 k = 1, 5.
X1 [k] = 2 (4)
0 k 6= 1, 5.

(b) Plot the time domain representation of ~x1 . Plot the magnitude, |X[n]|, and plot the phase, ∠X[n], for its
DFT-basis representation.
Solution:

EECS 16B, Fall 2017, Homework 13 1


EECS 16B, Fall 2017, Homework 13 2

(c) Compute the DFT coefficients of x2 [n] = cos( 4π


6 n) where n ∈ {0, 1, . . . , 5}.
Solution:

6
~x2 = (~
u2 + u~4 ) (5)
2

√
 6 k = 2, 4.
X2 [k] = 2 (6)
0 k 6= 2, 4.

(d) Plot the time-domain representation and the magnitude and phase for the DFT-basis representation of
~x2 .
Solution:

EECS 16B, Fall 2017, Homework 13 3


EECS 16B, Fall 2017, Homework 13 4

(e) How about the general case, x p [n] = cos( 2π


6 pn), where n ∈ {0, 1, . . . , 5}?
Solution:

6
~x p = (~
u p +~u6−p ) (7)
2

√
 6 k = p, 6 − p.
Xp [k] = 2 (8)
0 k 6= p, 6 − p.

h iT
(f) Compute the DFT coefficients of ~s = 1 0 1 0 1 0 .
Solution:

6
~s = (~
u0 + u~3 ). (9)
2

√
 6 k = 0, 3.
S[k] = 2 (10)
0 k 6= 0, 3.

(g) Compute the DFT coefficients of y1 [n] = cos( 2π


6 n − π) where n ∈ {0, 1, . . . , 5}.

EECS 16B, Fall 2017, Homework 13 5


Solution:

6
~y1 = u1 −~u5 )
(−~ (11)
2

 √
− 6 k = 1, 5.
Y1 [k] = 2 (12)
0 k 6= 1, 5.

2. LTI filter
Suppose we apply the length L = 100 input

u[n] = cos(0.1πn) + cos(0.4πn), n = 0, 1, . . . , 99 (13)

to a finite impulse response filter whose impulse response is


(
1
h[n] = 6 n = 0, . . . , 5
0 otherwise.

We want to find the output y[n], n = 0, . . . , 104 from the DFT.

(a) Find the 105-point DFT of u[n] by adding 5 zeros to the length-100 signal given above and using the
DFT command numpy.fft.fft(x, norm="ortho"). Plot the magnitude |U[k]| against the

frequency variable ω ∈ [0, 2π]. (Recall that the integer k corresponds to the frequency 105 k.)

Solution:
(b) Find the 105-point DFT of h[n] by adding 99 zeros to the length-6 impulse response given above. Plot
the magnitude |H[k]| against the frequency variable ω ∈ [0, 2π]. Given this frequency response how
do you think each frequency component of u[n] will be affected when the filter is applied?

EECS 16B, Fall 2017, Homework 13 6


Solution:
Low frequencies pass, high frequencies are cut.
(c) Remember, the DFT coefficients of the output are

Y [k] = 105H[k]U[k], k = 0, . . . 104.

Find y[n] using the inverse DFT command numpy.fft.ifft(x, norm="ortho") Plot both
u[n] and y[n] versus time n and explain how the filter modified u[n].

Solution:
High frequency oscillation component is attenuated.

EECS 16B, Fall 2017, Homework 13 7


3. DFT Sampling Matching
Select the correct answer from the multiple choice options provided and give some justification.

(a) A sampled time domain signal and its DFT coefficients are given below:

Now given the following time domain signal, which of the options below shows the correct DFT
coefficient magnitudes?

Solution: The correct DFT coefficients are shown in B. The new signal completes 3 full cycles
during the discrete sequence. Its amplitude is the same as the first sequence.

EECS 16B, Fall 2017, Homework 13 8


(b) Given the time domain signal below, which of the options below shows the correct DFT coefficient
magnitudes?

Solution: The correct DFT coefficients are shown in A. The DFT coefficients of a unit impulse are
all √1N . This impulse has been shifted, so the DFT coefficients have varying phase and are not purely
real; however, their magnitudes are still uniformly √1 .
N

EECS 16B, Fall 2017, Homework 13 9


(c) Given the time domain signal below, which of the options below shows the correct DFT coefficient
magnitudes?

Solution: The correct DFT coefficients are shown in C. The largest frequency component in this sig-
nal corresponds to 4 full cycles over the duration of the sequence. There is a smaller higher frequency
component. The mean is 0.

EECS 16B, Fall 2017, Homework 13 10


Contributors:

• Yen-Sheng Ho.

• Harrison Wang.

• Murat Arcak.

EECS 16B, Fall 2017, Homework 13 11

Você também pode gostar