Concise guide on numerical methods

Slides:



Advertisements
Similar presentations
DFT & FFT Computation.
Advertisements

Acceleration of Cooley-Tukey algorithm using Maxeler machine
David Hansen and James Michelussi
Digital Kommunikationselektronik TNE027 Lecture 5 1 Fourier Transforms Discrete Fourier Transform (DFT) Algorithms Fast Fourier Transform (FFT) Algorithms.
The Discrete Fourier Transform. The spectrum of a sampled function is given by where –  or 0 .
LECTURE Copyright  1998, Texas Instruments Incorporated All Rights Reserved Use of Frequency Domain Telecommunication Channel |A| f fcfc Frequency.
FOURIER TRANSFORMS CENG 5931: GNU RADIO Dr. George Collins.
Richard Fateman CS 282 Lecture 101 The Finite-Field FFT Lecture 10.
Introduction to Fast Fourier Transform (FFT) Algorithms R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2003.
FFT1 The Fast Fourier Transform by Jorge M. Trabal.
Princeton University COS 423 Theory of Algorithms Spring 2002 Kevin Wayne Fast Fourier Transform Jean Baptiste Joseph Fourier ( ) These lecture.
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 16: Application-Driven Hardware Acceleration (1/4)
Chapter 12 Fourier Transforms of Discrete Signals.
Fast Fourier Transforms
Integral Transform Dongsup Kim Department of Biosystems, KAIST Fall, 2004.
1 Chapter 5 Divide and Conquer Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
CS 6068 Parallel Computing Fall 2013 Lecture 10 – Nov 18 The Parallel FFT Prof. Fred Office Hours: MWF.
FFT USING OPEN-MP Done by: HUSSEIN SALIM QASIM & Tiba Zaki Abdulhameed
5.6 Convolution and FFT. 2 Fast Fourier Transform: Applications Applications. n Optics, acoustics, quantum physics, telecommunications, control systems,
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Digital Signal Processing Chapter 3 Discrete transforms.
Fourier Analysis of Discrete Time Signals
Chapter 5 Finite-Length Discrete Transform
1 Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Fast Fourier Transforms. 2 Discrete Fourier Transform The DFT pair was given as Baseline for computational complexity: –Each DFT coefficient requires.
The Discrete Fourier Transform
Applied Symbolic Computation1 Applied Symbolic Computation (CS 567) The Fast Fourier Transform (FFT) and Convolution Jeremy R. Johnson TexPoint fonts used.
EE345S Real-Time Digital Signal Processing Lab Fall 2006 Lecture 17 Fast Fourier Transform Prof. Brian L. Evans Dept. of Electrical and Computer Engineering.
Math for CS Fourier Transforms
Discrete Fourier Transform
1 Chapter 8 The Discrete Fourier Transform (cont.)
Digital Image Processing Lecture 8: Fourier Transform Prof. Charlene Tsai.
DIGITAL SIGNAL PROCESSING ELECTRONICS
Chapter 12 Fast Fourier Transform
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Polynomial + Fast Fourier Transform
Instruction of Chapter 8 on
September 4, 1997 Applied Symbolic Computation (CS 300) Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Fast Fourier Transforms Dr. Vinu Thomas
Fast Fourier Transform
Applied Symbolic Computation
UNIT II Analysis of Continuous Time signal
GROUPS & THEIR REPRESENTATIONS: a card shuffling approach
Applied Symbolic Computation
FAST FOURIER TRANSFORM ALGORITHMS
Lecture #17 INTRODUCTION TO THE FAST FOURIER TRANSFORM ALGORITHM
4.1 DFT In practice the Fourier components of data are obtained by digital computation rather than by analog processing. The analog values have to be.
September 4, 1997 Applied Symbolic Computation (CS 300) Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Chapter 8 The Discrete Fourier Transform
Advanced Algorithms Analysis and Design
Fast Fourier Transformation (FFT)
Applied Symbolic Computation
September 4, 1997 Applied Symbolic Computation (CS 567) Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Chapter 9 Computation of the Discrete Fourier Transform
Chapter 5 Divide and Conquer
Applied Symbolic Computation
LECTURE 18: FAST FOURIER TRANSFORM
Chapter 8 The Discrete Fourier Transform
The Report of Monographic Study
Chapter 8 The Discrete Fourier Transform
Lecture #18 FAST FOURIER TRANSFORM ALTERNATE IMPLEMENTATIONS
Fast Fourier Transform (FFT) Algorithms
Lecture #17 INTRODUCTION TO THE FAST FOURIER TRANSFORM ALGORITHM
Fast Fourier Transform
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
Fast Polynomial and Integer Multiplication
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
LECTURE 18: FAST FOURIER TRANSFORM
Fourier Transforms of Discrete Signals By Dr. Varsha Shah
Presentation transcript:

