On the use of fast fourier transforms when high frequency resolution is required

5
Journal of Sound and Vibration (1986) 104(1), 75-79 ON THE USE OF FAST FOURIER TRANSFORMS WHEN HIGH FREQUENCY RESOLUTION IS REQUIRED R. PARKER AND S. A. T. STONEMAN Department of Mechanical Engineering, University College of Swansea, Singleton Park, Swansea SA2 8PP, Wales (Received 5 July 1984, and in revised form 15 December 1984) The paper gives a method of obtaining high frequency resolution of spectral peaks when time series data is transformed to the frequency domain by means of a simple Fast Fourier Transform. 1. INTRODUCTION The Fast Fourier Transform (FFT) is widely used for the analysis of time series data recorded in the course of experimental work where vibration or other time dependent phenomena are under investigation. It is quite common for investigators to require to establish the frequencies of any discrete frequency components which appear as narrow peaks in the spectrum, particularly when these are not related to any other known frequencies. For example a self-induced oscillation generated by fluid flow effects is normally related to a system resonance and establishing the frequency may be the primary purpose of the test. In these circumstances the investigator has no prior knowledge of the frequency content ofthe signals and it is necessary to adopt recording procedures which capture the maximum information in the minimum time. In many cases prolonged operation at each test condition or repeat tests are not practicable for economic or other reasons. The authors found themselves in such a situation when using an FFT to process signals from strain.gauges and pressure transducers in an investigation of acoustic resonances and blade vibration in axial-flow compressors. The work required the frequencies of several spectral peaks associated with flow induced resonances (and therefore not directly related to other measurable frequencies) to be determined to a high degree of accuracy. An examination of the literature indicated that the standard techniques did not give the required frequency resolution and this paper reports a method which was developed to overcome the problem. 2. THE BASIC PROPERTIES OF THE FFT The signals to be analyzed are assumed to have a spectral content comprising relatively low level random fluctuations together with a number of unrelated and unknown discrete frequency components which are of interest. The sampling rate and number of samples are chosen to cover the required overall frequency range and to be compatible with the amount of data storage available and an acceptable overall sampling time dependent on the "steadiness" of the test conditions. Antialiasing filters are provided to remove frequen- cies above the "Nyquist" frequency, which is half the sampling frequency. 75 0022-460x/86/010075+05 $03.00/0 1986 Academic Press Inc. (London) Limited

Transcript of On the use of fast fourier transforms when high frequency resolution is required

Journal of Sound and Vibration (1986) 104(1), 75-79

ON THE USE OF FAST FOURIER TRANSFORMS WHEN HIGH FREQUENCY RESOLUTION IS REQUIRED

R. PARKER AND S. A. T. STONEMAN

Department of Mechanical Engineering, University College of Swansea, Singleton Park, Swansea SA2 8PP, Wales

(Received 5 July 1984, and in revised form 15 December 1984)

The paper gives a method of obtaining high frequency resolution of spectral peaks when time series data is transformed to the frequency domain by means of a simple Fast Fourier Transform.

1. INTRODUCTION

The Fast Fourier Transform (FFT) is widely used for the analysis of time series data recorded in the course of experimental work where vibration or other time dependent phenomena are under investigation. It is quite common for investigators to require to establish the frequencies of any discrete frequency components which appear as narrow peaks in the spectrum, particularly when these are not related to any other known frequencies. For example a self-induced oscillation generated by fluid flow effects is normally related to a system resonance and establishing the frequency may be the primary purpose of the test.

In these circumstances the investigator has no prior knowledge of the frequency content of the signals and it is necessary to adopt recording procedures which capture the maximum information in the minimum time. In many cases prolonged operation at each test condition or repeat tests are not practicable for economic or other reasons.

The authors found themselves in such a situation when using an FFT to process signals from strain.gauges and pressure transducers in an investigation of acoustic resonances and blade vibration in axial-flow compressors. The work required the frequencies of several spectral peaks associated with flow induced resonances (and therefore not directly related to other measurable frequencies) to be determined to a high degree of accuracy.

