Fourier Analysis, Lecture notes of Law

The Fourier series approximates a function f(t) by using a trigonometric polynomial of degree N as follows ... MATLAB Fourier Series Example.

Typology: Lecture notes

2021/2022

Uploaded on 09/27/2022

mayer
mayer 🇬🇧

4.8

(5)

227 documents

1 / 47

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
372
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f

Partial preview of the text

Download Fourier Analysis and more Lecture notes Law in PDF only on Docsity!

372

Version:

TEX’d: Sep. 28, 2013

8 FOURIER ANALYSIS

PREVIEW The next two chapters are devoted primarily to the study of Fourier techniques. Collectively, these techniques form a branch of applied mathematics called Fourier analysis. The field of study is named for Jean Baptiste Fourier (1768–1830), who showed that any periodic function can be represented as the sum of sinusoids with integrally related frequencies. This observation leads to the study of Fourier series, which will be presented first in this chapter. The purpose of the Fourier series is to express a given function as a linear combination of sine and cosine basis functions. In many cases, the series is simpler to analyze than the original function. Most importantly for some applications, the components of the series allow physical interpretation of the function in terms of its frequency spectrum. The Fourier transform provides an extension of Fourier series to the analysis of nonperiodic functions. As with the series, the point of the transform is to represent a function in a manner that is easier to analyze and understand. Properties and applications of this important transform will be considered in the chapter. The present chapter concentrates on techniques and transforms that apply to a continuous function f(t). These include Fourier series and Fourier transforms. In Chapter 11, the discrete Fourier transform for

373

for all t and all integers k. Notice that the constant term a 0 /2 in the series of Equation 8.1 is the average value of f(t) on the interval −π ≤ t ≤ π since a 0 calculated by Equation 8.2 is twice the average value of f(t) over the interval. The integrals in Equation 8.3 are twice the average value of f(t) cos(nt) and f(t) sin(nt), respectively. When the series is written using a 0 /2 as the constant term, Equation 8.3 can be used for all the coefficients an by letting n vary from 0 to N.

EXAMPLE 8.1 Fourier Series Example Consider the periodic function

f (t) =

0 , −π < t < 0 , t, 0 < t < π, with period 2π, as shown in Figure 8.1.

  • π π

π

f ( t )

t

... ...

FIGURE 8.1 Periodic function f (t) for Example 8.

Using Equation 8.2, the Fourier coefficient a 0 is

a 0 =^1 π

∫ (^) π

−π

f (t) dt =^1 π

∫ (^) π

0

t dt = π 2 ,

which yields a constant term of a 0 /2 = π/4. The coefficients of the cosine terms are computed from Equation 8.3 as

an = 1 π

∫ (^) π

−π

f (t) cos(nt) dt

= 1 π

−π

0 cos(nt) dt + 1 π

∫ (^) π

0

t cos(nt) dt.

Integrating by parts yields

an = 1 π

[ (^) t n sin(nt) + 1 n^2 cos(nt)

]π 0

= 1 πn^2 [cos(nπ) − 1] (8.5)

for n = 1, 2 ,.. .. Similarly, the sine terms are computed as

bn = 1 π

∫ (^) π

−π

f (t) sin(nt) dt

= 1 π

−π

0 sin(nt) dt + 1 π

∫ (^) π

0

t sin(nt) dt,

8.1 Fourier Series 375

which yields

bn = 1 π

[

− t n cos(nt) + 1 n^2 sin(nt)

]π 0

= − 1 n [cos(nπ)] (8.6)

for n = 1, 2 ,.. .. The series approximation can be rewritten using the identity relationship cos(nπ) = (−1)n^ and noticing that an = 0 when n is an even integer. The result is f (t) = π 4 − 2 π

∑^ ∞

n=

cos(2n − 1)t (2n − 1)^2 −

∑^ ∞

n=

(−1)n^ sin(nt) n

where the (2n − 1) is introduced in the first sum to assure that only odd terms are included in that summation. Writing out a few terms yields the series for f (t) as

f (t) = π 4 − 2 π cos(t) − 2 9 π cos(3t) − · · ·

  • sin(t) − 1 2 sin(2t) + 1 3 sin(3t) + · · · , (8.8)

where the equality holds at points at which f (t) is continuous. At points of discontinuity t = nπ, the series converges to π/2, as explained later.

EXAMPLE 8.2 MATLAB Fourier Series Example The accompanying MATLAB script and plots show the Fourier approxi- mation to the function of Example 8.1 for 5 and 20 terms of the series.

