The discrete Fourier transform

Similar documents
Titus Beu University Babes-Bolyai Department of Theoretical and Computational Physics Cluj-Napoca, Romania

000=0 001=1 010=2 011=3 100=4 101=5 110=6 111=7 000=0 100=4 010=2 110=6 001=1 101=5 011=3 111=7

Fourier Sin and Cos Series and Least Squares Convergence

Chapter 5 Trigonometric Functions of Angles

Analytic Trigonometry. Copyright Cengage Learning. All rights reserved.

PHYS 404 Lecture 1: Legendre Functions

V(t) = Total Power = Calculating the Power Spectral Density (PSD) in IDL. Thomas Ferree, Ph.D. August 23, 1999

A more accurate Briggs method for the logarithm

6.1 The Inverse Sine, Cosine, and Tangent Functions Objectives

Using the Definitions of the Trigonometric Functions

Advanced Partial Differential Equations with Applications

Calculus II Practice Test Problems for Chapter 7 Page 1 of 6

Warm Up = = 9 5 3) = = ) ) 99 = ) Simplify. = = 4 6 = 2 6 3

Lecture 3f Polar Form (pages )

5.8 Chebyshev Approximation

23.4. Convergence. Introduction. Prerequisites. Learning Outcomes

multiply both sides of eq. by a and projection overlap

Tutorial 2 - Learning about the Discrete Fourier Transform

Precalculus Review. Functions to KNOW! 1. Polynomial Functions. Types: General form Generic Graph and unique properties. Constants. Linear.

The Fourier Transform (and more )

Trigonometric Ratios. θ + k 360

Pre- Calculus Mathematics Trigonometric Identities and Equations

Section 1.2 A Catalog of Essential Functions

Mathematics High School Functions

SET 1. (1) Solve for x: (a) e 2x = 5 3x

Mathematical methods and its applications Dr. S. K. Gupta Department of Mathematics Indian Institute of Technology, Roorkee

Practice Differentiation Math 120 Calculus I Fall 2015

Analytic Trigonometry. Copyright Cengage Learning. All rights reserved.

f (t) K(t, u) d t. f (t) K 1 (t, u) d u. Integral Transform Inverse Fourier Transform

EE16B - Spring 17 - Lecture 11B Notes 1

Math Analysis Chapter 5 Notes: Analytic Trigonometric

Purpose: This lab is an experiment to verify Malus Law for polarized light in both a two and three polarizer system.

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

Fourier transform. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

October 15 MATH 1113 sec. 51 Fall 2018

A Library of Functions

Inverse Trig Functions

SEISMIC WAVE PROPAGATION. Lecture 2: Fourier Analysis

Boundary value problems for partial differential equations

(Refer Slide Time: 01:30)

FOURIER TRANSFORM METHODS David Sandwell, January, 2013

Honors Algebra 2 Chapter 14 Page 1

Lecture 13: Forces in the Lagrangian Approach

Fourier analysis of discrete-time signals. (Lathi Chapt. 10 and these slides)

4-4. Exact Values of Sines, Cosines, and Tangents

Fourier Sin and Cos Series and Least Squares Convergence

5.8 Chebyshev Approximation

On an Eigenvalue Problem Involving Legendre Functions by Nicholas J. Rose North Carolina State University

Introduction to Finite Di erence Methods

Section 6: Summary Section 7

Fig. 1: Fourier series Examples

CAMI Education linked to CAPS: Mathematics

CK- 12 Algebra II with Trigonometry Concepts 1

6.5 Trigonometric Equations

EE 438 Supplementary Notes on Fourier Series and Linear Algebra.

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

Positive Definite Functions on Spheres

Chapter 5 Notes. 5.1 Using Fundamental Identities

Further Pure Mathematics 1

Answer Key. 7.1 Tangent Ratio. Chapter 7 Trigonometry. CK-12 Geometry Honors Concepts 1. Answers

Chapter 5 Analytic Trigonometry

Jim Lambers ENERGY 281 Spring Quarter Lecture 5 Notes

