Uploaded by Jordan Elliott

hw8solutions

advertisement
GEORGIA INSTITUTE OF TECHNOLOGY
SCHOOL of ELECTRICAL and COMPUTER ENGINEERING
ECE 2026
Spring 2023
Problem Set #8
SOLUTION
Date: Mar-14-2023
PROBLEM 8.1*:
Consider an FIR filter defined by the following difference equation:
√
y[n] = x[n] + 3x[n − 1] + x[n − 2].
(a) Find an equation for the frequency response H(ej ω̂ ) of the filter.
Solution: Given the difference equation
y[n] = x[n] +
√
3x[n − 1] + x[n − 2],
we can find the impulse response
h[n] = δ[n] +
√
3δ[n − 1] + δ[n − 2].
The frequency response for an FIR filter is defined as
j ω̂
H(e ) =
M
X
h[k]e−j ω̂k ,
k=0
thus we have
√
H(ej ω̂ ) = e−j ω̂(0) + 3e−j ω̂(1) + e−j ω̂(2)
√
= 1 + 3e−j ω̂ + e−j2ω̂
(b) Find an equation for the magnitude response |H(ej ω̂ )|. Sketch it versus ω̂.
(Hint: factor out e−j ω̂ and then apply Euler’s relation to what’s left.)
Solution: Observe that we can factor the frequency response from part (a) as follows:
√
H(ej ω̂ ) = 1 + 3e−j ω̂ + e−j2ω̂
√
= (e+j ω̂ + 3 + e−j ω̂ )e−j ω̂ .
We can then combine the two complex exponentials inside the parentheses into one cosine to
obtain
√
H(ej ω̂ ) = ( 3 + 2 cos(ω̂))e−j ω̂ .
This implies that the magnitude of the frequency response is
√
|H(ej ω̂ )| = | 3 + 2 cos(ω̂)|
Note that the frequency response is periodic with period 2π, hence we will often only plot
the curve from −π to π as shown here.
(c) Find the “dc gain” of the system; i.e., find the system output when the input is a constant
x[n] = 1, for all n.
Solution: The DC gain is the equal to frequency response evaluated at ω̂ = 0
√
H(ej ω̂ )
=
3 + 2 cos(0) e−j 0̂
ω̂=0
√
= 2 + 3 ≈ 3.73
Note that the DC gain is equivalent to the sum of the coefficients of the impulse response.
(d) Find the filter output y[n] when the filter input is the sinusoid x[n] = sin(πn/2).
Solution: We will need the magnitude and phase of the frequency response evalulated at
ω̂ = π/2. Observe that
√
H(ej ω̂ )
=
3 + 2 cos(π/2) e−jπ/2
ω̂=π/2
√
=
3 + 2(0) e−jπ/2
√
= 3e−jπ/2
and hence
|H(ejπ/2 )| =
√
3
and
̸
H(ejπ/2 ) = −
π
2
Therefore, we can use the frequency response to obtain the output as follows:
π
y[n] = |H(ejπ/2 )| sin
n + ̸ H(ejπ/2 )
2
√
√
π
π
= 3 sin 2 n − 2 = 3 cos π2 n − π
(e) This FIR filter is called a “nulling” filter because it nulls a sinusoidal input for a particular
sinusoid frequency. Which frequency does this filter null?
In other words, for what value of ω̂0 (in the range 0 to π) will an input of the form
x[n] = cos(ω̂0 n) result in an all-zero output, y[n] = 0 for all n?
Solution: The output is nulled when |H(ej ω̂0 )| = 0. Hence we need to find ω̂0 such that
√
| 3 + 2 cos(ω̂0 )| = 0.
and thus,
ω̂0 =
5π
6
Note we can confirm that this is indeed true looking at the plot in part (b).
PROBLEM 8.2*:
Consider an LTI system whose frequency response is H(ej ω̂ ) = 6e−4j ω̂ cos(3ω̂).
(a) Sketch the impulse response h[n] of the system.
Solution: We can rewrite the frequency response as
H(ej ω̂ ) = 6e−4j ω̂ cos(3ω̂)
j3ω̂
+ e−j3ω̂
−4j ω̂ e
= 6e
2
= 3e−j ω̂ + 3e−j7ω̂ .
It directly follows that the impulse response is
h[n] = 3δ[n − 1] + 3δ[n − 7]
(b) Write the difference equation for the system.
Solution: Given the impulse response
h[n] = 3δ[n − 1] + 3δ[n − 7]
it directly follows that
y[n] = 3x[n − 1] + 3x[n − 7]
(c) Find the “dc gain” of the system; i.e., find the system output when the input is a constant
x[n] = 1, for all n.
Solution: The DC gain is the equal to the frequency response evaluated at ω̂ = 0
H(ej ω̂ )
ω̂=0
= 6e−4j(0) cos(3(0))
=6
Note that the DC gain is equivalent to the sum of the coefficients of the impulse response.
(d) Find the system output when the input is the sinusoid x[n] =
√
50 cos(πn/4).
Solution: The output of the system will be equal to
π
√
π
π
y[n] = |H(ej 4 )| 50 cos
n + ̸ H(ej 4 )
4
hence we need to find the magnitude and phase of the frequency response at ω̂ = π4 :
π π
π
H(ej 4 ) = 6e−4j ( 4 ) cos 3
4
3π
= 6e−jπ cos
4
√ !
2
= 6 (−1) −
2
√
=3 2
Thus we see that
√
π
|H(ej 4 )| = 3 2
and
̸
π
H(ej 4 ) = 0
which means the output is
π
√
π
π
y[n] = |H(ej 4 )| 50 cos
n + ̸ H(ej 4 )
π4
√ √
50 cos
n+0
= 3 2
4
π
= 30 cos 4 n
PROBLEM 8.3*:
Consider an LTI system whose frequency response H(ej ω̂ ) is the real-valued function of ω̂ shown
below:
(a) Find the system output when the system input is x[n] = (–1)n .
Solution: First, observe that
x[n] = (−1)n
= cos(πn)
for any integer n. Hence, we can use the frequency response at ω̂ = π:
y[n] = |H(ejπ) | cos πn + ̸ H(ejπ)
= 32 cos(πn) = 32(−1)n
(b) Find the system output when the system input is:
7
x[n] = 0.1 + 0.25 cos(0.25πn) + 0.5 cos(0.5πn) + cos
8
7π
n .
8
Solution: In general, for each sinusoidal input A cos(ω̂n + ϕ) to an FIR filter with frequency
j ω̂
̸
response H(ej ω̂ ) = |H(ej ω̂ )|ej H(e ) , we will obtain an output equal to
|H(ej ω̂ )|A cos(ω̂n + ϕ + ̸ H(ej ω̂ )).
In otherwords, for a given frequency, the magnitude of the input and the magnitude of
the frequency response multiply and the phase of the input and the phase of the frequency
response sum.
For this problem, we see that the frequency response is real and non-negative and hence
|H(ej ω̂ )| = H(ej ω̂ ) and ̸ H(ej ω̂ ) = 0.
Given that
7
x[n] = 0.1 + 0.25 cos(0.25πn) + 0.5 cos(0.5πn) + cos
8
7π
n ,
8
we have
y[n] = H(ej0 )0.1 + |H(ej0.25π )|0.25 cos(0.25πn + ̸ H(ej0.25π ))
+ |H(ej0.5π )|0.5 cos(0.5πn + ̸ H(ej0.5π ))
7π
7
7π
j 7π
j
+ |H(e 8 )| cos
n + ̸ H(e 8 )
8
8
Inserting the values and simplifying yields
7
y[n] = (32)0.1 + (0)0.25 cos(0.25πn + 0) + (0)0.5 cos(0.5πn + 0) + (24) cos
8
= 3.2 + 21 cos 7π
8 n
7π
n+0
8
PROBLEM 8.4*:
Consider an LTI system described by the difference equation:
y[n] = Bx[n] + x[n − 1] + Bx[n − 2]
for some constant B to be determined.
If the output of this system in response to the input x[n] = 4 + cos(ω̂0 n) is y[n] = 12 for all n,
where ω̂0 satisfies 0 < ω̂0 ≤ π, then what must the constants B and ω̂0 be?
Solution: In order to receive this constant output, we must have that the constant input is scaled
up by a factor of 3 and that the frequency component is nulled. That is, we desire that
H(ej0 ) = 3
and
H(ej ω̂0 ) = 0
From the difference equation
y[n] = Bx[n] + x[n − 1] + Bx[n − 2]
we can find the impulse response
h[n] = Bδ[n] + δ[n − 1] + Bδ[n − 2]
and frequency response
H(ej ω̂ ) = B + e−j ω̂ + Be−j2ω̂
= Be+j ω̂ + 1 + Be−j ω̂ e−j ω̂
= (2B cos (ω̂) + 1) e−j ω̂
If we set ω̂ = 0, then
3 = H(ej0 ) = (2B cos (0) + 1) e−j0
= 2B + 1
=⇒ B = 1
Now, if we set ω̂ = ω̂0 with B = 1, then
0 = H(ej ω̂0 ) = (2B cos (ω̂0 ) + 1) e−j ω̂0
= (2 cos (ω̂0 ) + 1) e−j ω̂0
1
=⇒ cos(ω̂0 ) = −
2
=⇒ ω̂0 =
2π
3
Download