MATLAB Script Example 8. % EX8_2.M Plot the Fourier series of the function f(t) % f(t)=0 -pi < t < 0 % f(t)=t 0 < t < pi % Plot f(t) for 5 and 20 terms in the series clear t =[-pi:.031:pi]; % Time points for plotting sizet=size(t); fn = pi/4(ones(sizet)); % Fourier approximation at each t yplt=zeros(sizet); % for plot of f(t) % 5 terms for n=1: fn=fn+ (1/pi)(-2cos((2n-1)t)/(2n-1)^2)-((-1)^nsin(nt)/n); end % for k=1:length(t) % Create f(t) if t(k) < 0 yplt(k)=0; else yplt(k)=t(k); end end

376 Chapter 8 FOURIER ANALYSIS

Recall that in Chapter 2, the inner product of the trigonometric func- tions on the interval [−π, π] was defined as

〈f, g〉 =

π

∫ (^) π

−π

f(t)g(t) dt, (8.9)

where the factor 1/π was introduced to normalize the inner product for the Fourier trigonometric functions. Then, the trigonometric terms in the Fourier series consist of functions that form an orthonormal set, since for integers k and m

〈cos(kt), cos(mt)〉 =

1 , k = m 6 = 0, 0 , k 6 = m,

〈sin(kt), sin(mt)〉 =

1 , k = m 6 = 0, 0 , k 6 = m,

〈cos(kt), sin(mt)〉 = 0, for all k, m. (8.10) Thus, the Fourier coefficients in the expansion of a function f(t) from Equation 8.3 can be written as

ak = 〈 f(t), cos(kt)〉, k = 0, 1 ,.. ., bk = 〈 f(t), sin(kt)〉, k = 1, 2 ,.... (8.11)

Notice that the constant term a 0 is computed as

a 0 = 〈f(t), 1 〉 =

π

∫ (^) π

−π

f(t) dt, (8.12)

which is the inner product of f(t) and the cos(kt) term in Equation 8. for k = 0.

EVEN AND ODD

FUNCTIONS

The Fourier approximation of even and odd functions can be computed with significantly less effort than that needed for functions without such symmetry. The properties that define an even or odd function are as follows:

  1. An even function has a graph that is symmetric with respect to the vertical axis (t = 0) and satisfies the equation

f(−t) = f(t). (8.13)

  1. An odd function is symmetric with respect to the origin and satis- fies the equation f(−t) = −f(t). (8.14)

378 Chapter 8 FOURIER ANALYSIS

For the even function fe(t), a range of integration that is symmetrical about the vertical axis, where t = 0, yields the result ∫ (^) π

−π

fe(t) dt = 2

∫ (^) π

0

fe(t) dt.

The integral over a symmetrical range about the vertical axis for an odd function fo(t) is zero; that is, ∫ (^) π

−π

fo(t) dt = 0.

Based on these results, if f(t) is an even function,

f(t) = a 0 2

∑^ ∞

n=

[an cos(nt)], (8.15)

where

a 0 =

π

∫ (^) π

0

f(t) dt, (8.16)

an =

π

∫ (^) π

0

f(t) cos(nt) dt. (8.17)

If f(t) is an odd function,

f(t) =

∑^ ∞

n=

[bn sin(nt)], (8.18)

where bn =

π

∫ (^) π

0

f(t) sin(nt) dt. (8.19)

EXAMPLE 8.3 Fourier Series Odd Function Example Consider the Fourier series for the odd periodic function

f (t) = t, −π < t < π,

shown in Figure 8.3. Each term ai = 0, since there is no constant term or terms in cos(nt).

π

π

f ( t )

  • π t

FIGURE 8.3 Odd periodic function for Example 8.

8.1 Fourier Series 379

is the frequency in radians per second. Since 2nπ/T = 2nπf 0 = nω 0 , the series in Equation 8.21 can be writ- ten

f(t) =

a 0 2

∑^ ∞

n=

[an cos(2πnf 0 t) + bn sin(2πnf 0 t)]

a 0 2

∑^ ∞

n=

[an cos(nω 0 t) + bn sin(nω 0 t)], (8.22)

which emphasizes the components in terms of their frequencies. The first term in cosine or sine is called the fundamental component, and the other terms are the harmonics with frequencies that are integer multiples of the fundamental component’s frequency. Thus, the frequen- cies of the Fourier series terms are

f 0 , 2 f 0 , 3 f 0 ,... ,

although some of the components may be zero for a particular Fourier series. However, f(t) is a continuous function of time, and this aspect of the Fourier series is emphasized when the series is used to approximate f(t). In other applications, the frequencies of the components are of primary interest. Sometimes a function of a spatial variable x is of interest. If the function has period λ meters, the function repeats as

