8
Ž . Computer Standards & Interfaces 22 2000 261–268 www.elsevier.comrlocatercsi Evaluation of sine wave tests of ADCs from windowed data Istvan Kollar ) ´ ´ Department of Measurement and Information Systems, Technical UniÕersity of Budapest, H-1521 Budapest, Hungary Accepted 6 June 2000 Abstract Recently, much excitement has been caused in the EUPAS group by the evaluation of the IEEE 1241 draft standard. This draft contains a lot of useful information and several well-established facts. However, there are also some details that are not fully clarified, or need further examination. This paper deals with one of these: the possibility of data processing based on windowed data. q 2000 Elsevier Science B.V. All rights reserved. Keywords: IEEE-STD-1241; Windowing; Windowed data; Sine wave method; EUPAS 1. Introduction Finite record length effects may deteriorate the results of measurements with sinusoidals signifi- cantly. The draft standard recognizes this fact and, at several places, advocates coherent sampling. This means that in a test, an integer number of periods needs to be taken, that is, m i f s f , 1 Ž. i s M where f is the frequency of the sine wave, m is an i i integer less than Mr2, M is the number of samples Ž in the record, and f is the sampling frequency cf s wx . 1 4.1.5.1 . ) Tel.: q 36-1-463-1774; fax: q 36-1-463-4112. E-mail address: [email protected] Ž . www: http:rrwww.mit.bme.hur;kollar I. Kollar . ´ It is right indeed that whenever possible, coherent Ž . sampling is the proper choice Fig. 1 . However, when incoherent sampling may occur Ž Ž. Ž. Ž .. see i and ii above Eq. 4.1.5.1.3 , windowing is almost unavoidable. In the following sections, we are going to discuss the consequences of applying win- dows in detail. Ž . Fig. 1. Discrete Fourier transform DFT result of a coherently sampled sinusoidal. M s128, f s20. i 0920-5489r00r$ - see front matter q 2000 Elsevier Science B.V. All rights reserved. Ž . PII: S0920-5489 00 00049-0

Evaluation of sine wave tests of ADCs from windowed data

  • Upload
    istvan

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Ž .Computer Standards & Interfaces 22 2000 261–268www.elsevier.comrlocatercsi

Evaluation of sine wave tests of ADCs from windowed data

Istvan Kollar )´ ´Department of Measurement and Information Systems, Technical UniÕersity of Budapest, H-1521 Budapest, Hungary

Accepted 6 June 2000

Abstract

Recently, much excitement has been caused in the EUPAS group by the evaluation of the IEEE 1241 draft standard. Thisdraft contains a lot of useful information and several well-established facts. However, there are also some details that are notfully clarified, or need further examination. This paper deals with one of these: the possibility of data processing based onwindowed data. q 2000 Elsevier Science B.V. All rights reserved.

Keywords: IEEE-STD-1241; Windowing; Windowed data; Sine wave method; EUPAS

1. Introduction

Finite record length effects may deteriorate theresults of measurements with sinusoidals signifi-cantly. The draft standard recognizes this fact and, atseveral places, advocates coherent sampling. Thismeans that in a test, an integer number of periodsneeds to be taken, that is,

mif s f , 1Ž .i sM

where f is the frequency of the sine wave, m is ani i

integer less than Mr2, M is the number of samplesŽin the record, and f is the sampling frequency cfs

w x .1 4.1.5.1 .

) Tel.: q36-1-463-1774; fax: q36-1-463-4112.E-mail address: [email protected]

Ž .www: http:rrwww.mit.bme.hur;kollar I. Kollar .´

It is right indeed that whenever possible, coherentŽ .sampling is the proper choice Fig. 1 .

However, when incoherent sampling may occurŽ Ž . Ž . Ž ..see i and ii above Eq. 4.1.5.1.3 , windowing isalmost unavoidable. In the following sections, we aregoing to discuss the consequences of applying win-dows in detail.

Ž .Fig. 1. Discrete Fourier transform DFT result of a coherentlysampled sinusoidal. Ms128, f s20.i

