Mathematics for Chemists 2 Lecture 14: Fourier analysis. Fourier series, Fourier transform, DFT/FFT

Similar documents
SEISMIC WAVE PROPAGATION. Lecture 2: Fourier Analysis

EA2.3 - Electronics 2 1

Computer Problems for Fourier Series and Transforms

3 rd class Mech. Eng. Dept. hamdiahmed.weebly.com Fourier Series

1D Wave PDE. Introduction to Partial Differential Equations part of EM, Scalar and Vector Fields module (PHY2064) Richard Sear.

Periodic functions: simple harmonic oscillator

Time-Frequency Analysis

Examples of the Fourier Theorem (Sect. 10.3). The Fourier Theorem: Continuous case.

Fourier series

Chapter 17. Fourier series

Here is a summary of our last chapter, where we express a periodic wave as a Fourier series.

MATH 308 COURSE SUMMARY

Chapter 17: Fourier Series

FOURIER ANALYSIS. (a) Fourier Series

01 Harmonic Oscillations

Fourier and Partial Differential Equations

C. Complex Numbers. 1. Complex arithmetic.

Analysis II: Fourier Series

Lecture 5. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

2 = = 0 Thus, the number which is largest in magnitude is equal to the number which is smallest in magnitude.

Next, we ll use all of the tools we ve covered in our study of trigonometry to solve some equations.

1 + lim. n n+1. f(x) = x + 1, x 1. and we check that f is increasing, instead. Using the quotient rule, we easily find that. 1 (x + 1) 1 x (x + 1) 2 =

FOURIER SERIES. Chapter Introduction

1.4 Techniques of Integration

Taylor Series and Numerical Approximations

Fourier Series and the Discrete Fourier Expansion

Topic 4 Notes Jeremy Orloff

Review of Analog Signal Analysis

Fourier Sin and Cos Series and Least Squares Convergence

Tangent Lines Sec. 2.1, 2.7, & 2.8 (continued)

MATH 20B MIDTERM #2 REVIEW

Today s lecture. The Fourier transform. Sampling, aliasing, interpolation The Fast Fourier Transform (FFT) algorithm

Chapter 4 Sequences and Series

PHYS 502 Lecture 3: Fourier Series

Physics 342 Lecture 17. Midterm I Recap. Lecture 17. Physics 342 Quantum Mechanics I

a n cos 2πnt L n=1 {1/2, cos2π/l, cos 4π/L, cos6π/l,...,sin 2π/L, sin 4π/L, sin 6π/L,...,} (2)

MITOCW MITRES18_005S10_DiffEqnsMotion_300k_512kb-mp4

Physics 250 Green s functions for ordinary differential equations

Math 115 ( ) Yum-Tong Siu 1. Derivation of the Poisson Kernel by Fourier Series and Convolution

Lecture 10: Powers of Matrices, Difference Equations

Introduction to Fourier Analysis Part 2. CS 510 Lecture #7 January 31, 2018

The definition, and some continuity laws. Types of discontinuities. The Squeeze Theorem. Two special limits. The IVT and EVT.

Fig. 1: Fourier series Examples

Strauss PDEs 2e: Section Exercise 4 Page 1 of 6

Part 1. The simple harmonic oscillator and the wave equation

LECTURE 10: REVIEW OF POWER SERIES. 1. Motivation

Math 2Z03 - Tutorial # 6. Oct. 26th, 27th, 28th, 2015

Math 016 Lessons Wimayra LUY

Sequences and Series

Linear Second-Order Differential Equations LINEAR SECOND-ORDER DIFFERENTIAL EQUATIONS

14 Fourier analysis. Read: Boas Ch. 7.

Quantum Field Theory III

CS711008Z Algorithm Design and Analysis

Overview of Fourier Series (Sect. 6.2). Origins of the Fourier Series.

Fast Fourier Transform

Key Intuition: invertibility

In this section we extend the idea of Fourier analysis to multivariate functions: that is, functions of more than one independent variable.

Tutorial on obtaining Taylor Series Approximations without differentiation

The Schroedinger equation

