Walsh functions and their use in the assessment of surface texture

10
Wear, 57 (1979) 157 - 166 @ Elsevier Sequoia S.A., Lausanne - Printed in the Netherlands 157 WALSH FUNCTIONS AND THEIR USE IN THE ASSESSMENT OF SURFACE TEXTURE* E. H. SMITH and W. M. WALMSLEY School of Mechanical and Production Engineering and School of Mathematics, Statistics and Computing, Preston Polytechnic, Preston (Gt. Britain) (Received May 15,1979) Summary In order to characterize the “shape” of a surface which is subject to wear statistical analyses using Fourier transform methods are often used. In this paper it is suggested that Walsh analysis, a technique originally developed for communications engineering, might be more appropriate. The derivation of Walsh functions is discussed and Walsh analysis is compared with power spectral analysis. The results are encouraging for further inves- tigation of Walsh techniques in surface assessment. 1. Introduction Surface measuring equipment allows a magnified representation of an engineering surface to be produced on paper. The complex nature of the sur- faces revealed has led to a number of methods of surface characterization. These methods condense the complexity of a surface into a meaningful index or visual representation. Thus in the centre-line average (c.1.a.) tech- nique the average height of a surface above its mean line is presented as a measure of surface roughness. However, this technique cannot distinguish between many fundamentally different surfaces, e.g. ground and turned surfaces possessing identical c.1.a. values can exhibit mean valley-to-peak heights differing by a factor of 2. Other statistical indices which are moments of the amplitude distribution have been utilized and Stout et al. [ 11 provide a useful summary. It is unlikely that a surface can ever be fully characterized by a single index. Thus it is perhaps more appropriate to process a surface statistically into a simplified set of meaningful numbers which can then be plotted graphically. Such an approach is adopted with the autocovariance function (ACF), the prime attraction of which is that a simplified pictorial *Presented at the International Conference on Metrology and Properties of Engineering Surfaces, Leicester, April 18 - 20,1979.

Transcript of Walsh functions and their use in the assessment of surface texture

Page 1: Walsh functions and their use in the assessment of surface texture

Wear, 57 (1979) 157 - 166 @ Elsevier Sequoia S.A., Lausanne - Printed in the Netherlands

157

WALSH FUNCTIONS AND THEIR USE IN THE ASSESSMENT OF SURFACE TEXTURE*

E. H. SMITH and W. M. WALMSLEY

School of Mechanical and Production Engineering and School of Mathematics, Statistics and Computing, Preston Polytechnic, Preston (Gt. Britain)

(Received May 15,1979)

Summary

In order to characterize the “shape” of a surface which is subject to wear statistical analyses using Fourier transform methods are often used. In this paper it is suggested that Walsh analysis, a technique originally developed for communications engineering, might be more appropriate. The derivation of Walsh functions is discussed and Walsh analysis is compared with power spectral analysis. The results are encouraging for further inves- tigation of Walsh techniques in surface assessment.

1. Introduction

Surface measuring equipment allows a magnified representation of an engineering surface to be produced on paper. The complex nature of the sur- faces revealed has led to a number of methods of surface characterization. These methods condense the complexity of a surface into a meaningful index or visual representation. Thus in the centre-line average (c.1.a.) tech- nique the average height of a surface above its mean line is presented as a measure of surface roughness. However, this technique cannot distinguish between many fundamentally different surfaces, e.g. ground and turned surfaces possessing identical c.1.a. values can exhibit mean valley-to-peak heights differing by a factor of 2. Other statistical indices which are moments of the amplitude distribution have been utilized and Stout et al. [ 11 provide a useful summary.

It is unlikely that a surface can ever be fully characterized by a single index. Thus it is perhaps more appropriate to process a surface statistically into a simplified set of meaningful numbers which can then be plotted graphically. Such an approach is adopted with the autocovariance function (ACF), the prime attraction of which is that a simplified pictorial

*Presented at the International Conference on Metrology and Properties of Engineering Surfaces, Leicester, April 18 - 20,1979.

Page 2: Walsh functions and their use in the assessment of surface texture

158

transformation of a surface can be presented. Early computations of the ACF from a set of N surface amplitudes entailed N X N multiplications.

Since typical values of N are around lo3 this process can be a lengthy one even when a digital computer is used. The introduction of the fast Fourier transform (FFT) by Good [ 21 and later Cooley and Tukey [ 31 has enabled the ACF to be determined much more rapidly by utilizing the principle that it is the inverse Fourier transform of the power spectrum. Thus the total number of multiplications is reduced to approx- imately 2N log,N, e.g. when N = 1024 the multiplications are reduced from around lo6 to approximately 2 X 104. Such dramatic reductions in computer time required to determine the ACF may increase its use in sur- face texture analysis. Unfortunately, however, the function has limited suitability in this area. King and Stout [4] computed the ACF of a surface at various stages during a wear process and found that the shape of the function did not alter significantly even though the shape of the surface itself was modified considerably. This behaviour can be understood if one appreciates Fourier’s theorem that a function can be considered to be an infinite sum of a set of sine waves possessing different amplitudes and relative phase shifts. The ACF effectively converts a sine wave of amplitude A, frequency o and relative phase shift $ into a cosine wave of amplitude A2/2 and zero relative phase shift:

sin(wt + G) sin{o(t + 7) + $1 dt

i.e. R,(r) = (A42) cos 07

Thus a function composed of many sine waves is transformed into a function of many cosine waves possessing zero relative phase differences. Hence the ACF loses the phase information and therefore the ACF can be insensitive to a wear process.

As the use of the FFT spreads computation of the power spectrum (PS) may increase. The results of this analysis are a set of coefficients which represent the squares of the amplitudes of the constituent sine waves of a function. Again, phase information is not utilized and thus the PS exhibits the same limitations as the ACF as demonstrated in Fig. 1 by the power spectral plots of a number of truncated sine waves. The PS of the complete waveform y = sin w t is illustrated in Fig. l(a) and Figs. l(b) - l(f) show spectra corresponding to truncation at the +0.8, +0.6, +0.4, +0.2, +O.l levels respectively. The PSs differ only in the magnitude of the mean level.and the fundamental spectral frequency. Thus although the shape of the original sine function is altered significantly the PSs indicate that the original functions are merely a set of sine waves of decreasing amplitudes and increasing mean levels. Clearly therefore the power spectrum can be an insensitive indicator of wear.

The phase information in a function can be utilized if the straight- forward Fourier transform is presented in terms of two graphs, amplitude

Page 3: Walsh functions and their use in the assessment of surface texture

159

x 10” I6

(a) 5

0 L & 5 I0 I5 20

x10-l

x10” I0

5 1 (e1 0L

0 5 I0 I5 m

x10-1 10,

(b) 5

0 L 0 5 I0 I5 20

x 10-l

Ii

5 Id)

0 k 0 5 I0 I5 20

Fig. 1. Variation of power (ordinate) with harmonic frequency component (abscissa) of truncated sine waves.

uersus spatial frequency and relative phase difference uers’8us spatial frequency. However, this would complicate the comparison between surfaces since two curves must be examined for each surface. Therefore the use of a technique originally confined to the world of communications engineering, namely Walsh analysis, has been investigated. Fundamentals of this approach are outlined and a comparison between Walsh and Fourier analyses is discussed.

In attempting to characterize heuristically the “shape” of a surface which is subject to a wear process the discontinuous nature of the surface may best be represented by a set of orthogonal functions which, unlike sinusoidal signals, are themselves of a discontinuous nature. The two-state Walsh functions are well suited to the representation of records of discontin- uous data.

Page 4: Walsh functions and their use in the assessment of surface texture

160

2. Historical perspective on Walsh functions

The earliest noteworthy paper on Walsh functions was presented by Walsh [ 51 in 1922. Independently of Walsh, Rademacher [ 61 presented a system of functions which in 1929 were shown by Kaczmarz [ 71 to be a subset of the Walsh system. Not a great deal of attention was devoted to Walsh functions from an engineering point of view until Harmuth [ 81 regenerated interest in this area.

The attractiveness of the two-state Walsh function is in the possibility of being able to handle tasks which were previously the exclusive domain of the sinusoidal function. With the increasing availability of low cost digital circuits and microcomputers this possibility could not be ignored. Six International Conferences on this subject were held in the period 1970 - 1975. Although the initial fervour has now subsided there are still many enthusiastic workers in this field.

3. Definition and properties of Walsh functions

The Walsh functions form a complete set of orthogonal functions over their interval of definition, usually the unit interval 8 = (0,l). A popular symbolism for a function of order n defined over 0 is

wal (n, 0)

Figure 2 illustrates the first 16 Walsh functions. The functions take the values +l or -1 and on close inspection functions such as wall, 2, 3,4, 7, 15 bear a marked resemblance to the familiar square wave function. These are the so-called Rademacher subset. These waveforms occur on passing a sinusoid through a hard limiting amplifier and invoke the rather heuristic definition

R,(B) = sgn(sin(2n2V))

where

(1)

sgn{f(x)) = +1 iff(z)> 8 =- 1 iff(x)< e

Therefore R,(B) is the Rademacher function of order it defined over the interval 8. An important property of both Rademacher and Walsh functions is that the number of excursions the function may make over 0 is always restricted to an integral power of 2.

Equation (1) enables the more obscure functions (for example wal 9, 10,ll) to be generated. A practical procedure to generate wal (k, e ) is the following:

(a) write k in binary notation; (b) convert k to Gray code (achieved by bit-by-bit addition modulo-2); (c) multiply the Rademacher functions whose order corresponds to the

appearance of 1s in the Gray code expansion of k.

Page 5: Walsh functions and their use in the assessment of surface texture

161

WAL(O,B)

WALfl ,GJ)

WAL(3 ,e)

WAL(4 ,ef

WAL( 5 ,e)

WALt7 ,GJ)

WAL(6 ,81

WAL(9 ,8)

WAL(‘tO,e,

WAL(ll,e)

WAL(12.8)

WAL(13,8)

WAL( 14,e)

WAL(i5.e)

WAL( 0.0)

s4u I,61

CAL{ 1 ,8)

SAL( 2,8)

CA t( 2,9)

SAL( 3,8)

CAL{ 3,6)

SAL{ 4.8)

CAL(4,e)

SAL{ 5,6 f

CAU 5,0)

SAL( 6,8)

CAL< 6,ef

SAL( 7,‘3)

CAL< 7.8)

SAL( 8.8)

Fig. 2. Walsh functions: 0 = (0,l); cal (n,8) = wal (2n,o);sal (n,@) = (2n - 1,6).

For example if k = 13 (a) (13) = 1101 (b) (1101) in Gray code is 1011 (c) compare the Rademacher function with this codeword:

R3 R2 RI RCI

1 0 1 1

Hence wal(13,0) = R3*RI*R0. This is illustrated in Fig. 3. The order II of the Walsh function can be given a more practical mean-

ing by considering the number of zero crossings that a particular function performs over the unit interval. Each Walsh function is ordered according to the number of zero crossings interior to the interval 8. This is termed the “sequency” of the function and expresses in a more general sense the frequency of the signal. The functions exhibit either odd or even symmetry about the point 0 = 0.5. From these considerations the terminology sal (n, 0) and cal (n, 0) are derived by analogy with the odd/even sine~cosine functions, i.e.

sine w&h = sal

cosine w&h = cal

Page 6: Walsh functions and their use in the assessment of surface texture

162

INTERVAL OF DEFINITION, 0

WAL(13,el

Fig. 3. Walsh synthesis from Rademacher functions.

and

sal(n,e) = wal(2n - 1,e)

cal(n,8) = wal(2?2,8)

n = 1, 2, 3, . . .

The exception is wal (0,e) which is a special case.

4. Walsh functions in signal representation

Perhaps the most important area of application of Walsh functions is in signal representation in terms of a Walsh series. This is analogous to the representation of a signal in terms of a Fourier series of suitably weighted sine and cosine functions.

In this case the representation is in the Walsh (or sequency) domain as opposed to the Fourier (or frequency) domain. A function f(e) can be represented as

f(e) = co + c1 wal(l,e) + ce wa1(2,e) + . . .

or alternatively

f(e) = a0 + al cal(i,e) + a2 ca1(2,e) + . . . + b1 sal(i,e) + b2 sa1(2,e) + + . . .

The Walsh coefficients ao, (I,,, b, are derived in a manner similar to Fourier coefficients, i.e.

a0 = f(e) de s I9

Page 7: Walsh functions and their use in the assessment of surface texture

163

a, = J f(e) cd(n, 6) de e

b, = j-f(6) saWz,6) de e

This analogy can be extended to corresponding definitions of discrete and fast Walsh transform procedures. The discrete Walsh transform (DWT) coefficient vector [C] of a signal represented by a series of samples in a vector [S] would be

where [ W] is an N X N matrix of Walsh functions. The Walsh matrix contains only the values +1 and it is therefore simple to perform the DWT procedure.

If the discrete Walsh matrix is factorized following a Cooley-Tukey type algorithm then the speed of the transformation procedure is greatly increased. Figure 4 illustrates a fast Walsh transform (FWT) procedure which is identical to the FFT algorithm except that the usual operations of complex multiplication are replaced by the much simpler operation of multiplication by +l which is trivial. A FORTRAN procedure for an FWT algorithm is given in the Appendix. The problems of reordering still remain

Fig. 4. Signal flow graph of the FWT used in the present application.

Page 8: Walsh functions and their use in the assessment of surface texture

164

but in an instrument dedicated to Walsh analysis the overall costs are greatly reduced by the simplicity of the technique.

5. Discussion

To compare the technique of power spectral analysis with Walsh analysis the Walsh transforms of the truncated sine waves are presented in Fig. 5 where the truncation levels are +l.O, +0.8, +0.6, +0.4, +0.2 and +O.O respectively. These plots indicate a variation of Walsh function amplitude (ordinate) with sequency components.

From these plots the Walsh spectrum responds to changes in surface shape in a more significant manner than the PS. Unlike the PS, signal re- construction is possible from the Walsh spectra. It is possible to achieve

x10-1 e

4

(a) 2

0

-2

-4 l’!?rzl 0 5 10 15 20

x10-I 6

4 (cl

2

0

-2 L

-4i-3T-L70

x10-I

7 4

(e) 2

0

-2 b

-‘A0

XIB-’

x10-1

x10-I 6

4 (f)

2

e

-2 b

-4--l--l 8 5 10 IS 20

Fig. 5. Variation of Walsh function amplitude (ordinate) with Walsh function sequency number (abscissa) for the same six truncated sine waves considered in Fig, 1.

Page 9: Walsh functions and their use in the assessment of surface texture

165

characterization from a full FFT procedure; however, this requires the inter- pretation of two curves and is generally not a convenient technique.

The dichotomy between the choice of suitable transforms is illustrated by the following: a Fourier transform on a square (Walsh) wave produces an infinite number of sinusoidal components, whereas a Walsh transform on a sine (Fourier) wave produces an infinite number of Walsh wave components. The choice of the transform should be dictated by the shape of the wave- form: a discontinuous picture is more satisfactorily represented by dis- continuous basis functions and a smooth waveform is better represented by smooth basis functions. If characterization must be presented as a single data record then Walsh analysis should be considered even in si~ations where a Fourier transformation would (analytically) be more appropriate.

It is therefore suggested that Walsh analysis is more appropriate for tbe representation of discontinuous signals such as those encountered in the study ofsurface texture. Certainly from a compu~tion~ point of view Walsh procedures are more easily implemented at low cost than are analogous Fourier procedures.

Work is proceeding on the relation between changes in the shape of the surface due to wear and corresponding changes in the Walsh spectral coeffi- cients. A clear motivation for continuing work on Walsh techniques in sur- face analysis is apparent since the resulting coefficient plot can be used as a self-contained indicator of surface texture.

References

K. J. Stout, D. J. Whitehouse and T, G. King, Analytical techniques in surface topo- graphy and their application to a running in experiment, personal communication, 1976. I. J. Good, The interaction algorithm and practical Fourier analysis, J. R, Stat. Sot., 20 (2) (1958) 361 - 372. J. W. Cooley and J. W. Tukey, An algorithm for the machine calculation of complex Fourier series,Am. Moth. Sot. -Math. Cornput., 19 (90) (1965) 297 - 301. T. J. King and K. J. Stout, Some topographic features of the wear process - theory and experiment, Ann. CIRP, 25 (1977) 351- 356. J. L. Walsh, A closed set of orthogonal functions, Am. J. Math., 45 (1923) 5 - 24. H. Rademacher, Einige Satz von allgemeinen Orthogonal funktionen, Math. Ann., 87 (1922) 112 - 138. S. Kaczmarz, iiber ein Orthogonalsystem, Congr. des Pays Slaues, Warsau~, 1929, pp. 189 - 192. H. I?. Harmuth, Applications of Walsh functions in communications, IEEE Spectrum, 6 (Nov. 1969) 82 - 91.

Page 10: Walsh functions and their use in the assessment of surface texture

166

Appendix

FORTRAN subroutine for Walsh transformation of NV = 2**N sample points

SUBROUTINE TRANSFORM (N, NV, S, JCOL, ICOL) DIMENSION S(NV, 2) IM = NV/2 ICOL = 1 JCOL = 2 DO2K=l,N IF(K - 1) 4, 5,4

4 JJCOL = ICOL ICOL = JCOL JCOL = JJCOL

5DO21=1,IM S(1, JCOL) = (S(2*1- 1, ICOL) + S(2*1, ICOL))/B II = NV/2 + I

2 S(I1, JCOL) = (S(2*1- 1, ICOL) - S(2*1, ICOL))/B RETURN END