12
Metrol. Meas. Syst., Vol. XVIII (2011), No. 3, pp. 379-390. _________________________________________________________________________________________________________________ Article history: received on May 20, 2011; accepted on June 2, 2011; available online on Sep. 26, 2011. METROLOGY AND MEASUREMENT SYSTEMS Index 330930, ISSN 0860-8229 www.metrology.pg.gda.pl CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION OF THE WINDOW SPECTRUM BY LEAST SQUARES METHOD Józef Borkowski Wroclaw University of Technology, Chair of Electronic and Photonic Metrology, ul. B. Prusa 53/55, 50-317 Wroclaw, Poland ([email protected]) Abstract This paper presents the general solution of the least-squares approximation of the frequency characteristic of the data window by linear functions combined with zero padding technique. The approximation characteristic can be discontinuous or continuous, what depends on the value of one approximation parameter. The approximation solution has an analytical form and therefore the results have universal character. The paper presents derived formulas, analysis of approximation accuracy, the exemplary characteristics and conclusions, which confirm high accuracy of the approximation. The presented solution is applicable to estimating methods, like the LIDFT method, visualizations, etc. Keywords: data window, spectrum approximation, interpolated DFT, LIDFT, spectrum estimation, zero padding. © 2011 Polish Academy of Sciences. All rights reserved 1. Introduction The least-squares approximation of the data window frequency characteristics with appropriate linear functions is used in the linear interpolation of the discrete Fourier transform (LIDFT) [1-3] and the zero padding can also be used with this approximation to increase approximation accuracy [4]. Linear approximation of the spectrum allows for linearizing relationships to determine component frequencies and this feature of the LIDFT method differs it from other methods of signal estimation [5-13]. The piece-wise linear DFT approximation is used in [14] but in the simple form, not by least squares method. In the methods described in [1-4] the approximation function is discontinuous, which can be inadvisable in some applications. The paper removes discontinuity from the approximation function and is organized as follows. Symbols and basic equations are defined in Section 2. In section 3 the approximation from [4], with zero padding technique, is presented in more general form than in previous papers [1-4]. Afterwards the alternative approximation is analysed in Section 4. Section 5 describes how the formulas for continuous approximation function are obtained and Section 6 presents the exemplary characteristics for a triangle data window. 2. The data window frequency characteristic The data window frequency characteristic W(λ) is given by equation: - + = π - = 1 / j2 0 0 ) ( N n n n N n n e w W λ λ , (1) where: λ = fNT is the normalized frequency (in [bins]), f is the frequency in [Hz], T is the

CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

Metrol. Meas. Syst., Vol. XVIII (2011), No. 3, pp. 379-390.

_________________________________________________________________________________________________________________ Article history: received on May 20, 2011; accepted on June 2, 2011; available online on Sep. 26, 2011.

METROLOGY AND MEASUREMENT SYSTEMS

Index 330930, ISSN 0860-8229 www.metrology.pg.gda.pl

CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION OF THE WINDOW SPECTRUM BY LEAST SQUARES METHOD Józef Borkowski Wroclaw University of Technology, Chair of Electronic and Photonic Metrology, ul. B. Prusa 53/55, 50-317 Wroclaw, Poland (�[email protected])

Abstract

This paper presents the general solution of the least-squares approximation of the frequency characteristic of the data window by linear functions combined with zero padding technique. The approximation characteristic can be discontinuous or continuous, what depends on the value of one approximation parameter. The approximation solution has an analytical form and therefore the results have universal character. The paper presents derived formulas, analysis of approximation accuracy, the exemplary characteristics and conclusions, which confirm high accuracy of the approximation. The presented solution is applicable to estimating methods, like the LIDFT method, visualizations, etc.

Keywords: data window, spectrum approximation, interpolated DFT, LIDFT, spectrum estimation, zero padding.

© 2011 Polish Academy of Sciences. All rights reserved

1. Introduction

The least-squares approximation of the data window frequency characteristics with

appropriate linear functions is used in the linear interpolation of the discrete Fourier transform (LIDFT) [1-3] and the zero padding can also be used with this approximation to increase approximation accuracy [4]. Linear approximation of the spectrum allows for linearizing relationships to determine component frequencies and this feature of the LIDFT method differs it from other methods of signal estimation [5-13].

The piece-wise linear DFT approximation is used in [14] but in the simple form, not by least squares method. In the methods described in [1-4] the approximation function is discontinuous, which can be inadvisable in some applications.

The paper removes discontinuity from the approximation function and is organized as follows. Symbols and basic equations are defined in Section 2. In section 3 the approximation from [4], with zero padding technique, is presented in more general form than in previous papers [1-4]. Afterwards the alternative approximation is analysed in Section 4. Section 5 describes how the formulas for continuous approximation function are obtained and Section 6 presents the exemplary characteristics for a triangle data window.

2. The data window frequency characteristic

The data window frequency characteristic W(λ) is given by equation:

∑−+

=

π−=1

/j20

0

)(Nn

nn

NnnewW λλ , (1)

where: λ = fNT is the normalized frequency (in [bins]), f is the frequency in [Hz], T is the

Page 2: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

J. Borkowski: LINEAR APPROXIMATION OF THE DATA WINDOW SPECTRUM BY LEAST SQUARES METHOD

sampling period, N is the length of data window, which is defined by values wn and n0 denotes the first value of the sample index. Most often n0 = 0, what gives the discrete-time Fourier transform (DtFT) of the data window or n0 = −N/2 what gives shifted DtFT of the data window. In this paper the shifted DtFT is used (n0 = −N/2) because for a symmetric data window, the W(λ) has only real values. The non-shifted standard DtFT is obtained from W(λ) for n0 = −N/2 (and vice-versa) by simple formula:

∑∑−

=

π−π−

−=

π− ==1

0

/j212/

2/

/j2)(N

n

Nnn

jN

Nn

Nnn eweewW λλλλ . (2)

The zero padding technique involves computing (2) for the M-element series {w−N /2, …, wN /2−1, 0, …, 0}NR instead of the series {w−N /2, …, wN /2−1}N. Such a “R-times” zero padding technique (where M = NR) takes the following form from (2):

∑−

−=

π−=12/

2/

/j2)/(N

Nn

MnnewRW λλ . (3)

The values W(λ /R) for integer values of λ are easy to obtain by using the FFT algorithm and (2)-(3):

NRnkRkj

N

Nn

Mnkjn weew }{FFT/

12/

2/

/2 π−

−=

π− =∑ , (4)

where: {wn}NR is the zero padded data window:

}}0,...,0{,}{{}{ )1( −= RNNnNRn ww (5)

and M = NR is the natural power of 2 for radix-2 FFT algorithm. The window spectrum W(λ) defined by (2) is approximated in the LIDFT method by

function )(ˆ λW and in the least squares method the quality of this approximation is given by the mean square approximation error Q:

∫−

−=2/

2/

2|)(ˆ)(|N

N

dWWQ λλλ . (6)

This error has a different form in Sections 3-5, what gives different formulas for the parameters of the function )(ˆ λW .

3. The approximation by linear functions used in the LIDFT method

For data window and the zero padding technique, the LIDFT method assumes an approximation of the frequency characteristic W(λ) from (2) using linear functions, as shown in Fig. 1a [4]. The linear functions kkk baW += λλ)(ˆ approximate the window characteristic W(λ) for λ ∈ [k/R, (k+1)/R]. The error Q from (6) is defined as:

∑ ∫−

−=

+

−=12/

2/

/)1(

/

2)(ˆ)(

NR

NRk

Rk

Rk

k dWWQ λλλ (7)

and is described in the matrix form (on the base of (A7) of Appendix A) by:

AczAzcAccwwAzzzcAzcww HHHTHHT )()( −−+⋅=−−−+⋅= NNQ , (8) where: T

12/2/ ],....,[ −−= NN www , (9)

380

Page 3: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

Metrol. Meas. Syst., Vol. XVIII (2011), No. 3, pp. 379-390.

⋅⋅=

I0

0IA

3R , (10)

TTT ][ ccc ′′′= , (11)

T12/2/ ],...,[ −− ′′=′ MM ccc ,

++=′ kkk bR

ka

Rc

2/11 , (12)

T12/2/ ],...,[ −− ′′′′=′′ MM ccc , 26R

ac k

k =′′ , (13)

TTT ][ zzz ′′′= , (14)

T12/2/ ],...,[ −− ′′=′ MM zzz , ∫

+

=′Rk

Rk

k dWz/)1(

/

)( λλ , (15)

T12/2/ ],...,[ −− ′′′′=′′ MM zzz , ∫

+

+−=′′Rk

Rk

k dWR

kRz

/)1(

/

)(2/12 λλλ . (16)

The coefficients kz′ , kz′′ from (15)-(16) are given, by use of (2), as:

∑ ∫−

−=

+π−=′

12/

2/

/)1(

/

/2N

Nn

Rk

Rk

Nnjnk dewz λλ , ∑ ∫

−=

+π−

+−=′′12/

2/

/)1(

/

/22/12N

Nn

Rk

Rk

Nnjnk de

R

kwRz λλ λ . (17)

The integrals in (17) are given by:

Mnkjjxn

Rk

Rk

Nnj eeR

xde n /2

/)1(

/

/2 sinc π−−+

π− =∫ λλ , (18)

MnkjjxnRk

Rk

Nnj eeR

xjde

R

kn /2

2

/)1(

/

/2

2sinc'2/1 π−−

+π− ⋅=

+−∫ λλ λ , (19)

where:

M

nxn

π= , NRM = , 12/,...,2/ −−= NNn , (20)

n

nn x

xx

sinsinc = , n

nnn

n

nn x

xxx

dx

xdx

/)(sincos)sinc(sinc' −== . (21)

Taking into account (17)-(21), the matrices (15)-(16) are given by:

wWz ′⋅=′ −RR 1 , wWz ′′⋅=′′ −

RR 1 , (22) where: NM

MnkjR e ×

π−= ][ /2W , 12/,...,2/ −−= MMk , 12/,...,2/ −−= NNn , (23)

T12/2/ ],...,[ −− ′′=′ NN www , njx

nnn exww −=′ )(sinc , (24)

T12/2 ][ −− ′′′′=′′ NN/ w,...,ww , njx

nnn exjww −=′′ )sinc'( . (25) Let us notice that: IWW ⋅= MRR

H . (26)

From (24) the matrix z (14) is given by:

′′′

=

w

w

W0

0Wz

R

R

R

1 . (27)

381

Page 4: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

J. Borkowski: LINEAR APPROXIMATION OF THE DATA WINDOW SPECTRUM BY LEAST SQUARES METHOD

The task of determining the coefficients ak, bk of the approximating linear functions that minimize Q defined by (8) can be replaced by an equivalent task of determining the coefficients kc′ , kc ′′ from (12)-(13). They are obtained from:

0zcAc

=−= )(2d

dQ , (28)

which gives: zc = (29)

and then Q has minimum value determined on the basis of (8) and (29):

Azzww HTmin −⋅= NQ . (30)

From (10), (24)-(27) the expression zHAz from (30) is given by:

∑−

−=

+=′′′′+′′⋅=12/

2/

222HHH ])sinc'(3)sinc[(])(3)[(N

