Sale!

EE 113 Digital Signal Processing Homework 5 solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (5 votes)

Problem 1. (15 points) Two signals x[n] and h[n] are given by
x[n] = u[n] − u[n − 10] and h[n] = (0.8)nu[n]
(a). (5 points) Determine the DTFT for each signal.
(b). (5 points) Let y[n] be the convolution of these two signals, that is, y[n] = x[n]∗h[n]. Compute
y[n] by direct application of convolution sum.
(c). (5 points) Determine the DTFT of y[n] by direct application of DTFT analysis equation.
Verify that it is equal to the product of the individual transforms of x[n] and h[n]:
Y (Ω) = X(Ω)H(Ω)
Problem 2. (10 points) Let x[n] = α
2nu[n−1] with |α| < 1. Evaluate the following ratio by using
the properties of the DTFT:
P∞
n=0 n
2x[n]
P∞
n=0 nx[n]
Problem 3. Relation between DTFT, DFT and DTFS: (20 points): Let x[n] = δ[n + 2] −
δ[n] + δ[n − 2].
(a). (5 points) Determine its DTFT.
(b). (5 points) Sample the DTFT to obtain the 6-point DFT of x[n].
(c). (10 points) Let the periodic version of x[n] be defined as
x˜[n] = X∞
m=−∞
x[n + m · N].
Here N = 6, so it is periodic with period 6. Compute the DTFS coefficients of x˜[n]. Show that
N times the DTFS coefficients is equal to the corresponding N-point DFT coefficients.
Problem 4. (15 points): Let X[k] denote the N-point DFT of sequence x[n]. Let y[n] denote
the N-point DFT (not inverse DFT) of the sequence X[k]. Let Y [k] denote the N-point DFT of the
sequence y[n]. Let w[n] denote the N-point DFT (not inverse DFT) of the sequence Y [k]. Relate the
sequences w[n] and x[n]. The series of transformations can be illustrated as follows:
x[n]
DF T
→ X[k]
DF T
→ y[n]
DF T
→ Y [k]
DF T
→ w[n]
Problem 5. (40 points): Visualizing the effect of windowing on DTFT using FFT and
MATLAB.
In this problem we are going to use a N-point FFT to approximate the DTFT of a signal. We
will also see the effect of windowing on the DTFT spectrum. Here we are choosing a “long” signal –
a signal with a large number of samples. In principle one could choose N as large as possible to plot
as many frequency samples of the DTFT as possible, so the resolution in the frequency domain (also
called “spectral resolution”) could be made arbitrarily fine. However, large N means more storage,
longer sampling time, longer computation, etc. In practice, we store L samples of x[n], and then
1
compute an N-point DFT of x[n] to get X[k] = X(
2πk
N
). We can ask: how good is our frequency
resolution as a function of N?
First, we create the signal x[n] on MATLAB, use the following commands. The signal created is
thus sampled every 100th of a second and exists for 50 sec. Plot the signal for the first 3 sec as a
function of time to see how it looks.
1 f s = 1 0 0 ; % s am pl i n g f r e q u e n c y
2 t = 0 : 1 / f s : 5 0 ; % t ime a x i s
3 x = 2 ∗ s i n ( 2∗ p i ∗30∗ t ) + 3∗ s i n ( 2∗ p i ∗2 0∗( t −2) )
4 + 3 ∗ s i n ( 2∗ p i ∗1 0∗( t −4) ) ; % t h e s i g n a l a s a f u n c t i o n o f t ime
5 N = l e n g t h ( x ) ; % l e n g t h o f t h e d i s c r e t e t ime s i g n a l
The tasks:
(a). Plot the DTFT spectrum of the signal using the following commands.
1 omega = 2∗ p i ∗ ( 0 :N−1)/N;
2 omega = f f t s h i f t ( omega ) ;
3 omega = unwrap ( omega − 2∗ p i ) ; % c r e a t i n g t h e f r e q u e n c y a x i s
4 X = f f t ( x ,N) ; % compu te N p o i n t DFT o f x
5 X = X/max(X) ; % r e s c a l e t h e DFT
6 p l o t ( omega , a b s ( f f t s h i f t (X) ) , ’ L ineW id th ’ , 2 ) ; % c e n t e r DFT a t 0 and
p l o t t h e magn i tude
7 t i t l e ( ’DTFT o f x [ n ] ’ , ’ f o n t s i z e ’ , 1 4 )
8 s e t ( gca , ’ f o n t s i z e ’ , 1 4 )
9 x l a b e l ( ’ Rad ians ’ , ’ f o n t s i z e ’ , 1 4 )
(b). (15 points): Now create a rectangular window wr[n], with a width of 2 sec. To do so on
MATLAB, you must create a N-length vector where only the samples corresponding to t ≤ 2
are 1 and the other samples are zero. Now multiply x[n] with wr[n] pointwise to get xr[n] =
wr[n] · x[n]. This gives a rectangular windowed version of x[n]. Compute the DTFT of xr[n]
using its N-point FFT and plot it as was done for x[n].
(Hint: On MATLAB, elementwise multiplication of two vectors a and b can be accomplished
with a.*b.)
(c). (15 points): Now create a Hamming window wh[n], with a width of 2 sec. To do so on
MATLAB, you must create a N-length vector where only the samples corresponding to t ≤ 2
are non-zero and the other samples are zero. You can use the function hamming on MATLAB
with appropriate parameters to accomplish this. Now multiply x[n] with wh[n] pointwise to get
xh[n] = wh[n] · x[n]. This gives a Hamming windowed version of x[n]. Compute the DTFT of
xh[n] using its N-point FFT and plot it as was done earlier.
(d). (10 points): Compare the three plots and explain the effects of windowing on the DTFT
magnitude spectrum for the rectangular and hamming window.
Attach all the codes and plots when submitting.
2