Concise guide on numerical methods Grzegorz Pytel, Warsaw University of Technology Fourier Transform and its applications Fourier Transform and its applications. Grzegorz Pytel. Warsaw University of Technology

Fourier Transform and its application Talk scheme 1 Theoritcal introduction 2 Numerical methods 3 Applications Fourier transform and its application in review 17/11/2018 Fourier Transform and its application Fourier Transform and its applications. Grzegorz Pytel. Warsaw University of Technology

Theoretical introduction 1 Theoretical introduction t Fourier Transform and its application Fourier Transform and its applications. Grzegorz Pytel. Warsaw University of Technology

Fourier Transform and its application Fourier analysis Symmetry Periodic Phenomena Linear Numerical methods Group theory 17/11/2018 Fourier Transform and its application

Periodicity Periodicity sin⁡(2Π𝑡) Period 1 Freq 1 In space In time Number of repetitions of a patttern in a second Uses period. Measurement of how big the pattern is that repeats Periodicity arises from symmetry sin⁡(6Π𝑡) Period 1 3 Freq 3 t? You’re fixed in a period. Period of sum=1 17/11/2018 Fourier Transform and its application

Fourier Transform and its application 𝐿 𝑏𝑐 1 = 𝐹:𝑅 𝐶,𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑜𝑢𝑠,𝑏𝑜𝑢𝑛𝑑𝑒𝑑, 𝑓 1 = −∞ ∞ 𝑓(𝑥) 𝑑𝑥<∞ Theorem: 𝑓,𝑔∈ 𝐿 𝑏𝑐 1 𝑡ℎ𝑒𝑛 𝑐𝑜𝑛𝑣𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝑓∗𝑔 𝑥 = −∞ ∞ 𝑓 𝑦 𝑔 𝑥−𝑦 𝑑𝑦 𝑎𝑛𝑑 𝑒𝑥𝑖𝑠𝑡𝑠 𝑓𝑜𝑟 ∀𝑥∈𝑅: 𝑓∗𝑔∈ 𝐿 𝑏𝑐 1 𝑅 f*g=g*f Iff ℎ∈ 𝐿 𝑏𝑐 1 𝑅 𝑡ℎ𝑒𝑛 𝑓∗ 𝑔∗ℎ = 𝑓∗𝑔 ∗ℎ f*(g+h)=f*g+f*h Definition If 𝑓∈ 𝐿 𝑏𝑐 1 𝑅 then we define Fourier Transform as: 𝑓 𝑦 = −∞ ∞ 𝑓(𝑥) 𝑒 −2Π𝑖𝑦𝑥 𝑑𝑥 Time Frequency More, including properties: http://en.wikipedia.org/wiki/Fourier_transform 17/11/2018 Fourier Transform and its application

