6.02 Tutorial Problems: Frequency Domain & Filters


Problem .

Give an expression for the magnitude of a complex exponential with frequency φ, i.e., |e|. Hint: it's a numeric value independent of φ.

|e| = |cos(φ) + j*sin(φ)| = sqrt(cos2(φ) + sin2(φ)) = 1


Problem .

  1. Prove the validity of the following formula, often referred to as the finite sum formala:

    For α ≠ 1, do the following:
    1. expand the sum
    2. multiply expansion by (1–α)/(1–α)
    3. simplify the numerator

  2. Use the finite sum formula to show:

    Simply apply the finite sum formula and use the fact that e = –1.


Problem .

Consider the following signals, which are periodic with period N. For each signal compute the spectral coefficients ak. In 6.02, we usually choose N consecutive k's starting with -N/2.

  1. x[n] = 1 + sin((2π/N)*n) + 3*cos((2π/N)*n) + cos(2*(2π/N)*n + π/2).
    Rewrite the sin and cos componients using complex exponentials and gather ejk(2π/N)n terms for the different k.
    a-2 = -(1/2)j
    a-1 = (3/2) - (1/2j) = (3/2) + (1/2)j
    a0 = 1
    a1 = (3/2) + (1/2j) = (3/2) - (1/2)j
    a2 = (1/2)j
    
    ak = 0  otherwise
    
    Note the ak are periodic with period N, so, for example, aN = 1. For simplicity, we'll just list the spectal coefficients around 0.

  2. x[n] = 5*cos(6πn + π) + 7*cos(3πn)
    First determine the smallest N for which x[n] is periodic and then rewrite the frequencies in the form k(2π/N) for some k. If the resulting k is greater than N, you can replace it with k mod N.

    In this example, the smallest N is 2:

    x[n] = 5*cos(6(2π/2)n + π) + 7*cos(3(2π/2)n)  = 5cos(π) + 7*cos(1(2π/2)n)
    
    Now we compute the two spectral coefficients (actually we can read them off the equation by inspection!):
    a0 = -5
    a1 = 7/2

  3. x[n] is a square wave with period N=4 with the following values: x[0]=1, x[1]=1, x[2]=0, x[3]=0.
    Compute the answer using the formula
    ak = (1/N)Σn=<N>x[n]e-jk(2π/N)n
    
    You can save yourself some work by remembering that ak is the complex conjugate of a-k when x[n] is real.
    a-2 = (1 + -1)/4 = 0
    a-1 = (1 + j)/4
    a0 = (1 + 1)/4 = 1/2
    a1 = (1 - j)/4
    

  4. x[n] = cos(2πn/3)*sin(2πn/9)
    The smallest N for which x[n] is periodic is 9. Expanding the product in terms of complex exponentials and gathering terms, we get
    a-4 = j/4
    a-2 = -j/4
    a0 = 0
    a2 = j/4
    a4 = -j/4
    
    ak = 0 otherwise
    

  5. x[n] has exactly one non-zero value per period, i.e., x[m] ≠ 0 for some m and 0 otherwise. Compute the magnitude of ak.
    | ak | = | (1/N)Σn=<N>x[n]e-jk(2π/N)n |
           = (1/N)|x[m]| | e-jk(2π/N)m |
           = |x[m]|/N
    
    since the magnitude of e is 1 for any φ.


Problem .

If x[n] is real, even (i.e., x[n] = x[-n]) and periodic with period N, show that all the ak are real.

ak = (1/N)Σn=<N>x[n]e-jk(2π/N)n
Noting that x[1] = x[-1], x[2] = x[-2], ..., if N is odd we can rewrite this as:
ak = (1/N)[x[0] + x[1](ejk(2π/N) + e-jk(2π/N)) + x[2](ejk(2π/N)2 + e-jk(2π/N)2) + ...]
   = (1/N)[x[0] + x[1]*2cos(2πk/N) + x[2]*2cos(4πk/N) + ...]
which is a sum of real numbers. If N is even, there will be one negative index in the equation, n = -N/2, that won't be matched with a positive counterpart. But
x[-N/2]e-jk(2π/N)(-N/2) = x[-N/2]ejkπ = x[-N/2]*(-1)k
which is also real.


Problem .

Suppose you're given the spectral coefficients ak for a particular periodic sequence x[n]. Compute the spectral coefficients bk for w[n] = x[n-α], i.e., x time shifted by α samples, in terms of the ak.

bk = (1/N)Σn=<N>w[n]e-jk(2π/N)n
   = (1/N)Σn=<N>x[n-α]e-jk(2π/N)n