An examination of the literature indicated that the standard techniques did not give the required frequency resolution and this paper reports a method which was developed to overcome the problem.

2. THE BASIC PROPERTIES OF THE FFT

The signals to be analyzed are assumed to have a spectral content comprising relatively low level random fluctuations together with a number of unrelated and unknown discrete frequency components which are of interest. The sampling rate and number of samples are chosen to cover the required overall frequency range and to be compatible with the amount of data storage available and an acceptable overall sampling time dependent on the "steadiness" of the test conditions. Antialiasing filters are provided to remove frequen- cies above the "Nyquis t" frequency, which is half the sampling frequency.

75 0022-460x/86/010075+05 $03.00/0 �9 1986 Academic Press Inc. (London) Limited

76 R. P A R K E R A N D S. A . T . S T O N E M A N

The output, after conversion to the frequency domain via the FFT, is a series of complex numbers from which the energy content and relative phases of the oscillations occurring within a series of narrow frequency bands, referred to as "bins", may be found. The width of each bin is the inverse of the overall sampling time and, if no further refinement is possible, is the degree of resolution with which the frequencies of the spectral "peaks" may be found.

A further consequence of the finite sampling time is that, in general, it does not correspond to integral numbers of cycles of the various discrete frequency components of the signal, and this produces significant amplitudes in several bins on either side of those containing the actual peaks. The magnitudes of these "leakage" amplitudes are dependent on the differences between the actual frequencies and the centre frequencies of the bins in which the peaks fall. To reduce this effect to acceptable levels various "windows" are used to modify the data before transformation.

The usual interpretation of the FFT output is to consider the frequencies of the peaks to be the centre frequencies of the bins in which they occur and to obtain the corresponding amplitudes by averaging the energy contents (amplitude 2) of three or more bins [1].

If there is a requirement to identify a particular peak and record the frequency to a higher degree of resolution than the sample bin width, the usual procedure is to alter the sampling rate and resample the data with use of further refinements to give a "zooming" effect. This is of course not possible if the phenomenon cannot be repeated as required.

3. THE HANNING WINDOW

The most commonly used window is that ascribed to Hanning. This may be described in various ways, of which the "raised cosine" is probably the most informative. I f the data comprises the time series x,, i = 0, 1, 2 , . . . , ( n - 1) the "windowed" data is