Discrete Fourier Transform Let 𝑎 𝑖 ∈𝑅,𝑖=0,..,𝑁−1 be discretized values of signal DFT: 𝑎 0 , 𝑎 1 ,.., 𝑎 𝑁−1 𝐴 0 , 𝐴 1 ,.., 𝐴 𝑁−1 𝑤ℎ𝑒𝑟𝑒 𝐴 𝑖 ∈𝐶 𝑎𝑛𝑑 𝐴 𝑘 = 𝑛=0 𝑁−1 𝑎 𝑛 𝜔 𝑁 −𝑘𝑛 ,𝑘=0,..,𝑁−1 Where 𝜔 𝑁 = 𝑒 2Π𝑖 𝑁 𝐴 𝑘 = 𝑛=0 𝑁−1 𝑎 𝑛 𝑒 − 2Π𝑖𝑘𝑛 𝑁 ,𝑘=0,..,𝑁−1 Inverse Discrete Fourier Transform: 𝑎 𝑛 = 1 𝑁 𝑘=0 𝑁−1 𝐴 𝑘 𝜔 𝑁 𝑘𝑛 ,𝑛=0,..,𝑁−1 Complexity: 𝑂( 𝑁 2 ) 17/11/2018 Fourier Transform and its application

Fast Fourier Transform Wolfgang Bangerth, Guido Kanschat, and Ralf Hartmann, a software library for computational solution of partial differential equations using adaptive finite elements A fast Fourier transform (FFT) is an efficient algorithm to compute the discrete Fourier transform (DFT) and its inverse. FFTs was constructed by J. W. Cooley of IBM and John W. Tukey of Princeton published a paper in 1965 reinventing the algorithm and describing how to perform it conveniently on a computer http://www.fftw.org/ 2007 Jonathan Shewchuk for Triangle, a two-dimensional mesh generator and Delaunay Triangulator 2003 1999 Chris Bischof and Alan Carle for ADIFOR 2.0, an automatic differentiation tool for Fortran 77 programs 1995 On Thursday, 8 July 1999, the third Wilkinson Prize for Numerical Software was awarded to Matteo Frigo and Steven Johnson of Massachusetts Institute of Technology. The winning entry, FFTW (the "Fastest Fourier Transform in the West"), is a library of C routines for the efficient computation of the discrete Fourier transform of real and complex data. The unparalleled efficiency over a wide range of computer platforms is by automatically determining the best computational strategy for the particular hardware. Linda Petzold for DASSL, a differential algebraic equation solver 1991 Complexity: 𝑂(𝑁𝑙𝑜𝑔𝑁) Wilkinson Prize axis 17/11/2018 Fourier Transform and its application

Fast Fourier Transform – Danielson Lenczos Procedure FFT(N,ω,a(x)) If N=1 then 𝐴 0 𝑎 0 Else { 𝑏 𝑥 = 𝑖=0 𝑁 2 −1 𝑎 2𝑖 𝑥 𝑖 ;𝑐 𝑥 𝑖=0 𝑁 2 −1 𝑎 2𝑖+1 𝑥 𝑖 𝐵 𝐹𝐹𝑇 𝑁 2 , 𝜔 2 ,𝑏 𝑥 ;𝐶 𝐹𝐹𝑇 𝑁 2 , 𝜔 2 ,𝑐 𝑥 for i from 0 to 𝑁 2 −1 do { 𝐴 𝑖 𝐵 𝑖 + 𝜔 𝑖 𝐶 𝑖 𝐴 𝑁 2 +𝑖 𝐵 𝑖 + 𝜔 𝑖 𝐶 𝑖 } } Return 𝐴 0 , 𝐴 1 ,…, 𝐴 𝑁−1 end 17/11/2018 Fourier Transform and its application

Fourier Transform and its application 2 Numerical methods World’s major methods used for computing FFT Fourier Transform and its application Fourier Transform and its applications. Grzegorz Pytel. Warsaw University of Technology

Fast Fourier Transform Cooley–Tukey Prime-factor Bruun's Rader's Bluestein's Winogard 17/11/2018 Fourier Transform and its application