This time, let's run the indicies of the summation from α to α+(N-1):
bk = (1/N)Σα ≤ n ≤ α+(N-1)x[n-α]e-jk(2π/N)n
   = (1/N)Σ0 ≤ n ≤ (N-1)x[n]e-jk(2π/N)(n+α)
   = (1/N)Σ0 ≤ n ≤ (N-1)x[n]e-jk(2π/N)ne-jk(2π/N)α
   = e-jk(2π/N)α(1/N)Σ0 ≤ n ≤ (N-1)x[n]e-jk(2π/N)n
   = ake-jk(2π/N)α


Problem .

Consider an LTI system characterized by the unit-sample response h[n].

  1. Give an expression for the frequency response of the system H(e) in terms of h[n].
    H(e) = Σmh[m]e-jΩm.

  2. If h[0]=1, h[1]=0, h[2]=1, and h[n]=0 for all other n, what is H(e)?
    H(e) = 1 + e-2jΩ.

  3. Let h[n] be defined as in part B and x[n] = cos(φn). Is there a value of φ such that y[n]=0 for all n and 0 ≤ φ ≤ π?
    H(e)=0 when φ = π/2.

  4. Let h[n] be defined as in part B. Find the maximum magnitude of y[n] if x[n] = cos(πn/4).
    |H(ejπ/4)| = |1 + e-jπ/2| = |1 - j| = sqrt(2).

  5. Let h[n] be defined as in part B. Find the maximum magnitude of y[n] if x[n] = cos(-(π/2)n).
    |H(ejπ/2)| = |1 + e-jπ| = |1 - 1| = 0.


Problem .

In answering the questions below, please consider the unit sample response and frequency response of two filters, H1 and H2, plotted below.

Note: the only nonzero values of unit sample response for H1 are : h1[0] = 1, h1[1]=0, h1[2]=1.

Note, the only nonzero values of unit sample response for H2 are : h2[0] = 1, h2[1]=-sqrt(3), h2[2]=1.

In answering the several parts of this review question consider four linear time-invariant systems, denoted A, B, C, and D, each characterized by the magnitude of its frequency response, |HA(e)|, |HB(e)|, |HC(e})|, and |HD(e)| respectively, as given in the plots below. This is a review problem, not an actual exam question, so similar concepts are tested multiple times to give you practice

  1. Which frequency response (A, B, C or D) corresponds to a unit sample response given by

    h[n] = α δ[n] - h1[n]

    and what is the numerical value of |α|?

    Must be HB as that is the only frequency response that has the same values at 0 and ±π and extremes at ±&pi/2.

    |α|=2 as H1(ej0)=2 but HB(ej0)=0.

  2. Which frequency response (A, B, C or D) corresponds to a unit sample response given by

    h[n] = Σmh1[m]h2[n-m] for m = 0 to n

    and what are the numerical values of h[2], h[3] and H(ej0)?

    Must be HA since H1(e)H2(e) = H(e), and therefore |H(e)|=0 whenever H1(e)=0 or H2(e)=0.

    H(ej0) = H1(ej0)H2(ej0) = 2(2 - sqrt(3)) = 4 - 2sqrt(3)

    h[n] = [1,0,1]*[1,-sqrt(3),1] so h[2] = 2 and h[3] = -sqrt(3).

  3. Which frequency response (A, B, C or D) corresponds to a unit sample response given by

    h[n] = α δ[n] - Σmh1[m]h2[n-m] for m = 0 to n

    and what is the numerical value of |α|?

    Since HA is the frequency response for H1*H2, HD must be the solution. It's the only frequency response with enough wiggles.

    Since |HA(e)| = |H1(e)||H2(e)|, |α| = 2(2 + sqrt(3)) = 4 + 2sqrt(3).

  4. Which frequency response (A, B, C or D) corresponds to a unit sample response given by

    h[n] = α δ[n] - h2[n]

    and what is the numerical value of |α|?

    Must be HC by elimination but also because none of the other frequency repsonse could be generated by a single magnitude shift of H2(e).

    HC(ej0) = 0 so |α| = |H2(ej0)| = 2 - sqrt(3).

  5. Suppose the input to each of the above four systems is

    x[n]=0 for n < 0 and
    x[n] = cos(nπ/6) + cos(nπ/2) + 1.0 for n ≥ 0

    Which system (A, B, C or D) produced an output, y[n] below, and what is the value of y[n] for n > 10?

    Must be HA, as |HA(e)| = 0 for Ω=±π/6 and Ω=±π/2.

    y[n] for n > 10 = |HA(ej0)|*1 = 4 - 2sqrt(3)

  6. Suppose the input to each of the above four systems is

    x[n]=0 for n < 0 and
    x[n] = cos(nπ/6) + cos(nπ/2) + 1.0 for n ≥ 0

    Which system (H1 or H2) produced an output, y[n] below, and what is the value of y[22]?

    Must be H1 since the H2 system would eliminate cos(π/6), and since the output will eventually be a cosine offset by H1(ej0)*1.

    First compute some useful H's from the given h[n]:

    H(e) = 1 + e-j2Ω
    H(ej0) = 1 + 1 = 2
    H(ej(-π/6)) = 1 + ejπ/3
    H(ej(π/6)) = 1 + e-jπ/3
    H(ej(-π/2)) = 1 + e = 1 - 1 = 0
    H(ej(π/2)) = 1 + e-jπ = 1 - 1 = 0
    
    Now we can plug those into our equation for y[n] that uses the spectral coefficients for x[n] and the frequency response H:
    y[n] = ΣkakH(ejk(2π/N))ejk(2π/N)n
         = 2 + (1/2)H(ej(-π/6))ej(-π/6)n  + (1/2)H(ej(π/6))ej(π/6)n
         = 2 + (1/2)(1 + ejπ/3)ej(-π/6)n  + (1/2)(1 + e-jπ/3)ej(π/6)n
         = 2 + (1/2)ej(-π/6)n + (1/2)e-j((π/6)n - π/3) + (1/2)ej(π/6)n + (1/2)ej((π/6)n - π/3)
         = 2 + cos((π/6)n) + cos((π/6)n - π/3)
    
    So
    y[22] = 2 + cos(22π/6) + cos(22π/6 - π/3)
          = 2 + 0.5 - 0.5
          = 2
    


