<<

Jim Lambers MAT 773 Fall Semester 2018-19 Lecture 11 and 12 Notes These notes correspond to Section 3.1 in the text.

The Discrete

By the Composite Trapezoidal Rule, Z 2π   1 1 2π Y0 Yn F (t) dt ≈ + Y1 + Yn−1 + , 2π 0 2π n 2 2 where Yj = F (hj) = F (2πj/n), for j = 0, 1, . . . , n. If F (t) is 2π-periodic, then Y0 = Yn and we then have n−1 1 Z 2π 1 X F (t) dt ≈ Y . 2π n j 0 j=0 Thus complex Fourier coefficients can be approximated by n−1 n−1 1 Z 2π 1 X 2πj  1 X α = f(t)e−ikt dt ≈ f e−2πijk/n = y wjk, k 2π n n n j 0 j=0 j=0 where 2πj  y = f , w = e2πi/n. j n

Definition of Discrete Fourier Transform

Let Sn be the set of n-periodic of complex numbers.

∞ Definition 1 Let y = {yj}j=−∞ ∈ Sn. The discrete Fourier transform (DFT) of y is the (Fn[y])k =y ˆk, where

n−1 X 2πi yˆ = y wjk, w = exp . k j n j=0

It follows that the complex Fourier coefficients and discrete Fourier transform are related by 1 α ≈ yˆ . k n k The discrete Fourier transform can also be expressed as a matrix-vector multiplication

Fn[y] =y ˆ = F ny, where  1 1 1 ··· 1  2 n−1  1 w w ··· w     1 w2 w4 ··· w2(n−1)  Fn =   .  . .. .   . . .  1 wn−1 w2(n−1) ··· w(n−1)2

1 Properties of the Discrete Fourier Transform

Lemma 2 Fn is a linear operator from Sn to Sn.

This can be proved by showing directly thaty ˆk+n =y ˆk.

Theorem 3 Let y ∈ Sn and let

n−1 X jk yˆk = Fn[y]k = yjw . j=0

Then n−1 1 X y = F −1[ˆy] = yˆ wjk. j n j n k k=0