f(x + λ) = f(x).

Then, the variable t in Equation 8.22 is replaced by x, and the frequency components are defined by replacing f 0 with 1/λ. The spatial equivalent of ω 0 is

k =

2 π λ

measured in inverse units of length. Such a formulation of Fourier series is used frequently in problems involving optics. In optical applications, the values nk are called spatial frequencies. Thus, λ represents the wavelength of the light wave being analyzed.

EXAMPLE 8.4 Fourier series square wave example A square wave of amplitude A and period T shown in Figure 8.4 can be defined as

f (t) =

A, 0 < t < T 2 , −A, − T 2 < t < 0 ,

with f (t) = f (t + T ), since the function is periodic.

8.1 Fourier Series 381

f ( t )

t

A

–A

–T

–– T

FIGURE 8.4 Square wave of Example 8.

The first observation is that f (t) is odd, which yields the result that a 0 = 0 and ai = 0 for every coefficient of the cosine terms. Letting ω 0 = 2π/T , the coefficients bn are bn = 2

2 T

) ∫^ T / 2

0

A sin(nω 0 t) dt.

The result is f (t) = 4 A π

∑^ ∞

n=

sin[(2n − 1)ω 0 t] (2n − 1) ,

where (2n − 1) is introduced to assure that only odd terms are included in the summation. The sine waves that make up the Fourier series for the odd square wave are f (t) = 4 A π

[

sin(ω 0 t) + sin(3ω 0 t) 3

  • · · ·

]

,

so the series consists not only of sine terms, as expected, but also odd harmonics appear. This is due to the rotational symmetry of the function since the wave shapes on alternate half-cycles are identical in shape but reversed in sign. Such waveforms are produced in certain types of rotating electrical machinery.

SYMMETRIES Symmetry in a function f(t) should be exploited to reduce the computa- tional effort of finding the Fourier coefficients. Generally, the symmetry exists either about a vertical line or a horizontal line. Several types of symmetry are presented in Table 8.1. Even and odd symmetry were dis- cussed previously. Rotational symmetry exists about the zero axis, and the waveshape of alternate half-cycles is identical but reversed in sign. This symmetry is also called half-wave symmetry since the integrals for the Fourier coefficients need be taken over only half a period. There is no constant term when rotational symmetry exists. If the function is also odd, only odd-harmonic sine terms will appear in the Fourier series, as was the case for the odd square wave of Example 8.4. An even function with rotational symmetry will have a Fourier series consisting of odd-harmonic cosine terms.

382 Chapter 8 FOURIER ANALYSIS

Orthogonality To find the coefficients in Equation 8.23, each side is multiplied by e−imω^0 t^ and integrated over the period to yield ∫ (^) T / 2

−T / 2

f(t)e−imω^0 t^ dt =

∑^ ∞

n=−∞

αn

∫ T / 2

−T / 2

ei(n−m)ω^0 t^ dt. (8.27)

Since the terms with different exponents are orthogonal, all terms but that for which m = n are zero for the integral on the right-hand side. Thus, ∫ (^) T / 2

−T / 2

f(t)e−imω^0 t^ dt =

∫ T / 2

−T / 2

e−inω^0 teinω^0 t^ dt = αnT,

so that dividing both sides T yields the coefficients

αn =

T

∫ T / 2

−T / 2

f(t)e−inω^0 t^ dt. (8.28)

EXAMPLE 8.5 Complex Series Square Wave Example Consider the odd square wave of Example 8.4 and the complex Fourier coefficients

αn = 1 T

−T / 2

(−A)e−inω^0 t^ dt + 1 T

∫ T / 2

0

(A)e−inω^0 t^ dt, (8.29)

which leads to the series

f (t) = 2 A iπ

∑^ ∞

n=−∞

ei(2n−1)ω^0 t (2n − 1)

as defined in Equation 8.23. This form contains complex coefficients, but the series can be written in terms of sine waves by combining the corresponding terms for positive and negative arguments. To determine the coefficients, the amount of difficulty is about the same for the trigonometric series and the complex series. However, the complex series perhaps has an advantage when the magnitude of the coefficients are of interest. Each coefficient has the form

αn = 2 A inπ = 2 A nπ e−iπ/^2 , n = ± 1 , ± 3 ,... ,

and the coefficients for even values, n = 0, ± 2 ,.. ., are zero. Notice that the coefficients decrease as the index n increases. The use of these coefficients to compute the frequency spectrum of f (t) is considered later. The trigonometric series is derived from the complex series by expanding the complex series of Equation 8.30 as

