Numerical Integration Procedures in Computing the DFTt

Because of the characteristics of digitizing equipment, the samples in a digitized data record are generally evenly spaced. Numerical integration procedures based on evenly spaced data are called Newton-Coates methods. A number of different Newton-Coates methods are available, and the effect of the choice of an integration method on the quality of the results should be examined.

The objective in calculating the DFT is to evaluate integrals of the form

Подпись:where

or

t See Hunt (6).

We must make assumptions on the shape of y(t) between sampling points in formulating different numerical integration schemes. Each different inte­gration procedure is based on a different assumption on the shape of y(t) between samples. For the specific case of evaluating the DFT, we have complete knowledge of the behavior of one of the factors (sin cot or cos cot) in y(r). Thus we may develop our numerical integration procedure either by making an assumption on the form of y(t) between points or by making an assumption on x(t) between points.

Let us consider first the simplest numerical procedure, which involves a direct evaluation of Eq. (4.3.5). (We will use the complex form to simplify the discussion, but the reader will appreciate the equivalence with an analysis based on the trigonometric form.)

F'(jco) = (l/N) £ XP exp( ~jo)tp) (4.5.4)

P = 0

or

Подпись: (4.5.5)Подпись: (4.5.6)F’Ucj) = (l/N) £ xpe-^’

P = 0

This is equivalent to

F'(ja>) = X УР

p-0

image71

y(t)

t

Fig. 4.8. Interpolation assumption in trapezoid rule.

where yp = (l/N)xpe~JapM. Now consider the numerical integration scheme based on the assumption that y(r) varies linearly between points (see Fig. 4.8). This is called the trapezoid rule. In this case,

f y(t) dt = {y(tp) + ±[y(tp+ j) — y(rp)]} Ar = |[y(tp+ j) + y(tp)] At (4.5.7)

J‘p

image129

image200

F(jco) = (l/N)^ xpe-^ (4.5.10)

P= 0

is based on a trapezoid rule integration of the function x(t)e~jmt. We will call this the trapezoid DFT.

 

X(t)

 

f— 1

 

Fig. 4.9. Staircase interpolation of data

 

We now will consider other numerical DFT procedures that are based on assuming the form of x(t) between points. As a first choice, let us assume that x(t) is a staircase function (see Fig. 4.9). The DFT is given by

 

image201

jco At

 

image72

The second factor is identical with the trapezoid DFT result of Eq. (4.5.10). Thus we see that the staircase DFT is related to the trapezoid DFT by a simple factor. If the analyst has reason to believe that x(t) is nearly a stair­case function, then results from a trapezoid DFT may be transformed into the staircase DFT using Eq. (4.5.11).

Подпись: F"{ju} image204 Подпись: (4.5.12)

Another approximation is that x(t) varies linearly between points. We will call this the ramp DFT. The reader should note that this is not the same as assuming that x(t) e~jat varies linearly between points as in the trapezoid DFT. It may be shown that an integration based on this assumption gives

This shows that the ramp DFT may be obtained by multiplying the trapezoid DFT by

(1 — e^’Xl — 2[1 — cos(w At)]

(со At)2 (со At)2 1 ‘

As with the staircase DFT, the ramp DFT may be obtained by multiplying the trapezoid DFT by a simple factor.

It should be noted that the correction factors will cancel if the ratio of two DFTs is calculated. Thus the corrections to the DFT are unnecessary in that case, but the individual DFTs may differ significantly from exact results.

TABLE 4.2

DFT Analysis of a Square Wave

Number of samples per

period

Har­

monic

Trapezoid DFT

Staircase DFT

Ramp DFT

Exact

Real

Imagin­

ary

Real

Imagin­

ary

Real

Imagin­

ary

Real

Imagin­

ary

2

і

1

0

0

-0-637

0.405

0

0

-0.637

2

2

0

0

0

0

0

0

0

0

2

3

1

0

0

-0.212

0.045

0

0

-0.212

2

4

0

0

0

0

0

0

0

0

2

5

1

0

0

-0.127

0.016

0

0

-0.127

2

6

0

0

0

0

0

0

0

0

10

1

0.200

-0.616

0

-0.637

0.194

-0.596

0

-0.637

10

2

0

0

0

0

0

0

0

0

10

3

0.200

-0.145

0

-0.212

0.147

-0.107

0

-0.212

10

4

0

0

0

0

0

0

0

0

10

5

0.200

0

0

-0.127

0.081

0

0

-0.127

10

6

0

0

0

0

0

0

0

0

The correction of the trapezoid DFT to give the staircase DFT and the ramp DFT may be demonstrated with two examples. Consider first a square wave. The staircase DFT should give exact results. (See Section 2.5 for an evaluation of the exact results.) Table 4.2 shows trapezoid DFT results and results obtained using Eqs. (4.5.11) and (4.5.9) to convert trapezoid DFT results into staircase DFT results and ramp DFT results for several different numbers of samples. The corrected staircase results agree perfectly with the exact theoretical values. A second example involves the triangular wave shown in Fig. 4.10. In this case, the ramp DFT should give exact results. Table 4.3 shows trapezoid DFT results and results obtained using Eq. (4.5.19). Again we find that the appropriate correction procedure gives the exact result.

image73

Fig. 4.10. A triangular wave.

TABLE 4.3

DFT Analysis of a Triangular Wave

Number of points per

period

Har­

monic

Trapezoid DFT

Staircase DFT

Ramp DFT

Exact

Real

Imagin­

ary

Real

Imagin­

ary

Real

Imagin­

ary

Real

Imagin­

ary

8

і

0

-1.707

-0.637

-1.537

0

-1.621

0

-1.621

8

2

0

0

0

0

0

0

0

0

8

3

0

0.293

0.212

0.088

0

0.180

0

0.180

8

4

0

0

0

0

0

0

0

0

8

5

0

-0.293

-0.127

0.053

0

-0.065

0

-0.065

8

6

0

0

0

0

0

0

0

0

16

1

0

-1.642

-0.318

-1.600

0

-1.621

0

-1.621

16

2

0

0

0

0

0

0

0

0

16

3

0

0.202

0.106

0.159

0

0.180

0

0.180

16

4

0

0

0

0

0

0

0

0

16

5

0

-0.090

-0.064

-0.043

0

-0.065

0

-0.065

16

6

0

0

0

0

0

0

0

0