MATH 2412 Sections Fundamental Identities. Reciprocal. Quotient. Pythagorean

2 sin 2 (x) 1 = 0 2 sin 2 (x) = 1. sin 2 (x) = sin(x) = ± 2. x 3 = sin 1 ( 1/ 2) = π. x 2 = π x 1 = 3π 4. 4 x 4 = π x 3 = 5π 4

A note on multivariate Gauss-Hermite quadrature

sin cos 1 1 tan sec 1 cot csc Pre-Calculus Mathematics Trigonometric Identities and Equations

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

EE 3054: Signals, Systems, and Transforms Spring A causal discrete-time LTI system is described by the equation. y(n) = 1 4.

THE VORTEX PANEL METHOD

THE COMPOUND ANGLE IDENTITIES

Module 3.9: nag kelvin fun Kelvin Functions. Contents

Radian measure and trigonometric functions on the reals

Lesson 33 - Trigonometric Identities. Pre-Calculus

Numerical Analysis: Approximation of Functions

Calculus II Practice Test 1 Problems: , 6.5, Page 1 of 10

EFFICIENT 3D POISSON SOLVERS FOR SPACE-CHARGE SIMULATION

More on Fourier Series

Course 2BA1: Hilary Term 2006 Section 7: Trigonometric and Exponential Functions

EE 3054: Signals, Systems, and Transforms Summer It is observed of some continuous-time LTI system that the input signal.

Fourier Series Tutorial

Section 6.2 Trigonometric Functions: Unit Circle Approach

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

More with Angles Reference Angles

23 Elements of analytic ODE theory. Bessel s functions

Chapter 17. Fourier series

Chapter 5: Trigonometric Functions of Angles Homework Solutions

Power Series Solutions We use power series to solve second order differential equations

Chapter 17 : Fourier Series Page 1 of 12

( ) ( ) ( ) 2 6A: Special Trig Limits! Math 400

Biruk Alemayehu Petros 1. Mobile number:

CS711008Z Algorithm Design and Analysis

Asymptotics of Integrals of. Hermite Polynomials

CK- 12 Algebra II with Trigonometry Concepts 1

Math Section 4.3 Unit Circle Trigonometry

MTH4101 CALCULUS II REVISION NOTES. 1. COMPLEX NUMBERS (Thomas Appendix 7 + lecture notes) ax 2 + bx + c = 0. x = b ± b 2 4ac 2a. i = 1.

UNIVERSITY OF CAMBRIDGE Faculty of Mathematics MATHEMATICS WORKBOOK

Visualizing Complex-valued Functions

I.e., the range of f(x) = arctan(x) is all real numbers y such that π 2 < y < π 2

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

1 Solutions in cylindrical coordinates: Bessel functions

Transcription:

3 The discrete Fourier transform Page 1 3.1 Introduction Let f(t) be a function describing a physical process in the time domain. An equivalent representation of the process, F (ν), is possible in the frequency domain, and the two representations are connected by means of the direct and inverse Fourier transforms: F (ν) = f(t) = Z Z f(t) e 2πiνt dt (3.1) F (ν) e 2πiνt dν. (3.2) In the most common situations, the function f(t) is sampled at a finite number of time arguments. Suppose that we have N consecutive sampled values: f f(t ), with t ( 1), =1, 2,...,N, (3.3) where denotes the sampling interval. We consider the N discrete frequencies ν k = k 1 1, k =1, 2,...,N,

2 3. The discrete Fourier transform and approximate the integral (3.1) by a discrete sum: F (ν k ) ' f e 2πiν kt = =1 =1 f exp 2πi ( 1)(k 1). The last sum is called the discrete Fourier transform of the N values f : ( 1)(k 1) F k = f exp 2πi, k =1, 2,...,N. (3.4) =1 The discrete Fourier transform maps N complex numbers, f,inton complex numbers, F k. Having the N values F k of the discrete Fourier transform, the N original values f can be recovered by the discrete inverse Fourier transform: f = 1 N k=1 ( 1)(k 1) F k exp 2πi. (3.5) It is obvious that a routine designed to calculate the discrete Fourier transform can calculate the inverse transform, too. There are two important particular cases of the Fourier transform. If the transformed function f(t) vanishes at the origin (f(0) f 0 =0), than the basis functions should behave similarly and the natural transform in this case is the sine transform: ( 1)(k 1) F k = f sin π, k =1, 2,...,N. (3.6) =1 If the derivative of the transformed function f(t) vanishes at the origin, than the basis functions should show the same behavior, too, and the natural transform in this case is the cosine transform: N 1 X ( 1)(k 1) F k = f cos π + 1 i hf 1 +( 1) k 1 f N, k =1, 2,...,N. 2 =2 (3.7) The cosine transform is its own inverse, N 1 X ( 1)(k 1) f = F k cos π + 1 F1 +( 1) 1 F N, =1, 2,...,N, 2 k=2 (3.8)

3.1 Introduction 3 and the transformed values F k appear in the Fourier expansion of f as weights of the cosine functions with the frequencies ν k = k 1 1, k =1, 2,...,N. (3.9) 2 We remind that t =( 1). The straightforward implementation of the discrete cosine transform (3.7)- (3.9) is:!============================================================================ subroutine FTcos0(f,ft,n)!----------------------------------------------------------------------------! Straightforward implementation of the discrete cosine transform!! f - input data! ft - transformed data! n - no. of data values! Frequencies corresponding to the transformed data:! freq(k) = (k-1) / (2.d0 * dt * (n-1)), k=1,n!---------------------------------------------------------------------------- implicit real(8) (a-h,o-z) real(8), parameter :: pi = 3.1415926535897932385d0 real(8) f(n), ft(n) isgn = 1 fact = pi / (n-1) do k = 1,n theta = (k-1) * fact sum = 0.d0 do = 2,n-1 sum = sum + f() * cos((-1)*theta) ft(k) = sum + 0.5d0 * (f(1) + isgn*f(n)) isgn = -isgn end Due to the repeated evaluations of the cosine function, the above implementation is highly inefficient and the execution time becomes critical when the number of observations N exceeds 10 5.

4 3. The discrete Fourier transform 3.2 Efficient discrete Fourier transform We consider only the sum in expression (3.7) of the cosine transform F k, N 1 X =2 f cos ( 1)θ 0 k, (3.10) with θ 0 k = k 1 π, (3.11) and split it in even- and odd- terms: X f cos ( 1)θ 0 X k + f cos ( 1)θ 0 k. =2,4 =3,5 The addition formula cos [( 1)θ] =cosθcos(θ)+sinθsin(θ) is used to expand the first sum, and the index is changed to +1in the second one: X f Ck cos(θ 0 k )+S k sin(θ 0 k ) + X f +1 cos(θ 0 k ), where =2,4 C k =cosθ 0 k, S k =sinθ 0 k. =2,4 Now, we replace the index by 2 in both sums and group together the sine and cosine functions with the same argument: Here we use the notations: MX [U cos(θ k )+V sin(θ k )]. (3.12) =1 U = C k f 2 + f 2+1, V = S k f 2, (3.13) θ k =2θ 0 k, (3.14) and M = 2 is the integer part of ()/2. (3.15)

3.2 Efficient discrete Fourier transform 5 Next, the arguments of the trigonometric functions will be modified in the even- moiety. To this end, G k is split first into odd- and even- terms, and in the odd- terms the argument θ k is replaced by ( +1)θ k θ k : + =1,3 =2,4 {U cos [( +1)θ k θ k ]+V sin [( +1)θ k θ k ]} [U cos(θ k )+V sin(θ k )]. In the first sum, addition formulas for the modified cosine and sine functions are applied: + + =1,3 =1,3 =2,4 U {cos [( +1)θ k ]cosθ k + sin [( +1)θ k ]sinθ k } V {sin [( +1)θ k ]cosθ k cos [( +1)θ k ]sinθ k } [U cos(θ k )+V sin(θ k )]. Now, all arguments imply even multiples of θ k. In order to be able to group the trigonometric functions, +1is replace by 2 in the first two sums, and by 2 in the last one: X =1 U 2 1 {cos(2θ k )cosθ k +sin(2θ k )sinθ k } + X =1 V 2 1 {sin(2θ k )cosθ k cos(2θ k )sinθ k } + X [U 2 cos(2θ k )+V 2 sin(2θ k )]. =1 Collecting the terms and making the notations: U (1) = U 2 1 cos θ k V 2 1 sin θ k + U 2 V (1) = U 2 1 sin θ k + V 2 1 cos θ k + V 2, (3.16)

6 3. The discrete Fourier transform leads to the following form of G k : [(M+1)/2] X =1 h i U (1) cos(2θ k )+V (1) sin(2θ k ), (3.17) where [(M +1)/2] is the integer part of (M +1)/2. ForoddM, the new coefficients, U (1) and V (1),implyfor =[(M +1)/2] the old coefficients, U M+1 and V M+1, which do not actually exist. These terms should be interpreted as zero. By comparing expression (3.17) of G k with its original form (3.12), it can be seen that at the expense of having to evaluate a new set of coefficients (U (1) and V (1) for =1, [(M +1)/2]), the number of summed terms was condensed by a factor of almost 2 (according to the parity of M). The corresponding sine and cosine functions may be easily evaluated from the duplication formulas: sin(2θ k ) = 2sin(θ k )cos(θ k ), cos(2θ k ) = 2cos 2 (θ k ) 1. (3.18) A careful analysis shows that if such a condensation procedure is repeated N cond times, where N cond =[log 2 (2M 1)], (3.19) then ust two terms remain and one gets the final expression: U (N cond) 1 cos(2 N cond θ k )+V (N cond) 1 sin(2 N cond θ k ), (3.20) from which G k canbeeasilyevaluated. By this condensation procedure, the number of sines and cosines evaluationsisreducedfromm to N cond, or, for instance, from 1000 to 10. Actually, one ust has to evaluate before starting the condensation procedure cos θ k and sin θ k for =1,M, the rest of the sine and cosine functions forming a sequence which can be readily generated by the duplication formulas (3.18). The routine listed below represents the exact implementation of the presented algorithm.!============================================================================ subroutine FTcos(f,ft,n)!----------------------------------------------------------------------------! Calculates the cosine transform of an array f of n real values.! The transformed data is returned in array ft.!---------------------------------------------------------------------------- implicit real(8) (a-h,o-z)

Bibliografie 7 parameter (pi = 3.1415926535897932385d0) real(8) f(n), ft(n) real(8), allocatable :: u(:), v(:) n2 = (n-1)/2 allocate(u(n2+1), v(n2+1)) ncond = int(log(2.d0*n2-1.d0)/log(2.d0)) isgn = 1 fact = pi / (n-1) fn = f(n); f(n) = 0.d0 do k = 1,n theta = (k-1) * fact c = cos(theta); s = sin(theta) do = 1,n2 2 = 2 * u() = c * f(2) + f(2+1) v() = s * f(2) s = 2.d0 * s * c c = 2.d0 * c * c - 1.d0 nterm = n2 do icond = 1,ncond u(nterm+1) = 0.d0; v(nterm+1) = 0.d0 nterm = int((nterm+1)/2) do = 1,nterm 2 = 2* - 1 utmp = c * u(2) - s * v(2) + u(2+1) v() = s * u(2) + c * v(2) + v(2+1) u() = utmp s = 2.d0 * s * c c = 2.d0 * c * c - 1.d0 ft(k) = c * u(1) + s * v(1) + 0.5d0 * (f(1) + isgn*fn) isgn = -isgn deallocate(u,v) end Bibliografie [1] Aubanel, E.E. and Oldham, K.B.., "Fourier smoothing without the fast Fourier transform", Byte, February 1985, p. 207.

8 Bibliografie [2] W.H. Press, S.A. Teukolsky, W.T. Vetterling, B.P Flannery, Numerical Recipes in C, Second Edition (Cambridge University Press, Cambridge, 1992).