Nnnnn xxwNN wwwwAzz (31)

and then (30) has the following form:

∑−

−=

=12/

2/

2min

N

NnnnwcNQ , 22 )sinc'(3)sinc(1 nnn xxc −−= . (32)

Let us define the vectors d′ and d ′′ and coefficients kd′ , kd ′′ , based on the values of

approximating function )(ˆ λkW for λ = k/R, (k+1/2)/R, (k+1)/R (two extreme values and the median value of the range [k/R, (k+1)/R]) as follows:

T12/2/ ],...,[ −− ′′=′ MM ddd , kkkk b

R

ka

R

kWd ++=

+=′ 2/12/1ˆ , (33)

T12/2/ ],...,[ −− ′′′′=′′ MM ddd ,

R

a

R

kW

R

kWd k

kkk =

+=′′ ˆ1ˆ . (34)

Using (11)−(13) they can be described as:

cI0

0Iddd ⋅

⋅=′′′=

6][ TTT R (35)

and taking into account (27), (29) one has:

′′⋅′

=′′′=

w

w

W

0Wddd

60][ TTT

R

R (36)

or in non-matrix form by:

∑−

−=

−−=++=

+=′12/

2/

/π2sinc2/12/1ˆN

Nn

Mnkjjxnnkkkk eexwb

R

ka

R

kWd n , (37)

∑−

−=

−−==

+=′′12/

2/

/π2sinc'6ˆ1ˆN

Nn

Mnkjjxnn

kkkk eexwj

R

a

R

kW

R

kWd n . (38)

The coefficients kd′ , kd ′′ can be calculated by FFT from (4). The equations (36)-(38) allow the calculation of the parameters kd′ , kd ′′ of approximating

linear functions, and hence their coefficients ak, bk can be calculated. The graphical interpretation of kd′ , kd ′′ is shown in Fig. 1b.

382

Page 5: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

Metrol. Meas. Syst., Vol. XVIII (2011), No. 3, pp. 379-390.

R

5.1

R

5.0

R

5.0-

R

5.1-

0.4

0.5

0.6

0.7

0.8

0.9

1.0

[bins]l

R

1-

R

1

R

2-

R

20

00 ba +l

11 ba +l

11 -- +l ba

22 -- +l ba

)(ˆ),( ll WW)(lW

2=R

úû

ùêë

é +Îl+l=l

R

k

R

kbaW kkk

1,for)(ˆ

´W(0)a)