0920-5489r00r$ - see front matter q 2000 Elsevier Science B.V. All rights reserved.Ž .PII: S0920-5489 00 00049-0

( )I. KollarrComputer Standards & Interfaces 22 2000 261–268´262

2. Modeling a sine wave

The cause of many problems is the fact thattheoretically, the Fourier transform of a sine waveconsists of two Dirac delta functions at the appropri-ate frequencies:

FF Acos 2p f tqf� 4Ž .i

A Ajf yjfs e d fy f q e d fq f . 2Ž . Ž . Ž .i i2 2

In a strict sense, this does not exist and in mea-surements, we obtain only a secondary function basedon this. We collect samples from a finite-lengthrecord. This operation can be modeled by cutting outthe finite-length record from the infinite-length sinu-soidal applying multiplication by a window function.The equivalent of this multiplication is a convolutionin the frequency domain:

FF Acos 2p f tqf w t� 4Ž . Ž .i

A Ajf yjfs e W fy f q e W fq f . 3Ž . Ž . Ž .i i2 2

The consequence of discrete processing is, first ofall, that the shape of the above-described windowfunction slightly changes because of aliasing, so theresults for continuous-time windows only approxi-mately hold. In other words, the window shapebecomes slightly dependent on the number of sam-ples, M. Second, in the discrete Fourier transformŽ .DFT we see only the samples of the discrete-timewindow, taken at the frequency bins of the DFT:

fsf sk skD f . 4Ž .k M

Now, the problem we will try to solve is thefollowing: we have M samples in the time or in thefrequency domain, corrupted by some noise and bysome distortion components. From these samples, wewould like to determine the parameters of the sinewave as precisely as possible, then subtract it fromthe samples, and evaluate the rest for Signal-to-Noise

Ž .and Distortion Ratio SINAD , Total Harmonic Dis-Ž .tortion THD , etc., which may also be using the

amplitude of the sinusoidal.

In the case of no extra windowing, we have theso-called rectangular window. For the continuous-time case:

1 if 0F tFTw t s 5Ž . Ž .rect ½ 0 otherwise

sin p f TŽ .jp f TW f se T . 6Ž . Ž .rect

p f T

When we apply the DFT to discrete points, wehave the following:

1 for 0F iFMy1w i s 7Ž . Ž .rect ½ 0 otherwise.

The DFT is clearly a delta function at zero, andzero elsewhere. However, when writing the N-pointDFT, we see more:

ksin p Mž /Njp kW k se . 8Ž . Ž .rect , MrN k

sin pž /N

Ž .The absolute value of W k is shown inrect, MrN

Fig. 2.The records that are obtained by coherent sam-

pling are easy to use. As long as the time domainwindow consists of at most a few low-frequencysinusoids whose frequencies correspond to the DFT

Ž .bins it is a harmonic window , the frequency do-

Fig. 2. DFT of the rectangular window, Ns128, Ms16.

( )I. KollarrComputer Standards & Interfaces 22 2000 261–268´ 263

Fig. 3. Hanning window in the frequency domain, Ns128,Ms16.

main equivalent of the window contains zeros atdistances nD f from the center. As an example, let us

Ž .consider the Hanning window Fig. 3 .

1w t s 1ycos 2p t w t 9Ž . Ž . Ž .H rectž /ž /T

W fŽ .H

1 1s d f y0.5d fy y0.5d fqŽ . ž / ž /ž /T T

=)W fŽ .rect

1sW f y0.5W fyŽ .rect rect ž /T

1y0.5W fq . 10Ž .rect ž /T

The formulae are similar for the discrete case.Apart from the main lobes, the repeated rectangu-

lar windows have zeros at the same places. Thismeans that in the Fourier transform there is only alarge central peak, while the sinusoid has no effecton the other bins. Therefore, coherent sampling isusually insensitive to harmonic windowing. We willcome back to this later. Let us discuss now what weare interested in: how the Fourier transform is ob-tained in the case of incoherent sampling.

3. Discussion