A glimpse of Fourier analysis

11.5. The Chain Rule. Introduction. Prerequisites. Learning Outcomes

Physics 342 Lecture 2. Linear Algebra I. Lecture 2. Physics 342 Quantum Mechanics I

Quantum Mechanics-I Prof. Dr. S. Lakshmi Bala Department of Physics Indian Institute of Technology, Madras. Lecture - 21 Square-Integrable Functions

Monday, 6 th October 2008

Q: How can quantum computers break ecryption?

Physics 342 Lecture 2. Linear Algebra I. Lecture 2. Physics 342 Quantum Mechanics I

d 1 µ 2 Θ = 0. (4.1) consider first the case of m = 0 where there is no azimuthal dependence on the angle φ.

DCSP-2: Fourier Transform

DIFFERENTIAL EQUATIONS COURSE NOTES, LECTURE 2: TYPES OF DIFFERENTIAL EQUATIONS, SOLVING SEPARABLE ODES.

Convergence of sequences and series

In Which We Conclude Calculus by Using Taylor Series to Prove Euler s Identity Calculus 12, Veritas Prep.

Our goal is to solve a general constant coecient linear second order. this way but that will not always happen). Once we have y 1, it will always

Math 20B Supplement. Bill Helton. September 23, 2004


Math 489AB A Very Brief Intro to Fourier Series Fall 2008

Continuum Limit and Fourier Series

8.5 Taylor Polynomials and Taylor Series

3 Algebraic Methods. we can differentiate both sides implicitly to obtain a differential equation involving x and y:

7: FOURIER SERIES STEVEN HEILMAN

FILTERING IN THE FREQUENCY DOMAIN

MATH 320, WEEK 11: Eigenvalues and Eigenvectors

The Fourier spectral method (Amath Bretherton)

df(x) = h(x) dx Chemistry 4531 Mathematical Preliminaries Spring 2009 I. A Primer on Differential Equations Order of differential equation

Lecture Wigner-Ville Distributions

10.12 INTRODUCTION TO FOURIER SERIES

Chapter 5.8: Bessel s equation

Communication Engineering Prof. Surendra Prasad Department of Electrical Engineering Indian Institute of Technology, Delhi

Mathematics 324 Riemann Zeta Function August 5, 2005

Weierstrass Products and More on Analytic Continuation

Review of Concepts from Fourier & Filtering Theory. Fourier theory for finite sequences. convolution/filtering of infinite sequences filter cascades

CHAPTER 4 FOURIER SERIES S A B A R I N A I S M A I L

Vectors in Function Spaces

8/19/16. Fourier Analysis. Fourier analysis: the dial tone phone. Fourier analysis: the dial tone phone

Geometric Series and the Ratio and Root Test

JUST THE MATHS UNIT NUMBER DIFFERENTIATION APPLICATIONS 5 (Maclaurin s and Taylor s series) A.J.Hobson

MITOCW watch?v=rf5sefhttwo

University of Connecticut Lecture Notes for ME5507 Fall 2014 Engineering Analysis I Part III: Fourier Analysis

CHAPTER 2. The Derivative

MATH141: Calculus II Exam #4 review solutions 7/20/2017 Page 1

Math 20B Supplement Linked to Stewart, Edition 5. December 2005 version

Transcription:

Mathematics for Chemists 2 Lecture 14: Fourier analysis Fourier series, Fourier transform, DFT/FFT Johannes Kepler University Summer semester 2012 Lecturer: David Sevilla Fourier analysis 1/25 Remembering periodicity f : R R is said to have period T > 0 if f (x + T ) = f (x), and T is the smallest positive number with this property (if T satisfies the condition, then nt does it as well for any n Z). Examples: sin(x) and cos(x) have period 2π tan(x) has period π sin(x + A) has period 2π sin(2πx) has period 1 If two functions have the same period T, their sum also has period T. If two functions have different periods, their sum is not usually periodic. But if their periods are T /m and T /n for some integers m, n and real T, then their sum has period T /k where k is another integer. Important: given a function f : [a, b] R it is clear how to make a function R R with period b a by repetition. Fourier analysis 2/25