Equivalently, Theorem 3 states that 1 y = F −1yˆ = F y,ˆ n n n which, in view ofy ˆ = F ny, yields 1 F F = I . n n n n H √ Because Fn is complex symmetric, we have F n = Fn , and therefore 1/ nFn is a unitary matrix. To show that this is in fact the case, we can show directly that   n−1 ( 1 H 1 X `k kj 1 if j = `, FnF = w w = n n n 0 otherwise. `j k=0

Theorem 4 The following properties hold for the discrete Fourier transform.

k • Shifts or translations: If y, z ∈ Sn and zj = yj+1, then Fn[z]k = w Fn[y]k, where w = e2πi/n.

• Convolutions: If y, z ∈ Sn, then the sequence y ∗ z defined by

n−1 X [y ∗ z]j = ykzj−k k=0

is also in Sn.

: Fn[y ∗ z]k = Fn[y]kFn[z]k.

• If y ∈ Sn is a sequence of real numbers, then

Fn[y]n−k = Fn[y]k.

That is,y ˆn−k = yˆk.

2 The Fast Fourier Transform Consider the discrete Fourier transform with 2N nodes:

2N−1 X jk yˆk = yjw j=0

Split into sums with even- and odd-numbered terms:

N−1 N−1 X 2jk X (2j+1)k yˆk = y2jw + y2j+1w j=0 j=0

Let W = w2: N−1 N−1  X jk k X jk yˆk = y2jW + w  y2j+1W  . j=0 j=0 That is, k yˆk = FN [{y0, y2, . . . , y2N−2}]k + w FN [{y1, y3, . . . , y2N−1}]k. Note that

•FN [yeven], FN [yodd] ∈ SN • wk+N = wkwN = wke−iπ = −wk

Then, for k = 0, 1,...,N − 1, we have

k yˆk = FN [{y0, y2, . . . , y2N−2}]k + w FN [{y1, y3, . . . , y2N−1}]k, k yˆk+N = FN [{y0, y2, . . . , y2N−2}]k − w FN [{y1, y3, . . . , y2N−1}]k.

Similarly, for the inverse transform, we have 1 y = F −1[{yˆ , yˆ ,..., yˆ }] + wjF −1[{yˆ , yˆ ,..., yˆ }] , j 2 N 0 2 2N−2 j N 1 3 2N−1 j 1 y = F −1[{yˆ , yˆ ,..., yˆ }] − wjF −1[{yˆ , yˆ ,..., yˆ }] . j+N 2 N 0 2 2N−2 j N 1 3 2N−1 j In terms of matrix-vector products, we have        IN DN F N 0 yeven F2N y = F 2N y = , IN −DN 0 F N yodd

2 N−1 where DN = diag(1, w, w , . . . , w ).

Example 5 Let f(t) = t + t2, and lety ˆk, k = 0, 1, . . . , n, denote the (n + 1)-point DFT of f. It can be seen from a graph thaty ˆk is symmetric around k = n/2. Furthermore, |yˆk| decreases with k until k = n/2, only to increase after that due to this symmetry. 2

3 Example 6 Consider the signal

2 y(t) = e−(cos t) (sin 2t + 2 cos 4t + 0.4 sin t sin 50t).

This signal has noise with a frequency greater than 5, so if we compute its (n + 1)-point DFT, where n is even, we can remove the noise from the signal by settingy ˆk = 0 for 6 ≤ k ≤ n/2, and then by symmetry,y ˆk = 0 for n/2 ≤ k ≤ n − 6. 2

Example 7 Consider the signal

2 y(t) = e−t /10(sin 2t + 2 cos 4t + 0.4 sin t sin 10t) on [0, 2π]. We can compress this signal by zeroingy ˆk that are smaller than some threshold. However, because the 2π-periodic extension of y(t) is not continuous, Gibbs’ phenomenon appears in the compressed signal. 2

The FFT Approximation to the Fourier Transform Let f be defined on [a, b] from samples taken at n equally spaced nodes a + jT , j = 0, 1, . . . , n − 1 where T = (b − a)/n. We assume f(t) = 0 outside [a, b], continuous on [a, b), and periodic (that is, f(b) = f(a)). Then 1 Z b fˆ(ω) = √ f(t)e−iωt dt. 2π a t−a Let θ = 2π b−a to map [a, b] to [0, 2π]. Then

b − a Z 2π fˆ(ω) = f(a + (b − a)θ/(2π))e−iω(a+(b−a)θ/(2π) dθ 3/2 (2π) 0 Z 2π b − a −iωa −i (b−a)ω θ = e f(a + (b − a)θ/(2π))e 2π dθ. 3/2 (2π) 0 Let 2π g(θ) = f(a + (b − a)θ/(2π)), ω = k. k b − a Then b − a  1 Z 2π  ˆ −iωka −ikθ f(ωk) = √ e g(θ)e dθ 2π 2π 0 b − a −iωka = √ e gˆk 2π We then define  2π   b − a y = g j = g(jh) = f a + j = f(a + jT ), j = 0, 1, . . . , n − 1. j n n

Thus the FFT and (continuous) Fourier transform are related by

b − a T ˆ −iωka −iωka f(ωk) ≈ √ e yˆk = √ e yˆk. n 2π 2π

4 Application: Parameter Identification Consider the ODE au00 + bu0 + cu = f(t), 2 where b −4ac < 0 and f(t) = f0δ(t). Using the Laplace transform, and assuming initial conditions u(0) = u0(0) = 0, we obtain  0 t < 0, u(t) = f 0 sin(ωt)e−µt t ≥ 0, ωa √ 4ac − b2 b where ω = and µ = . 2a 2a In the case where the coefficients a, b, c are unknown, but the solution u(t) is known, we can use the DFT to obtain approximate values for ω and µ from the frequency and amplitude of the solution, respectively. Then, values for a, b and c can be obtained from the formulas for ω and µ.

Application: Discretization of Ordinary Differential Equations Let h = 2π/n, and suppose that we approximate derivatives of u(t) using the finite differences

u(t) − u(t − h) u0(t) ≈ , h u(t + h) − 2u(t) + u(t − h) u00(t) ≈ . h2

Let tk = kh and uk = u(tk) for k = 0, 1, . . . , n. Since u is periodic, un = u0. The preceding difference formulas then become, for k = 1, 2, . . . , n − 1, u − u u0(t ) ≈ k k−1 , k h u − 2u + u u00(t ) ≈ k+1 k k−1 . k h2 Substituting these approximations into the ODE au00 + bu0 + cu = f(t) yields

2 auk+1 + βuk + γuk−1 = h fk, k = 1, 2, . . . , n − 1,

2 where fk = f(kh), β = ch + bh − 2a, and γ = a − bh. Let u ∈ Sn be the solution of this difference equation, and letu ˆ = Fn[u], fˆ = Fn[f], and w = eih. From Theorem 4, we obtain

2 j j −1 uˆj = h (aw + β + γw ) fˆj.

We can then obtain u via the inverse DFT.

Exercises

Chapter 3: Exercises 2, 10, 11, 12

5