Math A: Homework 6 solutions. (a) The coefficients of the Fourier sine series are given by b n = π f (x) sin nx dx = x(π x) sin nx dx π = (π x) cos nx dx nπ nπ [x(π x) cos nx]π = n ( )(sin nx) dx + π n π [(π x) sin nx]π = 4 n 3 π [cos nx]π + = 4( ( )n ) n 3, π which can be written as b n = { 8 πn 3 for n odd, for n even. Hence 8 sin[(k + )x] f s (x) = π(k + ) k= 3. For the Fourier cosine series, the zeroth term is a = x(π x)dx = [ x π π π x3 3 The remaining terms in the Fourier cosine series are a n = π = nπ = n π x(π x) cos nx dx ] π = π 3. (π x) sin nx dx + nπ [x(π x) sin nx]π ( ) cos nx dx + n π [(π x) cos nx]π = + n π [( )n π] = ( + ( )n ) n, which can be written as { for n odd, a n = for n even. 4 n
Hence f c (x) = π 6 4 cos kx (k). (b) Plots of the first four terms of the Fourier sine and cosine series are shown in Fig., and are compared with the exact form. For the sine series, the exact form can be written on < x < π as x(π x ), whereas for the cosine series, the exact form can be written as x (π x ). From the graphs, it is clear that the sine series converges more rapidly to the exact form. This should be expected, since the terms in the sine series decay like n 3, while the terms in the cosine series decay more slowly at a rate of n. The difference in decay rates is due to the fact the sine series extension is differentiable, whereas the cosine series extension is not. (c) First note that Hence and therefore Hence π 4 = f s(π/) = ( π ) f = π ( π π ) = π 4. 8 sin[(k + /)π] π(k + ) k= 3 = k= 8( ) k+ π(k + ) 3. π 3 3 = ( ) k+ (k + ) k= 3 = 3 3 3 + 5 3 7 3 +.... π 4 = f c(π/) = π 6 4 cos kπ (k) π = + 3 4 +.... = π 6 ( ) k k. (d) The average value of ( f (x)) over the interval x < π is π π f (x) dx = x (π x) dx π = [ x 3 π x4 π + x5 π 3 4 5 = [ π 5 ] π 3 = π4 3. ] π
By applying Parseval s theoreom to the Fourier sine series, this is equal to π 4 3 = b n = 64 π (k + ) 6 and hence π 6 96 = 6 + 3 6 + 5 6 + 7 6 +.... Similarly, applying Parseval s theorem to the Fourier cosine series gives and therefore π 4 3 = a 4 + a n = π4 36 + π 4 9 = 4 + 4 + 3 4 + 4 4 +.... 6 (k) 4. Suppose that f (x) is a real function with complex Fourier series f (x) = If f is real, then f (x) = f (x), and hence f (x) = f (x) = c n e inx. n= c n e inx = c k e ikx n= k= where the final equality is obtained by reordering the sum according to k = n. Since the functions e inx form an orthogonal basis, it follows that c n = c n. 3. Suppose that the function f has normal and complex Fourier series expansions f (x) = a + a n cos nx + b n sin nx = c n e inx. Using the identity e ix = cos x + i sin x, the complex Fourier series can be expanded as f (x) = c + = c + = c + c n e inx + c n e inx c n (cos nx + i sin nx) + (c n + c n ) cos nx + 3 c n (cos nx i sin nx) (c n c n )i sin nx
and since the cosines and sines form an orthogonal basis, it follows that a = c, a n = c n + c n, b n = i(c n c n ) where n is any positive integer. Rearrangement gives c = a, c n = a n ib n, c n = a n + ib n. Note that if the function f (x) is real, then by making use of the identities of the previous section, 4. If f (x) = c n e inx then a n = c n + c n = Re(c n ), b n = i(c n c n ) = Im(c n ). f (x) = inc n e inx and thus the complex Fourier series coefficients of f are d n = inc n. Similarly f (x l) = c n e in(x l) = c n e inl e inx and thus the complex Fourier series coefficients of f (x l) are q n = c n e inl. 5. Suppose that f and g are periodic functions on the interval x < π, with complex Fourier series f (x) = c n e inx, g(x) = d n e inx. n= n= If f g is the convolution of f and g, defined as ( f g)(x) = f (y)g(x y)dy then the complex Fourier series coefficients of f g can be written as e n = ( f g)(x)e inx dx π = [ ] f (y)g(x y)dy e inx dx π = dx dy f (y)g(x y)e inx π = dx dy f (y)g(x y)e in((x y)+y). π 4
To make progress at this point, the substitution z = x y can be used. This changes the limits of one of the integrals to y < z < π + y. However, since the functions being integrated are π-periodic, this integration interval is equivalent to < z < π, and hence e n = π = [ π = πc n d n. dy dz f (y)g(z)e in(z+y) ] [ ] f (y)e iny dy g(z)e inz dz Thus the coefficients of the Fourier series of the convolution are the products of the terms in the Fourier series of f and g. 6. (a) Since f (x) is an even function it can be expressed as a cosine series. The zeroth term is a = f (x)dx = π π π = and the higher terms are Hence and thus a n = π a n = / f (x) cos nx dx = cos nx dx π = [ ] sin nx π/ π n = sin nπ nπ. { f (x) = π ( ) (n )/ nπ for n odd, for n even. k= (b) The filtered function has Fourier series f λ (x) = π k= ( ) k cos[(k + )x]. k + ( ) k λ k+ cos[(k + )x]. k + Plots of f λ for the cases of λ =.7,.8,.9 are shown in Fig. (a). As λ decreases and the filtering becomes stronger, the discontinuity in f at ±π/ becomes increasingly smoothed out over a larger range. 5
(c) Suppose that f (x) has a complex Fourier series f (x) = c n e inx n= Then filtered function will have complex Fourier coefficients λ n c n. By making use of the result from question 5, it follows that if f λ = K λ f, then K λ has complex Fourier coefficients λ n /(π). Hence the function can be computed according to πk λ (x) = n= = + = + = λ n e inx λ n e inx + λ n e inx + n= λ n e inx λ n e inx n= λe ix + λe ix = λe ix + λe ix ( λe ix )( λe ix ) λ cos x = ( + λ ) λ cos x = λ cos x λ + λ cos x ( + λ ) λ cos x λ = ( + λ ) λ cos x. The functions K λ are plotted in Fig. (b). The width of the functions roughly correspond to the widths of the jumps at ±π/ in the filtered functions in Fig. (a), as would be expected from the definition of the convolution. 6
(a) fs - - / π/ π x Exact Four non-zero terms.5 (b).5 fc.5 / π/ π x Exact Four non-zero terms Figure : Plots of the first four terms of (a) the Fourier sine series and (b) the Fourier cosine series, compared to the exact forms. 7
(a).8.6 y.4. y = f (x) y = f.9 (x) y = f.8 (x) y = f.7 (x) / π/ π x 3.5 (b) y = K.9 (x) y = K.8 (x) y = K.7 (x) y.5.5 / π/ π x Figure : (a) Plots of a square wave f compared to several filtered versions f λ. (b) Plots of the corresponding filtering kernel K λ. 8