Fourier series: the goal Consider a function f : R R which has period 2π. Can we write it as a sum of sines and cosines of x, 2x,...? If we allow infinite sums (series) then we can, under some assumptions on f. In particular, we will have f (x) = a 0 2 + [a n cos nx + b n sin nx] n=1 (note that sin nx and cos nx have period 2π/n, so in particular they also repeat every 2π). The terms with n = 1 are called the first or fundamental harmonic, the terms with n = 2 are called the second harmonic, and so on. It is a mathematical theorem that every integrable function (in particular continuous ones) can be written as a Fouries series. We will learn to calculate the coefficients, by using integrals. Fourier analysis 3/25 Two easy examples of Fourier series The Fourier series of f (x) = cos x obviously has coefficients a 0 = a 1 = a 2 = = 0, and b 1 = 1, b 2 = b 3 = = 0. Now consider f = cos(x + 1). We can calculate its Fourier series using trigonometric identities. Namely, the formula for the cosine of a sum gives cos(x + 1) = cos 1 cos x sin 1 sin x. This means that the Fourier series of f has coefficients a 1 = cos 1, b 1 = sin 1 and the rest are zero. The examples in the next slide cannot be computed by us yet. But pay attention to the series and try to guess a rule from those examples. Fourier analysis 4/25

Two more examples of Fourier series n=1 f (x) = x 2 ( 1) n sin nx n f (x) = { 1 if x > 0 1 if x < 0 sin x + 1 3 sin 3x + 1 5 sin 5x + (The pictures show approximations by adding the beginning of the infinite series; if you add the whole series you get the exact functions.) Fourier analysis 5/25 Functions and their Fourier series For the Fourier series of f to exist, we just need that f is integrable. Another condition that also works is that f, f and f are piecewise continuous on [, π]. The definition of piecewise continuous in an interval [a, b] is that there is a finite amount of points x 1, x 2,..., x n in the interval such that: the function is continuous on [a, b] except at the points x i at every x i, the limits to the left and right exist and are real numbers (not infinity) For example, the functions f (x) = x and f (x) = sign(x) have a Fourier series, but not a Taylor series at 0. On the other hand, if a function is not periodic then a Fourier series is valid only in [, π] (one can convert it to another interval easily if needed). But if f is periodic, the Fourier expansion is valid for all x. Fourier analysis 6/25

Integral relations between trigonometric functions The functions sin mx, cos nx satisfy some integral relations that we will use. They will be easiest to express by using the symbol δ mn, which is equal to 1 when m = n and equal to 0 when m n. We have then: sin mx cos nx = 0 for any m, n sin nx sin mx = πδ mn cos nx cos mx = πδ mn All of them can be calculated by applying a certain trigonometric identity that converts all the integrals into easy ones. Fourier analysis 7/25 Calculation of the coefficients As we said, we will use integrals to calculate the coefficients of the Fourier series one by one. The key will be to write f (x) = a 0 2 + [a n cos nx + b n sin nx], n=1 to multiply this expression by a certain function, and to integrate; all the summands will disappear except one, and that will give us the desired coefficient. In order to calculate a n for n 0, we multiply f (x) by cos nx and integrate, we get a n = 1 π Similarly, for b n, n 1: b n = 1 π f (x) cos nx dx. f (x) sin nx dx Fourier analysis 8/25

A physical interpretation of the Fourier series Sound is, basically, quick changes of pressure in the air. This can be seen as a pressure wave. If we represent the wave as a function, its Fourier series allows us to write the wave as a sum of waves with bigger and bigger frequencies. a sum of four simple waves For example, the internal mechanism of our ear is built to separate the different harmonics of the sounds that reach us. This is why we can tell apart different musical instruments even if they play the same note: they have different harmonics. Fourier analysis 9/25 Complex Fourier series It is not so nice that we have two series of coefficients. It is usual to unify sines and cosines by means of Euler s formula: e ix = cos x + i sin x Using this we can combine the terms a n cos nx and b n sin nx into two exponential terms: a n cos nx + b n sin nx = c n e inx + c n e inx (The relation between the left and right coefficients is very simple to compute so it is left as an exercise.) Then the Fourier series becomes f (x) = n= c n e inx Fourier analysis 10/25

Coefficients of the complex Fourier series The coefficients are calculated as c n = 1 2π f (x) e inx dx The coefficients of the real version can be understood as amplitudes at different frequencies, where sin and cos are just displaced with respect to each other. In the complex case, instead of considering a complex number as real and imaginary parts, think of them as amplitude and phase (these are new names for something you know: polar coordinates). Then, the component of frequency n corresponds to two waves that contribute to the original function, and whose amplitudes and phases are given by the complex numbers c ±n. The next slide has a simple example to clarify this. Fourier analysis 11/25 Example: complex Fourier series of a sine function Consider the function f (x) = sin x. In real terms, all coefficients would be 0 except one, which would be 1. In complex terms, however, sin x = 1 2i eix 1 2i e ix so the distribution is like this: 1.0 c n 0.5 0.0 3 2 1 0 1 2 3 π/2 arg c n 0 3 2 1 0 1 2 3 /2 Fourier analysis 12/25

Example of calculation of a complex Fourier series Let f (x) = x 2. Then the complex Fourier series has coefficients c 0 = 1 2π x 2 dx = 1 2π [ x 3 3 ] x=π x= = 1 2π 3 2π 3 = π2 3 2πc n = x 2 e [ e inx inx dx = = n 3 (in2 x 2 + 2nx 2i) = = ( 1)n 4π n 2 c n = 2( 1)n n 2, n 0 so the series is x 2 = π2 3 + n= 2( 1) n e inx n 2 ] x=π x= = Fourier analysis 13/25 An application of Fourier series to ODEs A simple application of Fourier series to ODEs is the calculation of periodic particular solutions. The great advantage of Fourier series for differential equations is that we can differentiate a Fourier series term by term (note that for finite sums this is a basic rule, but not for infinite sums!). The method is then: 1. Calculate the Fourier series of the non-homogeneous part. 2. Write a general Fourier series with unknown coefficients for the particular solution. 3. Calculate its derivatives as needed. 4. Equate coefficients and calculate the Fourier series for the particular solution. 5. If possible, write the series as a function. We see an example in the next slide. Fourier analysis 14/25

Example of Fourier series for ODEs Find a periodic particular solution for y + 2y + y = sin x. Using sin x = eix e ix we get that the Fourier series of sin x 2i has coefficients c 1 = 1/2i, c 1 = 1/2i and the rest are zero. Now, for the particular solution we write y = d n e inx And we get also y = n= n= d n ine inx, y = n= d n (in) 2 e inx. Putting this in the ODE and comparing coefficients we get [(in) 2 + 2(in) + 1] d n = c n. This gives d 1 = d 1 = 1/4 and the others are zero. Thus y = eix 4 e ix 4 = = 1 cos x. 2 Fourier analysis 15/25 Next step: Fourier transform The Fourier series is a discretization of a function: from a continuous object we go to a discrete (but infinite) series of numbers. This works well because we are talking about a function defined on an interval [, π] (or, what is the same, a periodic function defined on R). It is clear that we could do this in any interval [a, b], by adapting the formulas. When we have a non-periodic function defined on R, we have no Fourier series but we have a generalization called the Fourier transform, which is a function instead of a discrete sum. It also represents how the contributions of different frequencies add up to form the original function. Fourier analysis 16/25

Definition of Fourier transform of a function One important detail: before we were thinking of periods 2π and submultiples of it. Now we change to period 1 because it seems to be a more common formulation. In any case, if you find different definitions in the future, they are all equivalent and they all have advantages and disadvantages. Let f : R C. We ask that f is integrable, which in the complex setting means n= f (x) dx <. Then we define the Fourier transform of f as the function ˆf such that ˆf (y) = f (x) e 2πiyx dx This is also a function ˆf : R C. Fourier analysis 17/25 Comparison with the coefficients of the Fourier series Compare the Fourier transform ˆf (y) = with the complex Fourier series, c n = 1 2π f (x) e 2πiyx dx f (x) e inx dx. The 2π has moved, this has to do with the change of periodicity we have mentioned in the beginning. The limits of integration have increased from a periodicity interval to the whole real numbers. If we applied the Fourier transform to a function defined on an interval, we would get Fourier coefficients (we would need to move the interval to [, π] to get exactly the same). The transform gives values for any real number given as an argument; the series takes integer arguments. In this sense the transform includes the series and gives more information (a continuum of frequencies as opposed to discrete submultiples of a starting frequency). Fourier analysis 18/25

Examples of Fourier transforms δ is the Dirac delta function, which has very special properties Fourier analysis 19/25 The inverse Fourier transform There is also an inverse operation, the inverse Fourier transform, which takes a function representing a frequency distribution and produces a function representing the time/etc. distribution. The formula is very similar: f (x) = ˆf (y) e 2πixy dy (basically, the only difference is the sign on top of the exponential.) Fourier analysis 20/25

The discrete Fourier transform Apart from not being very easy to calculate or manipulate, the Fourier transform has another problem: in practice, we don t have the whole function f but only some values (from an experiment, for example). So there is a discrete version of the Fourier transform that is very often used. It is called the discrete Fourier transform (DFT). It applies to functions which are periodic, or equivalently to functions defined on a bounded interval. It is defined as follows: let x 0,..., x N 1 be a finite set of N samples (real or complex) of a function or signal taken at regular intervals. then the DFT of this data is the sequence X 0,..., X N 1 defined as X k = N 1 n=0 x n e i 2π N kn, k = 0,..., N 1. Note that this is a linear function when we fix N. Fourier analysis 21/25 Inverse discrete Fourier transform The inverse operation (IDFT) takes a sample of frequencies and produces a sample of values of the time function. The formula is: x n = 1 N N 1 k=0 X k e 2πi N kn n = 0,..., N 1. It is worth knowing that one can use the formula for the DFT to calculate the IDFT as well, by using some very simple tricks. We do not go into this here. This, together with the fast Fourier transform algorithms (next slide) make DFT into a very powerful algorithm. Fourier analysis 22/25

Fast Fourier transform In the formula for the DFT, we have to calculate N outputs and each involves a sum of N terms, so the number of operations is comparable to n 2 ( comparable has a technical meaning which we do not explore here). But there are ways of calculating the DFT using an amount of operations comparable to n log n, and any of those ways is called a fast Fourier transform (FFT). The most known algorithm for FFT applies when N is composite, and breaks down the calculation of the DFT into smaller DFT computations. This can be repeated, for example when N = 2 d we can break the DFT into two pieces of size 2 d 1, which can be divided further, etc. We see an example in the next slide. Fourier analysis 23/25 Example of fast Fourier transform Let s take N = 6. Let w = e 2πi 6, then the 6 values of the transform are x 0 + w r x 1 + w 2r x 2 + w 3r x 3 + w 4r x 4 + w 5r x 5, r = 0,..., 5 but this can be written as (x 0 + w 2r x 2 + w 4r x 4 ) + w r (x 1 + w 2r x 3 + w 4r x 5 ) Now, notice that the two parentheses are just DFTs with N = 3 (the value w 2r is the correct one for N = 3, as you can check), and when we have calculated them we put them together with something like a DFT with N = 2. You can see that if N could be factored further, we could make more reduction steps, which would make it even faster. Fourier analysis 24/25

Applications of DFT The main applications of DFT in practice are signal processing. That is, take a signal, decompose it into its frequencies with a DFT, and then study the result or manipulate it. In those situations, the choice of the sampling rate is very important, since a low rate may cause strange results (aliasing). An example of this is the JPG and MP3 formats. They work by taking an image or sound, applying a DFT to it, and then eliminating the part of the image or sound with frequencies outside the human range of detection. This produces a compact representation of the data (data compression). If we discard too much, the effect can be seen or heard. One can also use these methods for solving PDEs in an approximate way (spectral methods). Fourier analysis 25/25