Usually, we have one or maximum 2–3 sinusoidalsignals. We are not primarily interested in them, butrather in the rest of the spectrum. We usually wish to

remove them as profoundly as possible since theremaining part is the error that we want to measure.The basic steps are as follows:

Ø determine the sine parameters from the record,Ž . Ž .Ø subtract suppress the sine s ,

Ø analyze the residuals.

3.1. Determination of the sine parameters

Let us look first at a typical DFT result calculatedfrom incoherently sampled data.

In Fig. 4, we see in the individual bins thesamples of the window function, positioned aroundthe frequency of the sine wave. The exact frequencyof the sine wave is somewhere between the adjacentlarge peak pairs. The true frequency of the sine waveis, at most, D fr2 from the place of the maximumpeak, and the maximum peak is also down from the

Ž .theoretical value equal to 64 .This inaccuracy is far too large for our purpose,

especially because the value of the maximum alsomay vary down to about 64% of the true value.There are basically two approaches to tackle theseproblems.

By the nonparametric approach, we can signifi-cantly improve the approximation of the maximum

w xvalue by applying the so-called flat top window 2 .By this, we modify the shape of the window so thatthe value of the window we achieve is essentiallyconstant in the frequency domain between

Fig. 4. Typical DFT of an incoherently sampled sine wave,f s20.3.i

( )I. KollarrComputer Standards & Interfaces 22 2000 261–268´264

Fig. 5. Incoherent sampling processed with flat top window.

w ]yD fr2,D fr2 . In Fig. 5, the maximum amplitudeŽerror is about 0.2% the difference between heights

of the lines, being at a distance D f from each other,.is much larger . However, the determination of the

frequency is still not improved — we can only usethis method for our purpose when the frequency ofthe sine wave is known. If we know both the ampli-tude and the frequency, the determination of thephase is a straightforward process.

3.1.1. Parametric model fittingA more useful approach is parametric model

fitting. This can be performed in the time domain orin the frequency domain. Intuitively, it is clear thatwhen performed properly, the procedures in the twodomains are essentially equivalent. In any case, thebasic idea is that we assume a certain model of the

Ž .signal e.g., sine wave or waves and of the noiseŽ .e.g., white, etc. , and determine the parameters fromthe model that fits the measured data best.

There is, however, a fundamental problem. Wecan solve the proper fitting of the model if the modelis valid. When any non-modeled phenomenon oc-curs, even the best method may yield wrong results.For example, in the case of incoherent sampling, any

Ž .other harmonics e.g., harmonic distortion may dis-turb the fitting procedure. Then, the consequence isthat the parameters are imprecise, and therefore theremoval of the sine wave is inaccurate. The error wecommit may be in the same order of magnitude asthe residuals we want to evaluate. This can be a

wserious problem in the four-parameter method 1,x4.1.4.3 .

A possibility to circumvent the above difficultiesis to model eÕery important harmonic, which may bepresent, and after the fit, remove the fundamentalsine wave only. The difficulty is that it is generallyvery difficult to select the frequencies where suchharmonics are present. Selecting too many harmonicscan make the algorithm slow and sensitive to localminima. The only reasonable way is to extend thefour-parameter method through a mechanism, whichtakes into account that most of such components areharmonically related to each other. Therefore, whilethere are several components, their frequencies are

Ž .described by a single parameter, v , and the fixedi

harmonic numbers only. This work does not provideany description of this approach because of thepossible difficulty in tackling premature complica-tions.

The equivalent of the four-parameter method, orthe extension of its components, is to fit the DFTresult by a scaled version of the frequency domainform of the discrete window, or by a set of suchwindows. This is generally more complex comparedto the time domain, so we do not discuss it further.

When we want to avoid the above-described com-plex modeling, and still want to determine the pa-rameters of the sine wave properly, the best way is tomake sure that the different the harmonics do notdisturb the estimates of each other. This is the basicidea of windowing.

3.1.2. WindowingFrom Fig. 4, it is obvious that each incoherently

sampled sine wave results in components at the otherŽ .frequency bins leakage . The cause is the form of