R

5.2

R

5.1

R

5.0

kkkk bR

ka

R

kWd +

+=÷

ø

öçè

æ +=¢

2/12/1ˆ

R

a

R

kW

R

kWd k

kkk =÷ø

öçè

æ-÷

ø

öçè

æ +=¢¢ ˆ1ˆ

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.0

0d ¢

1d ¢

2d ¢

1d ¢¢

0d ¢¢

R

1

R

20

[bins]l

)(ˆ

)(

l

l

W

W

2=R´W(0)b)

R

5.1

R

5.0

R

5.0-

R

5.1-

0.4

0.5

0.6

0.7

0.8

0.9

1.0

[bins]l

R

1-

R

1

R

2-

R

20

00 ba +l

11 ba +l11 -- +l ba

22 -- +l ba 22 ba +l

)(ˆ),( ll WW

)(lW

2=R

úû

ùêë

é +-Îl+l=l

R

k

R

kbaW kkk

2/1,

2/1for)(ˆ

´W(0)c)

R

5.2

R

5.1

R

5.0

R

a

R

kW

R

kWd k

kkk =÷ø

öçè

æ --÷

ø

öçè

æ +=¢¢

2/1ˆ2/1ˆ

kkkk bR

ka

R

kWd +=÷

ø

öçè

æ=¢ ˆ

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.0

0d ¢

1d ¢

2d ¢2d ¢¢

1d ¢¢

00 =¢¢d

R

1

R

20

[bins]l

)(ˆ

)(

l

l

W

W

2=R´W(0)d)

Fig. 1. Approximation of data window spectrum by linear functions: a,b) in Section 3; c,d) in Section 4

4. Alternative approximation by linear functions