f (t) =

∑^ ∞

n=−∞

αneinω^0 t

= · · · − 2 A 3 πi e−i^3 ω^0 t^ − 2 A πi e−iω^0 t^ + 2 A πi eiω^0 t^ + 2 A 3 πi ei^3 ω^0 t^ + · · ·

384 Chapter 8 FOURIER ANALYSIS

and recognizing the sum of negative and positive terms for each n as 2 sin(nω 0 t). The trigonometric series becomes

f (t) = 4 A π

sin(ω 0 t) + sin(3ω 0 t) 3

  • · · ·

= 4 A π

∑^ ∞

n=

sin[(2n − 1)ω 0 t] (2n − 1) ,

which is the result of Example 8.4.

FOURIER

SPECTRUM FOR

PERIODIC

FUNCTIONS

In general, the Fourier series of a periodic function with period T seconds contains the fundamental sinusoid and numerous harmonics some of which may be zero. The plot of the magnitude of the frequency components is called the amplitude, or frequency spectrum. The frequency components are spaced f 0 = 1/T hertz apart. On a graph, the spectrum is a series of points (or lines) and is called a discrete spectrum. A discrete Fourier spectrum is characteristic of all periodic functions. Spectrum of Trigonometric Series An alternative method of ex- pressing the trigonometric Fourier series of Equation 8.22 is to write the series with terms of the form

cn cos(2πnf 0 t + θn), (8.31)

which we will call a shifted cosine series due to the phase shift θn in each term. To derive the relationship between the coefficients cn and the coefficients of the complete cosine and sine series, we set the nth term in the cosine expansion equal to the nth component of the original series as follows: cn cos(nt + θn) = an cos(nt) + bn sin(nt), (8.32) where an, bn, and θn are known. Using the identity

cn cos(nt + θn) = cn cos(nt) cos(θn) − cn sin(nt) sin(θn), (8.33)

and expanding the left-hand side of Equation 8.32 leads to the relation- ships,

cn cos(θn) = an, cn sin(θn) = −bn,

to be solved for cn and θn. Squaring these equations and adding them together yields the solution for cn, and taking the ratio determines θn. The result is

cn =

a^2 n + b^2 n and θn = tan−^1

bn an

Notice that the sign of the argument of the tangent is negative.

8.1 Fourier Series 385

spectrum (n = 1, 2 ,.. .) for the complex series consists of the terms 2 |αn|. The phase is given by the terms θn just as for the trigonometric series. If both positive and negative frequency components are shown, the terms |αn| are plotted. The zero frequency term is the same for any represen- tation.

Real Functions If f(t) is a real and even function of t, the coefficients αn are real and even functions of n. If f(t) is a real and odd function of t, then the coefficients αn are imaginary and odd functions of n. In either case, plotting |αn| results in a real and even discrete frequency spectrum for the amplitudes.

Power in the signal It is an important result of alternating current theory that the power associated with a periodic wave of voltage or current f(t) is proportional to the mean-square value of f(t). The mean-square formula is

f^2 (t) =

T

∫ T / 2

−T / 2

[f(t)]^2 dt, (8.35)

which is seen to be the average of the square of f(t). For a pure sinusoid, the average value of its square is one-half the peak value. Thus, for the nth harmonic cn cos(nω 0 t), the result is cn^2 /2. Applying the mean-square formula to any of the Fourier series rep- resentations leads to the power spectrum for the function. The power is computed by squaring the appropriate series and dividing the integral over the period by the period itself to compute the mean-square value of each component. All the cross terms average to zero since the trigonometric functions are orthogonal. The average power in the time signal must equal the power computed by the Fourier series. A rigorous statement of this fact is called Parseval’s theorem. This important result was presented in Chapter 7.

Comment: If the function f(t) represents a voltage signal (volts) or a current (amperes), the power is not strictly given by Equation 8.35 when the signal is applied to a circuit. For example, the average power dissi- pated in a resistor of R ohms would be P (t) = f(t)^2 /R watts when f(t) represents the voltage across the resistor. Generally, when no confusion would result, the power in a periodic signal is considered to be given by Equation 8.35.

8.1 Fourier Series 387

FOURIER SERIES

SUMMARY

For a periodic signal f(t) with period T , the various forms of the Fourier series and the power associated with the signal are shown in Table 8.2.

TABLE 8.2 Fourier Series Representation

Series Power Sine and cosine series: a 0 2

∑^ ∞

n=

[an cos(2nπf 0 t) + bn sin(2nπf 0 t)]