Fourier Transform and its application Cooley-Tukley Radix 2-Decimation in Time, 1965 𝑋 𝑘=0..𝑁−1 = 𝑚=0 𝑁 2 −1 𝑥 2𝑚 𝑒 − 2Π𝑖 𝑁 2 2𝑚 𝑘 + 𝑒 − 2Π𝑖 𝑁 𝑘 𝑚=0 𝑁 2 −1 𝑥 2𝑚+1 𝑒 − 2Π𝑖 𝑁 2 𝑚𝑘 Danielson-Lanczos Lemma, 1942 C-T C source code: http://en.literateprograms.org/Cooley-Tukey_FFT_algorithm_(C) Twiddle factor The discrete Fourier transform of length (where is even) can be rewritten as the sum of two discrete Fourier transforms, each of length N/2. One is formed from the even-numbered points; the other from the odd-numbered points. Denote the th point of the discrete Fourier transform by . Then 𝐹 𝑛 = 𝑘=0 𝑁−1 𝑓 𝑘 𝑒 − 2Π𝑖𝑛 𝑁 = 𝑘=0 𝑁 2 𝑒 − 2Π𝑖𝑘𝑛 𝑁 2 𝑓 2𝑘 + 𝑊 𝑛 𝑘=0 𝑁 2 −1 𝑒 − 2Π𝑖𝑘𝑛 𝑁 2 𝑓 2𝑘+1 = 𝐹 𝑛 𝑒 + 𝑊 𝑛 𝐹 𝑛 0 More: http://mathworld.wolfram.com/Danielson-LanczosLemma.html Danielson-Lanczos Cooley-Tukley Time [min] 140 0.02 Task’s size 64 DFT 3–5 significant digits, real numbers 2048 DFT 8 digits 17/11/2018 Fourier Transform and its application

Fourier Transform and its application Cooley-Tukley Can only be used to speed the calculation of DFTs of a size that is a power of two Requires padding with 0 extra multiplications by roots of unity called twiddle factors NlogN complexity More inc. sourcecode at: http://numericalrecipes.blogspot.com/2009/04/cooley-turkey-fft-algorithm.html 17/11/2018 Fourier Transform and its application

Cooley-Tukley general factorizations DCT DFT 1 𝑁 2 2 Transpose Multiply by N twiddle factors 𝑁 1 More info and Python sourcecode: http://numericalrecipes.wordpress.com/2009/05/29/the-cooley-tukey-fft-algorithm-for-general-factorizations/ 17/11/2018 Fourier Transform and its application

Prime factor (Good-Thomas algorithm) DFT: Is a FFT that re-expresses the DFT of a 𝑁= 𝑁 1 𝑁 2 as two-dimensional 𝑁 1 𝑥 𝑁 2 DFT, but only for the case where 𝑁 1 and 𝑁 2 are relatively prime 𝑥 𝑘 = 𝑛=0 𝑁−1 𝑥 𝑛 𝑒 − 2Π𝑖 𝑁 𝑛𝑘 ,𝑘=0,…,𝑁−1 𝑛= 𝑛 1 𝑁 2 + 𝑛 2 𝑁 1 𝑚𝑜𝑑 𝑁 𝑘= 𝑘 1 𝑁 2 −1 𝑁 2 + 𝑘 2 𝑁 1 −1 𝑁 1 𝑋 𝑘 1 𝑁 2 −1 𝑁 2 + 𝑘 2 𝑁 1 −1 𝑁 1 = 𝑛 1 =0 𝑁 1 −1 𝑛 2 =0 𝑁 2 −1 𝑥 𝑛 1 𝑁 2 + 𝑛 2 𝑁 1 𝑒 − 2Π𝑖 𝑁 2 𝑛 2 𝑘 2 𝑒 − 2Π𝑖 𝑁 1 𝑛 1 𝑘 1 More at: http://neohumanism.org/p/pr/prime_factor_fft_algorithm.html Example at: http://cnx.org/content/m12033/latest/ 17/11/2018 Fourier Transform and its application