The approximation alternative to the presented in Section 3 is defined by kkk bλa(λW +=)ˆ for λ ∈ [(k−0.5)/R, (k+0.5)/R] (Fig. 1c). The mean square error Q of such approximation is different from (7), i.e. it has a different range of integration:

∑ ∫−

−=

+

−=12/

2/

/)2/1(

/)2/1(

2)(ˆ)(

NR

NRk

Rk

Rk

k dWWQ λλλ (39)

and, on the basis of (A10) of Appendix A, is equal (8) where matrices w , A , c , c ′′ , z are defined by (9)-(11), (13)-(14), and c′ , z′ , z ′′ are defined by:

T12/2/ ],...,[ −− ′′=′ MM ccc ,

+=′ kkk bR

ka

Rc

1 , (40)

T12/2/ ],...,[ −− ′′=′ MM zzz , ∫

+

=′Rk

Rk

k dWz/)2/1(

/)2/1(

)( λλ , (41)

T12/2/ ],...,[ −− ′′′′=′′ MM zzz , ∫

+

−=′′Rk

Rk

k dWR

kRz

/)2/1(

/)2/1(

)(2 λλλ . (42)

After taking into account (2), the coefficients kz′ , kz′′ from (41)-(42) can be written as:

∑ ∫−

−=

+

π−=′12/

2/

/)2/1(

/)2/1(

/2N

Nn

Rk

Rk

Nnjnk dewz λλ , ∑ ∫

−=

+

π−

−=′′12/

2/

/)2/1(

/)2/1(

/22N

Nn

Rk

Rk

Nnjnk de

R

kwRz λλ λ . (43)

The integrals in both of these dependencies are given by:

Mnkjn

Rk

Rk

Nnj eR

xde /2

/)2/1(

/)2/1(

/2 sinc π−+

π− ⋅=∫ λλ , MnkjnRk

Rk

Nnj eR

xjde

R

k /22

/)2/1(

/)2/1(

/2

2sinc' π−

+

π− ⋅=

−∫ λλ λ , (44)

where: xn, sinc xn, sinc′xn are defined by (20)-(21). The matrices (41)-(42) can be written as in (22), i.e. wWz ′⋅=′ −

RR 1 , wWz ′′⋅=′′ −RR 1 ,

383

Page 6: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

J. Borkowski: LINEAR APPROXIMATION OF THE DATA WINDOW SPECTRUM BY LEAST SQUARES METHOD

where RW is defined by (23), and vectors w′ , w ′′ are defined as:

T12/2/ ],...,[ −− ′′=′ NN www , )(sinc nnn xww =′ , (45)

T12/2 ][ −− ′′′′=′′ NN/ w,...,ww , )sinc'( nnn xjww =′′ . (46)

The task of determining the coefficients ka , kb ( kc′ , kc ′′ ) of the approximating linear functions that minimize Q defined by (39) is obtained by using equations (28)-(29), and similar transformations as in (30)-(31) give the same result for the mean square error of alternative approximation as the (32).

By defining the vectors d′ and d ′′ with coefficients kd′ , kd ′′ , based on the values of

