**3.2.3 Comparison of STFT and harmonic wavelet**

In the research presented by Lemaster (2004) the various DWT and CWT were compared to the STFT. In addition, direct comparisons between the Harmonic and Daubachies D20 DWT techniques were also conducted. As mentioned previously, the CWT techniques did not provide enough increase in resolution to justify the added computational intensity. Also, a benefit of the Harmonic DWT was that it provided direct frequency information instead of scaling information which is only indirectly proportional to the frequency. So for the remainder of this discussion, a comparison was done between the more established Short Time Fourier Transform (STFT) and the Newland Harmonic DWT.

A series of simulated signals (waves) were generated to compare the ability of the two techniques to detect simulated surface defects including changing frequency and a localized defect (scratch or gouge on wood). The resulting plots were shown in units of length of scan and spatial frequency (marks per inch) to illustrate the plots in terms of spatial frequency for the actual surface scans. The plots consisted of 8192 data points over a 1 inch length of simulated scan. The STFT and DWT plots that were conducted on a reduced data set (every 16th data point for faster calculation speed) missed small defects such as the scratch. As discussed above, for larger defects such as the presence of a periodic component, the reduced data set still yielded a sufficient sampling frequency for the frequency and joint time/frequency analysis while maintaining the high sampling density required for time domain analysis. The first series of comparison was between two sine waves (5 Hz and 20 Hz). These frequencies were chosen because they approximate a single knife and a four knife finish on a typical moulder or planer operation. Two versions of the sine waves can exist, the first is when the two frequencies are superimposed on each other as when there are two sources of machine vibration and the second condition is when the two frequencies are appended to each other as when the feed rate has changed due to an alteration or slippage of the feed system (Figure 12).

The Use of the Wavelet Transform to Extract

Additional Information on Surface Quality from Optical Profilometers 115

The next set of simulated surface scans was for a localized defect such as a dent or scratch in the surface while still having knife marks. Since the lower frequencies of knife marks have proven to be more difficult to detect, a surface scan of 5 marks per inch with a small scratch in the surface was simulated. This surface profile is shown in Figure 14. This signal had a 5 Hz sine wave with a peak-to-peak amplitude of 2.0 and a scratch that had an amplitude of 1.5. Figure 15 show the STFT and harmonic wavelet plots respectively. Both the STFT and the harmonic wavelet detected the scratch in the surface. The STFT had to be adjusted so that the length of the analysis window and the amount to advance the window each time was much smaller than previous analyses. This means that a prior knowledge of the type of defect expected is required in order to use the STFT method on-line. Though this configuration of the STFT could detect the scratch, it resulted in a loss of resolution in detecting the 5 Hz sine wave. The harmonic wavelet could detect the scratch with no adjustments to the analysis. Additional tests for both the STFT and the harmonic wavelet showed that the scratch had to be larger than the peak height of the sine wave to be detected. Neither the STFT nor the harmonic wavelet could detect the scratch of a simulated surface scan that had a scratch amplitude of 1.0 with the 5 Hz sine wave having a 2.0 peak to peak amplitude. This means that a scratch would have to be at least of the same magnitude of the knife marks in order to be detected. The Newland HWT has the advantage in that frequency is accurately plotted rather than scale and its use

was chosen for the signal analysis of the remainder of this research.

Amplitud


Fig. 14. Simulated surface profile of 5 Hz sine wave (5 marks per inch) with "scratch"

Scan Length 0.0 0.5 1.0 1.5 2.0

Fig. 15. STFT (left) and HWT (right) of 5 Hz sine wave with "scratch"

Fig. 12. Time domain signal of two superimposed sine waves (left) and two appended sine waves (5 Hz and 20 Hz)

Figure 13 (left) shows the time-frequency plot of the STFT of the two appended sine waves. From this figure it can be seen that a ridge is detected at 5 Hz extending from 0 to 1.0 second and a second ridge is detected at 20 Hz extending from 1.0 to 2.0 seconds. The edges of the ridges are sloped and not sharp. Similarly in Figure 13 (right), which shows the timefrequency plot of the appended sine waves for the HWT, the two ridges are detected at 5 and 20 Hz and extending only half way across the time axis as they should. The ridge at 5 Hz, however, is not as well defined as the ridge at 20 Hz.

