Chapter 5

Fourier Analysis for Discrete-Time Signals and Systems

Chapter Objectives

  • Learn the use of discrete-time Fourier series for representing periodic signals using orthogonal basis functions.
  • Learn the discrete-time Fourier transform (DTFT) for non-periodic signals as an extension of discrete-time Fourier series for periodic signals.
  • Study properties of the DTFT. Understand energy and power spectral density concepts.
  • Explore frequency-domain characteristics of DTLTI systems. Understand the system function concept.
  • Learn the use of frequency-domain analysis methods for solving signal-system interaction problems with periodic and non-periodic input signals.
  • Understand the fundamentals of the discrete Fourier transform (DFT) and fast Fourier transform (FFT). Learn how to compute linear convolution using the DFT.

5.1 Introduction

In Chapter 1 and Chapter 3 we have developed techniques for analyzing discrete-time signals and systems from a time-domain perspective. A discrete-time signal can be modeled as a function of the sample index. A DTLTI system can be represented by means of a constant-coefficient linear difference equation, or alternatively by means of an impulse response. The output signal of a DTLTI system can be determined by solving the corresponding difference equation or by using the convolution operation.

In this chapter frequency-domain analysis methods are developed for discrete-time signals and systems. Section 5.2 focuses on analyzing periodic discrete-time signals in terms of their frequency content. Discrete-time Fourier series (DTFS) is presented as the counterpart of the exponential Fourier series (EFS) studied in Chapter 4 for continuous-time signals. Frequency-domain analysis methods for non-periodic discrete-time signals are presented in Section 5.3 through the use of the discrete-time Fourier transform (DTFT). Energy and power spectral density concepts for discrete-time signals are introduced in Section 5.4. Section 5.5, Section 5.6 and Section 5.7 cover the application of frequency-domain analysis methods to the analysis of DTLTI systems. Section 5.8 introduces the discrete Fourier transform (DFT) and the fast Fourier transform (FFT).

5.2 Analysis of Periodic Discrete-Time Signals

In Section 4.2 of Chapter 4 we have focused on expressing continuous-time periodic signals as weighted sums of sinusoidal or complex exponential basis functions. It is also possible to express a discrete-time periodic signal in a similar manner, as a linear combination of discrete-time periodic basis functions. In this section we will explore one such periodic expansion referred to as the discrete-time Fourier series (DTFS). In the process we will discover interesting similarities and differences between DTFS and its continuous-time counterpart, the exponential Fourier series (EFS) that was discussed in Section 4.2. One fundamental difference is regarding the number of series terms needed. We observed in Chapter 4 that a continuous-time periodic signal may have an infinite range of frequencies, and therefore may require an infinite number of harmonically related basis functions. In contrast, discrete-time periodic signals contain a finite range of angular frequencies, and will therefore require a finite number of harmonically related basis functions. We will see in later parts of this section that a discrete-time signal with a period of N samples will require at most N basis functions.

5.2.1 Discrete-Time Fourier Series (DTFS)

Consider a discrete-time signal x˜[n] periodic with a period of N samples, that is, x˜[n]=x˜[n+N] for all n. As in Chapter 4 periodic signals will be distinguished through the use of the tilde (˜) character over the name of the signal. We would like to explore the possibility of writing x˜[n] as a linear combination of complex exponential basis functions in the form

ϕk[n]=ejΩkn(5.1)

using a series expansion

x˜[n]=kc˜kϕk[n]=kc˜kejΩkn(5.2)

Two important questions need to be answered:

  1. How should the angular frequencies Ωk be chosen?
  2. How many basis functions are needed? In other words, what should be the limits of the summation index k in Eqn. (5.2)?

Intuitively, since the period of x˜[n] is N samples long, the basis functions used in constructing the signal must also be periodic with N. Therefore we require

ϕk[n+N]=ϕk[n](5.3)

for all n. Substituting Eqn. (5.1) into Eqn. (5.3) leads to

ejΩk(n+N)=ejΩkn(5.4)

For Eqn. (5.4) to be satisfied we need ejΩkN = 1, and consequently ΩkN = 2πk. The angular frequency of the basis function φk[n] must be

Ωk=2πkN(5.5)

leading to the set of basis functions

ϕk[n]=ej(2π/N)kn(5.6)

Using φk[n] found, the series expansion of the signal x˜[n] is in the form

x˜[n]=kc˜kej(2π/N)kn(5.7)

To address the second question, it can easily be shown that only the first N basis functions φ0[n]1[n],...,φN−1[n] are unique; all other basis functions, i.e., the ones obtained for k < 0 or k ≥ N, are duplicates of the basis functions in this set. To see why this is the case, let us write φk+N [n]:

ϕk+N[n]=ej(2π/N)(k+N)n(5.8)

Factoring Eqn. (5.8) into two exponential terms and realizing that ej2πn = 1 for all integers n we obtain

ϕk+N[n]=ej(2π/N)knej2πn=ej(2π/N)kn=ϕk[n](5.9)

Since φk+N[n] is equal to φk[n], we only need to include N terms in the summation of Eqn. (5.7).

The signal x˜[n] can be constructed as

x˜[n]=k=0Nc˜kej(2π/N)kn(5.10)

As a specific example, if the period of the signal x˜[n] is N = 5, then the only basis functions that are unique would be

ϕk[n]fork=0,1,2,3,4

Increasing the summation index k beyond k = 4 would not create any additional unique terms since φ5[n] = φ0[n], φ6[n]= φ1[n], and so on.

Eqn. (5.10) is referred to as the discrete-time Fourier series (DTFS) expansion of the periodic signal x˜[n]. The coefficients c˜k used in the summation of Eqn. (5.10) are the DTFS coefficients of the signal x˜[n].

Example 5.1: DTFS for a discrete-time sinusoidal signal

Determine the DTFS representation of the signal x˜[n]=cos(2πn).

Solution: The angular frequency of the signal is

Ω0=2πt    rad

and it corresponds to the normalized frequency

F0=Ω02π=12

Since normalized frequency F0 is an irrational number, the signal specified is not periodic (refer to the discussion in Section 1.4.4 of Chapter 1). Therefore it cannot be represented in series form using periodic basis functions. It can still be analyzed in the frequency domain, however, using the discrete-time Fourier transform (DTFT) which will be explored in Section 5.3.

Example 5.2: DTFS for a discrete-time sinusoidal signal revisited

Determine the DTFS representation of the signal x˜[n]=cos(0.2πn).

Solution: The angular frequency of the signal is

Ω0=0.2π     rad

and the corresponding normalized frequency is

F0=Ω02π=110

Based on the normalized frequency, the signal is periodic with a period of N = 1/F0 = 10 samples. A general formula for obtaining the DTFS coefficients will be derived later in this section. For the purpose of this example, however, we will take a shortcut afforded by the sinusoidal nature of the signal x˜[n], and express it using Euler’s formula:

x˜[n]=12ej0.2πn+12ej0.2πn=12ej(2π/10)n+12ej(2π/10)n(5.11)

The two complex exponential terms in Eqn. (5.11) correspond to φ1[n] and φ1[n], therefore their coefficients must be c˜1 and c˜1, respectively. As a result we have

c˜1=12,andc˜1=12(5.12)

As discussed in the previous section we would like to see the series coefficients c˜k in the index range k = 0,...,N − 1 where N is the period. In this case we need to obtain c˜k for k = 0,..., 9. The basis functions have the property

ϕk[n]=ϕk+N[n]

The term φ1[n] in Eqn. (5.11) can be written as

ϕ1[n]=ej(2π/10)n=ej(2π/10)nej2πn=ej(18π/10)n=ϕ9[n](5.13)

Eqn. (5.11) becomes

x˜[n]=cos(0.2πn)=12ej(2π/10)n+12ej(18π/10)n=c˜1ej(2π/10)n+c˜9ej(18π/10)n

DTFS coefficients are

c˜k={12,k=1 or k=90,otherwise

The signal x˜[n] and its DTFS spectrum c˜k are shown in Fig. 5.1.

Figure 5.1

Figure showing (a) The signal x˜[n] for Example 5.2, and (b) its DTFS spectrum.

(a) The signal x˜[n] for Example 5.2, and (b) its DTFS spectrum.

Software resources:

ex_5_2.m

Example 5.3: DTFS for a multi-tone signal

Determine the DTFS coefficients for the signal

x˜[n]=1+cos(0.2πn)+2sin(0.3πn)

Solution: The two angular frequencies Ω1 = 0.2π and Ω2 = 0.3π radians correspond to normalized frequencies F1 = 0.1 and F2 = 0.15 respectively. The normalized fundamental frequency of x˜[n] is F0 = 0.05, and it corresponds to a period of N = 20 samples. Using this value of N, the angular frequencies of the two sinusoidal terms of x˜[n] are

Ω1=2Ω0=2π20(2)

and

Ω2=3Ω0=2π20(3)

We will use Euler’s formula to write x˜[n] in the form

x˜[n]=1+12ej(2π/20)2n+12ej(2π/20)2n+1jej(2π/20)3n1jej(2π/20)3n=1+12ϕ2[n]+13ϕ2[n]+1jϕ3[n]1jϕ3[n]=1+12ϕ2[n]+12ϕ2[n]+ejπ/2ϕ3[n]ejπ/2ϕ3[n]

The DTFS coefficients are

c˜0=1c˜2=12,c˜2=12c˜3=ejπ/2,c˜3=ejπ/2

We know from the periodicity of the DTFS representation that

c˜2=c˜18andc˜3=c˜17(5.14)

The signal x˜[n] and its DTFS spectrum c˜k are shown in Fig. 5.2.

Figure 5.2

Figure showing (a) The signal x˜[n] for Example 5.3, (b) magnitude of the DTFS spectrum, and (c) phase of the DTFS spectrum.

(a) The signal x˜[n] for Example 5.3, (b) magnitude of the DTFS spectrum, and (c) phase of the DTFS spectrum.

Software resources:

ex_5_3.m

Finding DTFS coefficients

In Examples 5.2 and 5.3 the DTFS coefficients for discrete-time sinusoidal signals were easily determined since the use of Euler’s formula gave us the ability to express those signals in a form very similar to the DTFS expansion given by Eqn. (5.7). In order to determine the DTFS coefficients for a general discrete-time signal we will take advantage of the orthogonality of the basis function set k[n], k = 0,...,N − 1}. It can be shown that (see Appendix D)