( (^) a 0 2

1 2

∑^ ∞

n=

(a^2 n + b^2 n )

where an = 2 T

∫ T / 2

−T / 2

f (t) cos(2nπf 0 t) dt

bn =^2 T

∫ T / 2

−T / 2

f (t) sin(2nπf 0 t) dt

Shifted cosine: a 0 2

∑^ ∞

n=

cn cos(2πnf 0 t + θn )

( (^) a 0 2

1 2

∑^ ∞

n=

c^2 n

where cn =

a^2 n + b^2 n, θn = tan−^1

− bn an

Complex series: ∑^ ∞

n=−∞

αnei^2 πnf^0 t

∑^ ∞

n=−∞

|αn|^2

where

αn = 1 T

∫ T / 2

−T / 2

f (t)e−i^2 nπf^0 t^ dt

Comparing the power relations in the table, the coefficients of the shifted cosine series are related to those for the sine and cosine series as

c^2 n = a^2 n + b^2 n,

with c 0 = a 0 /2. The complex series coefficients are related to the coeffi- cients of the trigonometric series as

α^2 n =

(a^2 n + b^2 n)

with α 0 = a 0 /2.

388 Chapter 8 FOURIER ANALYSIS

MATLAB Script Example 8. % CLSPEC1.M Plot positive frequency spectrum of square wave % The components are 2/(n pi); n odd. % Plot 10 components of the discrete spectrum [f F] % by calling function clptdscf % clear xunit=’Hertz’; % Units of frequency f=[0:1:10]; % Frequency scale Fn=zeros(1,11); % Row vector of 11 elements % Frequency spectrum for n=1:5 % Compute 5 positive components Fn(2n-1)=2/((2n-1)*pi); end Fn=[0 Fn]; % Add the zero value % clptdscf(f,Fn,xunit) % Call for plot

The function clptdscf plots a discrete function (f,F) in f units specified by the input xunit and the units will be displayed. The title of the graph must be input from the keyboard when the function executes.

MATLAB Script Example 8. function clptdscf(f,F,xunit) % CALL: clptdscf(f,F,xunit) Plot a discrete spectrum [f F] % Input to function is % f - frequencies % F - spectral values % xunit - units of frequency (Hz or rad/sec) % Input title of graph from keyboard nl=length(f); % Number of f points fmin=min(f); % and range fmax=max(f); Fmax=max(F); % Plotting range, lengthen axes by 10% Fmaxp=Fmax+.1Fmax; fminp=fmin-.1fmax; fmaxp=fmax+.1*fmax; % title1=input(’Title ’, ’s’ ); clf % Clear any figures axis([fminp fmaxp 0 Fmaxp]) % Manual scaling for I=1:nl, fplots=[f(I) f(I)]; Fplot=[0 F(I)]; plot(fplots,Fplot) % Plot one line at a time hold on end

390 Chapter 8 FOURIER ANALYSIS

title(title1) ylabel(’Amplitude’) xlabel([’Frequency in ’, xunit])

EXAMPLE 8.7 Fourier spectrum Consider the even, periodic pulse train in Figure 8.6. This is an important test signal in electronics and the signal is also of interest because of the char- acteristics of its Fourier components. The period is T , the amplitude is A, and the pulse has duration τ in each period. The function is an even function with average value over a period of Aτ /T. f ( t )

t

...

A

–– 2

- τ –– 2 τ –– 2 –– 2 3 T –– 2 –3 T –– 2

...

  • T T

FIGURE 8.6 Periodic train of rectangular pulses

Letting ω 0 = 2π/T , the coefficients of the complex series are

αn =^1 T

∫ T / 2

−T / 2

Ae−inω^0 t^ dt =^1 T

∫ (^) τ/ 2

−τ/ 2

Ae−inω^0 t^ dt.

Integrating and substituting −2 sin(nω 0 τ /2) for the resulting exponentials and then multiplying and dividing by the term ω 0 τ /2 yields

αn = Aτ T

sin(nω 0 τ /2) nω 0 τ / 2 .

The coefficient α 0 is determined as Aτ /T by l’Hˆopital’s rule. Notice that the coefficient α 0 = Aτ T = area of pulse period .

Defining the function sinc x ≡ sin x x

with x = nω 0 τ /2 leads to the series

f (t) = Aτ T

  • 2 Aτ T

∑^ ∞

n=

sinc(nω 0 τ /2) cos(nω 0 t)

since the coefficients of the cosine series are twice the values of those in the complex series.

Comment: The sinc function is frequently defined as

sinc t = sin πt πt .

8.1 Fourier Series 391