Fourier Transform and its application Bruun’s Only real coefficients until the last computation stage May be less accurate than Cooley–Tukey in the face of finite numerical precision (Storn, 1993) 𝜔 𝑁 𝑛 = 𝑛 𝑘 𝑒 − 2Π𝑖 𝑁 𝑛 𝑥 𝑧 = 𝑛=0 𝑁−1 𝑥 𝑛 𝑧 𝑛 x(z) – polynomial whose coefficients are 𝑥 𝑛 𝑋 𝑘 =𝑥 𝜔 𝑁 𝑘 =𝑥 𝑧 𝑚𝑜𝑑 𝑧− 𝜔 𝑁 𝑘 17/11/2018 Fourier Transform and its application

Fourier Transform and its application Rader’s Computes DFT of prime sizes by re-expressing the DFT as a cyclic convolution Is a one-dimensional index-mapping scheme that turns a length-N DFT (N prime) into a length-(N−1) convolution and a few additions. Rader's conversion works only for prime-length N. Most efficient for prime-length N More at: http://cnx.org/content/m12023/latest/ 17/11/2018 Fourier Transform and its application

Fourier Transform and its application Rader’s Mapping 𝑘= 𝑟 𝑚 𝑚𝑜𝑑𝑁,𝑚=0,..,𝑁−2, N-prime, uniquely generates all elements k=[1,..,N-1] N=5,r=2 2 0 𝑚𝑜𝑑5=1 2 1 𝑚𝑜𝑑5=2 2 2 𝑚𝑜𝑑5=4 2 3 𝑚𝑜𝑑5=3 N-prime, the inverse of r 𝑟 −1 𝑟𝑚𝑜𝑑𝑁=1 N=5,r=2, 𝑟 −1 =3 2𝑥3𝑚𝑜𝑑5=1 3 0 𝑚𝑜𝑑5=1 3 1 𝑚𝑜𝑑5=3 3 2 𝑚𝑜𝑑5=4 3 3 𝑚𝑜𝑑5=2 𝑚𝑛 𝑚=[0,..,𝑁−2 ]⋀𝑛=[1,..,𝑁−1])(𝑛= 𝑟 −𝑚 𝑚𝑜𝑑𝑁) 𝑝𝑘 𝑝=[0,..,𝑁−2 ]⋀𝑘=[1,..,𝑁−1])(𝑘= 𝑟 −𝑝 𝑚𝑜𝑑𝑁) 𝑋 𝑘 = 𝑛=0 𝑁−1 𝑥 𝑛 𝑊 𝑁 𝑛𝑘 = 𝑥 0 + 𝑛=1 𝑁−1 𝑥 𝑛 𝑊 𝑁 𝑛𝑘 𝑖𝑓 𝑘≢0 𝑛=0 𝑁−1 𝑥 𝑛 𝑖𝑓 𝑘=0 𝑊 𝑁 𝑛𝑘 = 𝑒 − 𝑖 2Π𝑖𝑛𝑘 𝑁 For 𝑘≢0: 𝑋 𝑟 𝑝 𝑚𝑜𝑑𝑁 = 𝑚=0 𝑁−2 𝑥 𝑟 −𝑚 𝑚𝑜𝑑𝑁 𝑊 𝑟𝑃𝑟−𝑚 +𝑥 0 = 𝑥 0 +𝑥 𝑟 −𝑙 𝑚𝑜𝑑𝑁 ∗ 𝑊 𝑟 𝑙 ,𝑙=0,1,..,𝑁−2 17/11/2018 Fourier Transform and its application

Fourier Transform and its application Bluestein’s (1968) Computes FFT at arbitrary sizes by re-expressing the DFT as a convolution can be performed with a pair of FFTs (plus the pre-computed FFT of bn) via the convolution theorem. The key point is that these FFTs are not of the same length N: such a convolution can be computed exactly from FFTs only by zero-padding it to a length greater than or equal to 2N–1 O(N log N) 𝑋 𝑘 = 𝑛=0 𝑁−1 𝑥 𝑛 𝑒 − 2Π𝑖 𝑁 𝑛𝑘 ,𝑘=0,..,𝑁−1 𝑛𝑘= − 𝑘−𝑛 2 + 𝑛 2 + 𝑘 2 2 𝑋 𝑘 = 𝑒 − Π𝑖 𝑁 𝑘 2 𝑛=0 𝑁−1 𝑥 𝑛 𝑒 − Π𝑖 𝑁 𝑛 2 𝑒 Π𝑖 𝑁 (𝑘−𝑛) 2 ,𝑘=0,..,𝑁−1 𝑎 𝑛 = 𝑥 𝑛 𝑒 − Π𝑖 𝑁 𝑛 2 𝑏 𝑛 = 𝑒 Π𝑖 𝑁 𝑛 2 𝑋 𝑘 = 𝑏 𝑘 𝑛=0 𝑁−1 𝑎 𝑛 𝑏 𝑘−𝑛 ,𝑘=0,..,𝑁−1 17/11/2018 Fourier Transform and its application