the rectangular window: its sidelobes are too large.The idea is then to modify the shape of the windowfunction to have as small sidelobes as it is possible.

Here, there are two approaches again. One is theuse of so-called harmonic windows: windows thatare the sum of a few low-frequency sinusoidal func-tions, which therefore have a series of zeros for

Ž Ž ..coherent sampling see Eq. 10 . This gives thew xso-called Blackman–Harris windows 3,4 .

However, we can realize that the requirement ofŽ .zeros for coherent sampling is not necessary. We

can speculate that it is enough to prescribe that thesidelobes do not surpass a certain level. This leads to

( )I. KollarrComputer Standards & Interfaces 22 2000 261–268´ 265

the designed low-ripple windows, like the KaiserŽ . w xKaiser–Bessel window 3,4,9 or the Dolph–

w xChebyshev one 3,4,8 .In general, we may observe that when we pre-

scribe the frequency domain behavior and wish todesign a symmetric time series to this, we just designa linear phase FIR filter. Consequently, any goodFIR filter design algorithm, e.g. the well-knownREMEZ algorithm can be used to attain the bestwindow obtainable.

It is true for each window that sidelobe suppres-sion is at the cost of widening the main lobe. There-fore, windowing somewhat decreases selectivity:non-overlapping components may not be closer than

Ž .a few bins a few times D f . Therefore, the fre-quency of the sine wave must be larger than a fewtimes D fs f rM for proper processing.s

In the light of the above discussion, we canŽwprobably refine the statement in the draft 1, Section

x4.1.5 : AThe window functions are chosen in a trade-Ž .off between the effective noise bandwidth ENBW ,

or resultant DFT bins, and minimum stopband re-sponse of the window filter function as discussed inthe following clause.B In the above light, ENBW isnot very important. The proper selection of the win-dow function can be as follows: select the one withthe allowed stopband response, with the smallestmain lobe bandwidth1 possible. Now, the value ofthe ENBW will be determined by the window: it canbe appropriately calculated from the window sam-ples. However, its definition may deserve a littleexplanation. First of all, let us observe that it is

Žamplitude-scaling-independent, and its value see Eq..4.1.5.1.4 is exactly 1 for the rectangular window.

Let us first discuss the scaling of the windows.There are a few strategies for this. We can

Ž .a keep the scaling of the frequency domain peaksŽof sinusoidals constant that is, maintain the

.same value of the time domain integral , orŽ .b keep the variance of a white noise sequence

constant.

1 Keeping sine waves in mind, let us define the width of themainlobe as the distance between the two stopbands, because thisdetermines the minimum necessary distance between non-overlap-ping harmonics.

In this paper, we follow the first strategy. By thismethod, the height of the peak of the Fourier trans-form of a sine wave is the same as without window-ing.2

For random signals, we cannot give a measure interms of the amplitude, only in terms of the standarddeviation or the variance. The integral of the window

Žfunction remains constant the denominator in the.expression of the ENBW , while the variance changes

for white noise by the following factor:

My112w nŽ .Ý My11M ns0 2K s s w nŽ .Ývar – ch My11 M ns02w nŽ .Ý rectM ns0

sENBW. 11Ž .

Because of Parseval’s theorem, this is also true in thefrequency domain:

My12W kŽ .Ý My11ks0 2K s s w nŽ .Ývar – ch My1 M ns02W kŽ .Ý rect

ks0

sENBW. 12Ž .

Therefore, the ENBW accounts for the change inthe noise variance. It is equal to the multiplicativeterm, and its square root corresponds to the multi-plicative term in the standard deviation.

We know now how the amplitude of the trans-form of a windowed sine wave changes, and we alsoknow how the variance or the standard deviation ofthe noise peaks change. The last thing we have todiscuss is whether the power of a sine wave can alsobe calculated from the spectrum without the neces-sity of calculating the amplitudes. Here, the preciseanswer is unfortunately no. The sum of squares of

2 This is at least theoretically true — for non-coherent sam-pling the maximum value of the spectrum can be smaller, depend-ing on the frequency mismatch and the shape of the window. Thesmaller the frequency mismatch, the closer the maximum to thetheoretical value is.