yi=(xi-.~)(1-cos27ri/n), where ) ( 1 .-1 =-- Z x,. (1) /1 i = 0

Subtraction of the mean (9() eliminates possible large amplitudes in the first (zero frequency) and second (1/sampling time) bins. The window adds extra components which are related to the harmonic content of the original data: i.e., for a component of amplitude (A2+B2) ~ and frequency to multiplication by the window gives (upon writing ~ t for 2~ri/n)

{A cos (tot)+ B sin (tot)}(1 - c o s ~ t ) = A cos (tot)+ B sin (tot)

-0 .5{A cos (to +O)t+B sin (to +/2) t}

-0 .5{A cos (to -12)t+B sin (to - / 2 ) t } .

The result is that the peak indicated by the FFT output is broadened, producing significant levels in three or four bins but negligible levels in all other bins. The extra components generate a 50% increase in the total energy represented by the contents of the bin containing the peak and the one or two adjacent bins on each side, the distribution depending on the difference between the actual frequency and the centre frequency of the bin in which it falls.

In most eases the recorded data contain a number of peaks and two components may interact if the frequencies are separated by less than five bins though in many cases the ettect is negligible when they are as little as three bins apart. There may also be some effect if the signal has a significant broad band content but in many eases the peaks are well above any noise or other broad band levels.

HIGH FREQUENCY RESOLUTION FROM FFT OUTPUTS 77

4. ANALYSIS OF THE PROBLEM

The content of any bin may be found analytically if the harmonic content of the time series is known, as the output at any frequency may be obtained by integrating the Euler equations over the total sampling period.

The frequency of a component may be defined in terms o f the bin in which it occurs (k) and the distance f rom the centre of that bin as a fraction of the bin width (p)" i.e.,

x(t) = a cos (k + p)Ot + b sin (k + p)~lt, (2)

where k is an integer and - 0 . 5 ~< p ~< +0.5. I f the data is t ransformed without windowing the result is

A, = (1/Tr){(k+p)/[(k+p) 2 - n2]}{a sin 2r rp+ b(1 - c o s 27rp)}, (3a)

Bn = (1/Ir){n/[(k+p) 2- n2]}{-a(1 - c o s 2rrp) + b sin 2~'p}, (3b)

(An + iB,) being the complex number in bin n of the FFT output. When the same data is "windowed" by using the Hanning window the components become

1 ~ (k+p) 0 " 5 ( k + l + p ) A " = ~ k ( k + - - ~ - n 2 ( k + l + p ) 2 - n 2

x {a sin 21rp + b(1 - c o s 27rp)},

1 f n 0.5n B.= (k+pS2_n2 (k+l+p)2_n

x { - a (1 - cos 2~'p) + b sin 2rrp}.

0 . 5 ( k - 1 + p ) "~

0"5n } (k - 1 + p ) 2 _ n2) '

(4a)

(4b)

Examination of these expressions shows that, although the output from the FFT decreases as the difference between k and n increases for the unwindowed output, the decrease is much more rapid when the window is applied. The other obvious conclusion is that there is little hope of evaluating p exactly from the FFT output although there is no difficulty in establishing which bins contain the peaks. By using equations (4a) and (4b), values of the amplitudes for bins k - 2 ~ < n <~ k + 2 were found with values o f p through the range +0.5. Table 1 gives an example where k = 256.

TABLE 1

Amplitudes and frequencies calculated from FFT output

FFT output

Bin p k - 2 k - 1 k k + l k + 2

Calculated from FFT output

P Amplitud e

-0"5 0-1698 0 " 8 4 8 8 0.8488 0.1698 0.0243 -0"5000 0-9899 -0"4 0.1213 0.7884 0.9010 0.2252 0"0265 -0"3992 0.9947 -0-3 0.0801 0.7213 0 " 9 4 3 3 0 " 2 8 7 1 0 " 0 2 6 1 -0"2986 0"9975 -0.2 0.0464 0 " 6 4 9 6 0 " 9 7 4 4 0 " 3 5 4 3 0.0221 -0-1986 0"9990 -0"1 0"0198 0-5752 0 " 9 9 3 5 0.4258 0 " 0 1 3 7 -0"0992 1"000 +0"1 0"0137 0.4258 0.9935 0.5752 0"0198 +0-0991 1"000 +0.2 0.0221 0.3543 0-9744 0.6496 0.0464 +0-1986 0.9990 +0.3 0-0261 0"2871 0 " 9 4 3 3 0.7213 0.0801 +0.2986 0-9975 +0.4 0.0265 0.2252 0 " 9 0 1 0 0-7884 0 " 1 2 1 3 +0"3992 0.9947 +0.5 0-0243 0 " 1 6 9 8 0 " 8 4 8 8 0.8488 0 " 1 6 9 8 +0.5000 0.9899

78 R. PARKER A N D S. A. T. S T O N E M A N

Examination of the results suggests that the values returned for bins k - 1, k and k + 1 lie on a curve which has a maximum approximately corresponding to p and that this may be located by assuming a second order polynomial. When this was tested the estimated values o fp were exact for 0.0 and • but errors of up to • were found at intermediate values. While this is an improvement in resolution compared with the bin width, further experiments showed that there was a marked improvement in accuracy if the square root of amplitude was used and, upon following the trend even further, the fourth root gave the values shown in Table 1. It may be seen that the maximum difference between the value of p calculated from the FFT output and the exact value never exceeds 0.002. The tabulated values were calculated by using

p = ( s - q ) / ( 4 r - 2 q - 2 s ) , (5)

where q~(n) is the amplitude in bin r/, q = q~(k- 1) ~ r = ~b(k) ~ s = ~b(k+ 1) ~ and the frequency of the peak was given by

f = (k +p) fL (6)

The amplitudes shown in Table 1 were calculated from

amplitude = {[~b(k- 1)2+ ~(k)~ + ~b(k+ 1)2]/1.5} ~ (7)

Tests were carried out at various values of k throughout the whole range and, in all cases, results were obtained showing frequency and amplitude resolutions similar to the results illustrated in Table 1.

5. DISCUSSION AND CONCLUSIONS

The methods described above are not mathematically "exact" but they have been thoroughly tested with artificially generated data and used extensively by the authors in a prolonged experimental investigation. In both cases no significant errors have been detected. A typical implementation was 1024 samples at intervals of 0.1 ms. The sample mean was reduced to zero and the Hanning window applied before transformation, the FFT subroutine given in Appendix 2 of reference [1] being used. Graphical presentations were produced without further refinement (e.g., the Z-plots described in reference [2]). The 10 largest peaks on each channel were located and the amplitudes and frequencies calculated by using equations (5), (6) and (7); the Fortran coding for this is reproduced in the Appendix. Generally two or three of the peaks were due to "blade passing" effects and therefore gave frequencies which could be tested against the shaft speed (which was measured simultaneously by a completely different method) and invariably confirmed the accuracy of the method.

From one sample it was possible to examine peaks in the frequency range 20 Hz to 5 kHz with a frequency resolution considerably better than 0.1 Hz (compared with a bin width of 9-766 Hz) and amplitudes with an accuracy of +1%. The only reservation is that the accuracy deteriorates if two peaks are very close together or a peak is small relative to the broadband noise.

REFERENCES

1. D. E. NEWLAND 1975 An Introduction to Random Vibrations and Spectral Analysis. London: Longman.

2. R. PARKER and S. A. T. STONEMAN 1984 Journal of Sound and Vibration 99, 169-182. An experimental investigation of the generation and consequences of acoustic waves in an axial flow compressor: large axial spacings between blade rows.

H I G H F R E Q U E N C Y R E S O L U T I O N F R O M F F T O U T P U T S

APPENDIX

F O R T R A N C O D I N G F O R F I N D I N G F R E Q U E N C I E S A N D A M P L I T U D E S O F PEAKS

C P(J) is an array of the absolute values of the complex C numbers returned by the FFT, J = 1, JMAX. C Maximum value of P(J) is 10. C JD is normally in the range 2 to 5 inclusive. C FREQ is the frequency. C AMPL is the amplitude. C FBIN is the FFT bin width, i.e., l./(total sample time).

J I = J D + I J2 = JMAX-J1

C C C

C C C

C C

C C

C C C C C C

Check that P(J) is greater than 0.01 and that it is greater than the next value on each side.

DO 22 J=J1 , J2 IF ((P(J).LT.0.01).OR.(P(J- 1).GE.P(J)).OR.

* (P(J+ 1).GT.P(J))) GO TO 22

Check whether P(J) is a true max by comparing it with average of 'JD' peaks eith.er side.

S=0 . DO 70 K = 1,JD

70 S = S + P ( J + K ) + P ( J - K) S = S/FLOAT(2*JD) IF (P(J). LT. S) GO TO 22

Calculate the aml~litude SUM2=0. DO 76 N = J - 1 , J + I

76 SUM2 = SUM2+P(N)*P(N) AMPL = SQRT(SUM2/1.5)

Calculate the frequency of the peak G = SQRT(SQRT(P(J))) G L = SQRT(SQRT(P(J- 1))) GU = SQRT(SQRT(P(J + 1))) UPPER = G U - GL DENOM = 4 . * G - 2.*(GU + GL) F = FLOAT(J- 1) IF (DENOM. GT. 0.001*UPPER) F = F+ UPPER/DENOM FREQ = F*FBIN

* * ~ * * * * * * * * * * * * * ~ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* Section to transfer results into arrays in order of * * decreasing amplitudes. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

22 CONTINUE

79