approximating function )(ˆ λkW for λ = (k−1/2)/R, k/R, (k+1/2)/R (two extreme values and the median value of the range [(k−1/2)/R, (k+1/2)/R]) as follows:

T12/2/ ],...,[ −− ′′=′ MM ddd , kkkk b

R

ka

R

kWd +=

=′ ˆ , (47)

T12/2/ ],...,[ −− ′′′′=′′ MM ddd ,

R

a

R

kW

R

kWd k

kkk =

−−

+=′′ 2/1ˆ2/1ˆ , (48)

it is possible, after taking into account (11), (13), (40), (45)-(46), to express them in the matrix form (35)-(36) or in the non-matrix form by:

∑−

−=

π−=+=

=′12/

2/

/2sincˆN

Nn

Mnkjnnkkkk exwb

R

ka

R

kWd , (49)

∑−

−=

π−==

−−

+=′′12/

2/

/2sinc'62/1ˆ2/1ˆN

Nn

Mnkjnn

kkkk exwj

R

a

R

kW

R

kWd . (50)

The coefficients kd′ , kd ′′ can be calculated by FFT from (4). The equations (49)-(50) allow the calculation of the parameters kd′ , kd ′′ of approximating

linear functions, and hence their coefficients ak, bk can be calculated. The graphical interpretation of kd′ , kd ′′ is shown in Fig. 1d.

Both approximations from the Sections 3 and 4 shown in Figure 1 are discontinuous, which may be disadvantageous in some applications. Their modification presented in the next Section, minimizes this discontinuity. 5. Reduction of approximation discontinuity

There is a natural question whether it is possible to eliminate or at least reduce the approximation discontinuity at points of transition to the next line fitting (Fig. 1). To this aim, it is possible to minimize the error (7) taking into account, with the weight µ , an additional component which is the mean square error of discontinuity:

∑−

−=+

+−

++=12/

2/

2

111ˆ1ˆ

NR

NRkkk R

kW

R

kWQQ µ (51)

or in the same way for the error (39):

384

Page 7: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

Metrol. Meas. Syst., Vol. XVIII (2011), No. 3, pp. 379-390.

∑−

−=+

+−

++=12/

2/

2

112/1ˆ2/1ˆ

NR

NRkkk R

kW

R

kWQQ µ . (52)

In both cases (based on equation (A12) of Appendix A), the 1Q is given by:

AcEIEIEIEIAc ][][ TH1 +−+−+= µQQ , (53)

where: Q , w , A are defined by (8)-(10) and c , z are defined by (11)-(16) for the approximation from Section 3 and by (11), (13)-(14), (40)-(42) for the approximation from Section 4 and, additionally, the matrix E is a circulant matrix defined as:

=

000011000001000010

OOOO

O

O

L

E . (54)

Minimization of error (53) is achieved for the condition:

0AcEIEIEIEIAzcAc

=+−+−+−= ][][2)(2 T1 µd

dQ (55)

and hence: zAcEIEIEIEIc =+−+−+ ][][ Tµ , (56)

zBAc =µ , (57) where: ][][ T11 EIEIEIEIAB +−+−+= −−µ . (58)

Calculation of the matrix 1−A is simple (since A is a diagonal matrix) and in calculating the matrix 1−B can be used specific properties of the matrix B , including the fact that the matrix E appearing in (58) is a cyclic permutation matrix (a kind of circulant matrix), for which the decomposition can be performed to form a diagonal matrix with the use of Fourier matrix W [15]. The solution of equation (57) is (according to equation (A16) of Appendix A) the vector c defined as:

AzW0

0W

ΛΛΛ

ΛΛΛ

W0

0Wzc

−⋅

−= H

H

2BBA

BA2A4

j

j

M

µ (59)

or by:

zW0

0WA

ΛΛΛ

ΛΛΛI

W0

0Wc

−−⋅

= H

H

2BBA

BA2A41

j

j

Mµ , (60)

where: ][ /2 Mnkje π−=W is a MM × matrix ( 12/,...,2/, −−= MMkn ), and matrices ][ AA nΛ=Λ , ][ BB nΛ=Λ are M -element diagonal matrices with elements defined by:

2/1

22A sin

31cos121)(sin

++⋅=Λ nnnn xxRx µ , M

nxn

π= , (61)

2/1

22B sin

31cos121)(cos

++⋅=Λ nnnn xxRx µ , M

nxn

π= , (62)

with the range 12/,...,2/ −−= MMn .

385

Page 8: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

J. Borkowski: LINEAR APPROXIMATION OF THE DATA WINDOW SPECTRUM BY LEAST SQUARES METHOD

Using (27) in (60) and the fact that [ ]TH 0I0WW NNR M ×⋅= we have:

′′′

′−′′⋅−′′⋅′−

=

w

w

ΛIΛΛ

ΛΛΛI

W

Wc 2

BBA

BA2

A

)(12412)(4

001

RRj

RjR

R R

R

µµµµ

, (63)

where: ][ AA nΛ=′Λ , ][ BB nΛ=′Λ are N -element diagonal matrices with elements defined by (61)-(62) for the range 12/,...,2/ −−= NNn , and vectors w′ , w ′′ are defined by (24)-(25) for the approximation from Section 3 and by (45)-(46) for the approximation from Section 4. Equation (63) can be transformed, using (61)-(62) and dependences for w′ , w ′′ , to the form:

Λ

W

Wc ⋅

⋅⋅

=

β

α

)6/1(001

R

R

R, wΛWc αRR

1=′ , wΛWc βRR61=′′ , (64)

where: w is the vector of the data window, diagonal matrices αΛ , βΛ are defined for the

approximation from Section 3 as ][ njxne

−= ααΛ , ][ njxnej −= ββΛ and for the approximation

from Section 4 as ][ nαα =Λ , ][ nj ββ =Λ with the coefficients nα , nβ defined by:

)sin(cos121sinccos121)sinc()( 2

312

nn

nnnn xxR

xxRx

+++=

µµµα ,

)sin(cos121sincsin4'sinc6)( 2

312

2

nn

nnnn xxR

xxRx

++−=

µµµβ . (65)

Taking into account (64) and definitions αΛ , βΛ , (35) has the form:

Λ

W

Wd ⋅

=

β

α

R

R

00

, wΛWd αR=′ , wΛWd βR=′′ (66)

or in the non-matrix form, from (33)-(34) for the approximation from Section 3:

∑−

−=

π−−=++=

+=′12/

2/

/2)(2/12/1ˆN

Nn

Mnkjjxnnkkkk eewb

R

ka

R

kWd nµα , (67)

∑−

−=

π−−==

+=′′12/

2/

/2)(ˆ1ˆN

Nn

Mnkjjxnn

kkkk eewj

R

a

R

kW

R

kWd nµβ (68)

and similarly, from (47)-(48) for the approximation from Section 4:

∑−

−=

π−=+=

=′12/

2/

/2)(ˆN

Nn

Mnkjnnkkkk ewb

R

ka

R

kWd µα , (69)

∑−

−=

π−==

−−

+=′′12/

2/

/2)(2/1ˆ2/1ˆN

Nn

Mnkjnn

kkkk ewj

R

a

R

kW

R

kWd µβ . (70)

For 0=µ the Eqs. (67)-(68) are identical with (37)-(38), and (69)-(70) are identical with (49)-(50).

Let us notice that for 0=µ (64) is the same as (27), i.e. )0( == µcz . From this fact and from (64) the expression )()( H zcAzc −− is determined. Using additional relations (30)-(31) the total mean square error Q of approximation defined by (7)-(8) or (39) is obtained:

∑−

−=

⋅=12/

2/

2)(),(N

Nnnn wcNRQ µµ , (71)

where:

386

Page 9: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

Metrol. Meas. Syst., Vol. XVIII (2011), No. 3, pp. 379-390.

2222 )]0()([121)]0()([)0(

121)0(1),( nnnnnnn Rc βµβαµαβαµ −+−+−−= . (72)

For 0=µ the Eqs (71)-(72) are the same as (32). The Maclaurin series of the cn(µ) for µ = 0 and µ → ∞ are described by:

)(3274425

1614175

215754

45)0( 12

10864

nnnnn

n xoxxxx

c +−+−==µ , (73)

)(1871116

202514

1894

45)( 12

10864

nnnnn

n xoxxxx

c ++++=∞→µ . (74)

These series and (20) show that for high values of R, the Q(µ → ∞) → Q(µ = 0), what is also confirmed by Fig. 2 and the figures presented in Section 6.

0.0

0.1

0.2

0.3

0.4

0.5

0 2/N2/N-n

)(4 m× ncR

0=m ¥®m

1=R

1=R

2=R

4=R8³R2³R

106 2,...,2=N

Fig. 2. Values of R4cn(µ) versus n as obtained from (72)

6. Exemplary approximations for triangle window

The conclusions obtained at the end of Section 5 and in Fig. 2 are confirmed for the case of

calculation of (71) for the triangle window – the mean square error Q(µ, R) is proportional to R−4: when R is doubled, the value cn(µ) to decrease 16-fold (Fig. 2 and (71)-(72)), which results in the 16-fold reduction of the mean square error Q(µ, R), as is shown in Fig. 3a,b, especially for big R. The value of the Q(µ, R) depends also on the value of parameter µ – for small R this dependence is significant, but the higher the value R, the dependence on µ is lesser (Fig. 2, 3a,b). The influence of the value µ is clearly shown in Fig. 3c in circle zooms – for µ = 0 the discontinuity of the approximation is the largest at analyzed point λ = 0.75 bins (although the mean square error Q has a minimum, as shown in Fig. 3a,b), for µ = 0.1 this discontinuity is more then twice smaller (but the Q is increased), and for µ → ∞ approximation is continuous (but the error Q is significantly larger for small R, as shown in Fig. 3b). The cases for the triangle window, µ = 0 and R = 2 are also shown in Fig. 1.

For the data window, the most important feature is its frequency characteristics |W(λ)|. This characteristic is completed by a graph of the frequency characteristic of the approximation error |)(ˆ)(| λλ WW − (Fig. 4). For 2≥R and triangle window, the envelope of this error is about (2.4R2)-times smaller than the envelope of the triangle window leakage (Fig. 4). The approximation error |)(ˆ)(| λλ WW − is discontinuous for µ = 0 and continuous for µ → ∞. The differences in Fig. 4 are the most visible for small value of R, i.e. R = 2.

387

Page 10: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

J. Borkowski: LINEAR APPROXIMATION OF THE DATA WINDOW SPECTRUM BY LEAST SQUARES METHOD

1 2 3 4 5 6 7 8 9 101.0

1.2

1.4

1.6

1.8

2.0

2.2

2.4

2.6

2.8

3.0),(

2

4

RQN

Rm

R

0=m

1.0=m

3.0=m

1=m

¥®m

106 2,...,2=Nx 10

-3

0.0 0.5 1.0 1.5 2.0 2.5

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.0

1.0=m

0=m

¥®m

)(lW

)(lW

)(lW

)(ˆ lW)(ˆ lW

)(ˆ lW

)(ˆ

)(

l

l

W

W

´W(0)

10 10 10 10 10 10 10 10 10-4 -3 -2 -1 0 1 2 3 4

),(2

4

RQN

Rm

2=R

3=R

4=R

8=R

128=Rm

106 2,...,2=N5.1=R

b) c)