( )I. KollarrComputer Standards & Interfaces 22 2000 261–268´266

Fig. 6. Value of the power calculated from the adjacent lines, as afunction of the frequency. Kaiser window with betas3, Ms128.The values practically do not depend on the phase, at least for thegiven window and frequency range.

the frequency domain samples gives the power of thesine in the window, and this can be different fromthe power of the continuous-time signal. However,the deviation is usually not large. If we need the

Žapproximate power of the harmonic as for the total.harmonic distortion , the sum of the squares of the

frequency domain samples, divided by ENBW andby M, gives an approximate value of the power. The

Ž .result is not fully accurate see Fig. 6 since itslightly depends on the frequency of the sine, butwill still yield a good enough approximate value ofthe power we are looking for.

Now that we successfully separated the effect ofthe different harmonics, we can turn back again tothe determination of the parameters. Now our prob-lem is simplified to the following one: given a few

Žfrequency domain samples around the sine fre-.quency , determine the parameters.

The standard way for this is the so-called Interpo-w xlated FFT 5 . This is a set of algorithms which,

based on some approximation, determine the parame-ters of the sine wave from the samples around themaximum. This gives a good estimate of the ampli-tude and of the frequency.

Another possibility is as follows. In testing, weusually have some time for off-line calculations.There is a simple algorithm for this purpose. If weselect all the samples from the main lobe and set therest to zero, we have with, good approximation, theFourier transform of a windowed sine wave. Taking

the IDFT of the two selected line groups, we obtainthe time samples of the windowed sine wave. When

Ždividing by the window function and discardingthose values which are divided by a very small

.number where the window function is close to zero ,we can use the four-parameter method to determinethe desired parameters. This fairly simple procedurehas not been described in the draft yet.

3.2. Proper remoÕal of the sine components

As we already mentioned above, removal of thesine is only effective if the sine parameters areprecisely known. Inaccurate estimation of the param-eters is usually a problem because the sides of thesidelobes in Fig. 2 are steep, so a small error in theremoval may cause a large residual. This is the mainissue for windowing: we have to accept that thevalues of the sine parameters are not exact, but ifcorrection is necessary, which is comparable to the

Žquantities to measure harmonic distortion compo-.nents, noise , accurate characterization of the ADC is

illusory.The removal is fairly easy when there are no

significant sidelobes. We simply discard the group ofthe few large samples. We can even subtract the sinefrom the samples, take the ordinary DFT without

Žwindowing or with some windowing again for thedetermination of the largest peaks, like needed for

Ž ..Spurious-Free Dynamic Range SFDR , and evalu-ate the result.

3.3. Analysis of the residuals

As we have seen above, we can have both thewindowed and the non-windowed version of theresiduals, as we like. The only question is whichmethod is sensitive to incoherent sampling, and whatis the result of windowing.

3.3.1. THDwThe draft standard says about the THD 1, Section

x4.1.5 test:

The test described above is based on DFT analy-Ž .sis e.g., via DFT on unwindowed sample sets

. . .

( )I. KollarrComputer Standards & Interfaces 22 2000 261–268´ 267

Windowing is not recommended for these proce-dures due to the widening of resolution band-width.

Based on the above discussions, we can state thefollowing. If we talk about the effect of periodiccomponents, like in the case of the THD, it is logicalto use a close-to-flat-top window after the removalof the sine wave. The precision of the flatness de-pends on the requirement for the measurement of theamplitudes: this is usually not very strict. Read theamplitudes, and sum up the power accordingly. Theprice we pay is that the noise floor increases, and wemust not haÕe harmonics too close to each other.These disadvantages are usually tolerable.

Another possibility is to select the GROUPS ofŽlines belonging to the harmonic peaks the number

.depends on the window , add the squared absolutevalues together, and divide by the ENBW and M 2.This will give a good estimate of the power of theharmonic, with lower noise floor.

3.3.2. SFDRThe standard does not discuss the effect of win-

w xdowing to the SFDR 1, Section 4.4.5.3 . However,the calculation is straightforward: take the average ofthe windowed DFTs calculated with an approximate

Žflat top window with possibly small bandwidth to.prevent aliasing , and look for the largest peak.

3.3.3. SINADHere, we want to calculate the power of the

w xresiduals to have the SINAD 1, Section 4.5.1 . Thisis straightforward again: use the non-windowedresiduals, and add the squared absolute Õalues, ordo the same with windowed data, and divide by theENBW value. The trick is NOT to take the maxi-mum values of the harmonic peaks, since these donot change with ENBW, but calculate the total pow-ers.

3.3.4. ENOBw xThe effective number of bits 1, Section 4.5.2 is

directly calculated from SINAD, therefore the re-marks of the previous paragraph apply.

4. Suggestions

In the previous sections, we have formulated sug-gestions to extend and improve the draft standardIEEE 1241. We feel, however, that the design ofwindow functions — displaying their properties,evaluating complex algorithms with no programmingbugs, etc. — is a difficult task for most users. On theother hand, nobody can undertake the job of develop-

Žing all algorithms ready-to-use, but also flexible.enough for special purposes for all computers. The

suggestion is that EUPAS, in a joint effort with thedraft committee, make model algorithms publiclyavailable via a website to enable users to comparetheir algorithms with standard ones, thus offeringquick solutions for a few cases. The author is readyto work on such an undertaking based on Matlabitself and on function M-files.

Acknowledgements

The author expresses his thanks to Jozsef Nemeth´ ´and Laszlo Sujbert for critical remarks and sugges-´ ´tions concerning this paper.

References

w x Ž .1 L. Schnell Ed. , Technology of Electrical Measurements,Wiley, Chichester, 1993, pp. 249–380.

w x2 A.H. Nuttall, Some windows with very good sidelobe behav-Ž .ior, IEEE Trans. Acoust, Speech, Signal Process. 29 1

Ž .1981 84–89, Feb.w x3 F.J. Harris, On the use of windows for harmonic analysis with

Ž . Ž .the discrete Fourier transform, Proc. IEEE 66 1 197851–83, Jan.

w x4 J. Schoukens, R. Pintelon, H. Van hamme, The interpolatedfast fourier transform: a comparative study, IEEE Trans. In-

Ž . Ž .strum. Meas. IM-41 2 1992 226–232, April.w x5 N.C. Geckinli, D. Yavuz, Discrete Fourier Transformation and

Its Applications to Power Spectra Estimation, Elsevier, Ams-terdam, 1983.

w x6 L.R. Rabiner, B. Gold, Theory and Application of DigitalSignal Processing, Prentice-Hall, Englewood Cliffs, 1975.

( )I. KollarrComputer Standards & Interfaces 22 2000 261–268´268

Istvan Kollar was born in Budapest,´ ´Hungary, in 1954. He graduated in 1997with a degree in Electrical Engineeringfrom the Technical University of Bu-dapest. In 1985, he received the degree

ŽACandidate of SciencesB the equivalent.of PhD , and in 1997, the degree ADoc-

tor of the AcademyB — both from theHungarian Academy of Sciences. He isa professor of Electrical Engineering atthe Budapest University of Technologyand Economics.In 1989–1990, he was visiting scientist

at the Vrije Universiteit Brussel, Belgium. In 1993–1995, he wasa Fulbright scholar and visiting associate professor in the Depart-ment of Electrical Engineering at Stanford University.His research interests span the areas of digital and analog signalprocessing, measurement theory, and system identification. He haspublished about 70 scientific papers, and he coauthored the book:

Ž . ŽSchnell L. Ed. : Technology of Electrical Measurements Wiley,.1993 . He authored the Frequency Domain System Identification

Toolbox for Matlab.Between 1988 and 1991, he was Editor of Periodica PolytechnicaSer. Electrical Engineering, and afterwards, until 1997, he wasChief Editor of Periodica Polytechnica.Dr. Kollar is a Fellow of the IEEE. He is an active member of´EUPAS.