n=0N1ej(2π/N)(mk)n={N,(mk)=rN, r integer0,otherwise(5.15)

To derive the expression for the DTFS coefficients, let us first write Eqn. (5.10) using m instead of k as the summation index:

x˜[n]=m=0N1c˜mej(2π/N)mn(5.16)

Multiplication of both sides of Eqn. (5.7) by ej(2π/N)kn leads to

x˜[n]ej(2π/N)kn=m=0N1c˜mej(2π/N)mnej(2π/N)kn(5.17)

Summing the terms on both sides of Eqn. (5.17) for n = 0,...,N − 1, rearranging the summations, and using the orthogonality property yields

n=0N1x˜[n]ej(2π/N)kn=n=0N1m=0N1c˜mej(2π/N)mnej(2π/N)kn=m=0N1c˜mn=0N1ej(2π/N)(mk)n=c˜kN(5.18)

The DTFS coefficients are computed from Eqn. (5.18) as

c˜=1Nn=0N1x˜[n]ej(2π/N)kn,k=0,...,N1(5.19)

In Eqn. (5.19) the DTFS coefficients are computed for the index range k = 0,...,N − 1 since those are the only coefficient indices that are needed in the DTFS expansion in Eqn. (5.10). If we were to use Eqn. (5.19) outside the specified index range we would discover that

c˜k+rN=c˜k(5.20)

for all integers r. The DTFS coefficients evaluated outside the range k = 0,...,N − 1 exhibit periodic behavior with period N. This was evident in Examples 5.2 and 5.3 as well. The development so far can be summarized as follows:

Discrete-Time Fourier Series (DTFS):

  1. Synthesis equation:

    x˜[n]=k=0N1c˜kej(2π/N)kn,all  n(5.21)

  2. Analysis equation:

    c˜k=1Nn=0N1x˜[n]ej(2π/N)kn(5.22)

Note that the coefficients c˜k are computed for all indices k in Eqn. (5.22), however, only the ones in the range k = 0,...,N − 1 are needed in constructing the signal x˜[n] in Eqn. (5.21). Due to the periodic nature of the DTFS coefficients c˜k, the summation in the synthesis equation can be started at any arbitrary index, provided that the summation includes exactly N terms. In other words, Eqn. (5.21) can be written in the alternative form

x˜[n]=k=N0N0+N1c˜kej(2π/N)kn,all n (5.23)

Example 5.4: Finding DTFS representation

Consider the periodic signal x˜[n] defined as

x˜[n]=nfor n=0,1,2,3,4andx˜[n+5]=x˜[n]

and shown in Fig. 5.3. Determine the DTFS coefficients for x˜[n]. Afterwards, verify the synthesis equation in Eqn. (5.21).

Figure 5.3

Figure showing the signal x˜[n] for Example 5.4.

The signal x˜[n] for Example 5.4.

Solution: Using the analysis equation given by Eqn. (5.22) the DTFS coefficients are

c˜k=15n=04x˜[n]ej(2π/5)kn=15ej2πk/5+25ej4πk/5+35ej6πk/5+45ej8πk/5(5.24)

Evaluating Eqn. (5.24) for k = 0,..., 4 we get

c˜0=2c˜1=0.5+j0.6882c˜2=0.5+j0.1625c˜3=0.5j0.1625c˜4=0.5j0.6882

The signal x˜[n] can be constructed from DTFS coefficients as

x˜[n]=c˜0+c˜1ej2πn/5+c˜2ej4πn/5+c˜4ej8πn/5 =2+(0.5+j0.6882)ej2πn/5+(0.5+j0.1625)ej4πn/5 +(0.5j0.1625)ej6πn/5 +(0.5j0.6882)ej8πn/5

Software resources:

ex_5_4a.m

ex_5_4b.m

Example 5.5: DTFS for discrete-time pulse train

Consider the periodic pulse train x˜[n] defined by

x˜[n]={1,LnL0,L<n<NLand x˜[n+N]=x˜[n]

where N > 2L + 1 as shown in Fig. 5.4. Determine the DTFS coefficients of the signal x˜[n] in terms of L and N.

Figure 5.4

Figure showing the signal x˜[n] for Example 5.5.

The signal x˜[n] for Example 5.5.

Solution: Using Eqn. (5.22) the DTFS coefficients are

c˜k=1Nn=LL(1)ej(2π/N)kn

The closed form expression for a finite-length geometric series is (see Appendix C for derivation)

Eqn(C.13):n=L1L2an=aL1aL2+11a

Using Eqn. (C.13) with a = ej(2π/N)k, L1 = −L and L2 = L, the closed form expression for c˜k is

c˜k=1Nej(2π/N)Lkej(2π/N)(L+1)k1ej(2π/N)k(5.25)

In order to get symmetric complex exponentials in Eqn. (5.25) we will multiply both the numerator and the denominator of the fraction on the right side of the equal sign with ejπk/N resulting in

c˜k=1Nej(2π/N)(L+1/2)kej(2π/N)(L+1/2)kej(2π/N)(k/2)ej(2π/N)(k/2)(5.26)

which, using Euler’s formula, can be simplified to

c˜k=sin(πkN(2L+1))Nsin(πkN),k=0,...,N1

The coefficient c˜0 needs special attention. Using L’Hospital’s rule we obtain

c˜0=2L+1N

The DTFS representation of the signal x˜[n] is

x˜[n]=k=0N1[sin(πkN(2L+1))Nsin(πkN)]ej(2π/N)kn

The DTFS coefficients are graphed in Fig. 5.5 for N = 40 and L = 3, 5, and 7.

Figure 5.5

Figure showing the DTFS coefficients of the signal x˜[n] of Example 5.5 for N = 40 and (a) L = 3, (b) L = 5, and (c) L = 7.

The DTFS coefficients of the signal x˜[n] of Example 5.5 for N = 40 and (a) L = 3, (b) L = 5, and (c) L = 7.

Software resources:

ex_5_5.m

Interactive Demo: dtfs_demo1

The demo program in “dtfs_demo1.m” provides a graphical user interface for computing the DTFS representation of the periodic discrete-time pulse train of Example 5.5. The period is fixed at N = 40 samples. The parameter L can be varied from 0 to 19. The signal x˜[n] and its DTFS coefficients c˜k are displayed.

  1. Set L = 0. Observe the coefficients and comment.
  2. Increment L to 2, 3, 4,... and observe the changes to DTFS coefficients. Pay attention to the outline (or the envelope) of the coefficients. Can you identify a pattern that emerges as L is incremented.

Software resources:

dtfs_demo1.m

Software resources:

See MATLAB Exercises 5.1 and MATLAB Exercise 5.2.

5.2.2 Properties of the DTFS

In this section we will summarize a few important properties of the DTFS representation of a periodic signal. To keep the notation compact, we will denote the relationship between the periodic signal x˜[n] and its DTFS coefficients c˜k as

x˜[n]DTFSc˜k(5.27)

Periodicity

DTFS coefficients are periodic with the same period N as the signal x˜[n].

Given

x˜[n]=x˜[n+rN],all integer  r

it can be shown that

c˜k=c˜k+rN,all integer   r(5.28)

Periodicity of DTFS coefficients follows easily from the analysis equation given by Eqn. (5.22).

Linearity

Let x˜1[n] and x˜2[n] be two signals, both periodic with the same period, and with DTFS representations

x˜1[n]DTFSc˜kandx˜2[n]DTFSd˜k

It can be shown that

α1x˜1[n]+α2x˜2[n]DTFSα1c˜k+α2d˜k(5.29)

for any two arbitrary constants α1 and α2.

Linearity property is easily proven starting with the synthesis equation in Eqn. (5.21).

Time shifting

Given that

x˜kDTFSc˜k

it can be shown that

x˜[nm]DTFSej(2π/N)kmc˜k(5.30)

Time shifting the signal x˜[n] causes the DTFS coefficients to be multiplied by a complex exponential function.

Consistency check: Let the signal be time shifted by exactly one period, that is, m = N. We know that x˜[nN]=x˜[n] due to the periodicity of x˜[n]. The exponential function on the right side of Eqn. (5.30) would be ej(2π/N)kN = 1, and the DTFS coefficients remain unchanged, as expected.

Symmetry of DTFS coefficients

Conjugate symmetry and conjugate antisymmetry properties were defined for discrete-time signals in Section 1.4.6 of Chapter 1. Same definitions apply to DTFS coefficients as well. A conjugate symmetric set of coefficients satisfy

c˜k*=c˜k(5.31)

for all k. Similarly, the coefficients form a conjugate antisymmetric set if they satisfy

c˜k*=c˜k(5.32)

for all k. For a signal x˜[n] which is periodic with N samples it is customary to use the DTFS coefficients in the index range k = 0,...,N − 1. The definitions in Equation (5.31) and Equation (5.32) can be adjusted in terms of their indices using the periodicity of the DTFS coefficients. Since c˜k=c˜Nk, a conjugate symmetric set of DTFS coefficients have the property

c˜k*=c˜Nk,k=0,...,N1(5.33)

Similarly, a conjugate antisymmetric set of DTFS coefficients have the property

c˜k*=c˜Nk,k=0,...,N1(5.34)

If the signal x˜[n] is real-valued, it can be shown that its DTFS coefficients form a conjugate symmetric set. Conversely, if the signal x˜[n] is purely imaginary, its DTFS coefficients form a conjugate antisymmetric set.

Symmetry of DTFS coefficients:

x˜[n]:Real,Im{x˜[n]}=0implies thatc˜k*=c˜Nk(5.35)

x˜[n]:Imag,Re{x˜[n]}=0implies thatc˜k*=c˜Nk(5.36)

Polar form of DTFS coefficients

DTFS coefficients can be written in polar form as

c˜k=|c˜k|ejθ¯k(5.37)

If the set {c˜k} is conjugate symmetric, the relationship in Eqn. (5.33) leads to

|c˜k|ejθ¯k=|c˜Nk|ejθ¯Nk(5.38)

using the polar form of the coefficients. The consequences of Eqn. (5.38) are obtained by equating the magnitudes and the phases on both sides.

Conjugate symmetric coefficients: c˜k*=c˜Nk

Magnitude:|c˜k|=|c˜Nk|=|c˜k|(5.39)

Phase:θ˜k=θ˜Nk=θ˜k(5.40)

It was established in Eqn. (5.35) that the DTFS coefficients of a real-valued x˜[n] are conjugate symmetric. Based on the results in Equation (5.39) and Equation (5.40) the magnitude spectrum is an even function of k, and the phase spectrum is an odd function of k.

Similarly, if the set {c˜k} is conjugate antisymmetric, the relationship in Eqn. (5.34) reflects on polar form of c˜k as

|c˜k|ejθ¯k=|c˜Nk|ejθ¯Nk(5.41)

The negative sign on the right side of Eqn. (5.41) needs to be incorporated into the phase since we could not write |c˜k|=|c˜Nk| (recall that magnitude must to be non-negative). Using e = 1, Eqn. (5.41) becomes

|c˜k|ejθ¯k=|c˜Nk|ejθ¯Nkejπ=|c˜Nk|ej(θ¯Nkπ)(5.42)

The consequences of Eqn. (5.42) are summarized below.

Conjugate antisymmetric coefficients: c˜k*=c˜Nk

Magnitude:|c˜k|=|c˜Nk|=|c˜k|(5.43)

Phase:θ˜k=θ˜Nk±π=θ˜k±π(5.44)

A purely imaginary signal x˜[n] leads to a set of DTFS coefficients with conjugate antisymmetry. The corresponding magnitude spectrum is an even function of k as suggested by Eqn. (5.43). The phase spectrum is neither even nor odd.

Example 5.6: Symmetry of DTFS coefficients

Recall the real-valued periodic signal x˜[n] of Example 5.4 shown in Fig. 5.3. Its DTFS coefficients were found as

c˜0=2c˜1=0.5+j0.6882c˜2=0.5+j0.1625c˜3=0.5j0.1625c˜4=0.5j0.6882

It can easily be verified that coefficients form a conjugate symmetric set. With N = 5 we have

k=1c˜1*=c˜4k=2c˜2*=c˜3

DTFS spectra of even and odd signals

If the real-valued signal x˜[n] is an even function of index n, the resulting DTFS spectrum c˜k is real-valued for all k.

x˜[n]=x˜[n],all  nimplies thatIm{c˜k}=0, all k(5.45)

Conversely it can also be proven that, if the real-valued signal x˜[n] has odd-symmetry, the resulting DTFS spectrum is purely imaginary.

x˜[n]=x˜[n],all  nimplies thatRe{c˜k}=0, all k(5.46)

Example 5.7: DTFS symmetry for periodic waveform

Explore the symmetry properties of the periodic waveform x˜[n] shown in Fig. 5.6. One period of x˜[n] has the sample amplitudes

x˜[n]={...,0n=0,12,1,34,0,34,1,12,...}

Figure 5.6

Figure showing the signal x˜[n] for Example 5.7.

The signal x˜[n] for Example 5.7.

Solution: The DTFS coefficients for x˜[n] are computed as

c˜k=n=07x˜[n]ej(2π/8)kn

and are listed for k = 0,..., 8 in Table 5.1 along with magnitudes and phase values for each. Symmetry properties can be easily observed. The signal is real-valued, therefore the DTFS spectrum is conjugate symmetric:

k=1c˜1*=c˜7k=2c˜2*=c˜6k=3c˜3*=c˜5

Table 5.1

DTFS coefficients for the pulse train of Example 5.7.

k

c˜k

|c˜k|

θk

0

0.0

0.0

N/A

1

j0.4710

0.4710

π/2

2

j0.0625

0.0625

−π/2

3

j0.0290

0.0290

−π/2

4

0.0

0.0

N/A

5

j0.0290

0.0290

π/2

6

j0.0625

0.0625

π/2

7

j0.4710

0.4710

−π/2

Furthermore, the odd symmetry of x˜[n] causes coefficients to be purely imaginary:

Re{c˜k}=0k=0,...,7

In terms of the magnitude values we have

k=1|c˜1|=|c˜7|k=2|c˜2|=|c˜6|k=2|c˜3|=|c˜5|

For the phase angles the following relationships hold:

k=1θ˜1=θ˜7k=2θ˜2=θ˜6k=2θ˜3=θ˜5

The phase values for θ˜0 and θ˜4 are insignificant since the corresponding magnitude values |c˜0| and |c˜4| are equal to zero.

Software resources:

ex_5_7.m

Periodic convolution

Consider the convolution of two discrete-time signals defined by Eqn. (3.128) and repeated here for convenience:

Eqn.(3.128):y[n]=x[n]*h[n]=k=x[k]h[nk]

This summation would obviously fail to converge if both signals x[n] and h[n] happen to be periodic with periods of N. For such a case, a periodic convolution operator can be defined as

y˜[n]=x˜[n]h˜[n]=k=0N1x˜[k]h˜[nk],all  n(5.47)

Eqn. (5.47) is essentially an adaptation of the convolution sum to periodic signals where the limits of the summation are modified to cover only one period (we are assuming that both x˜[n] and h˜[n] have the same period N). It can be shown that (see Problem 5.7) the periodic convolution of two signals x˜[n] and h˜[n] that are both periodic with N is also periodic with the same period.

Example 5.8: Periodic convolution

Two signals x˜[n] and h˜[n], each periodic with N = 5 samples, are shown in Fig. 5.7(a) and (b). Determine the periodic convolution

y˜[n]=x˜[n]h˜[n](5.48)

Figure 5.7

Figure showing Signals x˜[n] and h˜[n] for Example 5.4.

Signals x˜[n] and h˜[n] for Example 5.4.

Solution: Sample amplitudes for one period are

x˜[n]={...,0n=0,1,2,3,4,...}

and

h˜[n]={...,3n=0,3,3,2,1,...}

The periodic convolution is given by

y˜[n]=k=04x˜[k]h˜[nk]

To start, let n = 0. The terms x˜[k] and h˜[0k] are shown in Fig. 5.8. The main period of each signal is indicated with sample amplitudes colored blue. The shaded area contains the terms included in the summation for periodic convolution. The sample y˜[0] is computed as

y˜[0]=x˜[0]h˜[0]+x˜[1]h˜[4]+x˜[2]h˜[3]+x˜[3]h˜[2]+x˜[4]h˜[1]=(0)(3)+(1)(1)+(2)(3)+(3)(3)+(4)(4)=2

Figure 5.8

Figure showing the terms ˜x[k] and ˜h[0 − k] in the convolution sum.

The terms x˜[k] and h˜[0k] in the convolution sum.

Next we will set n = 1. The terms x˜[k] and h˜[1k] are shown in Fig. 5.9.

Figure 5.9

Figure showing the terms ˜x[k] and ˜h[1 − k] in the convolution sum.

The terms x˜[k] and h˜[1k] in the convolution sum.

The sample y˜[1] is computed as

y˜[1]=x˜[0]h˜[1]+x˜[1]h˜[0]+x˜[2]h˜[4]+x˜[3]h˜[3]+x˜[4]h˜[2]=(0)(3)+(1)(3)+(2)(1)+(3)(2)+(4)(3)=17

Finally, for n = 2 the terms involved in the summation are shown in Fig. 5.10.

Figure 5.10

Figure showing the terms ˜x[k] and ˜h[2 − k] in the convolution sum.

The terms x˜[k] and h˜[2k] in the convolution sum.

The sample y˜[2] is computed as

y˜[2]=x˜[0]h˜[2]+x˜[1]h˜[1]+x˜[2]h˜[0]+x˜[3]h˜[4]+x˜[4]h˜[3]=(0)(3)+(1)(3)+(2)(3)+(3)(1)+(4)(2)=2

Continuing in this fashion, it can be shown that y˜[3]=8 and y˜[4]=13. Thus, one period of the signal y˜[n] is

y˜[n]={...,2,17,2,8,13,...}

The signal y˜[n] is shown in Fig. 5.11.

Figure 5.11

Figure showing Periodic convolution result ˜y[n] for Example 5.8.

Periodic convolution result ˜y[n] for Example 5.8.

The periodic convolution property of the discrete-time Fourier series can be stated as follows:

Let x˜[n] and h˜[n] be two signals both periodic with the same period, and with DTFS representations

x˜[n]DTFSc˜kandh˜[n]DTFSd˜k

It can be shown that

x˜[n]h˜[n]DTFSNc˜kd˜k(5.49)

The DTFS coefficients of the periodic convolution result are equal to N times the product of the DTFS coefficients of the two signals.

Let y˜[n]=x˜[n]h˜[n], and let the DTFS coefficients of y˜[n] be e˜k. Using the DTFS analysis equation, we can write

e˜k=1Nn=0N1y˜[n]ej(2π/N)kn(5.50)

Substituting

y˜[n]=m=0N1x˜[m]h˜[nm](5.51)

into Eqn. (5.50) we obtain

e˜k=1Nn=0N1[m=0N1x˜[m]h˜[nm]]ej(2π/N)kn(5.52)

Changing the order of the two summations and rearranging terms leads to

e˜k=m=0N1x˜[m][1Nn=0N1h˜[nm]ej(2π/N)kn](5.53)

In Eqn. (5.53) the term in square brackets represents the DTFS coefficients for the time shifted periodic signal h˜[nm], and is evaluated as 1 N

1Nn=0N1h˜[nm]ej(2π/N)kn=ej(2π/N)knd˜k(5.54)

Using this result Eqn. (5.53) becomes

e˜k=d˜km=0N1x˜[m]ej(2π/N)km=Nc˜kd˜k(5.55)

completing the proof.

Example 5.9: Periodic convolution

Refer to the signals x˜[n], h˜[n]and ˜y[n] of Example 5.8. The DTFS coefficients of x˜[n] were determined in Example 5.4. Find the DTFS coefficients of h˜[n] and y˜[n]. Afterwards verify that the convolution property given by Eqn. (5.49) holds.

Solution: Let c˜k, d˜k and e˜k represent the DTFS coefficients of x˜[n], h˜[n] and y˜[n] respectively. Table 5.2 lists the DTFS coefficients for the three signals. It can easily be verified that

e˜k=5c˜kd˜k,k=0,...,4

Table 5.2

DTFS coefficients for Example 5.9.

k

c˜k

d˜k

e˜k

0

2.0000+j 0.0000

0.0000+j 0.0000

0.0000+j 0.0000

1

0.5000+j 0.6882

1.5326−j 0.6433

1.6180+j 6.8819

2

0.5000+j 0.1625

0.0326−j 0.6604

0.6180+j 1.6246

3

0.5000−j 0.1625

0.0326+j 0.6604

0.6180−j 1.6246

4

0.5000−j 0.6882

1.5326+j 0.6433

1.6180−j 6.8819

Software resources:

ex_5_9.m

Software resources:

See MATLAB Exercise 5.3.

5.3 Analysis of Non-Periodic Discrete-Time Signals

In the previous section we have focused on representing periodic discrete-time signals using complex exponential basis functions. The end result was the discrete-time Fourier series (DTFS) that allowed a signal periodic with a period of N samples to be constructed using N harmonically related exponential basis functions. In this section we extend the DTFS concept for use in non-periodic signals.

5.3.1 Discrete-time Fourier transform (DTFT)

In the derivation of the Fourier transform for non-periodic discrete-time signals we will take an approach similar to that employed in Chapter 4. Recall that in Section 4.3.1 a non-periodic continuous-time signal was viewed as a limit case of a periodic continuous-time signal, and the Fourier transform was derived from the exponential Fourier series. The resulting development is not a mathematically rigorous derivation of the Fourier transform, but it is intuitive. Let us begin by considering a non-periodic discrete-time signal x[n] as shown in Fig. 5.12.

Figure 5.12

Figure showing A non-periodic signal x[n].

A non-periodic signal x[n].

Initially we will assume that x[n] is finite-length with its significant samples confined into the range −M ≤ n ≤ M of the index, that is, x[n]= 0 for n< −M and for n>M. A periodic extension x˜[n] can be constructed by taking x[n] as one period in −M ≤ n ≤ M, and repeating it at intervals of 2M + 1 samples.

x˜[n]=k=x[n+k(2M+1)](5.56)

This is illustrated in Fig. 5.13.

Figure 5.13

Figure showing Periodic extension x˜[n] of the signal x[n].

Periodic extension x˜[n] of the signal x[n].

The periodic extension x˜[n] can be expressed in terms of its DTFS coefficients. Using Eqn. (5.21) with N = 2M + 1 we obtain

x˜[n]=k=02Mc˜kej(2π/2M+1)kn=k=MMc˜kej(2π/2M+1)kn(5.57)

The coefficients are computed through the use of Eqn. (5.22) as

c˜k=12M+1n=MMx˜[n]ej(2π/2M+1)kn,k=M,...,M(5.58)

Fundamental angular frequency is

Ω0=2π2M+1radians.

The k-th DTFS coefficient is associated with the angular frequency Ωk = kΩ0 = 2πk/ (2M + 1). The set of DTFS coefficients span the range of discrete frequencies

Ωk:2M2M+1π,...,0,...,2M2M+1π(5.59)

It is worth noting that the set of coefficients in Eqn. (5.59) are roughly in the interval (−π, π), just slightly short of either end of the interval. Realizing that x˜[n]=x[n] within the range −M ≤ n ≤ M, Eqn. (5.58) can be written using x[n] instead of x˜[n] to yield

c˜k=12M+1n=MMx[n]ej(2π/(2M+1))kn,k=M,...,M(5.60)

If we were to stretch out the period of the signal by increasing the value of M, then x˜[n] would start to resemble x[n] more and more. Other effects of increasing M would be an increase in the coefficient count and a decrease in the magnitudes of the coefficients c˜k due to the 1/(2M + 1) factor in front of the summation. Let us multiply both sides of Eqn. (5.60) by 2M + 1 to obtain

(2M+1)c˜k=n=MMx[n]ej(2π/(2M+1))kn(5.61)

As M becomes very large, the fundamental angular frequency Ω0 becomes very small, and the spectral lines get closer to each other in the frequency domain, resembling a continuous transform.

Mimplies thatΩ0=2π2M+1ΔΩ and kΔΩΩ(5.62)

In Eqn. (5.62) we have switched the notation from Ω0 to ΔΩ due to the infinitesimal nature of the fundamental angular frequency. In the limit we have

limM[x˜[n]]=x[n](5.63)

in the time domain. Using the substitutions 2πk/(2M +1) Ω and (2M+1)c˜kX(Ω) Eqn. (5.61) becomes

X(Ω)=n=x[n]ejΩn(5.64)

The result in Eqn. (5.64) is referred to as the discrete-time Fourier transform (DTFT) of the signal x[n]. In deriving this result we assumed a finite-length signal x[n], the samples of which are confined into the range −M ≤ n ≤ M, and then took the limit as M →∞. Would Eqn. (5.64) still be valid for an infinite-length x[n]? The answer is yes, provided that the summation in Eqn. (5.64) converges.

Next we will try to develop some insight about the meaning of the transform X (Ω). Let us apply the limit operation to the periodic extension signal x˜[n] defined in Eqn. (5.57).

x[n]=limM[x˜[n]]=limM[k=MMc˜kej(2π/(2M+1))kn](5.65)

For large M we have from Eqn. (5.62)

(2M+1)ΔΩ2π1(5.66)

Using this result in Eqn. (5.65) leads to

x[n]=limM[k=MM(2M+1)c˜kejkΔΩnΔΩ2π](5.67)

In the limit we have

(2M+1)c˜kX(Ω),kΔΩΩ and ΔΩdΩ(5.68)

Furthermore, the summation turns into an integral to yield

x[n]=12πππX(Ω)ejΩndΩ(5.69)

This result explains how the transform X (Ω) can be used for constructing the signal x[n]. We can interpret the integral in Eqn. (5.69) as a continuous sum of complex exponentials at harmonic frequencies that are infinitesimally close to each other.

In summary, we have derived a transform relationship between x[n] and X (Ω) through the following equations:

Discrete-Time Fourier Transform (DTFT):

  1. Synthesis equation:

    x[n]=12πππX(Ω)ejΩndΩ(5.70)

  2. Analysis equation:

    X(Ω)=n=x[n]ejΩn(5.71)

Often we will use the Fourier transform operator F and its inverse F1 in a shorthand notation as

X(Ω)=F{x[n]}(5.72)

for the forward transform, and

x[n]=F1{X[Ω]}(5.73)

for the inverse transform. Sometimes we will use an even more compact notation to express the relationship between x[n] and X(Ω) by

x[n]FX(Ω)(5.74)

In general, the Fourier transform, as computed by Eqn. (5.71), is a complex function of Ω. It can be written in Cartesian form as

X(Ω)=Xr(Ω)+jXi(Ω)(5.75)

or in polar form as

X(Ω)=|X(Ω)|ejX(Ω)(5.76)

5.3.2 Developing further insight

In this section we will build on the idea of obtaining the DTFT as the limit case of DTFS coefficients when the signal period is made very large. Consider a discrete-time pulse with 7 unit-amplitude samples as shown in Fig. 5.14.

Figure 5.14

Figure showing Discrete-time rectangular pulse.

Discrete-time rectangular pulse.

The analytical definition of x[n] is

x[n]={1,n=3,...,30,otherwise(5.77)

Let the signal x˜[n] be defined as the periodic extension of x[n] with a period of 2M + 1 samples so that

x˜[n]=r=x[n+r(2M+1)](5.78)

as shown in Fig. 5.15.

Figure 5.15

Figure showing Periodic extension of discrete-time pulse into a pulse train.

Periodic extension of discrete-time pulse into a pulse train.

One period of x˜[n] extends from n = −M to n = M for a total of 2M + 1 samples. The general expression for DTFS coefficients can be found by adapting the result obtained in Example 5.5 to the signal x˜[n] with L = 3 and N = 2M + 1:

c˜k=sin(7kΩ0/2)(2M+1)sin(kΩ0/2)(5.79)

The parameter Ω0 is the fundamental angular frequency given by

Ω0=2π2M+1 rad.(5.80)

Let us multiply both sides of Eqn. (5.79) by (2M + 1) and write the scaled DTFS coefficients as

(2M+1)c˜k=sin(7kΩ0/2)sin(kΩ0/2)(5.81)

Let M = 8 corresponding to a period length of 2M + 1 = 17. The scaled DTFS coefficients are shown in Fig. 5.16(a) for the index range k = −8,..., 8. In addition, the outline (or the envelope) of the scaled DTFS coefficients is also shown.

Figure 5.16

Figure showing (a) The scaled DTFS spectrum (2M +1)c˜k for M = 8 for the signal x˜[n], (b) the scaled DTFS spectrum as a function of angular frequency Ω.

(a) The scaled DTFS spectrum (2M +1)c˜k for M = 8 for the signal x˜[n], (b) the scaled DTFS spectrum as a function of angular frequency Ω.

In Fig. 5.16(a) the leftmost coefficient has the index k = 8, and is associated with the angular frequency 0 = 16π/17. Similarly, the rightmost coefficient is at k = 8, and is associated with the angular frequency 8Ω0 = 16π/17. Fig. 5.16(b) shows the same coefficients and envelope as functions of the angular frequency Ω instead of the integer index k.

It is interesting to check the locations for the zero crossings of the envelope. The first positive zero crossing of the envelope occurs at the index value

7kΩ02=πk=2π7Ω0=2M+17(5.82)

which may or may not be an integer. For M = 8 the first positive zero crossing is at index value k = 17/7= 2.43 as shown in Fig. 5.16(a). This corresponds to the angular frequency (17/7) Ω0 = 2π/7 radians, independent of the value of M.

If we increase the period M, the following changes occur in the scaled DTFS spectrum:

  1. The number of DTFS coefficients increases since the total number of unique DTFS coefficients is the same as the period length of x˜[n] which, in this case, is 2M + 1.
  2. The fundamental angular frequency decreases since it is inversely proportional to the period of x˜[n]. The spectral lines in Fig. 5.16(b) move in closer to each other.
  3. The leftmost and the rightmost spectral lines get closer to ±π since they are ±MΩ0 = ±2Mπ/(2M +1).
  4. As M →∞ the fundamental angular frequency becomes infinitesimally small, and the spectral lines come together to form a continuous transform.

We can conclude from the foregoing development that, as the period becomes infinitely large, spectral lines of the DTFS representation of x˜[n] converge to a continuous function of Ω to form the DTFT of x[n]. Taking the limit of Eqn. (5.81) we get

X(Ω)=limM[(2M+1)c˜k]=sin(7Ω/2)sin(Ω/2)(5.83)

We will also obtain this result in Example 5.12 through direct application of the DTFT equation.

Interactive Demo: dtft_demo1

The demo program in “dtft_demo1.m” provides a graphical user interface for experimenting with the development in Section 5.3.2. Refer to Figure 5.14 through Figure 5.17, Equation (5.77) through Equation (5.81). The discrete-time pulse train has a period of 2M +1. In each period 2L+1 contiguous samples have unit amplitude. (Keep in mind that M> L.) Parameters L and M can be adjusted and the resulting scaled DTFS spectrum can be observed. As the period 2M +1 is increased the DTFS coefficients move in closer due to the fundamental angular frequency Ω0 becoming smaller. Consequently, the DTFS spectrum of the periodic pulse train approaches the DTFT spectrum of the non-periodic discrete-time pulse with 2L + 1 samples.

Figure 5.17

Figure showing the scaled DTFS spectrum for the signal x˜[n] for (a) M = 20, (b) for M = 35, and (c) for M = 60.

The scaled DTFS spectrum for the signal x˜[n] for (a) M = 20, (b) for M = 35, and (c) for M = 60.

  1. Set L = 3 and M = 8. This should duplicate Fig. 5.16. Observe the scaled DTFS coefficients. Pay attention to the envelope of the DTFS coefficients.
  2. While keeping L = 3 increment M and observe the changes in the scaled DTFS coefficients. Pay attention to the fundamental angular frequency Ω0 change, causing the coefficients to move in closer together. Observe that the envelope does not change as M is increased.

Software resources:

dtft_demo1.m

5.3.3 Existence of the DTFT

A mathematically thorough treatment of the conditions for the existence of the DTFT is beyond the scope of this text. It will suffice to say, however, that the question of existence is a simple one for the types of signals we encounter in engineering practice. A sufficient condition for the convergence of Eqn. (5.71) is that the signal x[n] be absolute summable, that is,

n=|x[n]|<(5.84)

Alternatively, it is also sufficient for the signal x[n] to be square-summable:

n=|x[n]|2<(5.85)

In addition, we will see in the next section that some signals that do not satisfy either condition may still have a DTFT if we are willing to resort to the use of singularity functions in the transform.

5.3.4 DTFT of some signals

In this section we present examples of determining the DTFT for a variety of discrete-time signals.

Example 5.10: DTFT of right-sided exponential signal

Determine the DTFT of the signal x[n]= αn u[n] as shown in Fig. 5.18. Assume |α| < 1.

Figure 5.18

Figure showing the signal x[n] for Example 5.10.

The signal x[n] for Example 5.10.

Solution: The use of the DTFT analysis equation given by Eqn. (5.71) yields

X(Ω)=n=αnu[n]ejΩn

The factor u[n] causes terms of the summation for n< 0 to equal zero. Consequently, we can start the summation at n = 0 and drop the term u[n] to write

X(Ω)=n=0αnejΩn=11αejΩ(5.86)

provided that |α| < 1. In obtaining the result in Eqn. (5.86) we have used the closed form of the sum of infinite-length geometric series (see Appendix C). The magnitude of the transform is

|X(Ω)|=1|1αejΩ|=11+α22αcos(Ω)

The phase of the transform is found as the difference of the phases of numerator and denominator of the result in Eqn. (5.86):

X(Ω)=0(1αejΩ)=tan1[αsin(Ω)1αcos(Ω)]

The magnitude and the phase of the transform are shown in Fig. 5.19(a) and (b) for the case α = 0.4.

Figure 5.19

Figure showing the DTFT of the signal x[n] for Example 5.10 for α = 0.4: (a) the magnitude,

The DTFT of the signal x[n] for Example 5.10 for α = 0.4: (a) the magnitude,

Software resources:

ex_5_10.m

Interactive Demo: dtft_demo2

The demo program in “dtft_demo2.m” is based on Example 5.10. The signal x[n] is graphed along with the magnitude and the phase of its DTFT X (Ω). The parameter α may be varied, and its effects on the spectrum may be observed.

Software resources:

dtft_demo2.m

Example 5.11: DTFT of unit-impulse signal

Determine the DTFT of the unit-impulse signal x[n] = δ[n].

Solution: Direct application of Eqn. (5.71) yields

F{δ[n]}=n=δ[n]ejΩn(5.87)

Using the sifting property of the impulse function, Eqn. (5.87) reduces to

F{δ[n]}=1,     all Ω(5.88)

Example 5.12: DTFT for discrete-time pulse

Determine the DTFT of the discrete-time pulse signal x[n] given by

x[n]={1,LnL0,otherwise

Solution: Using Eqn. (5.71) the transform is

X(Ω)=n=LL(1)ejΩn

The closed form expression for a finite-length geometric series is (see Appendix C for derivation)

Eqn(C.13):n=L1L2an=aL1aL2+11a

Using Eqn. (C.13) with a = ejΩ, L1 = −L and L2 = L, the closed form expression for X (Ω) is

X(Ω)=ejΩLejΩ(L+1)1ejΩ(5.89)

In order to get symmetric complex exponentials in Eqn. (5.89) we will multiply both the numerator and the denominator of the fraction on the right side of the equal sign with ejΩ/2. The result is

X(Ω)=ejΩ(L+1/2)ejΩ(L+1/2)ejΩ/2ejΩ/2

which, using Euler’s formula, can be simplified to

X(Ω)=sin(Ω2(2L+1))sin(Ω2)

The value of the transform at Ω = 0 must be resolved through the use of L’Hospital’s rule:

X(0)=2L+1

The transform X (Ω) is graphed in Fig. 5.20 for L = 3, 4, 5.

Figure 5.20

Figure showing the transform of the pulse signal x[n] of Example 5.12 for (a) L = 3, (b) L = 4, and (c) L = 5.

The transform of the pulse signal x[n] of Example 5.12 for (a) L = 3, (b) L = 4, and (c) L = 5.

Software resources:

ex_5_12.m

Interactive Demo: dtft_demo3

The demo program in “dtft_demo3.m” is based on computing the DTFT of a discrete-time pulse explored in Example 5.12. The pulse with 2L + 1 unit-amplitude samples centered around n = 0 leads to the DTFT shown in Fig. 5.20. The demo program allows experimentation with that spectrum as L is varied.

Software resources:

dtft_demo3.m

Example 5.13: Inverse DTFT of rectangular spectrum

Determine the inverse DTFT of the transform X (Ω) defined in the angular frequency range −π< Ω by

X(Ω)={1,Ωc<Ω<Ωc0,otherwise

Solution: To be a valid transform, X(Ω) must be 2π-periodic, therefore we need X(Ω) = X(Ω + 2π). The resulting transform is shown in Fig. 5.21.

Figure 5.21

Figure showing the transform X (Ω) for Example 5.13.

The transform X (Ω) for Example 5.13.

The inverse x[n] is found by application of the DTFT synthesis equation given by Eqn. (5.70).

x[n]=12πΩ0Ω0(1)ejΩndΩ=sin(Ωcn)πn(5.90)

It should be noted that the expression found in Eqn. (5.90) for the signal x[n] is for all n; therefore, x[n] is non-causal. For convenience let us use the normalized frequency Fc related to the angular frequency Ωc by

Ωc=2πFc

and the signal x[n] becomes

x[n]=2Fcsinc(2Fcn)

The result is shown in Fig. 5.22 for the case Fc = 1/9. Zero crossings of the sinc function in Eqn. (5.91) are spaced 1/(2Fc) apart which has the non-integer value of 4.5 in this case. Therefore, the envelope of the signal x[n] crosses the axis at the midpoint of the samples for n = 4 and n = 5.

Figure 5.22

Figure showing the signal x[n] for Example 5.13.

The signal x[n] for Example 5.13.

Software resources:

ex_5_13.m

Interactive Demo: dtft_demo4

The demo program in “dtft_demo4.m” is based on Example 5.13 where the inverse DTFT of the rectangular spectrum shown in Fig. 5.21 was determined using the DTFT synthesis equation. The demo program displays graphs of the spectrum and the corresponding time-domain signal. The normalized cutoff frequency parameter Fc of the spectrum may be varied through the use of the slider control, and its effects on the signal x[n] may be observed. Recall that Ωc = 2πFc.

Software resources:

dtft_demo4.m

Example 5.14: Inverse DTFT of the unit-impulse function

Find the signal the DTFT of which is X(Ω) = δ(Ω) in the range −π< Ω .

Solution: To be a valid DTFT, the transform X(Ω) must be 2π-periodic. Therefore, the full expression for X(Ω) must be

X(Ω)=m=δ(Ω2πm)

as shown in Fig. 5.23.

Figure 5.23

Figure showing the transform X (Ω) for Example 5.14.

The transform X (Ω) for Example 5.14.

The inverse transform is

x[n]=12πππδ(Ω)ejΩndΩ

Using the sifting property of the impulse function we get

x[n]=12π,all n

Thus we have the DTFT pair

12πFm=δ(Ω2πm)(5.91)

An important observation is in order: A signal that has constant amplitude for all index values is a power signal; it is neither absolute summable nor square summable. Strictly speaking, its DTFT does not converge. The transform relationship found in Eqn. (5.91) is a compromise made possible by our willingness to allow the use of singularity functions in X (Ω). Nevertheless, it is a useful relationship since it can be used in solving problems in the frequency domain.

Multiplying both sides of the relationship in Eqn. (5.91) by 2π results in

F{1}=2πm=δ(Ω2πm)(5.92)

which is illustrated in Fig. 5.24. This relationship is fundamental, and will be explored further in the next example.

Figure 5.24

Figure showing the constant signal x[n] = 1 and its transform X (Ω).

The constant signal x[n] = 1 and its transform X (Ω).

Example 5.15: Inverse DTFT of impulse function revisited

Consider again the DTFT transform pair found in Eqn. (5.92) of Example 5.14. The unit-amplitude signal x[n] = 1 can be thought of as the limit of the rectangular pulse signal explored in Example 5.12. Let

x[n]=1, all nandω[n]{1,LnL0,otherwise

so that

x[n]=limL[ω[n]]

Adapting from Example 5.12, the transform of w[n] is

W(Ω)=sin(Ω2(2L+1))sin(Ω2)

and the transform of x[n] was found in Example 5.14 to be

X(Ω)=2πm=δ(Ω2πm)

Intuitively we would expect W(Ω) to resemble X(Ω) more and more closely as L is increased. Fig. 5.25 shows the transform W (Ω) for L = 10, 20, and 50. Observe the transition from W (Ω) to X (Ω) as L is increased.

Figure 5.25

Figure showing the transform W (Ω) of Example 5.15 for (a) L = 10, (b) L = 20, (c) L = 50.

The transform W (Ω) of Example 5.15 for (a) L = 10, (b) L = 20, (c) L = 50.

Software resources:

ex_5_15.m

Interactive Demo: dtft_demo5

The demo program in “dtft_demo5.m” is based on Examples 5.14 and 5.15. The signal x[n] is a discrete-time pulse with 2L + 1 unit-amplitude samples centered around n = 0.

The parameter L may be varied. As L is increased, the signal x[n] becomes more and more similar to the constant amplitude signal of Example 5.14, and its spectrum approaches the spectrum shown in Fig. 5.24(b).

Software resources:

dtft_demo5.m

5.3.5 Properties of the DTFT

In this section we will explore some of the fundamental properties of the DTFT. As in the case of the Fourier transform for continuous-time signals, careful use of DTFT properties simplifies the solution of many types of problems.

Periodicity

The DTFT is periodic:

X(Ω+2πr)=X(Ω)for all integers r(5.93)

Periodicity of the DTFT is a direct consequence of the analysis equation given by Eqn. (5.71).

Linearity

DTFT is a linear transform.

For two transform pairs

x1[n]FX1(Ω)x2[n]FX2(Ω)

and two arbitrary constants α1 and α2 it can be shown that

α1x1[n]+α2x2[n]Fα1X1(Ω)+α2X2(Ω)(5.94)

Proof: Use of the forward transform given by Eqn. (5.71) with the signal (α1x1[n] + α2x2[n]) yields

F{α1x1[n]+α2x2[n]}=n=(α1x1[n]+α2x2[n])ejΩn=n=α1x1[n]ejΩn+n=α2x2[n]ejΩn=α1n=x1[n]ejΩn+α2n=x2[n]ejΩn=α1F{x1[n]}+α2F{x2[n]}(5.95)

Time shifting

For a transform pair

x[n]FX(Ω)

it can be shown that

x[nm]FX(Ω)ejΩm(5.96)

The consequence of shifting, or delaying, a signal in time is multiplication of its DTFT by a complex exponential function of angular frequency.

Proof: Applying the forward transform in Eqn. (5.71) to the signal x[n − m] we obtain

F{x[nm]}=n=x[nm]ejΩn(5.97)

Let us apply the variable change k = n − m to the summation on the right side of Eqn. (5.97) so that

F{x[nm]}=k=x[k]ejΩ(k+m)(5.98)

The exponential function in the summation of Eqn. (5.98) can be written as the product of two exponential functions to obtain

F{x[nm]}=k=x[k]ejΩkejΩm=ejΩmk=x[k]ejΩk=ejΩmX(Ω)(5.99)

Example 5.16: DTFT of a time-shifted signal

Determine the DTFT of the signal x[n] = e−α(n−1) u[n − 1] as shown in Fig. 5.26. (Assume |α| < 1).

Figure 5.26

Figure showing the signal x[n] for Example 5.16.

The signal x[n] for Example 5.16.

Solution: The transform of a right-sided exponential signal was determined in Example 5.10.

As a result we have the transform pair

eαnu[n]F11αejΩ

Applying the time shifting property of the DTFT given by Eqn. (5.96) with m = 1 leads to the result

X(Ω)=F{eα(n1)u[n1]}=ejΩ1αejΩ

Since |e| = 1, the magnitude of X(Ω) is the same as that obtained in Example 5.10. Time shifting a signal does not change the magnitude of its transform.

|X(Ω)|=11+α22αcos(Ω)

The magnitude |X (Ω)| is shown in Fig. 5.27(a) for α = 0.4. The phase of X(Ω) is found by first determining the phase angles of the numerator and the denominator, and then subtracting the latter from the former. In Example 5.10 the numerator of the transform was a constant equal to unity; in this case it is a complex exponential. Therefore

X(Ω)=(ejΩ)(1αejΩ)=Ωtan1[αsin(Ω)1αcos(Ω)](5.100)

Figure 5.27

Figure showing the DTFT of the signal x[n] for Example 5.16 for α = 0.4: (a) the magnitude, (b) the phase as computed by Eqn. (5.100), (c) the phase shown in customary form.

The DTFT of the signal x[n] for Example 5.16 for α = 0.4: (a) the magnitude, (b) the phase as computed by Eqn. (5.100), (c) the phase shown in customary form.

Thus, the phase of the transform differs from that obtained in Example 5.10 by Ω, a ramp with a slope of 1. The phase, as computed by Eqn. (5.100), is shown in Fig. 5.27(b). In graphing the phase of the transform it is customary to fit phase values to in the range (−π, π) radians. Fig. 5.27(c) depicts the phase of the transform in the more traditional form.

Software resources:

ex_5_16.m

Interactive Demo: dtft_demo6

The demo program in “dtft_demo6.m” is based on Example 5.16. The signal

x[n]=eα(nm)u[nm]

is shown along with the magnitude and the phase of its transform X (Ω). The time delay m can be varied, and its effect on the spectrum can be observed.

  1. Observe that changing the amount of delay does not affect the magnitude of the spectrum.

  2. Pay attention to the phase characteristic. In Example 5.16 we have used m = 1 and obtained the expression given by Eqn. (5.100) for the phase. When the signal is delayed by m samples the corresponding phase is

    mΩtan1[αsin(Ω)1αcos(Ω)]

Software resources:

dtft_demo6.m

Time reversal

For a transform pair

x[n]FX(Ω)

it can be shown that

x[n]FX(Ω)(5.101)

Time reversal of the signal causes angular frequency reversal of the transform. This property will be useful when we consider symmetry properties of the DTFT.

Proof: Direct application of the forward transform in Eqn. (5.71) to the signal x[−n] yields

F{x[n]}=n=x[n]ejΩn(5.102)

Let us apply the variable change k = −n to the summation on the right side of Eqn. (5.102) to obtain

F{x[n]}=k=x[k]ejΩk(5.103)

which can be written as

F{x[n]}=k=x[k]ej(Ω)k=X(Ω)(5.104)

Example 5.17: DTFT of two-sided exponential signal

Determine the DTFT of the signal x[n] = α|n| with |α| < 1.

Solution: The signal x[n] can be written as

x[n]={αn,n0αn,n<0

It can also be expressed as

x[n]=x1[n]+x2[n]

where x1[n] is a causal signal and x2[n] is an anti-causal signal defined as

x1[n]=αnu[n]andx2[n]=αnu[n1]

This is illustrated in Fig. 5.28.

Figure 5.28

Figure showing (a) Two-sided exponential signal of Example 5.17, (b) its causal component, and (c) its anti-causal component.

(a) Two-sided exponential signal of Example 5.17, (b) its causal component, and (c) its anti-causal component.

Based on the linearity property of the DTFT, the transform of x[n] is the sum of the transforms of x1[n] and x2[n].

X(Ω)=X1(Ω)+X2(Ω)

For the transform of x1 = αnu[n] we will make use of the result obtained in Example 5.10.

X1(Ω)=11αejΩ

Time shifting and time reversal properties of the DTFT will be used for obtaining the transform of x2[n]. Let a new signal g[n] be defined as a scaled and time-shifted version of x1[n]:

g[n]=αx1[n1]=α(αn1u[n1])=αnu[n1]

Using the time shifting property, the transform of g[n] is

G(Ω)=αX(Ω)ejΩ=αejΩ1αejΩ

The signal x2[n] is a time reversed version of g[n], that is,

x2[n]=g[n]

Applying the time reversal property, the transform of x2[n] is found as

x2[n]=G(Ω)=αejΩ1αejΩ

Finally, X (Ω) is found by adding the two transforms:

X(Ω)=11αejΩ+αejΩ1αejΩ=1α212αcos(Ω)+α2(5.105)

The transform X(Ω) obtained in Eqn. (5.105) is real-valued, and is shown in Fig. 5.29 for α = 0.4.

Figure 5.29

Figure showing the DTFT of the signal x[n] of Example 5.17 for a = 0.4.

The DTFT of the signal x[n] of Example 5.17 for a = 0.4.

Software resources:

ex_5_17.m

Interactive Demo: dtft_demo7

The demo program in “dtft_demo7.m” is based on Example 5.17. It graphs the signal x[n] of Example 5.17 and the corresponding spectrum which is purely real due to the even symmetry of the signal. Parameter α can be varied in order to observe its effect on the spectrum.

Software resources:

dtft_demo7.m

Conjugation property

For a transform pair

x[n]FX(Ω)

it can be shown that

x*[n]FX*(Ω)(5.106)

Conjugation of the signal causes both conjugation and angular frequency reversal of the transform. This property will also be useful when we consider symmetry properties of the DTFT.

Proof: Using the signal x*[n] in the forward transform equation results in

F{x*[n]}=n=x*[n]ejΩn(5.107)

Writing the right side of Eqn. (5.107) in a slightly modified form we obtain

F{x*[n]}=[n=x[n]ejΩn]*=X*(Ω)(5.108)

Symmetry of the DTFT

If the signal x[n] is real-valued, it can be shown that its DTFT is conjugate symmetric. Conversely, if the signal x[n] is purely imaginary, its transform is conjugate antisymmetric.

Symmetry of the DTFT:

x[n]:Real,Im{x[n]}=0implies thatX*(Ω)=X(Ω)(5.109)

x[n]:Imag,Re{x[n]}=0implies thatX*(Ω)=X(Ω)(5.110)

Proof:

  1. Real x(t):

    Any real-valued signal is equal to its own conjugate, therefore we have

    x*[n]=x[n](5.111)

    Taking the transform of each side of Eqn. (5.111) and using the conjugation property stated in Eqn. (5.106) we obtain

    X*(Ω)=X(Ω)(5.112)

    which is equivalent to Eqn. (5.109).

  2. Imaginary x(t):

    A purely imaginary signal is equal to the negative of its conjugate, i.e.,

    x*[n]=x[n](5.113)

    Taking the transform of each side of Eqn. (5.113) and using the conjugation property given by Eqn. (5.106) yields

    X*[Ω]=X[Ω](5.114)

    This is equivalent to Eqn. (5.110). Therefore the transform is conjugate antisymmetric.

Cartesian and polar forms of the transform

A complex transform X(Ω) can be written in polar form as

X(Ω)=|X(Ω)|ejΘ(Ω)(5.115)

and in Cartesian form as

X(Ω)=Xr(Ω)+jXi(Ω)(5.116)

Case 1: If X (Ω) is conjugate symmetric, the relationship in Eqn. (5.109) can be written as

|X(Ω)|ejΘ(Ω)=|X(Ω)|ejΘ(Ω)(5.117)

using the polar form of the transform, and

Xr(Ω)+jXi(Ω)=Xr(Ω)jXi(Ω)(5.118)

using its Cartesian form. The consequences of Equation (5.117) Equation (5.118) can be obtained by equating the magnitudes and the phases on both sides of Eqn. (5.117) and by equating real and imaginary part on both sides of Eqn. (5.118). The results are summarized below:

Conjugate symmetric transform: X(Ω)=X*(Ω)

Magnitude:|X(Ω)|=|X(Ω)|(5.119)

Phase:Θ(Ω)=Θ(Ω)(5.120)

Real part:Xr(Ω)=Xr(Ω)(5.121)

Imag. part:Xi(Ω)=Xi(Ω)(5.122)

The transform of a real-valued x[n] is conjugate symmetric. For such a transform, the magnitude is an even function of Ω, and the phase is an odd function. Furthermore, the real part of the transform has even symmetry, and its imaginary part has odd symmetry.

Case 2: If X(Ω) is conjugate antisymmetric, the polar form of X(Ω) has the property

|X(Ω)|ejΘ(Ω)=|X(Ω)|ejΘ(Ω)(5.123)

The negative sign on the right side of Eqn. (5.123) needs to be incorporated into the phase since we could not write |X(Ω)| = −|X(Ω)| (recall that magnitude needs to be a non-negative function for all Ω). Using e = 1, Eqn. (5.123) can be written as

|X(Ω)|ejΘ(Ω)=|X(Ω)|ejΘ(Ω)ejπ=|X(Ω)|ej[Θ(Ω)π](5.124)

Conjugate antisymmetry property of the transform can also be expressed in Cartesian form as

Xr(Ω)+jXi(Ω)=Xr(Ω)+jXi(Ω)(5.125)

The consequences of Equation (5.124) and Equation (5.125) are given below.

Conjugate antisymmetric transform: X(Ω)=X*(Ω)

Magnitude:|X(Ω)|=|X(Ω)|(5.126)

Phase:Θ(Ω)=Θ(Ω)π(5.127)

Real part:Xr(Ω)=Xr(Ω)(5.128)

Imag. part:Xi(Ω)=Xi(Ω)(5.129)

We know that a purely-imaginary signal leads to a DTFT that is conjugate antisymmetric. For such a transform the magnitude is still an even function of Ω as suggested by Eqn. (5.126). The phase is neither even nor odd. The real part is an odd function of Ω, and the imaginary part is an even function.

Transforms of even and odd signals

If the real-valued signal x[n] is an even function of time, the resulting transform X(Ω) is real-valued for all Ω.

x[n]=x[n], all nimplies thatIm{X(Ω)}=0, all Ω(5.130)

Proof: Using the time reversal property of the DTFT, Eqn. (5.130) implies that

X(Ω)=X(Ω)(5.131)

Furthermore, since x[n] is real-valued, the transform is conjugate symmetric, therefore

X*(Ω)=X(Ω)(5.132)

Combining Equation (5.131) and Equation (5.132) we reach the conclusion

X*(Ω)=X(Ω)(5.133)

Therefore, X (Ω) must be real.

Conversely it can also be proven that, if the real-valued signal x[n] has odd-symmetry, the resulting transform is purely imaginary. This can be stated mathematically as follows:

x[n]=x[n], all nimplies thatRe{X(Ω)}=0, all Ω(5.134)

Conjugating a purely imaginary transform is equivalent to negating it, so an alternative method of expressing the relationship in Eqn. (5.134) is

X*(Ω)=X(Ω)(5.135)

Proof of Eqn. (5.135) is similar to the procedure used above for proving Eqn. (5.130) (see Problem 5.14 at the end of this chapter).

Frequency shifting

For a transform pair

x[n]FX(Ω)

it can be shown that

x[n]ejΩ0nFX(ΩΩ0)(5.136)

Proof: Applying the DTFT definition given by Eqn. (5.71) to the signal x[n]ejΩ0n we obtain

F{x[n]ejΩ0n} =n=x[n]ejΩ0nejΩn =n=x[n]ej(ΩΩ0)n =X(ΩΩ0)(5.137)

Modulation property

For a transform pair

x[n]FX(Ω)

it can be shown that

x[n]cos(Ω0n)F12[X(ΩΩ0)+X(Ω+Ω0)](5.138)

and

x[n]sin(Ω0n)F12[X(ΩΩ0)ejπ/2+X(Ω+Ω0)ejπ/2](5.139)

Modulation property is an interesting consequence of the frequency shifting property combined with the linearity of the Fourier transform. Multiplication of a signal by a cosine waveform causes its spectrum to be shifted in both directions by the angular frequency of the cosine waveform, and to be scaled by 12. Multiplication of the signal by a sine waveform causes a similar effect with an added phase shift of −π/2 radians for positive frequencies and π/2 radians for negative frequencies.

Proof: Using Euler’s formula, the left side of the relationship in Eqn. (5.138) can be written as

x[n]cos(Ω0n)=12x[n]eΩ0n+12x[n]eΩ0n(5.140)

The desired proof is obtained by applying the frequency shifting theorem to the terms on the right side of Eqn. (5.140). Using Eqn. (5.136) we obtain

x[n]ejΩ0nFX(ΩΩ0)(5.141)

and

x[n]ejΩ0nFX(Ω+Ω0)(5.142)

which could be used together in Eqn. (5.140) to arrive at the result in Eqn. (5.138).

The proof of Eqn. (5.139) is similar, but requires one additional step. Again using Euler’s formula, let us write the left side of Eqn. (5.139) as

x[n]sin(Ω0n)=12jx[n]ejΩ0n12jx[n]ejΩ0n(5.143)

Realizing that

1j=j=ejπ/2and1j=j=ejπ/2

Eqn. (5.143) can be rewritten as

x[n]sin(Ω0n)=12x[n]ejΩ0nejπ/2+12x[n]ejΩ0nejπ/2(5.144)

The proof of Eqn. (5.139) can be completed by using Equation (5.141) and Equation (5.142) on the right side of Eqn. (5.144).

Differentiation in the frequency domain

For a transform pair

x[n]FX(Ω)

it can be shown that

nx[n]FjdX(Ω)dΩ(5.145)

and

nmx[n]FjmdmX(Ω)dΩm(5.146)

Proof: Differentiating both sides of Eqn. (5.71) with respect to Ω yields

dX(Ω)dΩ=ddΩ[n=x[n]ejΩn]=n=jnx[n]ejΩn(5.147)

The summation on the right side of Eqn. (5.147) is the DTFT of the signal −jn x[n]. Multiplying both sides of Eqn. (5.147) by j results in the transform pair in Eqn. (5.145). Eqn. (5.146) is proven by repeated use of Eqn. (5.145).

Example 5.18: Use of differentiation in frequency property

Determine the DTFT of the signal x[n] = ne−αn u[n] shown in Fig. 5.30. Assume |α| < 1.

Figure 5.30

Figure showing the signal x[n] for Example 5.18.

The signal x[n] for Example 5.18.

Solution: In Example 5.10 we have established the following transform pair:

eαnu[n]F11αejΩ

Applying the differentiation in frequency property of the DTFT leads to

neαnu[n]FjddΩ[11αejΩ]

Differentiation is carried out easily:

ddΩ[11αejΩ]=ddΩ[(1αejΩ)1]=(1αejΩ)2(jαejΩ)

and the transform we seek is

X(Ω)=αejΩ(1αejΩ)2

The magnitude and the phase of the transform X(Ω) are shown in Fig. 5.31(a) and (b) for the case α = 0.4.

Figure 5.31

Figure showing the transform X(Ω) found in Example 5.18: (a) magnitude, (b) phase.

The transform X(Ω) found in Example 5.18: (a) magnitude, (b) phase.

Software resources:

ex_5_18.m

Convolution property

For two transform pairs

x1[n]FX1(Ω)andx2[n]FX2(Ω)

it can be shown that

x1[n]*x2[n]FX1(Ω)X2(Ω)(5.148)

Convolving two signals in the time domain corresponds to multiplying the corresponding transforms in the frequency domain.

Proof: The convolution of signals x1[n] and x2[n] is given by

x1[n]*x2[n]=k=x1[k]x2[nk](5.149)

Using Eqn. (5.149) in the DTFT definition yields

F{x1[n]*x2[n]}=n=[k=x1[k]x2[nk]]ejΩn(5.150)

Changing the order of the two summations in Eqn. (5.150) and rearranging terms we obtain

F{x1[n]*x2[n]}=k=x1[k][n=x2[nk]ejΩn](5.151)

In Eqn. (5.151) the expression in square brackets should be recognized as the transform of time-shifted signal x2[n − k], and is equal to X2(Ω) e−jΩk. Using this result in Eqn. (5.151) leads to

F{x1[n]*x2[n]}=k=x1[k][x2(Ω)ejΩk]=X2(Ω)k=x1[k]ejΩk=X1(Ω)X2(Ω)(5.152)

Example 5.19: Convolution using the DTFT

Two signals are given as

h[n]=(23)nu(n)andx(n)=(34)nu(n)

Determine the convolution y[n] = h[n] * x[n] of these two signals using the DTFT.

Solution: Transforms of H(Ω) and X(Ω) can easily be found using the result obtained in Example 5.10:

H(Ω)=1123ejΩ,X(Ω)=1134ejΩ

Using the convolution property, the transform of y[n] is

Y(Ω)=H(Ω)X(Ω)=1(123ejΩ)(134ejΩ)(5.153)

The transform Y(Ω) found in Eqn. (5.153) can be written in the form

Y(Ω)=8123ejΩ+9134ejΩ

The convolution result y[n] is the inverse DTFT of Y(Ω) which can be obtained using the linearity property of the transform:

y(n)=8(23)nu[n]+9(34)nu[n]

Solution of problems of this type will be more practical through the use of z-transform in Chapter 8.

Software resources:

ex_5_19.m

Multiplication of two signals

For two transform pairs

x1[n]FX1(Ω)andx2[n]FX2(Ω)(5.154)

it can be shown that

x1[n]x2[n]F12πππX1(λ)X2(Ωλ)dλ(5.155)

The DTFT of the product of two signals x1[n] and x2[n] is equal the 2π-periodic convolution of the individual transforms X1(Ω) and X2(Ω).

Proof: Applying the DTFT definition to the product x1[n] x2[n] leads to

F{x1[n]x2[n]}=n=x1[n]x2[n]ejΩn(5.156)

Using the DTFT synthesis equation given by Eqn. (5.70) we get

x1[n]=12πππX1(λ)ejλndλ(5.157)

Substituting Eqn. (5.157) into Eqn. (5.156)

F{x1[n]x2[n]}=n=[12πππX1(λ)ejλndλ]x2[n]ejΩn(5.158)

Interchanging the order of summation and integration, and rearranging terms yields

F{x1[n]x2[n]}=12πππX1(λ)[n=x2[n]ej(Ωλ)n]dλ=12πππX1(λ)X2(Ωλ)dλ(5.159)

Table 5.3 contains a summary of key properties of the DTFT. Table 5.4 lists some of the fundamental DTFT pairs.

Table 5.3

DTFT properties.

Theorem

Signal

Transform

Linearity

αx1[n] + βx2[n]

αX1 (Ω) + βX2 (Ω)

Periodicity

x[n]

X (Ω) = X (Ω + 2πr)   for all integers r

Conjugate symmetry

x[n] real

X* (Ω) = X (Ω)

 

 

  Magnitude:         |X (Ω)| = |X (Ω)|

 

 

  Phase:                  Θ (Ω) = Θ(Ω)

 

 

  Real part:             Xr (Ω) = Xr (Ω)

 

 

  Imaginary part:    Xi (Ω) = −Xi (Ω)

Conjugate antisymmetry

x[n] imaginary

X* (Ω) = −X (Ω)

 

 

  Magnitude:         |X (Ω)| = |X (Ω)|

 

 

  Phase:                   Θ (Ω) = Θ(Ω) ∓ π

 

 

  Real part:             Xr (Ω) = −Xr (Ω)

 

 

  Imaginary part:    Xi (Ω) = Xi (Ω)

Even signal

x[n] = x[−n]

Im {X (Ω)} = 0

Odd signal

x[n] = −x[−n]

Re {X (Ω)} = 0

Time shifting

x[n − m]

X(Ω) e−jΩm

Time reversal

x[−n]

X(Ω)

Conjugation

x*[n]

X* (Ω)

Frequency shifting

x[n] e0n

X Ω0)

Modulation

x[n] cos(Ω0n)

12[X(ΩΩ0)+X(Ω+Ω0)]

 

x[n] sin(Ω0n)

12[X(ΩΩ0)ejπ/2X(Ω+Ω0)ejπ/2]

Differentiation in frequency

nmx[n]

jmdmdΩm[X(Ω)]

Convolution

x1[n] * x2[n]

X1 (Ω) X2 (Ω)

Multiplication

x1[n]x2[n]

12πππX1(λ)X2(Ωλ)dλ

Parseval’s theorem

n=|x[n]|2=12πππ|X(Ω)|2dΩ

Table 5.4

Some DTFT transform pairs.

Name

Signal

Transform

Discrete-time pulse

x[n]={1,|n|L0,otherwise

X(Ω)=sin((2L+1)Ω2)sin(Ω2)

Unit-impulse signal

x[n] = δ[n]

X (Ω) = 1

Constant-amplitude signal

x[n] = 1, all n

X(Ω)=2πm=δ(Ω2πm)

Sinc function

x[n]=Ωcπsinc(Ωcnπ)

X(Ω)={1,|Ω|<Ωc0,otherwise

Right-sided exponential

x[n] = αnu[n] , |α| < 1

X(Ω)=11αejΩ

Complex exponential

x[n] = e0n

X(Ω)=2πm=δ(ΩΩ02πm)

5.3.6 Applying DTFT to periodic signals

In previous sections of this chapter we have distinguished between two types of discrete-time signals: periodic and non-periodic. For periodic discrete-time signals we have the DTFS as an analysis and problem solving tool; for non-periodic discrete-time signals the DTFT serves a similar purpose. This arrangement will serve us adequately in cases where we work with one type of signal or the other. There may be times, however, when we need to mix periodic and non-periodic signals within one system. For example, in amplitude modulation, a non-periodic signal may be multiplied with a periodic signal, and we may need to analyze the resulting product in the frequency domain. Alternately, a periodic signal may be used as input to a system the impulse response of which is non-periodic. In these types of scenarios it would be convenient to find a way to use the DTFT for periodic signals as well. We have seen in Example 5.14 that a DTFT can be found for a constant-amplitude signal that does not satisfy the existence conditions, as long as we are willing to accept singularity functions in the transform. The next two examples will expand on this idea. Afterwards we will develop a technique for converting the DTFS of any periodic discrete-time signal to a DTFT.

Example 5.20: DTFT of complex exponential signal

Determine the transform of the complex exponential signal x[n] = e0n with −π < Ω0 < π.

Solution: The transform of the constant unit-amplitude signal was found in Example 5.14 to be

F(1)=2πm=δ(Ω2πm)

Using this result along with the frequency shifting property of the DTFT given by Eqn. (5.136), the transform of the complex exponential signal is

F{ejΩ0n}=2πm=δ(Ω2πm)(5.160)

This is illustrated in Fig. 5.32.

Figure 5.32

Figure showing the transform of complex exponential signal x[n] = ejΩ0n.

The transform of complex exponential signal x[n] = ejΩ0n.

Example 5.21: DTFT of sinusoidal signal

Determine the transform of the sinusoidal signal x[n] = cos(Ω0n) with −π < Ω0 < π.

Solution: The transform of the constant unit-amplitude signal was found in Example 5.14 to be

F{1}=2πm=δ(Ω2πm)

Using this result along with the modulation property of the DTFT given by Eqn. (5.138), the transform of the sinusoidal signal is

F{cos(Ω0n)}=πm=δ(ΩΩ02πm)+πm=δ(Ω+Ω02πm)(5.161)

Let X˜(Ω) represent the part of the transform in the range −π < Ω < π.

X˜(Ω)=πδ(ΩΩ0)+πδ(Ω+Ω0)(5.162)

The DTFT can now be expressed as

X(Ω)=m=X˜(Ω2πm)(5.163)

This is illustrated in Fig. 5.33.

Figure 5.33

Figure showing the transform of complex exponential signal x[n] = cos(Ω0n): (a) the middle part ¯X (Ω), (b) the complete transform X (Ω).

The transform of complex exponential signal x[n] = cos(Ω0n): (a) the middle part ¯X (Ω), (b) the complete transform X (Ω).

In Examples 5.20 and 5.21 we were able to obtain the DTFT of two periodic signals, namely a complex exponential signal and a sinusoidal signal. The idea can be generalized to apply to any periodic discrete-time signal. The DTFS synthesis equation for a periodic signal x˜[n] was given by Eqn. (5.21) which is repeated here for convenience:

Eqn(5.21):x˜[n]=k=0N1c˜kej(2π/N)kn,all n

If we were to attempt to find the DTFT of the signal x˜[n] by direct application of the DTFT analysis equation given by Eqn. (5.71) we would need to evaluate

X(Ω)=n=x˜[n]ejΩn(5.164)

Substituting Eqn. (5.21) into Eqn. (5.164) leads to

X(Ω)=n=[k=0N1c˜kej(2π/N)kn]ejΩn(5.165)

Interchanging the order of the two summations in Eqn. (5.165) and rearranging terms we obtain

X(Ω)=k=0N1c˜k[n=ej(2π/N)knejΩn](5.166)

In Eqn. (5.166) the expression in square brackets is the DTFT of the signal ej(2π/N)kn. Using the result obtained in Example 5.20, and remembering that 2π/N = Ω0 is the fundamental angular frequency for the periodic signal x˜[n], we get

n=ej(2π/N)knejΩn=2πm=δ(Ω2πkN2πm) =2πm=δ(ΩkΩ02πm)(5.167)

and

X(Ω)=2πk=0N1c˜km=δ(ΩkΩ02πm)(5.168)

The part of the transform in the range 0 < Ω < 2π is found by setting m = 0 in Eqn. (5.168):

X˜(Ω)=2πk=0N1c˜kδ(ΩkΩ0)(5.169)

Thus, X˜(Ω) for a periodic discrete-time signal is obtained by converting each DTFS coefficient c˜k to an impulse with area equal to 2πc˜k and placing it at angular frequency Ω = kΩ0. The DTFT for the signal is then obtained as

X(Ω)=m=X¯(Ω2πm)(5.170)

This process is illustrated in Fig. 5.34.

Figure 5.34

Figure showing (a) DTFS coefficients for a signal periodic with N, (b) DTFT for −π < Ω < π, (c) complete DTFT.

(a) DTFS coefficients for a signal periodic with N, (b) DTFT for −π < Ω < π, (c) complete DTFT.

Note: In Eqn. (5.162) of Example 5.21 we have used X¯(Ω) to represent the part of the transform in the range −π < Ω < π. On the other hand, in Eqn. (5.169) above, X¯(Ω) was used as the part of the transform in the range 0 < Ω < 2π. This should not cause any confusion. In general, X¯(Ω) represents one period of the 2π-periodic transform, and the starting value of Ω is not important.

Example 5.22: DTFT of the periodic signal of Example 5.4

Determine the DTFT of the signal x[n] used in Example 5.4 and shown in Fig. 5.3.

Solution: We will first write the transform in the interval 0 < Ω < 2π.

X¯(Ω)=2π[c˜0δ(Ω)+c˜1δ(ΩΩ0)+c˜2δ(Ω2Ω0)+c˜3δ(Ω3Ω0)+c˜4δ(Ω4Ω0)]

The period of the signal x˜[n] is N = 5, therefore the fundamental angular frequency is Ω0 = 2π/5. Using the values of DTFS coefficients found in Example 5.4 we obtain

X¯(Ω) =12.566δ(Ω)+(3.142j4.324)δ(Ω2π/5) +(3.142j1.021)δ(Ω4π/5) +(3.142+j1.021)δ(Ω6π/5) +(3.142+j4.324)δ(Ω8π/5)(5.171)

The complete transform X (Ω) is found by periodically extending X¯(Ω).

X(Ω)=m=[12.566δ(Ω2πm)+(3.142j4.324)δ(Ω2π/52πm)+(3.142j1.021)δ(Ω4π/52πm)+(3.142+j1.021)δ(Ω6π/52πm)+(3.142+j1.021)δ(Ω8π/52πm)](5.172)

5.4 Energy and Power in the Frequency Domain

Parseval’s theorem and its application to the development of energy and power spectral density concepts were discussed for continuous-time signals in Section 4.4 of Chapter 4. In this section we will discuss Parseval’s theorem for periodic and non-periodic discrete-time signals, and introduce the corresponding energy and power spectral density concepts.

5.4.1 Parseval’s theorem

For a periodic power signal x˜[n] with period N and DTFS coefficients {c˜k,k=0,...,N1} it can be shown that

1Nn=0N1|x˜[n]|2=k=0N1|c˜k|2(5.173)

For a non-periodic energy signal x[n] with DTFT X(Ω), the following holds true:

n=|x˜[n]|2=12πππ|X(Ω)|2dΩ(5.174)

The left side of Eqn. (5.173) represents the normalized average power in a periodic signal which was derived in Chapter 1 Eqn. (1.187). The left side of Eqn. (5.174) represents the normalized signal energy as derived in Eqn. (1.180). The relationships given by Equation (5.173) and Equation (5.174) relate signal energy or signal power to the frequency-domain representation of the signal. They are two forms of Parseval’s theorem.

Proofs: First we will prove Eqn. (5.173). DTFS representation of a periodic discrete-time signal with period N was given by Eqn. (5.21), and is repeated here for convenience:

Eqn(5.21):x˜[n]=k=0N1c˜kej(2π/N)kn,all n

Using |x[n]|2 = x[n] x*[n], the left side of Eqn. (5.173) can be written as

1Nn=0N1|x˜[n]|2=1Nn=0N1[k=0N1c˜kej(2π/N)kn][m=0N1c˜mej(2π/N)mn]*=1Nn=0N1[k=0N1c˜kej(2π/N)kn][m=0N1c˜*mej(2π/N)mn](5.175)

Rearranging the order of the summations in Eqn. (5.175) we get

1Nn=0N1|x˜[n]|2=1Nk=0N1c˜k[m=0N1c˜m*[n=0N1ej(2π/N)(km)n]](5.176)

Using orthogonality of the basis function set {ej(2π/N)kn, k = 0,...,N − 1 it can be shown that (see Appendix D)

n=0N1ej(2π/N)(km)n={N,km=0,N,2N,...0,otherwise(5.177)

Using Eqn. (5.177) in Eqn. (5.176) leads to the desired result:

1Nn=0N1|x˜[n]|2=k=0N1c˜kc˜k*=k=0N1|c˜k|2(5.178)

The proof for Eqn. (5.174) is similar. The DTFT synthesis equation was given by Eqn. (5.70) and is repeated here for convenience.

Eqn(5.70):x[n]=12πππX(Ω)ejΩndΩ

The left side of Eqn. (5.174) can be written as

n=|x˜[n]|2=n=x[n][12πππX(Ω)ejΩndΩ]*=n=x[n][12πππX*(Ω)ejΩndΩ](5.179)

Interchanging the order of the integral and the summation in Eqn. (5.179) and rearranging terms yields

n=|x˜[n]|2=12πππX*(Ω)[n=x[n]ejΩn]dΩ=12πππ|X(Ω)|2dΩ(5.180)

5.4.2 Energy and power spectral density

The two statements of Parseval’s theorem given by Equation (5.173) and Equation (5.174) lead us to the following conclusions:

  1. In Eqn. (5.173) the left side corresponds to the normalized average power of the periodic signal x˜[n], and therefore the summation on the right side must also represent normalized average power. The term |c˜k|2 corresponds to the power of the signal component at angular frequency Ω = kΩ0. (Remember that Ω0 = 2π/N.) Let us construct a new function Sx (Ω) as follows:

    Sx(Ω)=k=2π|c˜k|2δ(ΩkΩ0)(5.181)

    The function Sx (Ω) consists of impulses placed at angular frequencies kΩ0 as illustrated in Fig. 5.35. Since the DTFS coefficients are periodic with period N, the function Sx(Ω) is 2π-periodic.

    Figure 5.35

    Figure showing the function Sx (Ω) constructed using the DTFS coefficents of the signal x˜[n].

    The function Sx (Ω) constructed using the DTFS coefficents of the signal x˜[n].

    Integrating Sx (Ω) over an interval of 2π radians leads to

    02πSx(Ω)dΩ=02π[k=2π|c˜k|2δ(ΩkΩ9)]dΩ(5.182)

    Interchanging the order of integration and summation in Eqn. (5.182) and rearranging terms we obtain

    02πSx(Ω)dΩ=2πk=|c˜k|2[02πδ(ΩkΩ0)dΩ](5.183)

    Recall that Ω0 = 2π/N. Using the sifting property of the impulse function, the integral between square brackets in Eqn. (5.183) is evaluated as

    02πδ(ΩkΩ0)dΩ={1,k=0,...,N10,otherwise(5.184)

    and Eqn. (5.183) becomes

    02πSx(Ω)dΩ=2πk=0N1|c˜k|2(5.185)

    The normalized average power of the signal x˜[n] is therefore found as

    Px=k=0N1|c˜k|2=12π02πSx(Ω)dΩ(5.186)

    Consequently, the function Sx (Ω) is the power spectral density of the signal x˜[n]. Since Sx (Ω) is 2π-periodic, the integral in Eqn. (5.186) can be started at any value of Ω as long as it covers a span of 2π radians. It is usually more convenient to write the integral in Eqn. (5.186) to start at −π.

    Px=12πππSx(Ω)dΩ(5.187)

    As an interesting by-product of Eqn. (5.186), the normalized average power of x˜[n] that is within a specific angular frequency range can be determined by integrating Sx (Ω) over that range. For example, the power contained at angular frequencies in the range (Ω0, Ω0) is

    Px in (Ω0,Ω0)=12πΩ0Ω0Sx(Ω)dΩ(5.188)

  2. In Eqn. (5.174) the left side is the normalized signal energy for the signal x[n], and the right side must be the same. The integrand |X (Ω)|2 is therefore the energy spectral density of the signal x[n]. Let the function Gx (Ω) be defined as

    Gx(Ω)=|X(Ω)|2(5.189)

    Substituting Eqn. (5.189) into Eqn. (5.174), the normalized energy in the signal x[n] can be expressed as

    Ex=n=|x˜[n]|2=12πππG(Ω)dΩ(5.190)

    The energy contained at angular frequencies in the range (Ω0, Ω0) is found by integrating Gx (Ω) in the frequency range of interest:

    Ex in (Ω0,Ω0)=12πΩ0Ω0Gx(Ω)dΩ(5.191)

  3. In Eqn. (5.174) we have expressed Parseval’s theorem for an energy signal, and used it to lead to the derivation of the energy spectral density in Eqn. (5.189). We know that some non-periodic signals are power signals, therefore their energy cannot be computed. The example of one such signal is the unit-step function. The power of a non-periodic signal was defined in Eqn. (1.188) in Chapter 1 which will be repeated here:

    Eqn(1.188):Px=limM[12M+1n=MM|x[n]|2]

    In order to write the counterpart of Eqn. (5.174) for a power signal, we will first define a truncated version of x[n] as

    xT[n]={x[n],MnM0,otherwise(5.192)

    Let XT (Ω) be the DTFT of the truncated signal xT [n]:

    XT(Ω)=F{xT[n]}=n=MMxT[n]ejΩn(5.193)

    Now Eqn. (5.174) can be written in terms of the truncated signal and its transform as

    n=MM|xT[n]|2=12πππ|XT(Ω)|2dΩ(5.194)

    Scaling both sides of Eqn. (5.194) by (2M + 1) and taking the limit as M becomes infinitely large, we obtain

    limM[12M+1n=MM|xT[n]|2]=limM[12π(2M+1)ππ|XT(Ω)|2dΩ](5.195)

    The left side of Eqn. (5.195) is the average normalized power in a non-periodic signal as we have established in Eqn. (1.188). Therefore, the power spectral density of x[n] is

    Sx(Ω)=limM[12M+1|XT(Ω)|2](5.196)

Example 5.23: Normalized average power for waveform of Example 5.7

Consider again the periodic waveform used in Example 5.7 and shown in Fig. 5.6. Using the DTFS coefficients found in Example 5.7, verify Parseval’s theorem. Also determine the percentage of signal power in the angular frequency range −π/3 < Ω0 <π/3.

Solution: The average power computed from the signal is

Px=18n=07|x˜[n]|2=18[0+(12)2+(1)2+(34)2+(1)2+(12)2]=0.4531

Using the DTFS coefficients in Table 5.1 yields

k=07|c˜k|2=0+(0.4170)2+(0.0625)2+(0.0290)2+0+(0.0290)2+(0.0625)2+(0.4710)2=0.4531

As expected, the value found from DTFS coefficients matches that found from the signal. One period of the power spectral density Sx (Ω) is

Sx(Ω)=0.0017πδ(Ω+3π/4)+0.0078πδ(Ω+π/2)+0.4436πδ(Ω+π/4)+0.4436πδ(Ωπ/4)+0.0078πδ(Ωπ/2)+0.0017πδ(Ω3π/4)

The power in the angular frequency range of interest is

Px in (π/3,π/3)=12ππ/3π/3Sx(Ω)dΩ=12π(0.4436π+0.4436π)=0.4436

The ratio of the power in −π/3 < Ω0 <π/3 to the total signal power is

Px in (π/3,π/3)Px=0.44360.4531=0.979

It appears that 97.9 percent of the power of the signal is in the frequency range −π/3 < Ω0 <π/3.

Software resources:

ex_5_23.m

Example 5.24: Power spectral density of a discrete-time sinusoid

Find the power spectral density of the signal

x˜[n]=3cos(0.2πn)

Solution: Using Euler’s formula, the signal can be written as

x˜[n]=32ej0.2πn+32ej0.2πn

The normalized frequency of the sinusoidal signal is F0 = 0.1 corresponding to a period length of N = 10 samples. Non-zero DTFS coefficients for k = 0,..., 9 are

c˜1=c˜9=32

Using Eqn. (5.181), the power spectral density is

Sx(Ω)=r=[9π2δ(Ω0.2π2πr)+9π2δ(Ω1.8π2πr)]

which is shown in Fig. 5.36.

Figure 5.36

Figure showing Power spectral density for Example 5.24.

Power spectral density for Example 5.24.

The power in the sinusoidal signal is computed from the power spectral density as

Px=12πππSx(Ω)dΩ=12π(9π2+9π2)=92

Example 5.25: Energy spectral density of a discrete-time pulse

Determine the energy spectral density of the rectangular pulse

x[n]={1,n=5,...,50,otherwise

Also compute the energy of the signal in the frequency interval −π/10 < Ω <π/10.

Solution: Using the general result obtained in Example 5.12 with L = 5, the DTFT of the signal x[n] is

X(Ω)=sin(11Ω2)sin(Ω2)

The energy spectral density for x[n] is found as

Gx(Ω)=|X(Ω)|2=sin2(11Ω2)sin2(Ω2)

which is shown in Fig. 5.37.

Figure 5.37

Figure showing Power spectral density for Example 5.25.

Power spectral density for Example 5.25.

The energy of the signal within the frequency interval −π/10 < Ω <π/10 is computed as

Ex in (π/10,π/10)=12ππ/10π/10Gx(Ω)dΩ

which is proportional to the shaded area under G (Ω) in Fig. 5.38.

Figure 5.38

Figure showing the area under Gx (Ω) for −π/10 < Ω/π/10.

The area under Gx (Ω) for −π/10 < Ω/π/10.

Direct evaluation of the integral in Eqn. (5.197) is difficult; however, the result can be obtained by numerical approximation of the integral, and is

Ex in (π/10,π/10)8.9309

Software resources:

ex_5_25.m

Energy or power in a frequency range

Signal power or signal energy that is within a finite range of frequencies is found through the use of Equation (5.188) and Equation (5.191) respectively. An interesting interpretation of the result in Eqn. (5.188) is that, for the case of a power signal, the power of x[n] in the frequency range Ω0 < Ω < Ω0 is the same as the power of the output signal of a system with system function

H(Ω)={1,|Ω|<Ω00,Ω0<|Ω|<π(5.197)

driven by the signal x[n]. Similarly, for the case of an energy signal, the energy of x[n] in the frequency range Ω0 < Ω < Ω0 is the same as the energy of the output signal of a system with the system function in Eqn. (5.197) driven by the signal x[n]. These relationships are illustrated in Fig. 5.39(a) and (b).

Figure 5.39

Figure showing Computation of signal power or energy in a range of frequencies.

Computation of signal power or energy in a range of frequencies.

5.4.3 Autocorrelation

The energy spectral density Gx (Ω) or the power spectral density Sx (Ω) for a signal can be computed through direct application of the corresponding equations derived in Section 5.4.2; namely Eqn. (5.189) for an energy signal, and either Eqn. (5.181) or Eqn. (5.196) for a power signal, depending on its type. In some circumstances it is also possible to compute either function from the knowledge of the autocorrelation function which will be defined in this section. Let x[n] be a real-valued signal.

For an energy signal x[n] the autocorrelation function is defined as

rxx[m]=n=x[n]x[n+m](5.198)

For a periodic power signal x˜[n] with period N, the corresponding definition of the autocorrelation function is

r˜xx[m]=x˜[n]x˜[n+m]=1Nn=0N1x˜[n]x˜[n+m](5.199)

The triangle brackets indicate time average. The autocorrelation function for a periodic signal is also periodic as signified by the tilde (˜) character used over the symbol rxx in Eqn. (5.199). Finally, for a non-periodic power signal, the corresponding definition is

rxx[m]=x[n]x[n+m]=limM[12M+1n=MMx[n]x[n+m]](5.200)

Even though we refer to rxx[m] as a function, we will often treat it as if it is a discrete-time signal, albeit one that uses a different index, m, from the signal x[n] for which it is computed. The index m simply corresponds to the time shift between the two copies of x[n] used in the definitions of Equation (5.198) through Equation (5.200).

It can be shown that, for an energy signal, the energy spectral density is the DTFT of the autocorrelation function, that is,

F{rxx[m]}=Gx(Ω)(5.201)

Proof: Let us begin by applying the DTFT definition to the autocorrelation function rxx[m] treated as a discrete-time signal indexed by m:

F{rxx[m]}=m=[n=x[n]x[n+m]]ejΩm(5.202)

The two summations in Eqn. (5.202) can be rearranged to yield

F{rxx[m]}=n=x[n][m=x[n+m]ejΩm](5.203)

Realizing that the inner summation in Eqn. (5.203) is equal to

m=x[n+m]ejΩm=F{x[m+n]}=ejΩmX(Ω)(5.204)

Eqn. (5.203) becomes

F{rxx[m]}=X(Ω)n=x[n]ejΩn(5.205)

and since x[n] is real, we obtain

F{rxx[m]}=X(Ω)X*(Ω)=|X(Ω)|2(5.206)

which completes the proof.

The definition of the autocorrelation function for a periodic signal x˜[n] can be used in a similar manner in determining the power spectral density of the signal.

Let the signal x˜[n] and the autocorrelation function r˜xx[m], both periodic with period N, have the DTFS representations given by

x˜[n]=k=0N1c˜kej(2π/N)kn(5.207)

and

r˜xx[m]=k=0N1d˜kej(2π/N)km(5.208)

respectively. It can be shown that the DTFS coefficients {c˜k} and {d˜k} are related by

d˜k=|c˜k|2(5.209)

and the power spectral density is the DTFT of the autocorrelation function, that is,

S˜x(Ω)=F{r˜xx[m]}(5.210)

Proof: Using the DTFS analysis equation given by Eqn. (5.22) with the definition of the autocorrelation function in Eqn. (5.199) leads to

d˜k=1Nm=0N1r˜xx[m]ej(2π/N)km=1Nm=0N1[1Nn=0N1x˜[n]x˜[n+m]]ej(2π/N)km(5.211)

Rearranging the order of the two summations Eqn. (5.211) can be written as

d˜k=1Nn=0N1x˜(n)[1Nm=0N1x˜[n]x˜[n+m]ej(2π/N)km](5.212)

Using the time shifting property of the DTFS given by Eqn. (5.30) the expression in square brackets in Eqn. (5.212) is

1Nm=0N1x˜[n+m]ej(2π/N)km=ej(2π/N)knc˜k(5.213)

Substituting Eqn. (5.213) into Eqn. (5.212) yields

d˜k=1Nn=0N1x˜[n]ej(2π/N)knc˜k=c˜k1Nn=0N1x˜[n]ej(2π/N)kn=c˜kc˜k*=|c˜k|2(5.214)

Using the technique developed in Section 5.3.6 the DTFT of r˜xx[m] is

F{r˜xx[m]}=2πk=d˜kδ(ΩkΩ0)(5.215)

Using Eqn. (5.214) in Eqn. (5.215) results in

F{r˜xx[m]}=2πk=|c˜k|2δ(ΩkΩ0)(5.216)

which is identical to the expression given by Eqn. (5.181) for the power spectral density of a periodic signal.

A relationship similar to the one expressed by Eqn. (5.210) applies to random processes that are wide-sense stationary, and is known as the Wiener-Khinchin theorem. It is one of the fundamental theorems of random signal processing.

Example 5.26: Power spectral density of a discrete-time sinusoid revisited

Consider again the discrete-time sinusoidal signal

x˜[n]=3cos(0.2πn)

the power spectral density of which was determined in Example 5.24. Determine the autocorrelation function r˜xx[m] for this signal, and then find the power spectral density Sx (Ω) from the autocorrelation function.

Solution: The period of x˜[n] is N = 10 samples. Using the definition of the autocorrelation function for a periodic signal

x˜xx[m]=110n=09x˜[n]x˜[n+m]=110n=09[3cos(0.2πn)][3cos(0.2π[n+m])](5.217)

Through the use of the appropriate trigonometric identity, the result in Eqn. (5.217) is simplified to

r˜xx[m]=110n=09[92cos(0.4πn+0.2πm)+92cos(0.2πm)]=920n=09cos(0.4πn+0.2πm)+920n=09cos(0.2πm)(5.218)

In Eqn. (5.218) the first summation is equal to zero since its term cos (0.4πn +0.2πm) is periodic with a period of five samples, and the summation is over two full periods. The second summation yields

r˜xx[m]=920n=09cos(0.2πm)=920cos(0.2πm)n=09(1)=92cos(0.2πm)

for the autocorrelation function. The power spectral density is found as the DTFT of the autocorrelation function. Application of the DTFT was discussed in Section 5.3.6. Using the technique developed in that section (specifically see Example 5.21) the transform is found as

Sx(Ω)=F{r˜xx[m]}=F{92cos(0.2πm)}=r=[9π2δ(Ω+0.2π2πr)+9π2δ(Ω0.2π2πr)]

which matches the answer found earlier in Example 5.24.

Software resources:

ex_5_26.m

Properties of the autocorrelation function

The autocorrelation function as defined by Equation (5.198), Equation (5.199) and Equation (5.200) has a number of important properties that will be summarized here:

  1. rxx[0] ≥ |rxx[m]| for all m.

    To see why this is the case, we will consider the non-negative function (x[n] ∓ x[n + m])2.

    The time average of this function must also be non-negative, therefore

    (x[n]x[n+m])20

    or equivalently

    x2[n]2x[n]x[n+m]+x2[n+m]0

    which implies that

    rxx[0]2rxx[m]+rxx[0]0

    which is the same as property 1.

  2. rxx[−m] = rxx[m] for all m, that is, the autocorrelation function has even symmetry. Recall that the autocorrelation function is the inverse Fourier transform of either the energy spectral density or the power spectral density. Since Gx (Ω) and Sx (Ω) are purely real, rxx[m] must be an even function of m.

  3. If the signal x˜[n] is periodic with period N, then its autocorrelation function r˜xx[m] is also periodic with the same period. This property easily follows from the time-average based definition of the autocorrelation function given by Eqn. (5.199).

5.5 System Function Concept

In time-domain analysis of systems in Chapter 3 two distinct description forms were used for DTLTI systems:

  1. A linear constant-coefficient difference equation that describes the relationship between the input and the output signals
  2. An impulse response which can be used with the convolution operation for determining the response of the system to an arbitrary input signal

In this section, the concept of system function will be introduced as the third method for describing the characteristics of a system.

The system function is simply the DTFT of the impulse response:

H(Ω)=F{h[n]}=n=h[n]ejΩn(5.219)

Recall that the impulse response is only meaningful for a system that is both linear and time-invariant (since the convolution operator could not be used otherwise). It follows that the system function concept is valid for linear and time-invariant systems only. In general, H (Ω) is a complex function of Ω, and can be written in polar form as

H(Ω)=|H(Ω)|ejΘ(Ω)(5.220)

Obtaining the system function from the difference equation

In finding a system function for a DTLTI system described by means of a difference equation, two properties of the DTFT will be useful: the convolution property and the time shifting property.

  1. Since the output signal is computed as the convolution of the impulse response and the input signal, that is, y[n] = h[n] * x[n], the corresponding relationship in the frequency domain is Y (Ω) = H (Ω) X (Ω). Consequently, the system function is equal to the ratio of the output transform to the input transform:

    H(Ω)=Y(Ω)X(Ω)(5.221)

  2. Using the time shifting property, transforms of the individual terms in the difference equation are found as

    y[nm]FejΩmY(Ω)m=0,1,...(5.222)

    and

    x[nm]FejΩmX(Ω)m=0,1,...(5.223)

The system function is obtained from the difference equation by first transforming both sides of the difference equation through the use of Equation (5.222) and Equation (5.223), and then using Eqn. (5.221).

Example 5.27: Finding the system function from the difference equation

Determine the system function for a DTLTI system described by the difference equation

y[n]0.9y[n1]+0.36y[n2]=x[n]0.2x[n1]

Solution: Taking the DTFT of both sides of the difference equation we obtain

Y(Ω)0.9ejΩY(Ω)+0.36ej2ΩY(Ω)=X(Ω)0.2ejΩX(Ω)

which can be written as

[10.9ejΩ+0.36ej2Ω]Y(Ω)=[10.2ejΩ]X(Ω)

The system function is found through the use of Eqn. (5.221)

H(Ω)=Y(Ω)X(Ω)=10.2ejΩ10.9ejΩ+0.36ej2Ω

The magnitude and the phase of the system function are shown in Fig. 5.40.

Figure 5.40

Figure showing the system function for Example 5.27: (a) magnitude, (b) phase.

The system function for Example 5.27: (a) magnitude, (b) phase.

Software resources:

ex_5_27.m

Example 5.28: System function for length-N moving average filter

Recall the length-N moving average filter with the difference equation

y[n]=1Nk=0N1x[nk]

Determine the system function. Graph its magnitude and phase as functions of Ω.

Solution: Taking the DTFT of both sides of the difference equation we obtain

Y[Ω]=1Nk=0N1ejΩkX[Ω]

from which the system function is found as

H(Ω)=Y(Ω)X(Ω)=1Nk=0N1ejΩk(5.224)

The expression in Eqn. (5.224) can be put into closed form as

H(Ω)=1ejΩN1ejΩ

As the first step in expressing H (Ω) in polar complex form, we will factor out e−jΩN/2 from the numerator and e−jΩ/2 from the denominator to obtain

H(Ω)=ejΩN/2(ejΩN/2ejΩN/2)ejΩ/2(ejΩ/2ejΩ/2)=sin(ΩN/2)sin(Ω/2)ejΩ(N1)/2

The magnitude and the phase of the system function are shown in Fig. 5.41 for N = 4.

Figure 5.41

Figure showing the system function for Example 5.28: (a) magnitude, (b) phase.

The system function for Example 5.28: (a) magnitude, (b) phase.

Software resources:

ex_5_28.m

Interactive Demo: sf_sdemo5.m

The demo program in “sf_demo5.m” is based on Example 5.28. It computes and graphs the magnitude and the phase of the system function H (Ω) for the length-N moving average filter. The filter length N may be varied.

  1. Observe that zero crossings (dips) of the magnitude spectrum divide the angular frequency interval 0 Ω 2π into N equal segments.
  2. Pay attention to the phase of the system function. Its sloped sections all have the same slope, indicating that the phase response is linear. How does the slope of the phase response relate to the filter length N?

Software resources:

sf_demo5.m

5.6 DTLTI Systems with Periodic Input Signals

In earlier sections of this chapter we have explored the use of the discrete-time Fourier series (DTFS) for representing periodic discrete-time signals. It was shown that a periodic discrete-time signal can be expressed using complex exponential basis functions in the form

Eqn(5.21)x˜[n]=k=0N1c˜kej(2π/N)knfor all n

If a periodic signal is used as input to a DTLTI system, the use of the superposition property allows the response of the system to be determined as a linear combination of its responses to individual basis functions

ϕk[n]=ej(2π/N)kn

5.6.1 Response of a DTLTI system to complex exponential signal

Consider a DTLTI system with impulse response h[n], driven by a complex exponential input signal

x˜[n]=ejΩ0n(5.225)

The response y[n] of the system is found through the use of the convolution relationship that was derived in Section 3.7.2 of Chapter 3.

y(h)=h[n]*x˜[n]=k=h[k]x˜[nk](5.226)

Using the signal x˜[n] given by Eqn. (5.225) in Eqn. (5.226) we get

y[n]=k=h[k]ejΩ0(nk)(5.227)

or, equivalently

y[n]=ejΩ0nk=h[k]ejΩ0n(5.228)

The summation in Eqn. (5.228) should be recognized as the system function evaluated at the specific angular frequency Ω = Ω0. Therefore

y˜[n]=ejΩ0nH(Ω0)(5.229)

We have used the tilde (˜) character over the name of the output signal in realization of the fact that it is also periodic. The development in Equation (5.227) through Equation (5.229) is based on the inherent assumption that the Fourier transform of h[n] exists. This in turn requires the corresponding DTLTI system to be stable. Any natural response the system may have exhibited at one point would have disappeared a long time ago. Consequently, the response found in Eqn. (5.229) is the steady-state response of the system.

For a DTLTI system driven by a complex exponential input signal, we have the following important relationship:

Response to complex exponential input:

y˜[n]=Sys{ejΩ0n}=ejΩ0nH(Ω0)=|H(Ω0)|ej[Ω0t+Θ(Ω0)](5.230)

  1. The response of a DTLTI system to a complex exponential input signal is a complex exponential output signal with the same angular frequency Ω0.
  2. The effect of the system on the complex exponential input signal is to
    1. Scale its amplitude by an amount equal to the magnitude of the system function at Ω = Ω0
    2. Shift its phase by an amount equal to the phase of the system function at Ω = Ω0

5.6.2 Response of a DTLTI system to sinusoidal signal

Let the input signal to the DTLTI system under consideration be a sinusoidal signal in the form

x˜[n]=cos(Ω0n)(5.231)

The response of the system in this case will be determined by making use of the results of the previous section.

We will use Euler’s formula to write the input signal using two complex exponential functions as

x˜[n]=cos(Ω0n)=12ejΩ0n+12ejΩ0n(5.232)

This representation of x˜[n] allows the results of the previous section to be used. The output signal can be written using superposition:

y˜[n]=12Sys{ejΩ0n}+12Sys{ejΩ0n}=12ejΩ0nH(Ω0)+12ejΩ0nH(Ω0)=12ejΩ0n|H(Ω0)|ejΘ(Ω0)+12ejΩ0n|H(Ω0)|ejΘ(Ω0)(5.233)

If the impulse response h[n] is real-valued, the result in Eqn. (5.233) can be further simplified. Recall from Section 5.3.5 that, for real-valued h[n], the transform H (Ω) is conjugate symmetric, resulting in

|H(Ω0)|=|H(Ω0)|  and  Θ(Ω0)=Θ(Ω0)(5.234)

Using these relationships, Eqn. (5.233) becomes

y˜[n]=12|H(Ω0)|ej[Ω0t+Θ(Ω0)]+12|H(Ω0)|ej[Ω0t+Θ(Ω0)]=|H(Ω0)|cos(ω0t+Θ(Ω0))(5.235)

For a DTLTI system driven by a cosine input signal, we have the following important relationship:

Response to cosine input:

y˜[n]=Sys{cos(Ω0n)}=|H(Ω0)|cos(ω0n+Θ(Ω0))(5.236)

  1. When a DTLTI system is driven by single-tone input signal at angular frequency Ω0, its output signal is also a single-tone signal at the same angular frequency.
  2. The effect of the system on the input signal is to
    1. Scale its amplitude by an amount equal to the magnitude of the system function at Ω = Ω0
    2. Shift its phase by an amount equal to the phase of the system function at Ω = Ω0

Example 5.29: Steady-state response of DTLTI system to sinusoidal input

Consider a DTLTI system characterized by the difference equation

y[n]0.9y[n1]+0.36y[n2]=x[n]0.2x[n1]

The system function for this system was determined in Example 5.27 to be

H(Ω)=Y(Ω)X(Ω)=10.2ejΩ10.9ejΩ+0.36ej2Ω

Find the response of the system to the sinusoidal input signal

x˜[n]=5cos(πn5)

Solution: Evaluating the system function at the angular frequency Ω0 = π/5 yields

H(π/5)=10.2ejπ/510.9ejπ/5+0.36ej2π/5=1.8890j0.6133

which can be written in polar form as

H(π/5)=|H(π/5)|ejΘ(π/5)=1.9861ej0.3139

The magnitude and the phase of the system function are shown in Fig. 5.42. The values of magnitude and phase at the angular frequency of interest are marked on the graphs.

Figure 5.42

Figure showing the system function for Example 5.29: (a) magnitude, (b) phase.

The system function for Example 5.29: (a) magnitude, (b) phase.

The steady-state response of the system to the specified input signal x˜[n] is

y˜[n]=5|H(π/5)|cos(πn5+Θ(π/5))=9.9305cos(πn50.3139)

Software resources:

ex_5_29.m

Software resources:

See MATLAB Exercise 5.4.

Interactive Demo: sf_demo6.m

The demo program “sf_demo6.m” is based on Example 5.29. It computes and graphs the steady-state response of the system under consideration to the sinusoidal input signal

x[n]=5cos(Ω0n)=5cos(2πF0n)=

The normalized frequency F0 can be varied from F0 = 0.01 to F0 = 0.49 using a slider control. As F0 is varied, the display is updated

  1. To show the changes to the steady-state response
  2. To show the critical magnitude and phase and values on the graphs of the system function

Software resources:

sf_demo6.m

5.6.3 Response of a DTLTI system to periodic input signal

Using the development in the previous sections, we are now ready to consider the use of a general periodic signal x˜[n] as input to a DTLTI system. Using the DTFS representation of the signal, the response of the system is

Sys{x˜[n]}=Sys{k=0N1c˜kej(2π/N)kn}(5.237)

Let us use the linearity of the system to write the response as

Sys{x˜[n]}=k=0N1Sys{c˜kej(2π/N)kn}=k=0N1c˜kSys{ej(2π/N)kn}(5.238)

Based on Eqn. (5.230) the response of the system to an exponential basis function at frequency Ω = 2πk/N is given by

Sys{ej(2π/N)kn}=ej(2π/N)knH(2πkN)(5.239)

Using Eqn. (5.239) in Eqn. (5.238), the response of the system to x˜[n] is found as

Sys{x˜[n]}=k=0N1c˜kH(2πkN)ej(2π/N)kn(5.240)

Two important observations should be made based on Eqn. (5.240):

  1. For a DTLTI system driven by an input signal x˜[n] with period N, the output signal is also periodic with the same period.
  2. If the DTFS coefficients of the input signal are {c˜k;k=1,...,N1} then the DTFS coefficients of the output signal are {d˜k;k=1,...,N1} such that

d˜k=c˜kH(2πkN),k=0,...,N1(5.241)

Example 5.30: Response of DTLTI system to discrete-time sawtooth signal

Let the discrete-time sawtooth signal used in Example 5.4 and shown again in Fig. 5.43 be applied to the system with system function

Figure 5.43

Figure showing the signal x˜[n] for Example 5.30.

The signal x˜[n] for Example 5.30.

Find the steady-state response of the system.

Solution: The DTFS coefficients for x˜[n] were determined in Example 5.4, and are repeated below:

c˜0=2c˜1=0.5+j0.6882c˜2=0.5+j0.1625c˜3=0.5j0.1625c˜4=0.5j0.6882

Evaluating the system function at angular frequencies

Ωk=2πk5,k=0,1,2,3,4

we obtain

H(0)=1.7391H(2π5)=0.8767j0.8701H(4π5)=0.5406j0.1922H(6π5)=0.5406+j0.1922H(8π5)=0.8767+j0.8701

The DTFS coefficients for the output signal are found using Eqn. (5.241):

d˜0=c˜0H(0)=(2)(1.7391)=3.4783d˜1=c˜1H(2π5)=(0.5000+j0.6882)(0.8767j0.8701)=0.1604+j1.0384d˜2=c˜2H(4π5)=(0.5000+j0.1625)(0.5406j0.1922)=0.2391+j0.1839d˜3=c˜3H(6π5)=(0.5000j0.1625)(0.5406+j0.1922)=0.2391j0.1839d˜4=c˜4H(8π5)=(0.5000j0.6882)(0.8767+j0.8701)=0.1604j1.0384

The output signal y[n] can now be constructed using the DTFS coefficients {d˜k;k=0,1,2,3,4}:

y˜[n]=k=04d˜kej(2π/N)kn =3.4783+(0.1604+j1.0384)ej2πn/5+(0.2391+j0.1839)ej4πn/5 +(0.2391j0.1839)ej6πn/5+(0.1604j1.0384)ej8πn/5

and is shown in Fig. 5.44.

Figure 5.44

Figure showing the output signal ˜ y[n] for Example 5.30.

The output signal ˜ y[n] for Example 5.30.

Software resources:

ex_5_30.m

5.7 DTLTI Systems with Non-Periodic Input Signals

Let us consider the case of using a non-periodic signal x[n] as input to a DTLTI system. It was established in Section 3.7.2 of Chapter 3 that the output of a DTLTI system is equal to the convolution of the input signal with the impulse response, that is

y[n]=h[n]*x[n]=k=h[k]x[nk](5.242)

Let us assume that

  1. The system is stable ensuring that H (Ω) converges.
  2. The DTFT of the input signal also converges.

We have seen in Section 5.3.5 of this chapter that the DTFT of the convolution of two signals is equal to the product of individual transforms:

Y(Ω)=H(Ω)X(Ω)(5.243)

The output transform is the product of the input transform and the system function.

Writing each transform involved in Eqn. (5.243) in polar form using its magnitude and phase we obtain the corresponding relationships:

|Y(Ω)|=|H(Ω)||X(Ω)|(5.244)

Y(Ω)=X(Ω)+Θ(Ω)(5.245)

  1. The magnitude of the output spectrum is equal to the product of the magnitudes of the input spectrum and the system function.
  2. The phase of the output spectrum is found by adding the phase characteristics of the input spectrum and the system function.

5.8 Discrete Fourier Transform

In previous sections of this chapter we have studied the discrete-time Fourier series (DTFS) for periodic discrete-time signals, and the discrete-time Fourier transform (DTFT) for non-periodic discrete-time signals. The result of DTFT analysis of a discrete-time signal x[n] is a transform X (Ω) which, if it exists, is a 2π-periodic function of the continuous variable Ω. Storing the DTFT of a signal on a digital computer is impractical because of the continuous nature of Ω. On the other hand, the DTFS representation of a signal x˜[n] that is periodic with N samples is a set of coefficients c˜k that is also periodic with N. While this combination would certainly be suitable for computer implementation and storage, it is only for periodic signals. We often deal with signals that are not necessarily periodic.

In the analysis of non-periodic discrete-time signals, sometimes it is desirable to have a transform that is also discrete. This can be accomplished through the use of the discrete Fourier transform (DFT) provided that the signal under consideration is finite-length.

Consider a signal x[n] the meaningful samples of which are limited to the index range n = 0,...,N − 1, that is,

x[n]=0  for n<0  or N

We will refer to x[n] as a length-N signal since it has N non-trivial samples. An easy method of representing x[n] with a transform that is also length-N would be as follows:

  1. Consider x[n] as one period of a periodic signal x˜[n] defined as

    x˜[n]=m=x[nmN](5.246)

    We will refer to x˜[n] as the periodic extension of x[n].

  2. Determine the DTFS coefficients c˜k for the periodic extension x˜[n] obtained from x[n] through Eqn. (5.246):

    x˜[n]DTFSc˜k(5.247)

  3. DTFS coefficients of x˜[n] form a set that is also periodic with N. Let us extract just one period {ck; k = 0,...,N − 1} from the DTFS coefficients {c˜k;all k}:

    ck={c˜k,k=0,...,N10,otherwise(5.248)

This gives us the ability to represent the signal x[n] with the set of coefficients ck for k = 0,...,N − 1. The coefficients can be obtained from the signal using the three steps outlined above. Conversely, the signal can be reconstructed from the coefficients by simply reversing the order of the steps.

The discrete Fourier transform (DFT) will be defined by slightly modifying the idea presented above. The forward transform is

X[k]=n=0N1x[n]ej(2π/N)kn,k=0,...,N1(5.249)

The length-N signal x[n] leads to the length-N transform X[k]. Compare Eqn. (5.249) with DTFS analysis equation given by Eqn. (5.22). The only difference is the scale factor 1/N:

X[k]=Nck,k=0,...,N1(5.250)

It is also possible to obtain the signal x[n] from the transform X[k] using the inverse DFT relationship

x[n]=1Nk=0N1X[k]ej(2π/N)kn,n=0,...,N1(5.251)

The notation can be made a bit more compact by defining wN as

ωN=ej(2π/N)(5.252)

Using wN the forward DFT equation becomes

X[k]=n=0N1x[n]ωNkn,k=0,...,N1(5.253)

and the inverse DFT is found as

x[n]=1Nk=0N1X[k]ωNkn,n=0,...,N1(5.254)

Notationally the DFT relationship between a signal and its transform can be represented as

x[n]DFTX[k]

or as

X[k]=DFT{x[n]}x[n]=DFT1{X[k]}

The analysis and the synthesis equations for the DFT can be summarized as follows:

Discrete Fourier transform (DFT)

  1. Analysis equation (Forward transform):

    X[k]=n=0N1x[n]ej(2π/N)kn,k=0,...,N1(5.255)

  2. Synthesis equation (Inverse transform):

    x[n]=1Nk=0N1X[k]ej(2π/N)kn,n=0,...,N1(5.256)

The DFT is a very popular tool in a wide variety of engineering applications for a number of reasons:

  1. The signal x[n] and its DFT X[k] each have N samples, making the discrete Fourier transform practical for computer implementation. N samples of the signal can be replaced in memory with N samples of the transform without losing any information. It does not matter whether we store the signal or the transform since one can always be obtained from the other.
  2. Fast and efficient algorithms, known as fast Fourier transforms (FFTs), are available for the computation of the DFT.
  3. DFT can be used for approximating other forms of Fourier series and transforms for both continuous-time and discrete-time systems. It can also be used for fast convolution in filtering applications.
  4. Dedicated processors are available for fast and efficient computation of the DFT with minimal or no programming needed.

Example 5.31: DFT of simple signal

Determine the DFT of the signal

x[n]={1n=0,1,2}

Solution: The discrete Fourier transform is

X[k]=ej(2π/3)k(0)ej(2π/3)k(1)+2ej(2π/3)k(2)=1ej2πk/3+2ej4πk/3

We will evaluate this result for k = 1, 2, 3:

X[0]=11+2=2X[1]=1ej2π/3+2ej4π/3=0.5+j2.5981X[2]=1ej4πk/3+2ej8πk/3=0.5j2.5981

Example 5.32: DFT of discrete-time pulse

Determine the DFT of the discrete-time pulse signal

x[n]=u[n]u[n10]={1n=0,1,1,1,1,1,1,1,1,1}

Solution: The discrete Fourier transform is

X[k]=n=09ej(2π/10)kn,k=0,...,9

which can be put into closed form using the finite-length geometric series formula (see Appendix C)

X[k]=1ej2πk1ej2πk/10={10,n=00,k=1,...,9(5.257)

Note that L’Hospital’s rule was used for determining the value X[0]. The signal x[n] and its DFT are shown in Fig. 5.45.

Figure 5.45

Figure showing the signal x[n] and the transform X[k] for Example 5.32.

The signal x[n] and the transform X[k] for Example 5.32.

5.8.1 Relationship of the DFT to the DTFT

Consider again a length-N signal x[n]. The DTFT of such a signal, defined by Eqn. (5.71), can be written as

X(Ω)=n=0N1x[n]ejΩn(5.258)

where the summation limits have been adjusted to account for the fact that the only significant samples of x[n] are in the interval n = 0,...,N − 1. A comparison of Eqn. (5.258) with Eqn. (5.71) reveals the simple relationship between the DTFT and the DFT:

The DFT of a length-N signal is equal to its DTFT evaluated at a set of N angular frequencies equally spaced in the interval [0, 2π). Let an indexed set of angular frequencies be defined as

Ωk=2πN,  k=0,...,N1

The DFT of the signal is written as

X[k]=X(Ωk)=n=0N1x[n]ej(2πk/N)n(5.259)

It is obvious from Eqn. (5.259) that, for a length-N signal, the DFT is very similar to the DTFT with one fundamental difference: In the DTFT, the transform is computed at every value of Ω in the range 0 Ω < 2π. In the DFT, however, the same is computed only at frequencies that are integer multiples of 2π/N. In a way, looking at the DFT is similar to looking at the DTFT placed behind a picket fence with N equally spaced openings. This is referred to as the picket-fence effect. We will elaborate on this relationship further in the next example.

Example 5.33: DFT of a discrete-time pulse revisited

Consider again the discrete-time pulse that was used in Example 5.32.

x[n]=u[n]u[n10]

The DFT of this pulse was determined in Example 5.32 and shown graphically in Fig. 5.45(b). The DTFT of x[n] is

X(Ω)=n=09ejΩn

and it can easily be put into a closed form as

X(Ω)=sin(5Ω)sin(0.5Ω)ej4.5Ω

Recall from earlier discussion (see Eqn. (5.259)) that the transform sample with index k corresponds to the angular frequency Ωk = 2πk/N. If we want to graph the DTFT and the DFT on the same frequency axis, we need to place the DFT samples using an angular frequency spacing of 2π/N radians. Fig. 5.46 shows both the DTFT and the DFT of the signal x[n], and reveals why we obtained such a trivial looking result in Eqn. (5.257) for the DFT.

Figure 5.46

Figure showing Relationship between the DFT and the DTFT of the signal x[n] used in Example 5.33: (a) magnitudes, and (b) phases of the two transforms.

Relationship between the DFT and the DTFT of the signal x[n] used in Example 5.33: (a) magnitudes, and (b) phases of the two transforms.

For k = 1,..., 9, the locations of the transform samples in X[k] coincide with the zero crossings of the DTFT. This is the so-called picket-fence effect. It is as though we are looking at the DTFT of the signal x[n] through a picket fence that has narrow openings spaced 2π/N radians apart. In this case we see mostly the zero crossings of the DTFT and miss the detail between them.

The DFT as given by Eqn. (5.257) is still a complete transform, and the signal x[n] can be obtained from it using the inverse DFT equation given by Eqn. (5.256).

Software resources:

ex_5_33.m

5.8.2 Zero padding

Even though the DFT computed in Examples 5.32 and 5.33 is a complete and accurate representation of signal x[n], from a visual perspective it does not show much. Sometimes we would like more visual detail than provided by the DFT result. Continuing with the picket-fence analogy, we may want to observe the DTFT through a more dense picket fence with more openings in a 2π-radian range of the angular frequency. This can be accomplished by zero-padding the original signal, that is, by extending it with zero-amplitude samples before computing the DFT.

Consider again the length-N signal x[n]. Let us define a length-(N + M) signal q[n] as follows:

q[n]={x[n],n=0,...,N10,n=N,...,N+M1(5.260)

The DFT of the newly defined signal q[n] is

Q[k]=n=0N+M1q[n]ej2πkn/(N+M)(5.261)

=n=0N1x[n]ej2πkn/(N+M)(5.262)

Comparing Eqn. (5.261) with Eqn. (5.258) we conclude that

Q(k)=X(Ω)|Ω=2πk/(N+M)(5.263)

Thus, Q[k] corresponds to observing the DTFT of x[n] through a picket fence with openings spaced 2π/(N + M) radians apart as opposed to 2π/N radians apart. The number of zeros to be appended to the end of the original signal can be chosen to obtain any desired angular frequency spacing.

Example 5.34: Zero padding the discrete-time pulse

Consider again the length-10 discrete-time pulse used in Example 5.33. Create a new signal q[n] by zero-padding it to 20 samples, and compare the 20-point DFT of q[n] to the DTFT of x[n].

Solution: The new signal q[n] is

q[n]={1,n=0,...,90,n=10,...,19

The 20-point DFT of q[n] is

Q[k]=n=019q[n]ej2πnk/20(5.264)

Since q[n] = 1 for n = 0,..., 9 and q[n] = 0 for n = 10,..., 19, Eqn. (5.264) can be written as

Q[k]=n=09ej2πnk/20=1ejπk1ej2πk/20,k=0,...,19

Q[k] is graphed in Fig. 5.47 along with the DTFT X (Ω). Compare the figure to Fig. 5.33. Notice how 10 new transform samples appear between the 10 transform samples that were there previously. This is equivalent to obtaining new points between existing ones through some form of interpolation. After zero-padding, the angular frequency spacing between the transform samples is Ωk = 2π/20.

Figure 5.47

Figure showing Relationship between the DFT and the DTFT of the zero-padded signal q[n] used in Example 5.34: (a) magnitudes, and (b) phases of the two transforms.

Relationship between the DFT and the DTFT of the zero-padded signal q[n] used in Example 5.34: (a) magnitudes, and (b) phases of the two transforms.

Software resources:

ex_5_34.m

Interactive Demo: pf_demo.m

The demo program pf_demo.m is based on Examples 5.33 and 5.34 as well as Figure 5.46 and Figure 5.47. The DFT and the DTFT of the 10-sample discrete-time pulse signal are graphed on the same coordinate system to show the picket-fence effect of the DFT. The input signal may be padded with a user-specified number (between 0 and 30) of zero-amplitude samples before the transform is computed. Accordingly, the case in Fig. 5.46 may be duplicated with no additional zero-amplitude samples whereas padding the signal with 10 zero-amplitude samples leads to the situation in Fig. 5.47. The horizontal axis variable for the graphs can be one of three choices: It can display the angular frequency Ω in the range from 0 to 2π, the normalized frequency F in the range from 0 to 1, or the DFT index k in the range from 0to N − 1where N is the size of the DFT. Recall that the relationships between these parameters are Ω = 2πF, Ωk = 2πk/N, and Fk = k/N.

  • Let L be the number of zero-amplitude data samples with which the 10 sample pulse signal is padded. Compare the graphs for L = 0 and L = 10. In going from L = 0 to L = 10, observe how the additional DFT samples for L = 10 interpolate between the existing DFT samples.
  • Compare the graphs for L = 0 and L = 20. In going from L = 0 to L = 20, observe that now two additional DFT samples are inserted between existing DFT samples.
  • Change the horizontal axis to display the DFT index k. Pay attention to the locations of DFT samples in terms of the angular frequency Ω. Explain why the last DFT sample does not coincide with the second peak of the magnitude function, but rather appears slightly to the left of it.

Software resources:

pf_demo.m

Software resources:

See MATLAB Exercise 5.5 and MATLAB Exercise 5.6.

5.8.3 Properties of the DFT

Important properties of the DFT will be summarized in this section. It will become apparent in that process that the properties of the DFT are similar to those of DTFS and DTFT with one significant difference: Any shifts in the time domain or the transform domain are circular shifts rather than linear shifts. Also, any time reversals used in conjunction with the DFT are circular time reversals rather than linear ones. Therefore, the concepts of circular shift and circular time reversal will be introduced here in preparation for the discussion of DFT properties.

In the derivation leading to forward and inverse DFT relationships in Equation (5.255) and Equation (5.256) for a length-N signal x[n] we have relied on the DTFS representation of the periodic extension signal x˜[n]. Let us consider the following scenario:

  1. Obtain periodic extension x˜[n] from x[n] using Eqn. (5.246).
  2. Apply a time shift to x˜[n] to obtain x˜[nm]. The amount of the time shift may be positive or negative.
  3. Obtain an length-N signal g[n] by extracting the main period of x˜[nm].

    g[n]={x˜[nm],n=0,...,N10,Otherwise(5.265)

The resulting signal g[n] is a circularly shifted version of x[n], that is

g[n]=x[nm]mod N(5.266)

The term

x[nm]mod N(5.267)

on the right side of Eqn. (5.266) uses modulo indexing. The signal x[n] has meaningful samples only for n = 0,...,N − 1. The index n − m for a particular set of n and m values may or may not be in this range. Modulo N value of the index is found by adding integer multiples of N to the index until the result is within the range n = 0,...,N − 1. A few examples are given below:

x[3]mod 8=x[5]x[12]mod 10=x[2]x[7]mod 25=x[18]x[16]mod 16=x[0]x[3]mod 4=x[1]x[95]mod 38=x[19]

The process that led to Eqn. (5.266) is illustrated in Figure 5.48 and Figure 5.49 for an example length-8 signal.

Figure 5.48

Figure showing Obtaining a circular shift to the right by two samples. In step 1 a periodic extension x˜[n] is formed. In step 2 the periodic extension is time shifted to obtain ˜ x[n − 2]. In step 3 the main period is extracted to obtain g[n].

Obtaining a circular shift to the right by two samples. In step 1 a periodic extension x˜[n] is formed. In step 2 the periodic extension is time shifted to obtain ˜ x[n − 2]. In step 3 the main period is extracted to obtain g[n].

Figure 5.49

Figure showing Obtaining a circular shift to the left by three samples.

Obtaining a circular shift to the left by three samples.

For the example we are considering in Figure 5.48 and Figure 5.49 imagine a picture frame that fits samples 0,..., 7. Right shifting the signal by two samples causes two samples to leave the frame from the right edge and re-enter from the left edge, as shown in Fig. 5.48. Left shifting the signal has the opposite effect. Samples leave the frame from the left edge and re-enter from the right edge, as shown in Fig. 5.49. Fig. 5.50 further illustrates the concept of circular shifting.

Figure 5.50

Figure showing Circular shifting a length-N signal.

Circular shifting a length-N signal.

For the time reversal operation consider the following steps:

  1. Obtain periodic extension x˜[n] from x[n] using Eqn. (5.246).
  2. Apply the time reversal operation to x˜[n] to obtain x˜[–n].
  3. Obtain an length-N signal g[n] by extracting the main period of x˜[–n].

g[n]={x˜[n],n=0,...,N10,otherwise(5.268)

The resulting signal g[n] is a circularly time reversed version of x[n], that is

g[n]=x[n]modN(5.269)

The process that led to Eqn. (5.269) is illustrated in Fig. 5.51 for an example length-8 signal.

Figure 5.51

Figure showing Circular time reversal of a length-8 signal.

Circular time reversal of a length-8 signal.

Software resources:

See MATLAB Exercise 5.7.

For DFT-related operations the definitions of conjugate symmetry properties also need to be adjusted so that they utilize circular time reversals. A length-8 signal x[n] is circularly conjugate symmetric if it satisfies

x*[n]=x[n]modN(5.270)

or circularly conjugate antisymmetric if it satisfies

x*[n]=x[n]modN(5.271)

A signal that satisfies neither Eqn. (5.270) nor Eqn. (5.271) can still be decomposed into two components such that one is circularly conjugate symmetric and the other is circularly conjugate antisymmetric. The conjugate symmetric component is computed as

xE[n]=x[n]+x*[n]modN2(5.272)

and the conjugate antisymmetric component is computed as

xO[n]=x[n]x*[n]modN2(5.273)

respectively, so that

x[n]=xE[n]+xO[n](5.274)

Software resources:

See MATLAB Exercise 5.8.

We are now ready to explore the properties of the DFT. All properties listed in this section assume length-N signals and transforms.

Linearity

Let x1[n] and x2[n] be two length-N signals with discrete Fourier transforms

x1[n]DFTX1[k]andx2[n]DFTX2[k]

It can be shown that

α1x1[n]+α2x2[n]DFTα1X1[k]+α2X2[k](5.275)

for any two arbitrary constants α1 and α2.

Linearity property is easily proven starting with the forward DFT equation in Eqn. (5.255).

Time shifting

Given a transform pair

x[n]DFTX[k]

it can be shown that

x[nm]modNDFTej(2π/N)kmX[k](5.276)

Circular shifting of the signal x[n] causes the DFT to be multiplied by a complex exponential function.

Consistency check: Let the signal be circularly shifted by exactly one period, that is, m = N. We know that

x[nN]modN=x[n]

In this case the exponential function on the right side of Eqn. (5.276) would be e−j(2π/N)kN = 1, and the transform remains unchanged, as expected.

Example 5.35: Gaining insight into the time shifting property of DFT

Let a signal x[n] be given by

x[n]={an=0,b,c,d}

where a, b, c, d represent arbitrary signal amplitudes. Write X[k], the DFT of x[n], in terms of the parameters a, b, c, d. Afterwards construct the transform

G[k]=e2πk/4X[k]

and determine the signal g[n] to which it corresponds.

Solution: The DFT of x[n] is

X[k]=a+bejπk/2+cejπk+dj3πk/2(5.277)

The transform G[k] is obtained as

G[k]=e2πk/4X[k]=aejπk/2+bejπk+cej3πk/2+dej2πk

Realizing that e−j2πk = 1 for any integer value of k, Eqn. (5.278) can be written as

G[k]=d+aejπk/2+bejπk+cej3πk/2(5.278)

Comparing Eqn. (5.278) with Eqn. (5.277) we conclude that G[k] is the DFT of the signal

g[n]={dn=0,a,b,c}

which is a circularly shifted version of x[n], that is,

g[n]=x[n1]mod4

Time reversal

For a transform pair

x[n]DFTX[k]

it can be shown that

x[n]modNDFTX[k]modN(5.279)

Example 5.36: Gaining insight into the time reversal property of DFT

Consider again the signal x[n] used in Example 5.35:

x[n]={an=0,b,c,d}

The transform X[k] = DFT {x[n]} was derived in Eqn. (5.277). Construct the transform

G[k]=X[k]mod4

and determine the signal g[n] to which it corresponds.

Solution: Writing X[k] for each value of the index k we get

X[0]=a+b+c+dX[1]=(ac)j(bd)X[2]=ab+cdX[3]=(ac)+j(bd)

The transform G[k] is a circularly time reversed version of X[k]. Its samples are

G[0]=X[0]=a+b+c+dG[1]=X[1]=(ac)j(db)G[2]=X[2]=ab+cdG[3]=X[3]=(ac)+j(db)

Comparing G[k] with X[k] we conclude that the expressions for G[0] through G[3] can be obtained from those for X[0] through X[3] by simply swapping the roles of the parameters b and d. Consequently the signal g[n] is

g[n]={an=0,d,c,b}

which is a circularly reversed version of x[n], that is,

g[n]=x[n]mod4

Conjugation property

For a transform pair

x[n]DFTX[k]

it can be shown that

x*[n]DFTX*[k]modN(5.280)

Symmetry of the DFT

If the signal x[n] is real-valued, it can be shown that its DFT is circularly conjugate symmetric. Conversely, if the signal x[n] is purely imaginary, its transform is circularly conjugate antisymmetric. When we discuss symmetry properties in the context of the DFT we will always imply circular symmetry. If the signal x[n] is conjugate symmetric, its DFT is purely real. In contrast, the DFT of a conjugate antisymmetric signal is purely imaginary.

Symmetry properties of the DFT:

x[n]:Real,Im{x[n]}=0X*[k]=X[k]modN(5.281)

x[n]:Imag,Re{x[n]}=0X*[k]=X[k]modN(5.282)

x*[n]=x[n]modNX[k]:Real(5.283)

x*[n]=x[n]modNX[k]:Imag(5.284)

Consider a length-N signal x[n] that is complex-valued. In Cartesian complex form x[n] can be written as

x[n]=xr[n]+jxi[n]

Let the discrete Fourier transform X[k] of the signal x[n] be written in terms of its conjugate symmetric and conjugate antisymmetric components as

X[k]=XE[k]+XO[k]

The transform relationship between x[n] and X[k] is

xr[n]+jxi[n]DFTXE[k]+XO[k]

We know from Equation (5.281) and Equation (5.282) that the DFT of a real signal must be conjugate symmetric, and the DFT of a purely imaginary signal must be conjugate antisymmetric. Therefore it follows that the following must be valid transform pairs:

xr[n]DFTXE[k](5.285)

jxi[n]DFTXO[k](5.286)

A similar argument can be made by writing the signal x[n] as the sum of a conjugate symmetric signal and a conjugate antisymmetric signal

x[n]=xE[n]+xO[n]

and writing the transform X[k] in Cartesian complex form

X[k]=Xr[k]+jXi[k]

The transform relationship between the two is

xE[n]+xO[n]DFTXr[k]+jXi[k]

which leads to the following transform pairs:

xE[n]DFTXr[k](5.287)

xO[n]DFTjXi[k](5.288)

Example 5.37: Using symmetry properties of the DFT

The DFT of a length-4 signal x[n] is given by

X[k]={(2+j3)k=0,(1+j5),(2+j4),(1j3)}

Without computung x[n] first, determine the DFT of xr[n], the real part of x[n].

Solution: We know from the symmetry properties of the DFT that the transform of the real part of x[n] is the conjugate symmetric part of X[k]:

DFT{xr[n]}=XE[k]=X[k]+X*[k]modN2

The complex conjugate of the time reversed transform is

X*[k]mod4={(2j3k=0),(1+j3),(2,j4),(1j5)}

The conjugate symmetric component of X[k] is

XE[k]={2k=0,j4,2,j4}

The real part of x[n] can be found as the inverse transform of XE[k]:

xr[n]={0n=0,1,0,3}

Example 5.38: Using symmetry properties of the DFT to increase efficiency

Consider the real-valued signals g[n] and h[n] specified as

g[n]={11n=0,2,7,9}h(n)={6n=0,14,13,8}

Devise a method of obtaining the DFTs of g[h] and h[n] by computing only one 4-point DFT and utilizing symmetry properties.

Solution: Let us construct a complex signal x[n] as

x[n]=g[n]+jh[n]={(11+n=0j6),(2+j14),(7j13),(9+j8)}

The 4-point XFT of x[n] is

X[k]={(25+k=0j15),(10+j30),(11j29),(2+j8)}

The conjugate symmetric component of X[k] is

XE[k]=X[k]+X*[k]mod42={25k=0,(4+j11),11,(4j11)}

and its conjugate antisymmetric component is

XO[k]=X[k]X*[k]mod42={j15k=0,(6+j19),j29,(6+j19)}

Based on the symmetry properties of the DFT we have DFT {g[n]} = XE[k] and DFT {jh[n]} = XO[k]. Therefore

G[k]=XE[k]{25k=0,(4+j11),11,(4j11)}

and

H[k]=jXO[k]={15k=0,(19j6),29,(19+j6)}

It can easily be verified that G[k] and H[k] found above are indeed the DFTs of the two signals g[n] and h[n].

Software resources:

ex_5_38.m

Software resources:

See MATLAB Exercise 5.9.

Frequency shifting

For a transform pair

x[n]DFTX[k]

it can be shown that

x[n]ej(2π/N)mnDFTX[km]modN(5.289)

Circular convolution

Periodic convolution of two periodic signals x˜[n] and h˜[n] was defined in Section 5.2.2, Eqn. (5.47). In this section we will define circular convolution for length-N signals in the context of the discrete Fourier transform. Let x[n] and h[n] be length-N signals. Consider the following set of steps:

  1. Obtain periodic signals x˜[n] and h˜[n] as periodic extensions of x[n] and h[n]:

    x˜[n]=m=x[n+mN]h˜[n]=m=h[n+mN]

  2. Compute y˜[n] as the periodic convolution of x˜[n] and h˜[n].

    y˜[n]=x˜[n]h˜[n]=k=0N1x˜[k]h˜[nk]

  3. Let y[n] be the length-N signal that is equal to one period of y˜[n]:

    y[n]=y˜[n],for n=0,...,N1

The signal y[n] is the circular convolution of x[n] and h[n]. It can be expressed in compact form as

y[n]=x[n]h[n]=k=0N1x[k]h[nk]modN,n=0,...,N1(5.290)

Example 5.39: Circular convolution of two signals

Determine the circular convolution of the length-5 signals

x[n]={1n=0,3,2,4,6}

and

h[n]={5n=0,4,3,2,1}

using the definition of circular convolution given by Eqn. (5.290).

Solution: Adapting Eqn. (5.290) to length-5 signals we have

y[n]=x[n]h[n]=k=04x[k]h[nk]mod5,n=0,1,2,3,4

Fig. 5.52 illustrates the steps involved in computing the circular convolution. The result is

y[n]={24n=0,31,33,5,27}

Figure 5.52

Figure showing the circular convolution for Example 5.39.

The circular convolution for Example 5.39.

The circular convolution property of the discrete Fourier transform can be stated as follows:

Let x[n] and h[n] be two length-N signals with discrete-Fourier transforms

x[n]DFTX[k]andh[n]DFTH[k]

It can be shown that

x[n]h[n]DFTX[k]H[k](5.291)

The DFT of the circular convolution of two signals x[n] and h[n] is equal to the product of individual DFTs X[k] and H[k].

This is a very significant result in the use of the DFT for signal processing applications. The proof is straightforward using the periodic convolution property of the discrete-time Fourier series (DTFS), and will be given here.

Let x˜[n] and h˜[n] be periodic extensions of the length-N signals x[n] and h[n]. Furthermore, let c˜k and ˜ dk be the DTFS coefficients for x˜[n] and h˜[n] respectively:

x˜[n]DTFSc˜kandh˜[n]DTFSd˜k

The periodic convolution of x˜[n] and h˜[n]is

y˜[n]=x˜[n]h˜[n]=m=0N1x˜[m]h˜[nm]

and the DTFS coefficients of y˜[n] are

e˜[k]=1Nn=0N1y˜[n]ej(2π/N)kn

We know from Eqn. (5.49) that

e˜k=Nc˜kd˜k(5.292)

Recall the relationship between the DTFS and the DFT given by Eqn. (5.250). The DFTs of length-N signals x[n], h[n] and y[n] are related to the DTFS coefficients of the periodic extensions by

X[k]=Nc˜k,k=0,...,N1(5.293)

H[k]=Nd˜k,k=0,...,N1(5.294)

Y[k]=Ne˜k,k=0,...,N1(5.295)

Using Equation (5.293), Equation (5.294) and Equation (5.295) in Eqn. (5.292) we obtain the desired result:

Y[k]=X[k]H[k](5.296)

Example 5.40: Circular convolution through DFT

Consider again the length-5 signals x[n] and h[n] of Example 5.39. The circular convolution

y[n]=x[n]h[n]

was determined in Example 5.39 in the time-domain. Verify the circular convolution property of the DFT using these signals.

Solution: Table 5.5 lists the DFT for the three signals. It can easily be verified that

Y[k]=X[k]H[k]

Table 5.5

DFTs of the three signals in Example 5.40.

k

X[k]

H[k]

Y[k]

0

8.0000+j 0.0000

15.0000+j 0.0000

120.0000+j 0.0000

1

5.3992+j 0.6735

2.5000+j 3.4410

11.1803+j 20.2622

2

6.8992-j 7.4697

2.5000+j 0.8123

11.1803−j 24.2784

3

6.8992+j 7.4697

2.5000−j 0.8123

11.1803+j 24.2784

4

5.3992−j 0.6735

2.5000−j 3.4410

11.1803−j 20.2622

Software resources:

ex_5_40.m

If the circular convolution of two length-N signals is desired, the convolution property of the DFT provides an easy and practical method of computing it.

Obtaining circular convolution y[n] = x[n] ⊗ h[n]:

  1. Compute the DFTs

    X[k]=DFT{x[n]},andH[k]=DFT{h[n]}

  2. Multiply the two DFTs to obtain Y [k].

    Y[k]=X[k]H[k]

  3. Compute y[n] through inverse DFT:

    y[n]=DFT1{Y[k]}

In most applications of signal processing, however, we are interested in computing the linear convolution of two signals rather than their circular convolution. The output signal of a DTLTI system is equal to the linear convolution of its impulse response with the input signal. The ability to use the DFT as a tool for the computation of linear convolution is very important due to the availability of fast and efficient algorithms for computing the DFT. Therefore, the following two questions need to be answered:

  1. How is the circular convolution of two length-N signals related to their linear convolution?
  2. What can be done to ensure that the circular convolution result obtained using the DFT method matches the linear convolution result?

The next example will address the first question.

Example 5.41: Linear vs. circular convolution

Consider again the length-5 signals x[n] and h[n] of Example 5.39.

x[n]={1n=0,3,2,4,6}h[n]={5n=0,4,3,2,1}

The circular convolution of these two signals was determined in Example 5.39 as

y[n]=x[n]h[n]={24n=0,31,33,5,27}(5.297)

The linear convolution of x[n] and h[n], computed using the convolution sum

yl[n]=k=x[k]h[nk]

is found as

yl[n]={5n=0,19,25,1,27,19,12,8,6}(5.298)

Note that in Eqn. (5.298) we have used the notation y [n] for linear convolution to differentiate it from the circular convolution result of Eqn. (5.297). The most obvious difference between the two results y[n] and y [n] is the length of each. The circular convolution result is 5 samples long, however the linear convolution result is 9 samples long. This is the first step toward explaining why the DFT method does not produce the linear convolution result. X[k] and H[k] are length-5 transforms, and the inverse DFT of their product yields a length-5 result for y[n].

How does yl [n] relate to y[n]? Imagine filling out a form that has 5 boxes for entering values, yet we have 9 values we must enter. We start from with the leftmost box and enter the first 5 of 9 values. At this point each box has a value in it, and we still have 4 more values not entered into any box. Suppose we decide to go back to the leftmost box, and start entering additional values into each box as needed. This is illustrated in Fig. 5.53 using the samples of the linear convolution result to fill the boxes.

Figure 5.53

Figure showing Relationship between linear and circular convolution in Example 5.41.

Relationship between linear and circular convolution in Example 5.41.

Each sample of the circular convolution result is equal to the sum of values in the corresponding box. For example, y[0] = yl [0] + yl [5] and y[1] = yl [1] + yl [6]. If a box has a single value, the circular convolution result is identical to the linear convolution result for the corresponding n. For boxes that have multiple entries, the circular convolution result is a corrupted version of the linear convolution result.

Software resources:

ex_5_41.m

Generalizing the results of Example 5.41 the circular convolution of two signals can be expressed in terms of their linear convolution as

y[n]=m=yl[n+mN](5.299)

If the circular convolution result is desired to be identical to the linear convolution result, the length of the circular convolution result must be sufficient to accommodate the number of samples expected from linear convolution. Using the analogy employed in Example 5.41, namely filling out a form with the results, there must be enough “boxes” to accommodate all samples of yl[k] without any overlaps. One method of achieving this is through zero-padding x[n] and h[n] before the computation of the DFT.

Computing linear convolution using the DFT:

Given two finite length signals with Nx and Nh samples respectively

x[n],  n=0,...,Nx1andh[n],  n=0,...,Nh1

the linear convolution yl [n] = x[n] * h[n] can be computed as follows:

  1. Anticipating the length of the linear convolution result to be Ny = Nx + Nh 1, extend the length of each signal to Ny through zero padding:

    xp[n]={x[n],n=0,...,Nx10,n=Nx,...,Ny1hp[n]={h[n],n=0,...,Nh10,n=Nh,...,Ny1

  2. Compute the DFTs of the zero-padded signals xp[n] and hp[n].

    Xp[k]=DFT{xp[n]},andHp[k]=DFT{hp[n]}

  3. Multiply the two DFTs to obtain Yp[k].

    Yp[k]=Xp[k]Hp[k]

  4. Compute yp[n] through inverse DFT:

    yp[n]=DFT1{Yp[k]}

    The result yp[n] is the same as the linear convolution of the signals x[n] and y[n].

    yp[n]=yl[n]for n=0,...,Ny1

Software resources:

See MATLAB Exercise 5.10 and MATLAB Exercise 5.11.

5.8.4 Using the DFT to approximate the EFS coefficients

EFS representation of a continuous-time signal xa (t) periodic with a period T0 was given in Eqn. (4.72) in Chapter 4 which is repeated below:

Eqn(4.72)ck=1T0t0t0+T0xa(t)ejkω0tdt

One method of approximating the coefficients ck on a computer is by approximating the integral in Eqn. (4.72) using the rectangular approximation method. More sophisticated methods for approximating integrals exist, and are explained in detail in a number of excellent texts on numerical analysis. The rectangular approximation method is quite simple, and will be sufficient for our purposes.

Suppose we would like to approximate the following integral:

G=0T0g(t)dt(5.300)

Since integrating the function g (t) amounts to computing the area under the function, a simple approximation is

Gn=0N1g(nT)T(5.301)

We have used the sampling interval T = T0/N and assumed that N is sufficiently large for the approximation to be a good one. The area under the function g (t) is approximated using the areas of successive rectangles formed by the samples g (nT). This is depicted graphically in Fig. 5.54.

Figure 5.54

Figure showing Rectangular approximation to an integral.

Rectangular approximation to an integral.

For the purpose of approximating Eqn. (4.72) let g (t) be chosen as

g(t)=1T0xa(t)ejkω0t(5.302)

so that the integral in Eqn. (4.72) is approximated as

ck1T0n=0N1xa(nT)ejkω0nTT(5.303)

Recalling that T0 = NT and ω0 = 2π/T0, and using the discrete-time signal x[n] = xa (nT), we have

ck1Nn=0N1x(n)ej(2π/N)kn1NX[k](5.304)

The EFS coefficients of a periodic signal can be approximated by sampling the signal at N equally spaced time instants over one period, computing the DFT of the resulting discrete-time signal x[n], and scaling the DFT result by 1/N. Some caveats are in order:

  1. The number of samples over one period, N, should be sufficiently large. If we want to be more rigorous, the conditions of the Nyquist sampling theorem must be observed, and the sampling rate fs = 1/T should be at least twice the highest frequency in the periodic signal x (t).
  2. Only the first half of the DFT values can be used as approximations for positive indexed coefficients, that is

    ck1NX[k],  k=0,...,N21(5.305)

    with negative indexed coefficients obtained from the second half of the DFT by

    ck1NX[Nk],  k=1,...,N2(5.306)

  3. If the conditions of the Nyquist sampling theorem cannot be satisfied in a strict sense (such as when we try to approximate the Fourier series of a pulse train which is not limited in terms of the highest frequency it contains), only the first few terms of each set in Equation (5.305) and Equation (5.306) should be used to keep the quality of the approximation acceptable.

Software resources:

See MATLAB Exercise 5.12 and MATLAB Exercise 5.13.

5.8.5 Using the DFT to approximate the continuous Fourier transform

It is also possible to use the DFT for approximating the Fourier transform of a non-periodic continuous-time signal. For a signal xa (t) the Fourier transform was defined by Eqn. (4.127) in Chapter 4 which is repeated here:

Eqn(4.127)Xa(ω)=xa(t)ejωtdt(5.307)

Suppose xa (t) is a finite-length signal that is zero outside the interval 0 ≤ t ≤ t1. The integral in Eqn. (4.127) can be written as

Xa(ω)=0t1xa(t)ejwtdt(5.308)

The integral can be evaluated in an approximate sense using the rectangular approximation technique outlined in Eqn. (5.301) with

g(t)=xa(t)ejωt(5.309)

The function g (t) needs to be sampled at N equally spaced time instants in the interval 0 ≤ t ≤ t1, and thus NT = t1. Rectangular rule approximation to the integral in Eqn. (5.308) is

Xa(ω)n=0N1xa(nT)ejωnTT(5.310)

Using the discrete-time signal x[n] = xa (nT) and evaluating Eqn. (5.310) at a discrete set of frequencies

ωk=kwsN=2πkNT,k=0,...,N1

where ωs is the sampling rate in rad/s, we obtain

Xa(ωk)Tn=0N1x[n]ej(2π/N)kn=TX[k](5.311)

The Fourier transform of a continuous-time signal can be approximated by sampling the signal at N equally spaced time instants, computing the DFT of the resulting discrete-time signal x[n], and scaling the DFT result by the sampling interval T. It is also possible to obtain the approximation for Xa (ω) at a more closely spaced set of frequencies than ωk = s/N by zero-padding x[n] prior to computing the DFT. Let

ω¯k=kωsN+M=2πk(N+M)T,  k=0,...,N+M1

where M is an integer. Using ω¯k in Eqn. (5.311) leads to

Xa(ω¯k)Tn=0N1x[n]ej2πkn(N+M)(5.312)

The summation on the right side of Eqn. (5.312) is the DFT of the signal x[n] zero-padded with M additional samples.

As noted in the discussion of the previous section, the conditions of the Nyquist sampling theorem apply to this case as well. Ideally we would have liked the sampling rate ωs to be at least twice the highest frequency of the signal the transform of which is being approximated. On the other hand, it can be shown that a time-limited signal contains an infinite range of frequencies, and strict adherence to the Nyquist sampling theorem is not even possible. Approximation errors are due to the aliasing that occurs in sampling a time-limited signal. For the approximation to be acceptable, we need to ensure that the effect of aliasing is negligible.

Based on the Nyquist sampling theorem, only the first half of the DFT samples in Equation (5.311) and Equation (5.312) should be used for approximating the transform Xa (ω) at positive frequencies in the range 0 ≤ ω < ωs/2. The second half of the DFT samples represent an approximation to the transform Xa (ω) in the negative frequency range −ωs/2 ≤ ω< 0.

Software resources:

See MATLAB Exercise 5.14.

Interactive Demo: dft_demo.m

The demo program dft_demo.m illustrates the use of DFT for approximating the Fourier transform of a continuous-time function. It is based on Eqn. (5.311), MATLAB Exercise 5.14 and Fig. 5.57.

The continuous-time function xa (t) used in MATLAB Exercise 5.14 is graphed on the left side of the screen along with its sampled form x[n]. The parameter N represents the number of samples in the time interval 0 ≤ t ≤ 1 s, and the parameter M represents the number of padded zero-amplitude samples, paralleling the development in Equation (5.307) through Equation (5.312). Magnitude and phase of the actual spectrum Xa (f) as well as the DFT based approximation are shown on the right side.

  • The case in Fig. 5.57 may be duplicated with the choices of N = 8 and M = 0. We know that NT = 1 s, so the sampling interval is T = 1/N = 0.125 s, and the sampling rate is fs = 8 Hz. The approximated samples appear from f1 = 4Hz to f2 = 3 Hz with a frequency increment of Δ f = 1 Hz.
  • While keeping N unchanged, set M = 8 which causes 8 zero-amplitude samples to be appended to the right of the existing samples before the DFT computation. Now there are 16 estimated samples of the transform Xa (f) starting at f1 = 4 Hz with an increment of Δ f = 0.5s.
  • Set N = 16 and M = 0. The sampling rate is fs = 16 Hz now, and therefore the estimated samples start at f1 = 8 Hz and go up to f2 = 7 Hz with an increment of Δ f = 1 Hz.
  • Understanding these relationships is key to understanding effective use of the DFT as a tool for analyzing continuous-time signals.

Software resources:

dft_demo.m

5.9 Further Reading

[1] R.J. Beerends. Fourier and Laplace Transforms. Cambridge University Press, 2003.

[2] A. Boggess and F.J. Narcowich. A First Course in Wavelets with Fourier Analysis. Wiley, 2011.

[3] S.C. Chapra. Applied Numerical Methods with MATLAB for Engineers and Scientists. McGraw-Hill, 2008.

[4] S.C. Chapra and R.P. Canale. Numerical Methods for Engineers. McGraw-Hill, 2010.

[5] D.G. Manolakis and V.K. Ingle. Applied Digital Signal Processing: Theory and Practice. Cambridge University Press, 2011.

[6] A.V. Oppenheim and R.W. Schafer. Discrete-Time Signal Processing. Prentice Hall, 2010.

[7] L. Tan and J. Jiang. Digital Signal Processing: Fundamentals and Applications. Elsevier Science, 2013.

[8] J.S. Walker. Fast Fourier transforms. Studies in Advanced Mathematics. Taylor & Francis, 1996.

MATLAB Exercises

MATLAB Exercise 5.1: Developing functions to implement DTFS analysis and synthesis

In this exercise we will develop two MATLAB functions to implement DTFS analysis and synthesis equations. Function SS_DTFS (..) given below computes the DTFS coefficients for the periodic signal x˜[n]. The vector “x” holds one period of the signal x˜[n] for n = 0,...,N −1. The vector “idx” holds the values of the index k for which the DTFS coefficients c˜k are to be computed. The coefficients are returned in the vector “c

 1	function c = ss_dtfs (x, idx)
 2	 c = zeros (size (idx)); %  Create all - zero vector.
 3	 N = length (x);	% Period of the signal.
 4	 for kk = 1: length (idx),
 5	 k = idx (kk);
 6	 tmp = 0;
 7	 for nn = 1: length (x),
 8	  n = nn -1;	% MATLAB  indices start with 1.
 9	  tmp = tmp + x(nn)* exp (- j *2* pi / N* k* n);
10	 end ;
11	 c(kk) = tmp /N;
12	 end ;
13	end

The inner loop between lines 6 and 11 implements the summation in Eqn. (5.22) for one specific value of k. The outer loop between lines 4 and 12 causes this computation to be performed for all values of k in the vector “idx”.

Function ss_invdtfs (..) implements the DTFS synthesis equation. The vector “c”holds one period of the DTFS coefficients c˜k for k = 0,...,N − 1. The vector “idx”holds the values of the index n for which the signal samples x˜[n] are to be computed. The synthesized signal x˜[n] is returned in the vector “x

 1	function  x = ss_invdtfs (c, idx)
 2	 x = zeros (size (idx)); %  Create all - zero vector.
 3	 N = length (c);	%  Period of the coefficient set.
 4	 for nn = 1: length (idx),
 5	 n = idx (nn);
 6	 tmp = 0;
 7	 for kk = 1: length (c),
 8	  k = kk -1;	% MATLAB  indices start with 1.
 9	  tmp = tmp + c(kk)* exp (j *2* pi/ N* k* n);
10	 end ;
11	 x(nn) = tmp ;
12	 end ;
13	end

Note the similarity in the structures of the two functions. This is due to the similarity of DTFS analysis and synthesis equations.

The functions ss_dtfs (..) and ss_invdtfs (..) are not meant to be computationally efficient or fast. Rather, they are designed to correlate directly with DTFS analysis and synthesis equations (5.22) and (5.21) respectively. A more efficient method of obtaining the same results will be discussed later in this chapter.

Software resources:

ss_dtfs.m

ss_invdtfs.m

MATLAB Exercise 5.2: Testing DTFS functions

In this exercise we will test the two functions ss_dtfs (..) and ss_invdtfs (..) that were developed in MATLAB Exercise 5.1.

Consider the signal x˜[n] used in Example 5.4 and shown in Fig. 5.3. It is defined by

x˜[n]=n,for n=0,...,4;andx˜[n+5]=x˜[n]

Its DTFS coefficients can be computed using the function ss_dtfs (..) as

	>>	x = [0, 1, 2, 3, 4]
	>>	c  =  ss_dtfs (x, [0:4])

The signal can be reconstructed from its DTFS coefficients using the function ss_invdtfs (..) as

	>>	x  =  ss_invdtfs (c, [-12:15])
	>>	stem ([-12:15], real (x))

The stem graph produced matches Fig. 5.3. The use of the function real (..) is necessary to remove very small imaginary parts due to round-off error.

Next, consider the signal of Example 5.5 which is a discrete-time pulse train. We will assume a period of 40 samples and duplicate the DTFS spectra in Fig. 5.5(a), (b), and (c). Let the signal x˜a[n] have L = 3. Its DTFS coefficients are computed and graphed as follows:

	>>	xa =[ones (1, 4), zeros (1, 33), ones (1, 3)]
	>>	ca = ss_dtfs (xa, [0:39])
	>>	stem ([0:39], real (ca))

Note that one period of the signal must be specified using the index range n = 0,..., 39. The DTFS coefficients for the signal x˜b[n] with L = 5 are computed and graphed with the following lines:

	>>	xb =[ones (1, 6), zeros (1, 29), ones (1, 5)]
	>>	cb = ss_dtfs (xb, [0:39])
	>>	stem ([0:39], real (cb))

Finally for x˜c[n] with L = 7 we have

	>>	xc =[ones (1, 8), zeros (1, 25), ones (1, 7)]
	>>	cc = ss_dtfs (xc, [0:39])
	>>	stem ([0:39], real (cc))

Software resources:

matex_5_2a.m

matex_5_2b.m

MATLAB Exercise 5.3: Developing and testing a function to implement periodic convolution

In this exercise we will develop a MATLAB function to implement the periodic convolution operation defined by Eqn. (5.47). The function ss_pconv (..) given below computes the periodic convolution of two length-N signals x˜[n] and h˜[n]. The vector “x” holds one period of the signal x˜[n] for n = 0,...,N − 1. Similarly, the vector “h” holds one period of the signal h˜[n]for n = 0,...,N − 1. One period of the periodic convolution result y˜[n] is returned in vector “y”.

 1	function y = ss_pconv (x, h)
 2	 N = length (x);	%  Period for all three signals.
 3	 y = zeros (size (x));	%  Create all - zero vector.
 4	 for n = 0: N -1,
 5	 tmp = 0;
 6	 for k = 0: N -1,
 7	  tmp = tmp + ss_per (x, k)* ss_per (h, n-k);
 8	 end ;
 9	 nn = n +1;
 10	 y(nn) = tmp ;
 11	 end ;
 12	end

Line 7 of the code is a direct implementation of Eqn. (5.47). It utilizes the function ss_per (..), which was developed in MATLAB Exercise 1.7 for periodically extending a discrete-time signal.

The function ss_pconv (..) can easily be tested with the signals used in Example 5.8. Recall that the two signals were

x˜[n]={...,0n=0,1,2,3,4,...}

and

h˜[n]={...,3n=0,3,3,2,1,...}

each with a period of N = 5. The circular convolution result is obtained as follows:

	>>	x = [0, 1, 2, 3, 4]
	>>	h = [3,3,-3,-2,-1]
	>>	y = ss_pconv (x, h)

Software resources:

matex_5_3.m

ss_pconv.m

MATLAB Exercise 5.4: Steady-state response of DTLTI system to sinusoidal input

Consider the DTLTI system of Example 5.29 described by the difference equation

y[n]0.9y[n1]+0.36y[n2]=x[n]0.2x[n1]

The steady-state response of the system to the input signal

x˜[n]=5cos(πn5)

was found to be

y˜[n]=9.9305cos(πn50.3139)

In this exercise we will obtain the response of the system to a sinusoidal signal turned on at n = 0, that is,

x[n]=5cos(πn5)u[n]

by iteratively solving the difference equation, and compare it to the steady-state response found in Example 5.29. MATLAB function filter (..) will be used in iteratively solving the difference equation. The script listed below computes both responses and compares them.

 1	% Script : matex_5_4.m
 2	%
 3	n = [-10:30];
 4	ytilde = 9.9305* cos (pi * n /5 -0.3139);	%  Steady - state
 5	x = 5* cos (pi* n /5).*(n >=0);
 6	y =  filter ([1, -0.2], [1, -0.9, 0.36], x);	% Solve diff. eqn.
 7	p1 = stem (n -0.125, ytilde, 'b'),
 8 	hold on
 9	p2 = stem (n +0.125, y, 'r '),
 10	hold off
 11	axis ([-11, 31, -12, 12]);
 12	xlabel ('n'),

The lines 7 and 9 of the script create two stem plots that are overlaid. In order to observe the two discrete-time signals comparatively, two different colors are used. In addition, horizontal positions of the stems are offset slightly from their integer values, to the left for y˜[n] and to the right for y[n]. The graph produced by the script is shown in Fig. 5.55. The steady-state response is shown in blue and the response to the sinusoidal signal turned on at n = 0 is shown in red. Notice how the two responses become the same after the transient dies out after about n = 10.

Figure 5.55

Figure showing the graph obtained in MATLAB Exercise 5.4.

The graph obtained in MATLAB Exercise 5.4.

Software resources:

matex_5_4.m

MATLAB Exercise 5.5: Exploring the relationship between the DFT and the DTFT

The DFT and the DTFT of the length-10 discrete-time pulse were computed in Example 5.33. In this exercise we will duplicate the results of that example in MATLAB. The script listed below computes the 10-point DFT and graphs it on the same coordinate system with the DTFT of the signal.

 1	% Script matex_5_5a.m
 2	%
 3	xn = ones (1, 10);	% Length -10 pulse signal.
 4	Xk = fft (xn);	% X[k] = DFT of x[n].
 5	% Create a vector ' Omega ' and compute the DTFT.
 6	Omega = [-0.1:0.01:1. 1]*2 * pi + eps ;
 7	XDTFT = sin (5* Omega)./ sin (0.5* Omega).* exp (- j *4.5* Omega);
 8	% Compute frequencies that correspond to DFT samples.
 9	k = [0:9];
10	Omega_k = 2* pi * k /10;
11	% Graph the DTFT and the DFT on the same coordinate system.
12	clf ;
13	subplot (211);
14	plot (Omega, abs (XDTFT), '-', Omega_k, abs (Xk), ' ro '), grid ;
15	axis ([-0.2* pi, 2.2* pi, -1, 11]);
16	xlabel (' Omega (rad)'),
17	ylabel (' Magnitude ')
18	subplot (212)
19	plot (Omega, angle (XDTFT), '-', Omega_k, angle (Xk), ' ro '), grid ;
20	axis ([-0.2* pi, 2.2* pi, - pi, pi]);
21	xlabel (' Omega (rad)'),
22	ylabel (' Phase (rad)'),

A slightly modified script is given below. The signal is padded with 10 additional zero-amplitude samples to extend its length to 20. This causes new transform samples to be displayed between the existing transform samples.

 1	% Script matex_5_5b.m
 2	%
 3	xn = ones (1, 10);	% Length -10 pulse signal.
 4	Xk = fft (xn, 20);	% X[k] = DFT of x[n] zero padded to 20.
 5	% Create a vector ' Omega ' and compute the DTFT.
 6	Omega = [-0.1:0.01:1. 1]* 2* pi + eps ;
 7	XDTFT = sin (5* Omega)./ sin (0.5* Omega).* exp (- j *4.5* Omega);
 8	% Compute frequencies that correspond to DFT samples.
 9	k = [0:19];
10	Omega_k = 2* pi* k /20;
11	% Graph the DTFT and the DFT on the same coordinate system.
12	clf ;
13	subplot (211);
14	plot (Omega, abs (XDTFT), '-', Omega_k, abs (Xk), ' ro '), grid ;
15	axis ([-0.2* pi, 2.2* pi, -1, 11]);
16	xlabel (' Omega (rad)'),
17	ylabel (' Magnitude ')
18	subplot (212)
19	plot (Omega, angle (XDTFT), '-', Omega_k, angle (Xk), ' ro '), grid ;
20	axis ([-0.2* pi, 2.2* pi, - pi, pi]);
21	xlabel (' Omega (rad)'),
22	ylabel (' Phase (rad)'),

Software resources:

matex_5_5a.m

matex_5_5b.m

MATLAB Exercise 5.6: Using the DFT to approximate the DTFT

Recall from the discussion in Section 5.8.2 that zero padding a length-N signal by M additional zero-amplitude samples before the computation of the DFT results in a frequency spacing of

Ωk=2πN+Mradians

By choosing M large, the angular frequency spacing can be made as small as desired. This allows us to use the DFT as a tool for approximating the DTFT. If sufficient DFT samples are available, they can be graphed in the form of a continuous function of Ω to mimic the appearance of the DTFT graph. The script listed below graphs the approximate DTFT of the length-10 discrete-time pulse

x[n]=u[n]u[n10]

The signal is padded with 490 zero-amplitude samples to extend its length to 500. The DFT result is obtained for k = 0,..., 499. The DFT sample for index k corresponds to the angular frequency Ωk = 2πk/500. The last DFT sample is at the angular frequency Ω499 = 998π/500 which is just slightly less than 2π radians.

 1	% Script : matex_5_6.m
 2	%
 3	x = ones (1, 10);	%  Generate x[n].
 4	Xk = fft (x, 500);	% Compute 500 - point DFT.
 5	k =  [0:499];	   % DFT indices
 6	Omega_k = 2* pi * k /500;	% Angular frequencies.
 7	%  Graph  the magnitude and the phase of the DTFT.
 8	clf ;
 9	subplot (211);
10	plot (Omega_k, abs (Xk)); grid ;
11	title ('| X( Omega)| '),
12	xlabel (' Omega (rad)'),
13	ylabel (' Magnitude '),
14	axis ([0, 2* pi, -1, 11]);
15	subplot (212);
16	plot (Omega_k, angle (Xk)); grid ;
17	title (' angle X( Omega)'),
18	xlabel (' Omega (rad)'),
19	ylabel (' Phase (rad) '),
20	axis ([0, 2* pi, - pi, pi]);

Software resources:

matex_5_6.m

MATLAB Exercise 5.7: Developing functions for circular time shifting and time reversal

Circular versions of time shifting and time reversal operations can be implemented in MATLAB using the steps presented in Section 5.8.3. Recall that the idea behind circularly shifting a length-N signal was to first create its periodic extension with period N, then to apply time shifting to the periodic extension, and finally to extract the main period for n = 0,...,N − 1. The function ss_per (..) which was developed in MATLAB Exercise 1.7 for periodically extending a discrete-time signal will be used in constructing the functions of this exercise.

The function ss_cshift (..) listed below circularly shifts a signal by the specified number of samples. The vector “x” holds the samples of the signal x[n] for n = 0,...,N − 1. The second argument “m” is the number of samples by which the signal is to be circularly shifted. The vector “g” returned holds samples of the circularly shifted signal for n = 0,...,N − 1.

1	function g = ss_cshift (x, m)
2	 N = length (x);	% Length of x[n].
3	 n  =  [0: N -1];	%  Vector of indices.
4	 g = ss_per (x, n - m);
5	end

The function ss_crev (..) listed below circularly reverses a signal. Again, the vector “x” holds the samples of the signal x[n] for n = 0,...,N − 1.

1	function g = ss_crev (x)
2	 N = length (x);	% Length of x[n].
3	 n  =  [0: N -1];	%  Vector of indices.
4	 g = ss_per (x, - n);
5	end

Let us create a length-10 signal to test the functions.

	>>	n  =  [0:9];
	>>	x = [0, 2, 3, 4, 4.5, 3, 1, -1, 2, 1];

The signal g[n] = x[n − 3]mod 10 is obtained and graphed by typing

	>>	g = ss_cshift (x, 3);
	>>	stem (n, g);

A circular shift to the left can be obtained as well. To compute g[n] = x[n + 2]mod 10 type the following:

	>>	g =  ss_cshift (x, -2);

A circularly time reversed version of x[n] is obtained by

	>>	g = ss_crev (x);
Software resources:

matex_5_7.m

ss_cshift.m

ss_crev.m

MATLAB Exercise 5.8: Computing conjugate symmetric and antisymmetric components

Any complex length-N signal or transform can be written as the sum of two components, one of which is circularly conjugate symmetric and the other circularly conjugate antisymmetric. The two components are computed using Equation (5.272) and Equation (5.273) which will be repeated here:

Eqn(5.272)xE[n]=x[n]+x*[n]modN2Eqn(5.273)xO[n]=x[n]x*[n]modN2

The terms needed in the two equations above can easily be computed using the function ss_crev (..) developed in MATLAB Exercise 5.7. Given a vector “x” that holds samples of x[n] for n = 0,...,N − 1, the signals xE[n] and xO[n] are computed as follows:

	>>	xE = 0.5*(x+ conj (ss_crev (x)))
	>>	xO = 0.5*(x - conj (ss_crev (x)))

Software resources:

matex_5_8.m

MATLAB Exercise 5.9: Using the symmetry properties of the DFT

Consider Example 5.38 where two real signals g[n] and h[n] were combined to construct a complex signal x[n]. The DFT of the complex signal was computed and separated into its circularly conjugate symmetric and antisymmetric components, and the individual transforms of g[n] and h[n] were extracted.

If the samples of the two signals are placed into MATLAB vectors “g”and “h”, the following script can be used to obtain the transforms G[k] and H[k].

 1	% Script matex_5_9. m
 2	%
 3	x = g+j* h;	   % Construct complex signal.
 4	Xk = fft (x);	% Compute DFT.
 5	% Compute the two components of the DFT.
 6	XE = 0.5*(Xk+ conj (ss_crev (Xk)));
 7	XO = 0.5*(Xk - conj (ss_crev (Xk)));
 8	% Extract DFTs of the two signals.
 9	Gk = XE;
10	Hk = -j* XO ;
11	disp (ifft (Gk))	% Should be the same as vector 'g '.
12	disp (ifft (Hk))	% Should be the same as vector 'h '.

Software resources:

matex_5_9.m

MATLAB Exercise 5.10: Circular and linear convolution using the DFT

Consider the two length-5 signals x[n] and h[n] used in Example 5.41. The script listed below computes the circular convolution of the two signals using the DFT method:

 1	% Script matex_5_10a.m
 2	%
 3	x =  [1,3,2,-4,6];	   % Signal x[n]
 4	h  =  [5, 4, 3, 2, 1];	%  Signal  h[n]
 5	Xk = fft (x);	   % DFT of x[n]
 6	Hk  =  fft (h);	   % DFT of y[n]
 7	Yk = Xk. *Hk;	    %  Eqn. (5.296)
 8	y = ifft (Yk);

If linear convolution of the two signals is desired, the signals must be extended to at least nine samples each prior to computing the DFTs. The script given below computes the linear convolution of the two signals using the DFT method.

 1	% Script : mex_5_10b.m
 2	%
 3	x =  [1,3,2,-4,6];	% Signal x[n]
 4	h =  [5, 4, 3, 2, 1];	%  Signal  h[n]
 5	xp = [x, zeros (1, 4)];	%  Extend  by  zero  padding.
 6	hp = [h, zeros (1, 4)];	% Extend by zero padding.
 7	Xpk = fft (xp);	% DFT  of xp[n]
 8	Hpk =  fft (hp);	% DFT of hp[n]
 9	Ypk = Xpk. * Hpk ;	% Eqn. (5.296)
10	yp = ifft (Ypk);

The script “matex_5_10b.m” can be further simplified by using an alternative syntax for the function fft (..). The statement

>>	fft (x, 9)

computes the DFT of the signal in vector “x” after internally extending the signal to nine samples by zero padding. Consider the modified script listed below:

 1	% Script : matex_5_10c. m
 2	%
 3	x =  [1,3,2,-4,6];	% Signal x[n]
 4	h =  [5, 4, 3, 2, 1];	%  Signal  h[n]
 5	Xpk = fft (x, 9);	% 9 - point DFT of x[n]
 6	Hpk = fft (h, 9);	% 9 - point DFT of h[n]
 7	Ypk = Xpk. * Hpk ;	% Eqn. (5.296)
 8	yp = ifft (Ypk);

Software resources:

matex_5_10a.m

matex_5_10b.m

matex_5_10c.m

MATLAB Exercise 5.11: Developing a convolution function using the DFT

In this exercise we will develop a function for convolving two signals. Even though the built-in MATLAB function conv (..) accomplishes this task very well, it is still instructive to develop our own function that uses the DFT. As discussed in Section 5.8.3, linear convolution can be obtained through the use of the DFT as long as the length of the transform is adjusted carefully. The function ss_conv2(..) given below computes the linear convolution of two finite-length signals x[n] and h[n] the samples of which are stored in vectors “x”and “h”.

 1	function y = ss_conv2 (x, h)
 2	 N1 = length (x);	%  Length of signal 'x'
 3	 N2 = length (h);	% Length of signal 'h'
 4	 N = N1 + N2 -1;	%  Length  of  linear  convolution result.
 5	 Xk  =  fft (x, N);	% DFT of x[n] zero padded to N.
 6	 Hk = fft (h, N);	% DFT of h[n] zero padded to N.
 7	 Yk = Xk. *Hk;
 8	 y = ifft (Yk, N);
 9	end

Software resources:

ss_conv2.m

MATLAB Exercise 5.12: Exponential Fourier series approximation using the DFT

In this example, we will develop a MATLAB function to approximate the EFS coefficients of a periodic signal. The strategy used will parallel the development in Equation (5.300) through Equation (5.306). We have concluded in Section 5.8.4 that the DFT can be used for approximating the EFS coefficients through the use of Equation (5.304) and Equation (5.305) provided that the largest coefficient index k that is used in approximation is sufficiently small compared to the DFT size N.

The code for the function ss_efsapprox (..) is given below.

 1	function c = ss_efsapprox(x, k)
 2	 Nx = length (x);	%  Size of vector 'x'
 3	 Nk = length (k);	%  Size of vector 'k'
 4	 %  Create a return vector same size as 'k '.
 5	 c = zeros (1, Nk);
 6	 Xk = fft (x)/ Nx ;	% Eqn. (5.304)
 7	 %  Copy  the coefficients  requested.
 8	 for i = 1: Nk,
 9	 kk = k(i);
10	 if (kk >= 0),
11	  c(i) = Xk (kk +1);
12	 else
13	  c(i) = Xk (Nx +1+ kk);
14	 end ;
15	 end ;
16	end

The input argument x is a vector holding samples of one period of the periodic signal. The argument k is the index (or a set of indices) at which we wish to approximate the exponential Fourier series coefficients, so it can be specified as either a scalar index or a vector of index values. The return value c is either a scalar or a vector of coefficients. Its dimensions are compatible with those of k.

Suppose that 500 samples representing one period of a periodic signal x˜(t) have been placed into the vector x. Using the statement

	>>	c = ss_efsapprox(x, 2)

causes an approximate value for the coefficient c2 to be computed and returned. On the other hand, issuing the statement

	>>	c = ss_efsapprox(x, [-2, -1, 0, 1, 2])

results in the approximate values of coefficients {c2,c1,c0,c1,c2,} to be computed and returned as a vector.

To keep the function listing simple, no error checking code has been included. Therefore, it is the user’s responsibility to call the function with an appropriate set of arguments. Specifically, the index values in k must not cause an out-of-bounds error with the dimensions of the vector x. Furthermore, for good quality approximate values to be obtained, indices used should satisfy |k| << N.

Software resources:

ss_efsapprox.m

MATLAB Exercise 5.13: Testing the EFS approximation function

In this exercise we will test the function ss_efsapprox (..) that was developed in MATLAB Exercise 5.12. Consider the periodic pulse train shown in Fig. 5.56.

Figure 5.56

Figure showing the periodic pulse train for MATLAB Exercise 5.13.

The periodic pulse train for MATLAB Exercise 5.13.

One period is defined as

x˜(t)={1,0t<10,1t<3

We will compute 1024 samples of this signal within one period. The test code for approximating ck for k = 0,..., 10 is given below:

 1	% Script : matex_5_13.m
 2	%
 3	t = [0:1023]/1024*3;		% 1024 samples in one period.
 4	x = (t (>)=1);		% x(t)=1 if t (>)=1
 5	% Compute and print approximate EFS coefficients for
 6	%  k=0,. .., 10.
 7	for k = 0:10,
 8	 coeff = ss_efsapprox (x,k);
 9	 str = sprintf ('k =%3 d, magnitude =%0.5 f, phase =%0.5 f',. ..
10	 k, abs (coeff), angle (coeff));
11	 disp (str);
12	end ;

One point needs to be clarified: In line 3 of the code we generate a vector “t” of time samples spanning one period of T = 3 seconds. The first element of the time vector is equal to 0. We might intuitively think that the last element of this vector should be set equal to 3, the length of the period, yet it is equal to 1023(3) / (1024) which is slightly less than 3. The reason for this subtle difference becomes obvious when we look at Fig. 5.54. The width of each rectangle used in the numerical approximation of the integral is T = 3/1024. The first rectangle starts at t = 0 and extends to t = T = 3/1024. The second rectangle rectangle starts at t = T = 3/1024 and extends to t = 2T = 6/1024. Continuing to reason in this fashion, the left edge of the last rectangle of the period is at t = 1023T = 1023(3) / (1024), and the right edge of it is at t = 3. The vector “t” holds the left edge of each rectangle in the approximation, and therefore its last value is just shy of the length of the period by one rectangle width.

Actual versus approximate magnitude and phase values of exponential Fourier series coefficients of the signal x˜(t) are listed in Table 5.6. The same table also includes percent error calculations between actual and approximated values. Note that for index values at which the magnitude of a coefficient is zero or near-zero, phase calculations are meaningless, and percent error values are skipped.

Table 5.6

Exact vs. approximate exponential Fourier series coefficients for the test case in MATLAB Example 5.13.

k

Magnitude

Phase (rad)

Actual

Approx.

% Error

Actual

Approx.

% Error

0

0.3333

0.3340

0.20

0.00

0.000

0.000

1

0.2757

0.2760

0.12

1.047

1.046

0.098

2

0.1378

0.1375

0.24

2.094

2.092

0.098

3

0.0000

0.0007

0.00

3.142

0.003

 

4

0.0689

0.0692

0.47

1.047

1.043

0.391

5

0.0551

0.0548

0.59

2.094

2.089

0.244

6

0.0000

0.0007

0.00

3.142

0.006

 

7

0.0394

0.0397

0.82

1.047

1.040

0.683

8

0.0345

0.0341

0.94

2.094

2.086

0.390

9

0.0000

0.0007

0.00

3.142

0.009

 

10

0.0276

0.0279

1.17

1.047

1.037

0.976

MATLAB Exercise 5.14: Fourier transform approximation using DFT

The continuous-time signal

xa(t)=sin(πt)Π(t12)={sin(πt),0t10,otherwise

has the Fourier transform (see Problem 4.33)

Xa(f)=12[sinc(f+12)+sinc(f12)]ejπf

In this example we will develop the MATLAB code to approximate this transform using the DFT as outlined by Equation (5.311) and Equation (5.312). The MATLAB script given below computes and graphs both the actual and the approximated transforms for the signal xa (t).

  1. The actual transform is computed in the frequency range 10 Hz ≤ f ≤ 10 Hz.
  2. For the approximate solution, N = 16 samples of the signal xa (t) are taken in the time interval 0 ≤<t ≤ 1 s. This corresponds to a sampling rate of fs = 16 Hz, and to a sampling interval of T = 0.0625 s.
  3. Initially no zero padding is performed, therefore M = 0.
  4. Approximations to the continuous Fourier transform are obtained at frequencies that are spaced fs/N = 1 Hz apart.
  5. The DFT result has 16 samples as approximations to the continuous Fourier transform at frequencies fk = kfs/N = k Hz. Only the first 8 DFT samples are usable for positive frequencies from 0 to 7 Hz. This is due to Nyquist sampling theorem. The second half of the transform represents negative frequencies from 8Hz to 1Hz, and must be placed in front of the first half. The function fftshift (..) used in line 21 accomplishes that.
 1	% Script : matex_5_14.m
 2	%
 3	f = [-10:0.01:10];	% Create a vector of frequencies
 4	%  Compute the actual  transform.
 5	X_actual = 0.5*(sinc (f +0.5)+ sinc (f -0.5)).* exp (-j*pi * f);
 6	% Set parameters for the approximate transform
 7	t1 = 1;	% Upper limit of the time range
 8	N = 16;	% Number of samples
 9	M = 0;	%  Number  of samples  for zero - padding
10	T = t1 / N;	% Sampling interval
11	fs = 1/ T;	% Sampling rate.
12	n  =  [0: N -1];	% Index n for the sampled signal x[n]
13	k = [0: N+M -1];	% Index k for the DFT X[k]
14	time = n* T;	% Sampling instants
15	% Sample the signal and compute the DFT.
16	xn = sin (pi * time);
17	Xk = T* fft (xn, N+ M);
18	fk = k*fs/(N+ M);
19	%  Use  fftshift() function on  the DFT  result to bring the zero -
20	% frequency to the middle. Also adjust vector fk for it.
21	Xk = fftshift (Xk);
22	fk = fk -0.5* fs ;
23	% Graph the results.
24	clf ;
25	subplot (2, 1, 1);
26	plot (f, abs (X_actual),'-',fk, abs (Xk), 'r* '), grid ;
27	title (' Magnitude of actual and approximate transforms '),
28	xlabel ('f (Hz)'),
29	ylabel (' Magnitude '),
30	subplot (2, 1, 2);
31	plot (f, angle (X_actual), '-',fk, angle (Xk), 'r* '), grid ;
32	title (' Phase of actual and approximate transforms '),
33	xlabel ('f (Hz)'),
34	ylabel (' Phase (rad) '),

The MATLAB graph produced by the script is shown in Fig. 5.57. The zero padding parameter M can be used to control the frequency spacing. For example, setting M = 16 causes the continuous Fourier transform to be estimated at intervals of 0.5 Hz starting at −8 Hz and ending at 7.5 Hz.

Figure 5.57

Figure showing the graph obtained in MATLAB Exercise 5.14. Magnitude and phase of the actual spectrum shown are in blue, and approximated values are shown with red asterisks.

The graph obtained in MATLAB Exercise 5.14. Magnitude and phase of the actual spectrum shown are in blue, and approximated values are shown with red asterisks.

Problems

  1. 5.1. Determine the DTFS representation of the signal x˜[n]=cos(0.3πn). Sketch the DTFS spectrum.

  2. 5.2. Determine the DTFS representation of the signal x˜[n]=1+cos(0.24πn)+3sin(0.56πn). Sketch the DTFS spectrum.

  3. 5.3. Determine the DTFS coefficients for each of the periodic signals given in Fig. P.5.3.

    Figure P. 5.3

    image

  4. 5.4. Consider the periodic signal of Example 5.4. Let g˜[n] be one sample delayed version of it, that is,

    g˜[n]=x˜[n1]

    as shown in Fig. P.5.4.

    Figure P. 5.4

    image

    1. Determine the DTFS coefficients of g˜[n] directly from the DTFS analysis equation.
    2. Determine the DTFS coefficients of g˜[n] by applying the time shifting property to the coefficients of x˜[n] that were determined in Example 5.4.
  5. 5.5. Verify that the DTFS coefficients found for the signals in Problem 5.3 satisfy the conjugate symmetry properties outlined in Section 5.2.2. Since the signals are real, DTFS spectra should be conjugate symmetric.

  6. 5.6. Consider the periodic signal shown in Fig. P.5.4.

    1. Find even and odd components of g˜[n] so that

      g˜[n]=g˜e[n]+g˜0[n]

    2. Determine the DTFS coefficients of g˜e[n] and g˜0[n]. Verify the symmetry properties outlined in Section 5.2.2. The spectrum of the even component should be real, and the spectrum of the odd component should be purely imaginary.
  7. 5.7. Let x˜[n] and h˜[n] be both periodic with period N. Using the definition of periodic convolution given by Eqn. (5.49), show that the signal

    y˜[n]=x˜[n]h˜[n]

    is also periodic with period N.

  8. 5.8. Consider the two periodic signals shown in Fig. P.5.8.

    Figure P. 5.8

    image

    1. Compute the periodic convolution

      y˜[n]=x˜[n]h˜[n]

      of the two signals.

    2. Determine the DTFS coefficients of signals x˜[n], h˜[n] and y˜[n]. Verify that the periodic convolution property stated by Eqn. (5.49) holds.

  9. 5.9. Repeat Problem 5.8 for the two signals shown in Fig. P.5.9.

    Figure P. 5.9

    image

  10. 5.10. Find the DTFT of each signal given below. For each, sketch the magnitude and the phase of the transform.

    1. x[n] = δ[n] + δ[n − 1]
    2. x[n] = δ[n] − δ[n − 1]
    3. x[n]={1,n=0,1,2,30,otherwise
    4. x[n]={1,n=2,...,20,otherwise
    5. x[n] = (0.7)n u[n]
    6. x[n] = (0.7)n cos (0.2πn) u[n]
  11. 5.11. Find the inverse DTFT of each transform specified below for −π ≤ Ω < π.

    1. X(Ω)={1,|Ω|<0.2π0,otherwise
    2. X(Ω)={1,|Ω|<0.4π0,otherwise
    3. X(Ω)={0,|Ω|<0.2π1,otherwise
    4. X(Ω)={1,0.1π<|Ω|<0.2π0,otherwise
  12. 5.12. Use linearity and time shifting properties of the DTFT to find the transform of each signal given below.

    1. x[n] = (0.5)n u[n − 2]
    2. x[n] = (0.8)n (u[n] − u[n − 10])
    3. x[n] = (0.8)n (u[n + 5] − u[n − 5])
  13. 5.13. Use linearity and time reversal properties of the DTFT to find the transform of the signals listed below:

    1. x[n] = (2)n u[−n − 1]
    2. x[n] = (1.25)n u[−n]
    3. x[n] = (0.8)|n|
    4. x[n] = (0.8)|n| (u[n + 5] + u[n − 5])
  14. 5.14. Prove that the DTFT of a signal with odd symmetry is purely imaginary. In mathematical terms, if

    x[n]=x[n]

    then

    X*(Ω)=X(Ω)

  15. 5.15. Signals listed below have even symmetry. Determine the DTFT of each, and graph the magnitude of the transform.

    1. x[n]={1,n=01/2,n=±10,otherwise
    2. x[n]={5|n|,|n|40,otherwise
    3. x[n]={cos(0.2πn),n=4,...,40,otherwise
  16. 5.16. Signals listed below have odd symmetry. For each signal determine the DTFT. Graph the magnitude and the phase of the transform.

    1. x[n]={1/4,n=21/2,n=11/2,n=11/4,n=20,otherwise
    2. x[n]={n,n=5,...,50,otherwise
    3. x[n]={sin(0.2πn),n=4,...,40,otherwise
  17. 5.17. Determine the transforms of the signals listed below using the modulation property of the DTFT. Sketch the magnitude and the phase of the transform for each.

    1. x[n] = (0.7)n cos (0.2πn) u[n]
    2. x[n] = (0.7)n sin (0.2πn) u[n]
    3. x[n] = cos (πn/5) (u[n] − u[n − 10])
  18. 5.18. Use the differentiation in frequency property of the DTFT to find the transforms of the signals listed below.

    1. x[n] = n (0.7)n u[n]
    2. x[n] = n (n + 1) (0.7)n u[n]
    3. x[n] = n (0.7)n (u[n] − u[n − 10])
  19. 5.19. Two signals x[n] and h[n] are given by

    x[n]=u[n]u[n10]andh[n]=(0.8)nu[n]

    1. Determine the DTFT for each signal.
    2. 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 the convolution sum.
    3. Determine the DTFT of y[n] by direct application of the DTFT analysis equation. Verify that it is equal to the product of the individual transforms of x[n] and h[n]:

      Y(Ω)=X(Ω)H(Ω)

  20. 5.20. Determine and sketch the DTFTs of the following periodic signals.

    1. x[n] = ej0.3πn
    2. x[n] = ej0.2πn + 3ej0.4πn
    3. x[n] = cos (πn/5)
    4. x[n] = 2 cos (πn/5) + 3 cos (2πn/5)
  21. 5.21. Determine and sketch the power spectral density for each signal shown in Fig. P.5.3.

  22. 5.22. Consider the periodic signal

    x˜[n]={1,LnL0,L<n<NLandx˜[n+N]=x˜[n]

    Recall that the DTFS representation of this signal was found in Example 5.5.

    1. Find the power spectral density Sx (Ω).
    2. Let N = 40 and L = 3. Determine what percentage of signal power is preserved if only three harmonics are kept and the others are discarded.
    3. Repeat part (b) with N = 40 and L = 6.
  23. 5.23. A DTLTI system is characterized by the difference equation

    y[n]+y[n1]+0.89y[n2]=x[n]+2x[n1]

    Determine the steady-state response of the system to the following input signals:

    1. x[n] = ej0.2πn
    2. x[n] = cos (0.2πn)
    3. x[n] = 2 sin (0.3πn)
    4. x[n] = 3 cos (0.1πn) 5 sin (0.2πn)

    Hint: First find the system function H (Ω).

  24. 5.24. Determine the steady-state response of a length-4 moving average filter to the following signals.

    1. x[n] = ej0.2πn
    2. x[n] = cos (0.2πn)
    3. x[n] = 2 sin (0.3πn)
    4. x[n] = 3 cos (0.1πn) 5sin (0.2πn)
  25. 5.25. A DTLTI system is characterized by the difference equation

    y[n]+y[n1]+0.89y[n2]=x[n]+2x[n1]

    Using the technique outlined in Section 5.6.3 find the steady-state response of the system to each of the periodic signals shown in Fig. P.5.3.

  26. 5.26. Compute the DFTs of the signals given below.

    1. x[n]={1n=0,1,1,1}
    2. x[n]={1n=0,1,1,0,0}
    3. x[n]={1n=0,1,1,0,0,0,0}
  27. 5.27. Compute the DFTs of the signals given below. Simplify the results and show that each transform is purely real.

    1. x[n]={1n=0,1,0,0,0,0,0,1}
    2. x[n]={1n=0,1,1,0,0,0,1,1}
    3. x[n]={1n=0,1,1,1,0,1,1,1}
  28. 5.28. It is possible to express the forward DFT in matrix form using the compact form of the DFT definition given by Eqn. (5.253). Given the signal x[n]; n = 0,...,N − 1 and its DFT X[k]; k = 0,...,N − 1, let the vectors x and X be defined as

    x=[x[0]x[1]x[N1]],X=[X[0]X[1]X[N1]]

    Show that the discrete Fourier transform can be computed as

    X=Wx

    Construct the N × N coefficient matrix W.

  29. 5.29. For each finite-length signal listed below, find the specified circularly shifted version.

    1. x[n]={4n=0,3,2,1}find x[n2]mod4
    2. x[n]={1n=0,1,1,0,0}find x[n4]mod5
    3. x[n]={1n=0,4,2,3,1,2,3,1}find x[n]mod8
    4. x[n]={1n=0,4,2,3,1,2,3,1}find x[n+2]mod8
  30. 5.30. Refer to Problem 5.29. Find the circularly conjugate symmetric and antisymmetric components xE[n] and xO[n] for each signal listed.

  31. 5.31. Consider the finite-length signal

    x[n]={1n=0,1,1,0,0}

    1. Compute the 5-point DFT X[k] for k = 0,..., 4.
    2. Multiply the DFT found in part (a) with e−j2πk/5 to obtain the product

      R[k]=ej2πk/5X[k]for k=0,...,4

    3. Compute the signal r[n] as the inverse DFT of R[k] and compare it to the original signal x[n].
    4. Repeat parts (b) and (c) with

      S[k]=ej4πk/5X[k]for k=0,...,4

    5. Provide justification for the answers found using the properties of the DFT.
  32. 5.32. Consider the finite-length signal

    x[n]={5n=0,4,3,2,1}

    1. Compute the 5-point DFT X[k] for k = 0,..., 4.
    2. Reverse the DFT found in part (a) to obtain a new transform R[k] as

      R[k]=X[k]mod5for k=0,...,4

    3. Compute the signal r[n] as the inverse DFT of R[k] and compare it to the original signal x[n]. Justify the answer found using the properties of the DFT.
  33. 5.33. The DFT of a length-6 signal x[n] is given by

    X[k]={(2+k=0j3),(1+j5),(2+j4),(1j3),(2),(3+j1)}

    Without computing x[n] first, determine

    1. The DFT of xr[n], the real part of x[n]
    2. The DFT of xi[n], the imaginary part of x[n]
  34. 5.34. Two signals x[n] and h[n] are given by

    x[n]={2n=0,3,4,1,6}h[n]={1n=0,1,1,0,0}

    1. Compute the circular convolution y[n] = x[n] ⊗ h[n] through direct application of the circular convolution sum.
    2. Compute the 5-point transforms X[k] and H[k].
    3. Compute Y [k] = X[k] H[k], and the obtain y[n] as the inverse DFT of Y [k]. Verify that the same result is obtained as in part (a).
  35. 5.35. Refer to the signals x[n] and h[n] in Problem 5.34. Let X[k] and H[k] represent 7-point DFTs of these signals, and let Y [k] be their product, that is, Y [k] = X[k] H[k] for k = 0,..., 6. The signal y[n] is the inverse DFT of Y [k]. Determine y[n] without actually computing any DFTs.

  36. 5.36.

    1. The DFT of a length-N signal is equal to its DTFT sampled at N equally spaced angular frequencies. In this problem we will explore the possibility of sampling a DTFT at fewer than N frequency values. Let X (Ω) be the DTFT of the length-12 signal

      x[n]=u[n]u[n12]

      Obtain S[k] by sampling the transform X (Ω) at 10 equally spaced frequencies, that is,

      S[k]=X(2πk10),k=0,...,9

      Determine s[n], the inverse DFT of S[k].

    2. Consider the general case where x[n] may be an infinitely long signal, and its DTFT is

      X(Ω)=n=x[n]ejΩn

      S[k] is obtained by sampling X (Ω) at N equally spaced angular frequencies:

      S[k]=X(2πkN),k=0,...,N1

      s[n] is the length-N inverse DFT of S[k]. Show that s[n] is related to x[n] by

      s[n]=r=x[n+rN],n=0,...,N1

MATLAB Problems

  1. 5.37. Consider the periodic signals x˜[n] and g˜[n] shown in Fig. P.5.37.

    Figure P. 5.37

    image

    Write a MATLAB script to do the following:

    1. Compute the DTFS coefficients of each signal using the function ss_dtfs (..) developed in MATLAB Exercise 5.1.
    2. Compute the DTFS coefficients of g˜[n] by multiplying the DTFS coefficients of x˜[n] with the proper exponential sequence as dictated by the time shifting property.
    3. Compare the results found in parts (a) and (b).
  2. 5.38. Consider again the periodic signals used in Problem 5.37 and shown in Fig. P.5.37. Both signals are real-valued. Consequently, their DTFS coefficients must satisfy the conjugate symmetry property as stated by Eqn. (5.35). Verify this with the values obtained in Problem 5.37.

  3. 5.39. Refer to the periodic pulse train used in Example 5.5. Write a MATLAB script to compute and graph its DTFS spectrum. Use the script to obtain graphs for the following parameter configurations:

    1. N = 30 , L = 5
    2. N = 30 , L = 8
    3. N = 40 , L = 10
    4. N = 40 , L = 15
  4. 5.40. Use the MATLAB script developed in Problem 5.39 to produce graphs that duplicate the three cases shown in Fig. 5.17 parts (a), (b) and (c).

  5. 5.41. Refer to Problem 5.22.

    1. Let N = 40 and L = 3. Develop a script to compute and graph a finite-harmonic approximation to x[n] using three harmonics.
    2. Repeat part (a) using a signal with N = 40 and L = 6.
  6. 5.42. Refer to Problem 5.24. Write a script to compute the response of the length-4 moving average filter to each of the the signals specified in the problem. Use the function ss_movavg4(..) that was developed in MATLAB Exercise 3.1 in Chapter 3. For each input signal compute the response for n = 0,..., 49. Compare the steady-state part of the response (in this case it will be after the first three samples) to the theoretical result obtained in Problem 5.24.

  7. 5.43. Refer to Problem 5.25.

    1. Develop a script to iteratively solve the difference equation given. The system should be assumed initially relaxed, that is, y[1] = y[2] = 0.
    2. Find the response of the system to each of the input signals in Fig. P.5.3 for n = 0,..., 49.
    3. In each of the responses, disregard the samples for n = 0,..., 24, and compare samples n = 25,..., 49 to the theoretical steady-state response computed in Problem 5.25.

    Hint: You may wish to use the function ss_per (..) that was developed in MATLAB Exercise 1.7 for creating the periodic signals needed.

  8. 5.44. Refer to Problem 5.28 in which the matrix form of the forward DFT equation was explored.

    1. Develop a MATLAB function ss_dftmat (..) to construct the coefficient matrix W needed in computing the DFT. Its syntax should be

      	W = ss_dftmat (N)

      where N is the size of the DFT to be computed.

    2. Use the function ss_dftmat (..) to compute the 10-point DFT of the discrete-time pulse signal

      x[n]=u[n]u[n10]

      using the matrix method. Compare the result to that obtained in Example 5.33.

    3. Use the function ss_dftmat (..) to compute the 20-point DFT of the discrete-time pulse signal through zero padding the vectorx. Compare the result to that obtained in Example 5.34.
  9. 5.45. Write a script to approximate the EFS coefficients of the half-wave rectified sinusoidal signal x˜(t) shown in Fig. P.5.45.

    Figure P. 5.45

    image

    You may wish to use the function ss_efsapprox (..) developed in MATLAB Exercise 5.12. Sample the signal with a step size of T = 0.01 s to obtain 100 samples in one period. Obtain approximate values for the coefficients ck for k = 15,..., 15 and compare to the correct values obtained in Chapter 4, Example 4.10.

  10. 5.46. Refer to Problem 5.36 in which the issue of sampling a DTFT was explored. Develop a MATLAB script to perform the following steps:

    1. Define an anonymous function to return the DTFT X (Ω) of the signal

      x[n]={n,n=0,...,110,otherwise

    2. Obtain S[k] by sampling the transform X (Ω) at 10 equally spaced frequencies, that is,

      S[k]=X(2πk10),k=0,...,9

      Compute s[n] = DFT1 {S[k]}, and create a stem plot.

    3. Repeat part (b) by evaluating the DTFT at 8 equally-spaced angular frequencies

      Ωk=2πk8k=0,...,7

MATLAB Projects

  1. 5.47. This problem is about increasing the efficiency of DFT computation by recognizing the symmetry properties of the DFT and using them to our advantage. Recall from the symmetry properties discussed in Section 5.8.3 that for a signal expressed in Cartesian complex form

    x[n]=xr[n]+jxi[n]

    and its transform expressed using circularly conjugate symmetric and antisymmetric components as

    X[k]=XE[k]+XO[k]

    the following relationships exist:

     xr[n]DFTXE[k]jxi[n]DFTXO[k]

    Develop a MATLAB script to compute the DFTs of two real-valued length-N signals r[n] and s[n] with one call to the function fft (..) using the following approach:

    1. Construct a complex signal x[n] = r[n] + js[n].
    2. Compute the DFT of the complex signal x[n] using the function fft (..).
    3. Find the DFTs of the signals r[n] and s[n] by splitting the transform X[k] into its two components XE[k] and XO[k] and making the necessary adjustments. You may wish to use the function ss_crev (..) developed in MATLAB Exercise 5.8.

    Test your script using two 128-point signals with random amplitudes. (Use MATLAB function rand (..) to generate them.) Compare the transforms for R[k] and S[k] to results obtained by direct application of the function fft (..) to signals r[n] and s[n].

  2. 5.48. One of the popular uses of the DFT is for analyzing the frequency spectrum of a continuous-time signal that has been sampled. The theory of sampling is covered in detail in Chapter 6. In this problem we will focus on computing and graphing the approximate spectrum of a recorded audio signal using the technique discussed in Section 5.8.5.

    Provided that a computer with a microphone and a sound processor is available, the following MATLAB code allows 3 seconds of audio signal to be recorded, and a vector “x” to be created with the recording:

    	hRec = audiorecorder;
    	disp (' Press a key to start recording '), pause ;
    	recordblocking (hRec, 3);
    	disp (' Finished recording '), x = getaudiodata(hRec);

    By default the analog signal xa (t) captured by the microphone and the sound device is sampled at the rate of 8000 times per second, corresponding to T = 125 s. For a 3-second recording the vector “x” contains 24000 samples that represent

    x[n]=xa(n8000),n=0,...,23999

    Develop a MATLAB script to perform the following steps to display the approximate spectrum of a speech signal xa (t):

    1. Extract 1024 samples of the vector x[n] into a new vector.

      r[n]=x[n+8000],n=0,...,1023

      We skip the first 8000 samples so that we do not get a blank period before the person begins to speak.

    2. Compute the DFT R[k] of the signal r[n]. Scale it as outlined in Section 5.8.5 so that it can be used for approximating the continuous Fourier transform of xa (t). Also create an approximate vector “f” of frequencies in Hz for use in graphing the approximate spectrum Xa (f).
    3. Compute and graph the decibel (dB) magnitude of the approximate spectrum as a function of frequency.
    4. Record your own voice and use it to test the script.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset