FourierTransformationforPedestrians T. Butz Fourier Transformation for Pedestrians With117Figures 123 ProfessorDr.TilmanButz Universita¨tLeipzig Fakulta¨tfu¨rPhysikundGeowissenschaften Linne´str.5 04103Leipzig,Germany e-mail:[email protected] LibraryofCongressControlNumber:2005933348 ISBN-103-540-23165-XSpringerBerlinHeidelbergNewYork ISBN-13978-3-540-23165-3SpringerBerlinHeidelbergNewYork Thisworkissubjecttocopyright.Allrightsarereserved,whetherthewholeorpartofthematerial isconcerned,specificallytherightsoftranslation,reprinting,reuseofillustrations,recitation,broad- casting,reproductiononmicrofilmorinanyotherway,andstorageindatabanks.Duplicationof thispublicationorpartsthereofispermittedonlyundertheprovisionsoftheGermanCopyrightLaw ofSeptember9,1965,initscurrentversion,andpermissionforusemustalwaysbeobtainedfrom Springer.ViolationsareliabletoprosecutionundertheGermanCopyrightLaw. SpringerisapartofSpringerScience+BusinessMedia. springeronline.com ©Springer-VerlagBerlinHeidelberg2006 PrintedinGermany Theuseofgeneraldescriptivenames,registerednames,trademarks,etc.inthispublicationdoesnot imply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevantpro- tectivelawsandregulationsandthereforefreeforgeneraluse. Typesetting:DatapreparedbytheAuthorandbySPIPublisher ServicesusingaSpringerTEXmacropackage Coverdesign:design&productionGmbH,Heidelberg Printedonacid-freepaper SPIN11318088 57/3141/SPIPublisher Services 5 4 3 2 1 0 To Renate, Raphaela, and Florentin Preface Fourier1 Transformation for Pedestrians. For pedestrians? Harry J. Lipkin’s famous “Beta-decay for Pedestrians” [1], was an inspiration to me, so that’s why. Harry’s book explains physical problems as complicated as helicity and parity violation to “pedestrians” in an easy to understand way. Dis- crete Fourier transformation, by contrast, only requires elementary algebra, something any student should be familiar with. As the algorithm2 is a lin- ear one, this should present no pitfalls and should be as “easy as pie”. In spite of that, stubborn prejudices prevail, as far as Fourier transformations are concerned, viz. that information could get lost or that you could end up trusting a hoax; anyway, who’d trust something that is all done with “smoke andmirrors”.Theaboveprejudicesoftenarecausedbynegativeexperiences, gainedthroughimproperuseofready-madeFouriertransformationprograms or hardware. This book is for all who, being laypersons – or pedestrians – are looking for a gentle and also humorous introduction to the application of Fourier transformation, without hitting too much theory, proofs of exis- tence and similar things. It is appropriate for science students at technical colleges and universities and also for “mere” computer–freaks. It’s also quite adequate for students of engineering and all practical people working with Fourier transformations. Basic knowledge of integration, however, is recom- mended.Ifthisbookcanhelptoavoidprejudicesorevendoawaywiththem, writing it has been well worthwhile. Here, we show how things “work”. Gen- erallywediscusstheFouriertransformationinonedimensiononly.Chapter1 introduces Fourier series and, as part and parcel, important statements and theorems that will guide us through the whole book. As is appropriate for pedestrians, we’ll also cover all the “pits and pitfalls” on the way. Chapter 2 covers continuous Fourier transformations in great detail. Window functions willbedealtwithinChap.3inmoredetail,asunderstandingthemisessential toavoidthedisappointmentcausedbyfalseexpectations.Chapter4isabout discreteFouriertransformations,withspecialregardtotheCooley–Tukeyal- gorithm(FastFourierTransform,FFT).Finally,Chap.5willintroducesome 1 JeanBaptisteJosephFourier(1768–1830),Frenchmathematicianandphysicist. 2 Integration and differentiation are linear operators. This is quite obvious in the discrete version (Chap. 4) and is, of course, also valid when passing on to the continuous form. VIII Preface useful examples for the filtering effects of simple algorithms. From the host of available material we’ll only pick items that are relevant to the recording and preprocessing of data, items that are often used without even thinking about them. This book started as a manuscript for lectures at the Technical University of Munich and at the University of Leipzig. That’s why it’s very muchatextbookandcontainsmanyworkedexamples–toberedone“manu- ally” –aswellasplentyofillustrations. Toshowthatatextbook(originally) written in German can also be amusing and humorous, was my genuine con- cern,becausededicationandassiduityontheirownarequiteinclinedtostifle creativity and imagination. It should also be fun and boost our innate urge to play. The two books “Applications of Discrete and Continuous Fourier Analysis” [2] and “Theory of Discrete and Continuous Fourier Analysis” [3] had considerable influence on the makeup and content of this book, and are to be recommended as additional reading for those “keen on theory”. This English edition is based on the third, enlarged edition in German [4]. In contrast to this German edition, there are now problems at the end of each chapter. They should be worked out before going to the next chap- ter. However, I prefer the word “playground” because you are allowed to go straight to the solutions, compiled in the Appendix, should your impatience get the better of you. In case you have read the German original, there I apologised for using many new-German words, such as “sampeln” or “wrap- pen”; I won’t do that here, on the contrary, they come in very handy and make the translator’s job (even) easier. Many thanks to Mrs U. Seibt and Mrs K. Schandert, as well as to Dr. T. Reinert, Dr. T. Soldner, and espe- cially to Mr H. Go¨del (Dipl.-Phys.) for the hard work involved in turning a manuscript into a book. Mr St. Jankuhn (Dipl.-Phys.) did an excellent job in proof-reading and computer acrobatics. Last but not least, special thanks go to the translator who managed to convert the informal German style into an informal (“downunder”) English style. Recommendations, queries and proposals for change are welcome. Have fun while reading, playing and learning. Leipzig, September 2005 Tilman Butz Preface of the Translator More than a few moons ago I read two books about Richard Feynman’s life, and that has made a lasting impression. When Tilman Butz asked me if I could translate his “Fourier Transformation for Pedestrians”, I leapt at the chance–mywayofgettingabitmoreintoscience.Duringtherathermechan- ical process of translating the German original, within its TEX-framework, I made sure I enjoyed the bits for the pedestrians, mere mortals like myself. Of course I’m biased, I’ve known the author for many years – after all he’s my brother. Hamilton, New Zealand, September 2005 Thomas-Severin Butz Contents Introduction.................................................. 1 1 Fourier Series............................................. 3 1.1 Fourier Series .......................................... 3 1.1.1 Even and Odd Functions .......................... 3 1.1.2 Definition of the Fourier Series ..................... 4 1.1.3 Calculation of the Fourier Coefficients............... 6 1.1.4 Fourier Series in Complex Notation................. 11 1.2 Theorems and Rules .................................... 13 1.2.1 Linearity Theorem................................ 13 1.2.2 The First Shifting Rule ........................... 14 1.2.3 The Second Shifting Rule ......................... 17 1.2.4 Scaling Theorem ................................. 21 1.3 Partial Sums, Bessel’s Inequality, Parseval’s Equation ....... 21 1.4 Gibbs’ Phenomenon .................................... 24 1.4.1 Dirichlet’s Integral Kernel ......................... 24 1.4.2 Integral Notation of Partial Sums .................. 26 1.4.3 Gibbs’ Overshoot................................. 27 Playground ................................................ 30 2 Continuous Fourier Transformation....................... 33 2.1 Continuous Fourier Transformation ....................... 33 2.1.1 Even and Odd Functions .......................... 33 2.1.2 The δ-Function .................................. 34 2.1.3 Forward and Inverse Transformation ................ 35 2.1.4 Polar Representation of the Fourier Transform ....... 40 2.2 Theorems and Rules .................................... 42 2.2.1 Linearity Theorem................................ 42 2.2.2 The First Shifting Rule ........................... 42 2.2.3 The Second Shifting Rule ......................... 43 2.2.4 Scaling Theorem ................................. 44 2.3 Convolution, Cross Correlation, Autocorrelation, Parseval’s Theorem .............................................. 46 2.3.1 Convolution ..................................... 46 2.3.2 Cross Correlation................................. 55 XII Contents 2.3.3 Autocorrelation .................................. 56 2.3.4 Parseval’s Theorem............................... 57 2.4 Fourier Transformation of Derivatives ..................... 58 2.5 Pitfalls................................................ 60 2.5.1 “Turn 1 into 3” .................................. 60 2.5.2 Truncation Error ................................. 63 Playground ................................................ 66 3 Window Functions........................................ 69 3.1 The Rectangular Window ............................... 69 3.1.1 Zeros ........................................... 70 3.1.2 Intensity at the Central Peak ...................... 70 3.1.3 Sidelobe Suppression.............................. 71 3.1.4 3 dB-Bandwidth ................................. 72 3.1.5 Asymptotic Behaviour of Sidelobes ................. 73 3.2 The Triangular Window (Fejer Window) .................. 73 3.3 The Cosine Window .................................... 74 3.4 The cos2-Window (Hanning)............................. 75 3.5 The Hamming Window ................................. 77 3.6 The Triplet Window .................................... 78 3.7 The Gauss Window..................................... 79 3.8 The Kaiser–Bessel Window .............................. 80 3.9 The Blackman–Harris Window ........................... 81 3.10 Overview over Window Functions......................... 84 3.11 Windowing or Convolution? ............................. 87 Playground ................................................ 88 4 Discrete Fourier Transformation .......................... 89 4.1 Discrete Fourier Transformation.......................... 89 4.1.1 Even and Odd Series and Wrap-around ............. 89 4.1.2 The Kronecker Symbol or the “Discrete δ-Function” .. 90 4.1.3 Definition of the Discrete Fourier Transformation..... 92 4.2 Theorems and Rules .................................... 96 4.2.1 Linearity Theorem................................ 96 4.2.2 The First Shifting Rule ........................... 96 4.2.3 The Second Shifting Rule ......................... 97 4.2.4 Scaling Rule/Nyquist Frequency.................... 98 4.3 Convolution, Cross Correlation, Autocorrelation, Parseval’s Theorem .............................................. 99 4.3.1 Convolution ..................................... 100 4.3.2 Cross Correlation................................. 103 4.3.3 Autocorrelation .................................. 104 4.3.4 Parseval’s Theorem............................... 104 4.4 The Sampling Theorem ................................. 105 4.5 Data Mirroring......................................... 109 Contents XIII 4.6 Zero-padding .......................................... 112 4.7 Fast Fourier Transformation (FFT) ....................... 118 Playground ................................................ 126 5 Filter Effect in Digital Data Processing ................... 131 5.1 Transfer Function ...................................... 131 5.2 Low-pass, High-pass, Band-pass, Notch Filter .............. 132 5.3 Shifting Data .......................................... 139 5.4 Data Compression ...................................... 141 5.5 Differentiation of Discrete Data .......................... 141 5.6 Integration of Discrete Data ............................. 143 Playground ................................................ 147 Appendix: Solutions .......................................... 149 References.................................................... 197 Index......................................................... 199