6.02 Practice Problems: Discrete-Time Fourier Series and Spectral Representation


Problem .

Consider the following signals, which are periodic with period N. This N can be different for each of the sub parts. 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. Then pick off the coefficients by pattern matching to the analysis equation.
    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)α