ECE 466 Homework 6
You can collaborate on homeworks and turn in a homework for 2 people. Make sure both of you submit.
Include your codes and answers within the cells that are requested. Do not create additional cells.
Upload the .ipynb document and a generated .html in a zip:
Your Name: [Name Surname]
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
1:
[20] Determine if the Fourier Transform
X
(
ω
)
of a signal
x
[
n
]
is a) even or odd, and b) imarinary or real when
x
[
n
]
is:
Real and even.
Imaginary and even.
Real and odd.
Imaginary and odd.
Show your work.
Answer for 1.1:
Answer for 1.2:
Answer for 1.3:
Answer for 1.4:
2:
[25 points] Determine and sketch the Fourier transforms
X
1
(
ω
)
,
X
2
(
ω
)
, and
X
3
(
ω
)
of the following signals:
x
l
[
n
]
=
{
1
,
1
,
1
–
,
1
,
1
}
.
x
2
[
n
]
=
{
1
,
0
,
1
,
0
,
1
–
,
0
,
1
,
0
,
1
}
.
x
3
[
n
]
=
{
1
,
0
,
0
,
1
,
0
,
0
,
1
–
,
0
,
0
,
1
,
0
,
0
,
1
}
.
Is there any relation between
X
1
(
ω
)
,
X
2
(
ω
)
, and
X
3
(
ω
)
? What is the physical meaning behind the relationship?
Show that if
x
k
[
n
]
=
{
x
[
n
k
]
,
if
n
/
k
is integer
,
0
,
otherwise
then
X
k
(
ω
)
=
X
(
k
ω
)
.
Answer for 2.1:
Answer for 2.2:
Answer for 2.3:
Answer for 2.4:
Answer for 2.5:
3:
[15 points] A signal
x
[
n
]
has the following Fourier transform:
X
(
ω
)
=
1
1
−
a
e
−
j
ω
Determine the Fourier transforms of the following signals:
x
[
2
n
+
1
]
e
π
n
/
2
x
[
n
+
2
]
x
[
n
]
c
o
s
(
0.3
π
n
)
Answer for 3.1:
Answer for 3.2:
Answer for 3.3:
4:
[40 points] Write a python function to compute the DTFT of a finite duration sequence. The format of the function should be as following:
def dtft(x, n, w):
“”” DTFT computed at w
Parameters:
—
x : finite duration sequence over n
n : sample position vector
w : frequency location vector
Returns:
—
X : DTFT values computed at frequencies w
“””
return X
Compute the DTFT for the following sequences by using your code. Choose
ω
as an array sampled between
−
π
and
π
uniformly (You can use np.arange for this). Plot the magnitude and angle of
X
(
ω
)
:
x
[
n
]
=
{
4
–
,
3
,
2
,
1
,
2
,
3
,
4
}
. Comment on the angle plot.
x
[
n
]
=
{
1
,
−
N
≤
n
≤
N
,
0
,
otherwise
.
Determine the DTFT for
N
=
5
,
25
,
100
. Scale the DTFT so that

X
(
0
)

=
1.
Comment on the behavior of the magnitude plot as a function of N.
# Code for question 4
Answer for 4.1:
Answer for 4.2: