APPLICATION NOTE 30 DFT or FFT? A Comparison of Fourier Transform Techniques



Similar documents
Basic Measurement Issues. Sampling Theory and Analog-to-Digital Conversion

Trigonometric Form of a Complex Number. The Complex Plane. axis. ( 2, 1) or 2 i FIGURE The absolute value of the complex number z a bi is

CHAPTER 3 DIGITAL CODING OF SIGNALS

Cooley-Tukey. Tukey FFT Algorithms. FFT Algorithms. Cooley

SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES

Theorems About Power Series

Sequences and Series

Our aim is to show that under reasonable assumptions a given 2π-periodic function f can be represented as convergent series

Domain 1 - Describe Cisco VoIP Implementations

Section 11.3: The Integral Test

Infinite Sequences and Series

FOUNDATIONS OF MATHEMATICS AND PRE-CALCULUS GRADE 10

Escola Federal de Engenharia de Itajubá

Cantilever Beam Experiment

Soving Recurrence Relations

Systems Design Project: Indoor Location of Wireless Devices

Confidence Intervals for One Mean

Convention Paper 6764

THE ARITHMETIC OF INTEGERS. - multiplication, exponentiation, division, addition, and subtraction

SAMPLE QUESTIONS FOR FINAL EXAM. (1) (2) (3) (4) Find the following using the definition of the Riemann integral: (2x + 1)dx

HCL Dynamic Spiking Protocol

where: T = number of years of cash flow in investment's life n = the year in which the cash flow X n i = IRR = the internal rate of return

Study on the application of the software phase-locked loop in tracking and filtering of pulse signal

Fast Fourier Transform and MATLAB Implementation

Research Article Sign Data Derivative Recovery

Institute of Actuaries of India Subject CT1 Financial Mathematics

Normal Distribution.

4.3. The Integral and Comparison Tests

The Binomial Multi- Section Transformer

The analysis of the Cournot oligopoly model considering the subjective motive in the strategy selection

INVESTMENT PERFORMANCE COUNCIL (IPC)

Modified Line Search Method for Global Optimization

Properties of MLE: consistency, asymptotic normality. Fisher information.

*The most important feature of MRP as compared with ordinary inventory control analysis is its time phasing feature.

PROCEEDINGS OF THE YEREVAN STATE UNIVERSITY AN ALTERNATIVE MODEL FOR BONUS-MALUS SYSTEM

In nite Sequences. Dr. Philippe B. Laval Kennesaw State University. October 9, 2008

Example 2 Find the square root of 0. The only square root of 0 is 0 (since 0 is not positive or negative, so those choices don t exist here).

WHEN IS THE (CO)SINE OF A RATIONAL ANGLE EQUAL TO A RATIONAL NUMBER?

Agency Relationship Optimizer

Taking DCOP to the Real World: Efficient Complete Solutions for Distributed Multi-Event Scheduling

A Theoretical and Experimental Analysis of the Acoustic Guitar. Eric Battenberg ME

Complex Numbers. where x represents a root of Equation 1. Note that the ± sign tells us that quadratic equations will have

Output Analysis (2, Chapters 10 &11 Law)

Chapter 7 Methods of Finding Estimators

INFINITE SERIES KEITH CONRAD

Research Method (I) --Knowledge on Sampling (Simple Random Sampling)

Enhancing Oracle Business Intelligence with cubus EV How users of Oracle BI on Essbase cubes can benefit from cubus outperform EV Analytics (cubus EV)

Incremental calculation of weighted mean and variance

Partial Di erential Equations

Class Meeting # 16: The Fourier Transform on R n

A probabilistic proof of a binomial identity

Convexity, Inequalities, and Norms

5: Introduction to Estimation

1 Computing the Standard Deviation of Sample Means

Chapter 5 Unit 1. IET 350 Engineering Economics. Learning Objectives Chapter 5. Learning Objectives Unit 1. Annual Amount and Gradient Functions

Chapter 5: Inner Product Spaces

Hypothesis testing. Null and alternative hypotheses

On the Periodicity of Time-series Network and Service Metrics

Non-life insurance mathematics. Nils F. Haavardsson, University of Oslo and DNB Skadeforsikring

Lecture 4: Cauchy sequences, Bolzano-Weierstrass, and the Squeeze theorem

How To Solve The Homewor Problem Beautifully

A Guide to the Pricing Conventions of SFE Interest Rate Products

(VCP-310)

CHAPTER 3 THE TIME VALUE OF MONEY

Domain 1: Designing a SQL Server Instance and a Database Solution

3. Greatest Common Divisor - Least Common Multiple

2-3 The Remainder and Factor Theorems

1. MATHEMATICAL INDUCTION

Chapter 6: Variance, the law of large numbers and the Monte-Carlo method

7.1 Finding Rational Solutions of Polynomial Equations

Heat (or Diffusion) equation in 1D*

ODBC. Getting Started With Sage Timberline Office ODBC

Asymptotic Growth of Functions

.04. This means $1000 is multiplied by 1.02 five times, once for each of the remaining sixmonth

hp calculators HP 12C Statistics - average and standard deviation Average and standard deviation concepts HP12C average and standard deviation

RISK TRANSFER FOR DESIGN-BUILD TEAMS

Building Blocks Problem Related to Harmonic Series

Determining the sample size

CS103X: Discrete Structures Homework 4 Solutions

Vladimir N. Burkov, Dmitri A. Novikov MODELS AND METHODS OF MULTIPROJECTS MANAGEMENT

Listing terms of a finite sequence List all of the terms of each finite sequence. a) a n n 2 for 1 n 5 1 b) a n for 1 n 4 n 2

AP Calculus AB 2006 Scoring Guidelines Form B

19. LINEAR VISCOUS DAMPING. Linear Viscous Damping Is a Property of the Computational Model And is not a Property of a Real Structure

MEI Structured Mathematics. Module Summary Sheets. Statistics 2 (Version B: reference to new book)

An Efficient Polynomial Approximation of the Normal Distribution Function & Its Inverse Function

THE HEIGHT OF q-binary SEARCH TREES

Basic Elements of Arithmetic Sequences and Series

Biology 171L Environment and Ecology Lab Lab 2: Descriptive Statistics, Presenting Data and Graphing Relationships

CHAPTER 7: Central Limit Theorem: CLT for Averages (Means)

An Area Computation Based Method for RAIM Holes Assessment

WindWise Education. 2 nd. T ransforming the Energy of Wind into Powerful Minds. editi. A Curriculum for Grades 6 12

Design of Cross-talk Cancellation Networks by using Fast Deconvolution

1 Correlation and Regression Analysis

Lesson 15 ANOVA (analysis of variance)

Department of Computer Science, University of Otago

Integrated approach to the assessment of long range correlation in time series data

Engineering Data Management

ni.com/sdr Software Defined Radio

Transcription:

APPLICATION NOTE 30 DFT or FFT? A Compariso of Fourier Trasform Techiques This applicatio ote ivestigates differeces i performace betwee the DFT (Discrete Fourier Trasform) ad the FFT(Fast Fourier Trasform) from a mathematical ad practical level whe utilised for harmoic aalysis of electrical waveforms. Exploratio of the advatages ad disadvatages of each algorithm, as well as determiatio of the best approach for harmoic aalysis withi a power electroics eviromet will be covered. With may Power Aalyzers utilisig the FFT ad fewer utilisig the DFT, the applicatio ote will ivestigate the reasos for the popularity of the FFT ad the problems associated with it. Defiitio Fourier aalysis is a mathematical method of represetig a periodic waveform i terms of a series of trigoometric fuctios. The Frech mathematicia ad Physicist Mr Jea Baptiste Joseph, Baro De Fourier developed the Fourier aalysis techique i the 18th~19th ceturies. Fourier aalysis is used i may idustries, electroics, mechaical egieerig, acoustic egieerig ad much more. This applicatio ote will apply Fourier aalysis to the decompositio of AC periodic waveforms. This is commoly used withi electroics to determie the distortio of a waveform by represetig a time varyig periodic sigal as a discrete umber of "harmoics". Periodic Fuctios A periodic fuctio should be cosidered as a "repeatig patter", where at time T, for all iteger values of, ad T equal to the repetitio period the waveform, the followig is true; f(x + T) = f(x) (1) For example : y = si(x)is periodic i x with a period of 2, if y = si(ωt) the the period of the waveform is 2 where ω ω = periodic frequecy (2f) For a frequecy of 10Hz, ω = 20 rads sec 2 therefore the fudametal time period T is = 0.1secods. 20 y = si ω(t + T) (2) The magitude of the waveform at iitial time t = 0.021 is calculated, as well as the subsequet magitudes at time t + ( T) si 20(0.021 + 0.1) (3) =0 =1 =2 0.969 0.969 0.969 A sie wave is kow as a cotiuous fuctio, it does ot exhibit ay sudde jumps or breaks. Whereas other waveforms, such as the square wave exhibits fiite discotiuities. A advatage of the Fourier series is that it ca be applied to both cotiuous ad discotiuous waveforms.

Fourier Series The fudametal basis of the Fourier series is that a fuctio defied withi the iterval x ca be expressed as a coverget trigoometric series i the followig form; f(x) = a 0 + a 1 cosx + a 2 cos2x + a 3 cos3x + + b 1 six + b 2 si2x + b 3 si3x + where a 0, a 1, a 2, a 3 b 1, b 2, b 3 are real costats This ca be simplified to the followig; f(x) = a 0 + =1 (a cos x + b si x) (4) For the rage to ; a 0 = 1 2 a = 1 b = 1 f(x)dx f(x) cos x dx f(x) si x dx ( = 1, 2, 3 ) (6) ( = 1, 2, 3 ) (7) (5) A alterative way of writig the Fourier series above, which is of more relevace to digital sigal processig of complex electrical waveforms is derived from the followig relatioship; a cos x + b cos x = c si (x + α) (8) Applyig this to the Fourier series; f(x) = a 0 + c 1 si(x + α) + c 2 si(2x + α 2 ) + + c si (3x + α ) (9) a 0 is a costat c 1 = a 1 2 + b 1 2,. c = a 2 + b 2 are the magitudes of each coefficiet (10) α = arcta a b is the phase offset of each coefficiet (11) C represets the magitude of the th compoet, or th harmoic. Whe = 1, the harmoic is kow as the fudametal. α represets the phase agle of the th harmoic. It is at this poit that all of the mathematical tools required to decompose a periodic waveform have bee derived.

Mathematical Example, 2Vpk Square Wave I this example a 2Vpk (4Vpk-pk) square wave is decomposed ito its costituet harmoics. The fuctio for the above waveform is give by; Fig 1. 2, whe < x < 0 f(x) = 2, whe 0 < x < As the pure square wave fuctio is discotiuous, the itegratio will be performed i two discrete halves. Oe from - to 0 ad aother from 0 to. a 0 = 1 2 f(x)dx a 0 = 1 [ 0 2 dx + 2 2 dx] 0 (12) (13) a 0 = 1 {[ 2x] 0 2 + [2x] 0 } = 0 (14) a 0 equates to the mea value of the waveform (DC offset i electrical terms) over the complete fudametal period. 0 a = 1 [ 2 cos x dx + 2 cos x dx ] 0 (15) a = 1 2 si x 0 si x + 2 0 = 0 (16) Therefore, a 1, a 2, a 3 are all zero. 0 b = 1 [ 2 si x dx + 2 si x dx ] 0 (17) b = 1 cos x 2 0 cos x + 2 0 = 0 (18) whe is odd

b = 2 1 1 + 1 1 (19) b = k 2 + 2 = 4k as k = 2, b = 8 (20) (21) Therefore b 1 = 8, b 3 = 8 3, b 5 = 8 5 whe is eve b = 2 1 1 + 1 1 = 0 (22) b 1, b 2, b 3 = 0 Therefore, the Fourier series for the 2Vpk square wave is as follows; f(x) = a 0 + =1 (a cos x + b si x) (23) f(x) = 0 + =1 (0 + b si x) (24) f(x) = 8 six + 8 si3x + 8 si5x + (25) 3 5 f(x) = 8 (six + 1 si3x + 1 si5x + ) (26) 3 5 The magitude ad phase of each harmoic ca be computed as follows; c = a 2 + b 2 are the magitudes of each coefficiet (27) α = arcta a b is the phase offset of each coefficiet (28) For the 3rd harmoic; c 3 = 0 2 + 8 2 8 = 3 3 α = arcta 0 = 0 (30) 8 3 3rd Harmoic = 0.85V, 0 (29)

Harmoic Aalysis It is widely kow that may of the waveforms withi the electroics idustry ca be represeted by simple mathematical expressios. By utilisig the Fourier series, the magitude ad phase of the harmoics ca be derived. Some waveforms do ot fit ito this category ad aalysis of such waveforms is performed through umerical methods. Harmoic Aalysis is the process of resolvig a periodic, o-siusoidal waveform ito a series of siusoids of icreasig order of frequecy. Followig o from the mathematical expressios derived earlier i this applicatio ote, a umerical method is ow preseted which itroduces the fudametals behid the approach used withi harmoic aalyzers. Ultimately, Fourier coefficiets a 0, a ad b will eed to be determied - see equatios (5), (6) ad (7), this will require itegratio. Numerically, the itegral fuctios (5), (6) ad (7) ca be described as mea values, as follows; a 0 = 1 f(x)dx = 1 2 2 0 2 f(x)dx (5) a 0 = mea value of f(x) (31) a = 1 f(x) cos x dx = 1 2 f(x) cos x dx 0 ( = 1, 2, 3 ) (6) a = twice mea value of f(x) cos x (32) b = 1 f(x) si x dx ( = 1, 2, 3 ) (7) b = twice mea value of f(x) si x (33) This itegratio is performed withi the sigal processig elemets of a harmoic aalyzer (traditioally a DSP) with the trapezoidal rule. As most waveforms withi the realm of electroics are periodic, the period of the waveform ca be referred to as w (widow), which ca be divided up ito s (sample poits) of equal parts. Where d(time delta) is the time iterval i betwee the sample poits. A complex waveform is ow used as a example (fig.2) to illustrate how the waveform is sampled ad umerical Fourier aalysis methods are explaied. Fig 2.

Fig 3. = total umber of samples, i th sample, d = time betwee samples a 0 = Mea Value = a = 1 v[i] cos 2hi i=1 b = 1 v[i] si 2hi i=1 area legth of base = 1 2 2 v[i] i=1 = 1 v[i] i=1 (34) (35) (36) I electrical terms, a 0 is the DC offset, a is the quadrature compoet of the th harmoic, ad b is the iphase compoet of the th harmoic. Simple trigoometry ca be applied to derive the magitude ad phase of the harmoics.

As equatios 35 ad 36 represet the mea value of the harmoics, it is commo to refer to the equivalet RMS values, a scale factor of 2 is applied to achieve this. a = 2 b = 2 v[i] cos 2hi i=1 v[i] si 2hi i=1 (37) (38) Harmoic aalyzers make use of the trapezoidal rule to closely approximate the true value of the harmoic magitudes. It is logical to assume that a higher sample rate results better accuracy ad although this is the case i simplistic terms, the reality is more complicated as averagig reduces the effect of lower sample rates. That beig said, as per Nyquist's theorem, the samplig rate must be twice that of the badwidth of the measured sigal. FFT Applicatio All previous cotet withi this applicatio ote represets the DFT, this could be cosidered the purest of Fourier trasforms ad is the origial Fourier trasform. I 1965 Cooley ad Tukey published the geeric FFT algorithm ad the drive for this developmet was ot improved accuracy but it was improved computatio time. Whilst the FFT required less processig power, i a real world measuremet eviromet it is difficult for the FFT to provide the same accuracy as the DFT. The reasos for this are due to the fact that the FFT is restricted (by the ature of its "divide ad coquer" mathematical approach) to a widow size of 2 samples. If the sample rate were ifiitely variable, ad the fudametal frequecy of the waveform to be aalysed already kow - the it would be possible to vary the sample rate i order to esure a iteger umber of cycles are ecompassed withi the samplig widow. As it is ot practical i a real time measuremet eviromet to ifiitely vary the sample rate, it is almost impossible to esure a iteger umber of cycles are ecompassed by the samplig widow. Importat ote : If a exact iteger umber of cycles were able to be ecompassed withi the data acquisitio widow of the FFT the this algorithm would provide similar accuracies to the DFT. The restrictio of 2 samples ad fixed/discrete sample rates meas this is impractical ad the FFT caot offer the same flexibility ad accuracy i a real time measuremet eviromet. The result of icomplete cycles withi the samplig widow is kow as "harmoic leakage", i which harmoics "leak" ito adjacet harmoic eighbours, causig iaccuracies i the calculated results. I the aalysis below, a 1024 poit FFT was sampled at 10ks/s upo a 100Vpk, 25Hz waveform. Due to the ature of the FFT ad its restrictio to 2 samples, at this sample rate (which provides 5kHz measuremet badwidth - Nyquist's theorem) it is clear that the data acquisitio widow does ot ecompass a iteger umber of samples, the additioal udesirable samples are show i the red box i fig 4. Fig 4.

If a FFT harmoic spectrum aalysis is performed, sigificat harmoic leakage is evidet as a result of the o itegral cycle acquisitio. Fig 5. Various complex waveforms are ow aalyzed ad results from FFT ad DFT algorithms are compared. If the data acquisitio widow ecompasses a iteger umber of cycles, the harmoic leakage is sigificatly reduced. Although this is urealistic i a dyamic, real time measuremet eviromet this is performed for clarity of the mathematics i fig 6 ad fig 7. Fig 6. Fig 7. FFT Aalysis with ideal widow size

If the frequecy detectio or sample rate limitatio (ad subsequet widow size) drifts by oly 3~4Hz, the errors itroduced ito the FFT are quite sigificat. The graphs below illustrate this effect; Fig 8. Fig 9. Harmoic 1 (Fudametal) is sigificatly lower tha the 100Vpk origial compoet, there is also sigificat leakage ito other harmoics which i reality have o spectral voltage compoets. This is caused by the fact that the "sie ad cosie" multiplicatio of the FFT is ot performed at the correct harmoic frequecies, the fudametal compoet is i fact a 29.3Hz sie ad cosie multiplicatio. The FFT frequecies are derived from the sample rate ad the widow size. FFT Frequecy = fs sa = sample frequecy umber 1,2,3 1024, fs = sample rate, sa = umber of samples The FFT frequecy deotes the actual sie cosie calculatio, if the sample frequecy is ot ifiitely adjustable the FFT frequecies will be close but ot completely matchig the actual harmoic frequecies.

Error i FFT calculatio Harmoic Frequecy Actual (Vpk) Calculated with FFT Error % Fudametal 30.3Hz 100 97.25 2.75 2 60.6Hz 0 4.38 3 90.9Hz 0 2.65 4 121.2Hz 0 2.64 5 151.5Hz 20 12.68 36.59 6 181.8Hz 0 2.57 Table 1. The further the fudametal frequecies drift from the FFT frequecy, the greater the leakage ad greater the error i the measured harmoics. To Illustrate this effect, a fudametal frequecy of 31.3Hz (equatig to a drift of 2Hz) results i the followig spectral aalysis ad subsequet errors. Fig 10. Harmoic Frequecy Actual (Vpk) Calculated with FFT Error % Fudametal 30.3Hz 100 92.49 7.51 2 60.6Hz 0 7.62 3 90.9Hz 0 3.95 4 121.2Hz 0 2.67 5 151.5Hz 20 1.67 91.67 6 181.8Hz 0 2.03 Table 2. As previously metioed, it is impractical to achieve a exact iteger umber of waveform periods to fit withi the data acquisitio widow whe usig the FFT i a dyamic eviromet. It is therefore ot desirable to utilise the FFT Fourier aalysis techique i moder day power aalysis. There are widowig methods available to the egieer which will reduce the spectral leakage, these algorithms will improve values at some frequecies but also worse values at other frequecies. Ultimately, oe of the widowig algorithms available whe applied to a FFT will match the accuracy of the DFT.

DFT (Discrete Fourier Trasform) The Discrete Fourier trasform is able to resolve its samplig widow to ay iteger umber of samples, this equates to; widow resolutio = 1 fs I the time domai, this equates to a time resolutio of 100uS for a 10ks/s sample rate. If a 50Hz waveform is cosidered, its time period is 20ms. A 100us time resolutio eables the widow to perfectly ecompass both a 50Hz ad 50.25Hz, it is logical to coclude that a higher sample rate will result i greater frequecy resolutio as well as higher badwidth, if multiple cycles are used this resolutio is further improved. Newtos4th power aalyzers feature sample rates of 1Ms/s ad above, coupled with very accurate aalogue performace, this provides extremely sesitive ad accurate harmoic aalysis with fast update rates. Newtos4th Frequecy resolutio o a 50Hz waveform N4L PPA5500 widow resolutio(cycle by cycle) = 1 2Ms/s = 1 2 10 6 = 500S 1 N4L PPA5500 cycle by cycle frequecy resolutio o 50Hz waveform = 50 0.02 + 500 10 9 = 50 49.99875 = 0.001Hz The same waveform illustrated i fig.10 was used ad a DFT was performed, for a appropriate compariso the same 10ks/s sample rate was used. Whe utilisig a DFT waveform, it is possible to sychroise the data acquisitio widow to the fudametal time period with a resolutio of 1 sample poit. Oce this is performed, the DFT is able to calculate the harmoic compoets of the waveform very accurately. I this example the fudametal time period is calculated as follows; Fudametal Time Period = 1 = 1 = 0.0319 secods f fud 31.3 The umber of samples required to sychroise the data acquisitio widow to the fudametal time period is calculated as follows; No of samples required = fud time period sample time iterval = 0.0319 = 319.489 1 10000 The closest iteger umber of samples calculated is used as the data widow acquisitio size, N4L power aalyzers compute the fudametal frequecy "real-time" with a proprietary frequecy detectio algorithm withi a dedicated DSP. It should be apparet that for the DFT to be successful, frequecy detectio is of paramout importace, as all N4L power aalyzers utilise sample rates i excess of 1Ms/s, it is clear that the widow ad subsequet frequecy resolutio will be very accurate.

Fig 11. Fig 12. Figure 11 ad Figure 12 illustrate the effectiveess of the DFT eve whe utilisig low sample rates ad a sigle cycle. Higher sample rates ad multiple cycle aalysis will achieve greater accuracies through better widow sychroisatio (providig frequecy detectio is accurate) as well as greater averagig. Harmoic Frequecy Actual (Vpk) Calculated with FFT Error % 1 31.300 100.000 100.063 0.063 2 62.600 0.000 0.175 3 93.900 0.000 0.057 4 125.200 0.000 0.056 5 156.500 20.000 20.077 6 187.800 0.000 0.447 0.447 Table 3. The calculated error achieved with the DFT is sigificatly better tha the equivalet FFT, further beefits of the DFT iclude the flexibility of the data acquisitio widow providig cycle by cycle aalysis of ay waveform without the restrictios of 2 FFT widowig.

Referece Measuremets A N4L PPA5500 Precisio Power Aalyzer, which utilises a DFT Harmoic Aalysis algorithm was bech tested agaist the Fluke 6105A power stadard. The tests were carried out withi the UKAS ISO17025 Test Laboratory (Lab o. 7949) based at N4L Headquarters i the UK, results from the tests are show below; Fluke 6015A Calibratio of PPA5530 Power Aalyzer - No Adjustmet Harmoic Frequecy Applied (Vpk) Measured Error Ucertaity 1 31.3 100 99.977 0.02% 0.01% 2 62.6 0 <10mV NA NA 3 93.9 0 <10mV NA NA 4 125.2 0 <10mV NA NA 5 156.5 20 19.994 0.03% 0.03% 6 187.8 0 <10mV NA NA The errors above represet the total error of the measuremet istrumet, icludig the error of the aalogue iput chaels. This calibratio procedure demostrates the power of the DFT whe combied with extremely liear aalogue iput desig. Summary Whilst the FFT has its place withi the electrical egieerig field, for high accuracy power aalysis the FFT is ot the optimum solutio. A high ed power aalyzer will eed to meet the demads of moder idustry i which harmoic distortio of varyig fudametal frequecies is required to be measured. It is the resposibility of the power aalyzer maufacturer to itegrate sufficietly powerful processors ad iovative digital sigal processig techiques i order to meet the computatioal demads of the DFT. All N4L power aalyzers have bee developed with this approach i mid ad years of experiece fie tuig both aalogue hardware performace ad DFT sigal processig algorithms have resulted i a extremely accurate solutio uder a wide rage of iput waveforms. For more iformatio about ay of the Newtos4th Power Aalyzers, visit http://www.ewtos4th.com/products/power-aalyzers/ Author : Sales ad Applicatios Egieerig, Newtos4th Ltd, UK Refereces [1] J. Bird, Higher Egieerig Mathematics - Fifth Editio, Elsevier, 2006