Você está na página 1de 3

ECE 301 Fall 2010 Division 2 Homework 8

Due Thursday November 18, 2010 at 4pm in MSEE 330

Reading: Sections 5.1, 5.3, 5.4, 5.6, 5.7.2, and 5.8 in the textbook, as well as the posted notes on
Fourier series.

Problem 1. Prove that for any DT signals x and y for which DTFT exists, the DTFT of their
product xy is Z   
1 
X ej Y ej() d.
2
Hint. Use the inverse DTFT formula, change the order of the two integrations, and use the frequency-
shifting property of the DTFT derived in class and in Section 5.3.3 in the text.

Problem 2.

(a) Let a be a fixed complex number with |a| < 1. Find the DTFT of the DT signal x, where
x[n] = nan u[n] for all integer n. Hint: Use the result of Example 5.1 in the textbook and the
differentiation-in-frequency property of the DTFT from Section 5.3.8 in the textbook.
(b) Find the impulse response for an ideal high-pass filter whose cutoff frequency is c . In other
words, find the inverse DTFT for the frequency response H which is given by the following for
frequencies between and :

j
 0, if || < c ,
H e =
1, if c || .
Use Matlab to plot the impulse response you find over the interval 20 n 20, assuming
c = /2.

Problem 3. According to Bohrs model, the electron in a hydrogen atom orbits the nucleus (much like
~2 2 2
the Earth orbits the Sun). The radii of possible orbits are given by: rn = mke 2 n = 0.53n (nanometers),
n = 1, 2, . . .. Thus, the electrons energy can only take on the following discrete values:
e2 13.6
En = k = 2 (electron volts) n = 1, 2, . . .
2rn n
Sometimes physicists need to calculate the sum of all the possible energy values. This would require
evaluating the following summation:

X 1
S= .
n2
n=1
In this problem, your task is to evaluate S. Two hints below may be helpful:

(1) Find the inverse DTFT of the following function: X(ej ) = j for . (Consider the
cases n = 0 and n 6= 0 separately.)

1
(2) Use Parsevals Theorem,
Z
X 1 2
|x(n)| = |X(ej )|2 d.
n=
2


X
Do not forget that the sum you need to evaluate is |x(n)|2 .
n=1

Problem 4. This exercise will examine the computation of the DTFT in Matlab. There are two
issues that arise when computing DTFT numerically. First, if x is an infinite-duration signal, then
it must be truncated to a finite duration, because only finite-duration signals can be represented by
vectors in Matlab. Another issue is that the DTFT X ej is defined over a continuous frequency


variable . In Matlab, the DTFT can only be computed at a discrete set of frequency samples, k . If
enough frequency samples are chosen, then a plot of the DTFT evaluated at these frequency samples
will be a good representation of the actual DTFT. For computational efficiency, it turns out that the
best set of frequency samples is the set of equally spaced points in the interval 0 2 given by
k = 2k/N for k = 0, . . . , N 1. For a signal x which is nonzero only for 0 n M 1, these
frequency samples correspond to
M
X 1
jk
x[n]ej2kn/N , for k = 0, . . . , N 1.

X e =
n=0

The Matlab function fft implements this equation in a computationally efficient manner. If x is a
vector containing the samples of x[n] for 0 n M 1, and if N M , then X=fft(x,N) computes N
evenly spaced samples of the DTFT of x and stores them in the vector X. If N < M , then the Matlab
function fft truncates x to its first N samples before computing the DTFT, thus yielding incorrect
values for the samples of the DTFT.

Note that the values of X(k) for k > N/2 are also samples of X ej on the interval < 0,


due to the fact that the DTFT is periodic with period 2. If you want to reorder the DTFT samples
returned by fft to correspond to the interval k < , the Matlab function fftshift was
written specifically to swap the second half of the vector X with the first half.

(a) Calculate analytically the DTFT of the rectangular pulse defined by x[n] = u[n] u[n 11].
Also create the vector x containing the nonzero samples of x.

(b) Create a vector of N = 100 frequencies containing the frequency samples w=2*pi*k/N for
k=[0:N-1]. Plot the magnitude of X ej over this range, using the formula you calculated in
Part (a). Also plot the phase of X ej . You may find the following function helpful:

function X=dtftsinc(M,w)
% X=dtftsinc(M,w)
% calculates the function X = sin(Mw/2)/sin(w/2)
% using selective indexing to avoid division by zero
den = sin(w/2);

2
num = sin(M*w/2);
X = zeros(size(w));
X(den~=0) = num(den~=0)./den(den~=0);
X(den==0) = M;

(c) Rearrange the frequency samples to correspond to < . To do this, use w=w-pi. Use
the function fft to calculate N = 100 samples of the DTFT of x and store your result in the
vector X. Plot the magnitude and the phase of X versus w. Do not forget to use fftshift to
rearrange the DTFT samples in X to match the frequencies in w. How do these plots compare to
your results in Part (b)?

Você também pode gostar