Fig. 13. STFT plot (left) of two appended sine waves (5 Hz and 20 Hz)(used every 16th point of 16384 point data file, 256 point window moved at 2 point intervals and Harmonic wavelet (right)(used every 16th point of 16384 point data file)

From these two figures, it appears that both the STFT and the harmonic wavelet can easily detect the two appended sine waves and provide information regarding where in the time domain the frequency of the sine waves change. The harmonic wavelet appeared to attenuate the lower frequency on the appended sine waves. The STFT attenuated the edges of the ridges at both frequencies.

Amplitude


Fig. 12. Time domain signal of two superimposed sine waves (left) and two appended sine

Time (sec) 0.0 0.5 1.0 1.5 2.0

Figure 13 (left) shows the time-frequency plot of the STFT of the two appended sine waves. From this figure it can be seen that a ridge is detected at 5 Hz extending from 0 to 1.0 second and a second ridge is detected at 20 Hz extending from 1.0 to 2.0 seconds. The edges of the ridges are sloped and not sharp. Similarly in Figure 13 (right), which shows the timefrequency plot of the appended sine waves for the HWT, the two ridges are detected at 5 and 20 Hz and extending only half way across the time axis as they should. The ridge at 5

Fig. 13. STFT plot (left) of two appended sine waves (5 Hz and 20 Hz)(used every 16th point of 16384 point data file, 256 point window moved at 2 point intervals and Harmonic wavelet

From these two figures, it appears that both the STFT and the harmonic wavelet can easily detect the two appended sine waves and provide information regarding where in the time domain the frequency of the sine waves change. The harmonic wavelet appeared to attenuate the lower frequency on the appended sine waves. The STFT attenuated the edges

waves (5 Hz and 20 Hz)

Amplitude


Hz, however, is not as well defined as the ridge at 20 Hz.

Time (sec) 0.0 0.5 1.0 1.5 2.0

(right)(used every 16th point of 16384 point data file)

of the ridges at both frequencies.

The next set of simulated surface scans was for a localized defect such as a dent or scratch in the surface while still having knife marks. Since the lower frequencies of knife marks have proven to be more difficult to detect, a surface scan of 5 marks per inch with a small scratch in the surface was simulated. This surface profile is shown in Figure 14. This signal had a 5 Hz sine wave with a peak-to-peak amplitude of 2.0 and a scratch that had an amplitude of 1.5. Figure 15 show the STFT and harmonic wavelet plots respectively. Both the STFT and the harmonic wavelet detected the scratch in the surface. The STFT had to be adjusted so that the length of the analysis window and the amount to advance the window each time was much smaller than previous analyses. This means that a prior knowledge of the type of defect expected is required in order to use the STFT method on-line. Though this configuration of the STFT could detect the scratch, it resulted in a loss of resolution in detecting the 5 Hz sine wave. The harmonic wavelet could detect the scratch with no adjustments to the analysis. Additional tests for both the STFT and the harmonic wavelet showed that the scratch had to be larger than the peak height of the sine wave to be detected. Neither the STFT nor the harmonic wavelet could detect the scratch of a simulated surface scan that had a scratch amplitude of 1.0 with the 5 Hz sine wave having a 2.0 peak to peak amplitude. This means that a scratch would have to be at least of the same magnitude of the knife marks in order to be detected. The Newland HWT has the advantage in that frequency is accurately plotted rather than scale and its use was chosen for the signal analysis of the remainder of this research.

Fig. 14. Simulated surface profile of 5 Hz sine wave (5 marks per inch) with "scratch"

Fig. 15. STFT (left) and HWT (right) of 5 Hz sine wave with "scratch"

The Use of the Wavelet Transform to Extract

Amplitude (in)


by loss of abrasive


0

5000

10000

Distance (inches) 0.0 0.5 1.0 1.5 2.0 2.5 3.0

Fig. 18. Harmonic wavelet transform of specimen with sanding ridges

plot also shows how the frequency changes along the length of the surface.

**4.2 Surface with varying frequency of knife marks** 

Additional Information on Surface Quality from Optical Profilometers 117

Fig. 17. Profile (left) and frequency spectrum (right) of specimen with sanding ridges caused

This section shows a situation in which the knife marks occurring on the surface change in frequency along the length of the surface. This type of surface defect could be due to slippage occurring in the feed works of the machining operation or a slowing of the cutterhead rpm due to motor overload. This type of defect may be both non-stationary (among different workpieces) as well as non-stationary within a workpiece. Figure 19 shows a photograph of this type of surface characteristic. The surface profile (Figure 20, left) shows the varying wavelengths as well as the varying amplitudes on the surface of the workpiece. The frequency spectrum (Figure 20, right) shows the difference in the amplitude of the two frequencies as well as the difference in the spatial frequencies. The harmonic wavelet plot (Figure 21) shows the predominant frequency extending across the majority of the surface scan but changing in amplitude but also with varying frequencies present like a chirp. This

Magnitude (in)

> Spatial Frequency (marks per inch) 0 20 40 60 80 100