[bins]l

2=R

1.2

1.3

1.4

1.5

1.6

1.7

1.8

1.9

x 10-3

a)

Fig. 3. The quality of approximation (example for a triangle window): a,b) dependence of the mean square error

Q from µ and R in a graph R4N−2Q versus µ and R, c) different degree of the approximation discontinuity at a point λ = 0.75 bins magnified in three circle zooms for µ = 0, 0.1, ∞

0=m

]bins[l

|)(| lW

|)(ˆ)(| ll WW -2=Rfor

16=R

|)(ˆ)(| ll WW -for

0 1 2 3 4 5 6 7-110

-100

-90

-80

-70

-60

-50

-40

-30

-20

-10

0

[dB])4.2(log20 210 R×

|)(| lW |)(ˆ)(| ll WW -,]dB[

64=N

1.0=m

]bins[l

|)(| lW

|)(ˆ)(| ll WW -2=Rfor

16=R

|)(ˆ)(| ll WW -for

-110

-100

-90

-80

-70

-60

-50

-40

-30

-20

-10

0

0 1 2 3 4 5 6 7

|)(| lW |)(ˆ)(| ll WW -,]dB[

64=N

¥®m

]bins[l

|)(| lW

|)(ˆ)(| ll WW -2=Rfor

16=R

|)(ˆ)(| ll WW -for

-110

-100

-90

-80

-70

-60

-50

-40

-30

-20

-10

0

0 1 2 3 4 5 6 7

64=N|)(| lW |)(ˆ)(| ll WW -,]dB[

Fig. 4. Graph of |)(| λW and |)(ˆ)(| λλ WW − for a triangle window and µ = 0, 0.1, ∞

7. Conclusions

The main result of the paper are the Eqs. (65)-(70) for the parameters kd′ , kd ′′ of the

approximating linear functions (and hence their coefficients ka , kb ) for the given value of the parameter µ , which defines the degree of the approximation discontinuity. The special cases are obtained for 0=µ (largest discontinuity, smallest mean square error of approximation) and ∞→µ (continuity approximation, largest mean square error). The values of coefficients of approximating linear functions are easy to calculate by FFT algorithm with the use of zero padding technique. The obtained formulas are valid for both kinds of approximation: when approximating linear functions are defined for the range ]/)1(,/[ RkRk + bins (Fig. 1a,b), and for the range ]/)2/1(,/)2/1[( RkRk +− bins (Fig. 1c,d). Results obtained in the paper are valid for any data window, not only symmetric like the triangle window used as an example, because all formulas are obtained without any assumption of this type. The formulas for parameters of approximating functions are given for the shifted DtFT, but it is possible to use them also for the non-shifted DtFT, by simple multiplication by the function )/exp( Rkjπ− , as follows from (2)-(4). Appendix A. Selected mathematical equations

R

dRk

Rk

1/)1(

/

=∫+

λ , 2

/)1(

/

2/1R

kd

Rk

Rk

+=∫+

λλ , 33

2/)1(

/

2

121)2/1(RR

kd

Rk

Rk

++=∫+

λλ , (A1)

R

dRk

Rk

1/)2/1(

/)2/1(

=∫+

λ , 2

/)2/1(

/)2/1( R

kdRk

Rk

=∫+

λλ , 33

2/)2/1(

/)2/1(

2

121RR

kdRk

Rk

+=∫+

λλ , (A2)

)]()([)]()([)])([(|)(|

])(][)([)(ˆ)(2

2

λλλλλλλλλ

λλλλλλ∗∗∗∗∗∗

∗∗∗

+−+−+++=

−−−−=−

WbWaWbWababaW

baWbaWWW

kkkkkkkk

kkkkk . (A3)

Based on (2), (9) there is:

388

Page 11: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

Metrol. Meas. Syst., Vol. XVIII (2011), No. 3, pp. 379-390.

wwT12/

2/

22/

2/

2|)(| ⋅== ∑∫−

−=−

NwNdWN

Nnn

N

N

λλ . (A4)

Based on (A1), (10)-(13) there is:

AccH12/

2/

/)1(

/

))(( =++∑ ∫−

−=

+∗∗

M

Mk

Rk

Rk

kkkk dbaba λλλ . (A5)

Based on (10)-(16) there is:

AzcH12/

2/

/)1(

/

)()( =+∑ ∫−

−=

+∗

M

Mk

Rk

Rk

kk dWba λλλ . (A6)

Based on (A3)-(A6) there is:

AczAzcAccww HHHT12/

2/

/)1(

/

2)(ˆ)( −−+⋅=−∑ ∫

−=

+

NdWWM

Mk

Rk

Rk

k λλλ . (A7)

Based on (A2), (10)-(11), (13), (40) there is:

AccH12/

2/

/)2/1(

/)2/1(

))(( =++∑ ∫−

−=

+

∗∗M

Mk

Rk

Rk

kkkk dbaba λλλ . (A8)

Based on (10)-(11), (13)-(14), (40)-(42) there is:

AzcH12/

2/

/)2/1(

/)2/1(

)()( =+∑ ∫−

−=

+

∗M

Mk

Rk

Rk

kk dWba λλλ . (A9)

Based on (A3)-(A4), (A8)-(A9) there is:

AczAzcAccww HHHT12/

2/

/)2/1(

/)2/1(

2)(ˆ)( −−+⋅=−∑ ∫

−=

+

NdWWM

Mk

Rk

Rk

k λλλ . (A10)

For any T12/2/ ],...,[ −−= MM xxx , T

12/2/ ],...,[ −−= MM yyy meeting the condition kMk xx =+ , the matrix E from (54) and identity matrix I , there is:

ExyH12/

2/1 =∑

−=

∗+

M

Mkkk yx , yEx TH

12/

2/1 =∑

−=

∗+

M

Mkkk yx . (A11)

For any T12/2/ ],...,[ −−= MM xxx , T

12/2/ ],...,[ −−= MM yyy meeting the conditions kMk xx =+ ,

kMk yy =+ , TTT ][ yxz = , the matrix E from (54) and identity matrix I , based on (A11), there is:

zEIEIEIEIz ][][)()( TH12/

2/

211 +−+−=+−−∑

−=++

M

Mkkkkk yyxx . (A12)

For diagonal matrices iΛ ( 3,2,1=i ), orthogonal matrix W meeting the condition IWWWW ⋅== MHH there is for the following block matrices:

IWΛΛΛWΛWΛΛΛWΛ

WΛΛΛWΛWΛΛΛWΛ

WWΛWWΛ

WWΛWWΛ 2H12

3211H12

3213

H123213

H123212

H2

H3

H3

H1

)()()()(

M=

+++−+

− −−

−−

. (A13)

For the matrix ][ /2 Mnkje π−=W ( 12/,...,2/, −−= MMkn ), matrix E from (54) and diagonal matrix ][ /2 Mnj

e e π−=Λ there is:

HWWΛE eM =⋅ , HT WWΛE ∗=⋅ eM , ][ /2 Mnje e π−=Λ . (A14)

389

Page 12: CONTINUOUS AND DISCONTINUOUS LINEAR APPROXIMATION …

J. Borkowski: LINEAR APPROXIMATION OF THE DATA WINDOW SPECTRUM BY LEAST SQUARES METHOD

For the matrices: E from (A14), A from (10) and identity matrix I there is:

+++−−−+−+

=

+−+−+=

∗−∗

∗∗−

−−

H1H

HH1

T11

)]())3(2[()()()]())(2[(1

][][

WΛΛIWWΛΛW

WΛΛWWΛΛIW

EIEIEIEIAB

eeee

eeee

R

R

M µµ

µ. (A15)

For )())(2( 11

∗− +−+= eeR ΛΛIΛ µ , )())3(2( 12

∗− +++= eeR ΛΛIΛ µ , ∗−= ee ΛΛΛ3 in (A15) there is from (A13):

AW0

0W

ΛΛΛ

ΛΛΛ

W0

0WAA

W0

0WA

ΛΛΛ

ΛΛΛAI

W0

0WB

−=

−−⋅

=−

H

H

2BBA

BA2A

2

H

H

2BBA

BA2A1

4

4

j

j

M

j

j

M

µµ

µµ

, (A16)

where: AΛ , BΛ are defined by (61)-(62). References [1] Borkowski, J. (2000). LIDFT – The DFT linear interpolation method, IEEE Trans. Instrum. Meas., 49,

741-745.

[2] Borkowski, J., Mroczka, J. (2000). Application of the discrete Fourier transform linear interpolation method in the measurement of volume scattering function at small angle, Opt. Eng. 39(6), 1576-1586.

[3] Borkowski, J., Mroczka, J. (2002). Metrological analysis of the LIDFT method, IEEE Trans. Instrum. Meas., 51, 67-71.

[4] Borkowski, J., Mroczka, J. (2010). LIDFT method with classic data windows and zero padding in multifrequency signal analysis, Measurement, 43, 1595-1602.

[5] Kay, S.M. (1988). Modern Spectral Estimation: Theory and Application, Englewood Cliffs, Prent.-Hall.

[6] Zygarlicki J, Zygarlicka M, Mroczka J, Latawiec K.J. (2010). A reduced Prony's method in power-quality analysis-parameters selection, IEEE Trans. Power Del., 25(2), 979-986.

[7] Szmajda M, Górecki K, Mroczka J. (2010). Gabor transform, spwvd, gabor-wigner transform and wavelet transform - tools for power quality monitoring, Metrology and Measurement Systems, 17(3), 383-396.

[8] Mroczka, J., Szczuczyński, D. (2009). Inverse problems formulated in terms of first-kind Fredholm integral equations in indirect measurements, Metrology and Measurement Systems, 16 (3), 333-357.

[9] Duda, K., Borkowski, D., Bień, A. (2009). Computation of the network harmonic impedance with Chirp-Z transform, Metrology and Measurement Systems, 16(2), 299-312.

[10] Agrež, D. (2002). Weighted Multipoint Interpolated DFT to Improve Amplitude Estimation of Multifrequency Signal, IEEE Transactions on Instrumentation and Measurement, 51(2), 287-292.

[11] Belega, D., Dallet, D. (2008). Frequency estimation via weighted multipoint interpolated DFT, IET Science, Measurement and Technology, 2(1), 1-8.

[12] Chen, K.F., Jiang, J.T., Crowsen, S. (2009). Against the long-range spectral leakage of the cosine window family, Computer Physics Communications, 180, 904-911.

[13] Duda, K. (2010). DFT Interpolation Algorithm for Kaiser–Bessel and Dolph–Chebyshev Windows, IEEE Transactions on Instrumentation and Measurement, 60(3), 784-790.

[14] Dehkordi, V.R., Labeau, F., Boulet, B. (2008). Piece-wise linear DFT interpolation for IIR systems: Performance and error bound computation, Proceedings of the 42nd Conference on Signals, Systems and Computers, Asilomar, Pacific Grove, CA., 588-592.

[15] Gray, R.M. (2006). Toeplitz and Circulant Matrices: A review, Foundations and Trends in Communications and Information Theory, 2(3), 155-239.

390