Fourier Transform and its application Winogard 𝑋= 𝐹 1 𝐹 2 𝑥 𝐹= 𝐴 𝑇 𝐷𝐴 𝑋= 𝐴 2 𝑇 𝐷 2 𝐴 2 𝐴 1 𝑇 𝐷 1 𝐴 1 𝑥 X= 𝐴 2 𝑇 𝐴 1 𝑇 𝐷 2 𝐷 1 𝐴 2 𝐴 1 𝑥 𝐷= 𝐷 2 𝐷 1 𝑋= 𝐴 1 𝑇 𝐴 2 𝑇 𝐷 𝐴 2 𝐴 1 𝑥 DFT’s row DFT’s column Winogard need O(N) multiplications to compute the FFT. However, at the cost of asymptotically many more additions, and thus they represent a tradeoff that is typically unfavorable on modern CPUs with hardware multipliers. Fastest, smallest number of operations Extremely efficient for small N (N<20) The number of adds becomes huge for large N Most difficult More at: http://cnx.org/content/m16333/latest/#uid24 17/11/2018 Fourier Transform and its application

Industrial applications 3 Industrial applications Examples of industrial applications of FFT and DFT Fourier Transform and its application Fourier Transform and its applications. Grzegorz Pytel. Warsaw University of Technology

Industrial products/companies reliable on FFT 17/11/2018 Fourier Transform and its application Fourier Transform and its applications. Grzegorz Pytel. Warsaw University of Technology

Fourier Transform and its application Voice power in matlab DEMO 17/11/2018 Fourier Transform and its application

Fourier Transform and its application DEMO Source code function [n,fs,waveData] = waveRecordFFT() n=20000; fs=11025; waveData=wavrecord(n,fs); wavplay(waveData,fs); frequency(waveData,n,fs); End function[] = frequency(waveData,n,fs) s1=waveData(:,1); p=fft(s1); nUniquePts=ceil((n+1)/2); p=p(1:nUniquePts); p=abs(p); p=p/n; p=p.^2; if rem(n,2) p(2:end) = p(2:end)*2; else p(2:end -1) = p(2:end - 1)*2; end freqArray=(0:nUniquePts-1)*(fs/n); plot(freqArray/1000,10*log10(p),'k') xlabel('Frequency (kHz)') ylabel('Power (dB)') 17/11/2018 Fourier Transform and its application

Fourier Transform and its application DIGITIZING NATURE 17/11/2018 Fourier Transform and its application Fourier Transform and its applications. Grzegorz Pytel. Warsaw University of Technology

Fourier Transform and its application End remarks FFT length Multiplies Adds Mults+Adds Radix 2 1024 10248 30728 40976 Split radix 7172 27652 34842 Prime factor 1008 5804 29100 34904 Winograd 3548 34416 37964 The most commonly used FFT algorithms by far are the power-of-two-length FFT algorithms Prime Factor and Winograd require somewhat fewer multiplies, but the overall difference usually isn't sufficient to warrant the extra difficulty Changing radix can speed up, up to 30-40 % 17/11/2018 Fourier Transform and its application

Fourier Transform and its application Bibliography http://see.stanford.edu/see/courseinfo.aspx?coll=84d174c2-d74f-493d-92ae-c3f45c0ee091 17/11/2018 Fourier Transform and its application