Problem .

In answering the several parts of this question, consider three linear time-invariant filters, denoted A, B, and C, each characterized by the magnitude of their frequency responses, |HA(e)|, |HB(e)|, |HC(e)|, respectively, as given in the plots below.

  1. Which frequency response (A, B, or C) corresponds to the following unit sample response, and what is maxΩ |H(e)| for your selected filter? Please justify your selection.

    Plan of attack: evaluate |H(e)| at several frequencies and see what we find.
    Ω=0: |H(ej0)| = |Σh[n](1)| = 0
    Ω=π: |H(e)| = |Σh[n](-1)n| = 6
    
    The only plot with a frequency response of 0 at frequency 0 and something non-zero at frequency π is the one for filter A.

    Looking at the frequency response for A, it has its largest magnitude at ±π, which we calculated above to be 6.

  2. Which frequency response (A, B, or C) corresponds to the following unit sample response, and is maxΩ |H(e)| > 6 for your selected filter? Please justify your answers.

    Repeating the strategy of part A:
    Ω=0: |H(ej0)| = |Σh[n]| = 1 + .5 - 1.5 - 1.5 + .5 + 1 = 0
    Ω=π: |H(e)| = |Σh[n](-1)n| = 1 -.5 - 1.5 + 1.5 +.5 - 1 = 0
    
    The only plot with a frequency response of 0 at frequencies 0 and π is the one for filter B.

    The maximum magnitude of the frequency response is given by:

    |H(e)| = |Σnh[n]e-jΩn| ≤ Σn|h[n]|(1) ≤ 6.
    
    So, no, it's not bigger than 6.

  3. Suppose the input to each of the above three filters is x[n] = 0 for n < 0 and for n ≥ 0 is

    x[n] = cos((π/3)n) + cos(πn) + 1.0

    Which filter (A, B,or C) produced the output, y[n] below, and what is maxΩ |H(e)| for your selected system?

    The output reaches a steady state at y[n] = 6, with no changes in value after that point. So sinusoidal components of x[n] must have been filtered out, i.e., H(ejπ/3) = 0 and H(e) = 0.

    The only other component of x[n] is the constant 1, so that means that H(ej0) = 6 since constant inputs have frequency 0.

    The only plot that satisfies these conditions is C. From the plot of C's frequency response, the maximum magnitude occurs at frequency 0 and has the value 6 as we calculated above.

  4. Six new filters were generated using the unit sample responses of filters A, B and C, denoted hA[n], hB[n], and hC[n] respectively. The unit sample responses of the new filters were gener- ated in the following way:

    Which of the six new filters has the frequency response plotted below?

    Only HC in non-zero at frequency 0 and only HA is non-zero at frequency π. So plot must correspond to new filter 2, which is filters A and C in parallel.

    Which of the six new filters from the previous question has the frequency response plotted below?

    Looking at the zeros in the plot above, the combination could have only come from two filters in series. Comparing the size of the response near frequency 0 with the response near frequency π, it must be filter B in series with filter C, i.e., new filter 6.