Frequency domain characterization of the vibrations of a tuning fork by vision and digital image processing

We demonstrate an experimental setup and associated digital image processing software for measuring the vibrational amplitude of a tuning fork with subpixel accuracy. Stroboscopic illumination allows the use of a standard video camera to explore the resonant frequencies up to the kHz range. No preliminary surface patterning is required because the image processing is based on features present in the object’s structure. Because the tuning fork is a high quality-factor resonator, it can be used for demonstrating the spectral power distribution of various excitation signals and the temperature dependence of the resonance frequency. The procedure can be generalized to the measurement of the in-plane lateral displacements of any structure. © 2008 American Association of Physics Teachers. DOI: 10.1119/1.2967705


I. INTRODUCTION
Measuring the displacement of vibrating mechanical structures is important for characterizing the material properties or the eigenmodes of an object.Out-of-plane displacements are usually characterized by holographic or interferometric methods leading to subwavelength accuracy.In-plane displacement characterization presents a challenge which can be addressed by digital image processing methods.Crude methods such as sampling with a period much shorter than the vibration period give results that are limited by either the contrast of the structures on the object or the object size corresponding to a single image pixel. 1 Measuring the vibrational amplitude of oscillating resonators with subpixel accuracy requires stroboscopic illumination and efficient image processing methods. 2 In this paper we report on the application of a stroboscopic technique to the characterization of an acoustic tuning fork.We chose the latter because tuning forks are widely used in undergraduate teaching for illustrating resonance.Beyond the recording of the sound generated by a tuning fork hit by a hard object, 3 little is known of the actual characteristics of a tuning fork such as its quality factor or the temperature dependence of the resonance frequency.Such measurements require measurements of the mechanical vibrations of the tuning fork subject to a continuous excitation.In this paper we demonstrate this kind of measurement and show how readily available equipment ͑a personal computer with a sound card, an audio amplifier, and a digital camera͒ can be used for precise measurements of a vibrating structure thanks to digital image processing.The analysis illustrates some of the well-known Fourier characteristics of classical waveforms and the dependence of the properties of this system on the temperature.

II. EXPERIMENTAL METHODS
We wish to visualize the vibrations of a tuning fork in a continuous, forced regime and measure the vibrations while the excitation frequency is swept so that the tuning fork can be fully characterized in the frequency domain.Because we also wish to make the setup affordable, the motion of the tuning fork is observed at a standard video rate with a commonly used camera. 4We chose a CMOS camera ͑uEye UI-1540-M͒ connected to the USB port of a personal computer and a C-mount zoom lens ͑Computar MLH-10x͒ to form the image of the prong-end surface on the image sensor.The observation of the vibrations up to the kHz range is based on stroboscopic illumination.We generate the drive signals by means of the stereo sound card.One channel is used for exciting the tuning fork and the other for exciting the pulses for driving the LED ͑Luxeon Star/LXHL MWEA͒ used as the light source.The control signals are synthesized by custom software with a frequency resolution of 0.1 Hz, which is limited only by the size of the buffer in which the signal is computed.One advantage of software synthesis of the signals, beyond requiring little hardware and hence being cost effective, is the ease with which various signal shapes can be selected.Few commercial synthesizers provide synchronized outputs based on the same reference clock.We have successfully used the Tektronix AFG320 to replace the sound card output.
We also had to identify a suitable excitation method for transferring energy from an actuator to the tuning fork.6][7][8][9] Energy transfer results from a combination of magnetic and acoustic coupling as we will discuss.The speaker position is adjusted using a positioning table with sub-millimeter accuracy.We will discuss in Sec. 4 the stability of the vibration amplitude resulting from this excitation method.
Figure 1 includes a schematic diagram and picture of the experimental setup.A two-channel audio amplifier ͑Sony XM-SD12X 250 W͒ amplifies the sound card outputs to the levels required for driving the LED and the speaker.A 2 Hz frequency shift is systematically applied between the speaker excitation and LED triggering.This choice produces a con-stantly shifting phase between the excitation of the tuning fork and its illumination.Therefore, the prong motion is observed with an apparent frequency of 2 Hz, compatible with the standard video rate.The LED is triggered by 60 s pulses, ensuring negligible averaging of the prong motion.In this way video sequences of the prong motion are recorded and the vibration amplitude is retrieved by digital processing of these image sequences as explained in Sec.III.
Figure 2 shows several recorded images of the end face of one prong of the tuning fork with different magnifications adjusted by means of the zoom lens.The magnification is determined by imaging calibrated patterns; the vibration measurements reported here were performed with one pixel corresponding to 5.8 m on the object.

III. IMAGE PROCESSING METHODS
For the experimental conditions we have described the tuning fork oscillations induce a rigid-body lateral displacement of the prong end face.The aim of the image processing is to retrieve the lateral displacement values from the recorded image sequences.The most conventional way to do so would be to use image cross-correlation with the location of the correlation peak directly giving the displacement value.Subpixel accuracy can be obtained by over-sampling digitally the initial images.][14] Instead of using the well-known correlation method, we chose an approach based on an interesting property of the phase of the Fourier transform.In this section we first present the pure phase shift produced in the Fourier spectrum by a spatial shift of the object.Then, we introduce an iterative algorithm which retrieves the spatial displacement by processing the spectral phase.Finally, we discuss some results obtained with this approach and other considerations.
The phase approach is an opportunity to emphasize the useful relation between the spectral phase and the relative displacement in the spatial ͑or temporal͒ domain.The latter is not well known because the Fourier transform is primarily known as an efficient tool for spectral component extraction or rejection by suitable filtering of the Fourier spectrum and inverse Fourier transform.Matlab code can be downloaded for implementing the required image processing. 15Experimental images are also available for demonstrations.The iterative algorithm can be avoided by using image crosscorrelation which also provides subpixel resolution.

A. Relation between spatial displacement and spectral phase
We consider the lateral displacement of the prong end face as a rigid body.The image recorded at time t i is a shifted form of the image recorded at time t = 0 and can be expressed as where ‫ء‬ represents the convolution product, ␦ stands for the Dirac impulse distribution, and ͑⌬ x , ⌬ y ͒ is the lateral shift between the two images.Equation ͑1͒ does not consider the finite extension of the imaged area which makes the objects observed before and after displacement not rigorously identical.This point and other side effects will be discussed later, but let us first accept Eq. ͑1͒.With this assumption, we consider the Fourier transform of Eq. ͑1͒: where u , v are the reciprocal spatial frequencies of x , y, and I ˜͑u , v͒ represents the Fourier transform of I͑x , y͒.Equation ͑2͒ shows that the effect of a lateral displacement in the spatial domain modifies only the phase in the spectral domain. 10,11The phase difference ⌬͑u , v͒ between the Fourier spectra before and after displacement can be written as

͑3͒
This phase difference is a tilted plane whose slopes versus u and v are directly proportional to the displacement.Therefore, the identification of the displacement is obvious from the map of the spectral phase difference.
The application of these principles to actual image processing is more complicated because of the way of determining the spectral phase.The argument of the complex spectrum results from an inverse tangent function which is defined only in the interval ͓− , ͒.Thus, the wrapped phase difference available numerically has the form

͑4͒
where ͑i , j͒ are the indices of the digital image and k ij is an integer resulting from the 2 modulus operation at pixel ͑i , j͒.Thus, the actual starting point of the digital processing for the retrieval of subpixel ͑⌬ x , ⌬ y ͒ is given by Eq. ͑4͒, which is less convenient than Eq.͑3͒ because of the presence of the constants k ij .The k ij constants have to be identified before determining the object displacement from Eq. ͑3͒.This problem is a particular case of phase unwrapping because we know a priori that the final result is a phase plane.We applied an iterative algorithm as we will describe in the following.

B. Iterative algorithm for displacement retrieval
We used a solution based on a spectral phase algorithm.The latter has been applied to the identification of the center of a symmetrical object in one 16 and two dimensions. 17It is well known that the Fourier spectrum of a symmetrical object ͑or even function͒ is real.Therefore, the spectral phase map is uniformly equal to zero.If such an object is shifted from the central position, the spectral phase of the corresponding Fourier spectrum is given by the exponential terms of Eq. ͑2͒.Therefore, the phase difference of Eq. ͑4͒ is given by the wrapped phase of a single Fourier spectrum.The algorithm proposed by Oriat 17 can be applied to object displacement measurements as has been demonstrated for speckle pattern images. 18Details can be found in Refs.16  and 17, and we present here only the basic principle of the algorithm.The first assumption is that the image displacement remains smaller than ͑M / a , N / b͒, where M and N are the image size in pixels and a and b are constants typically equal to 8 or 16.This condition implies that the k ij constants are equal to zero for spatial frequencies less than ͑M / 2a , N / 2b͒.A preliminary estimate of the displacement is evaluated from this restricted set of spatial frequencies.Then this preliminary value is used for the prediction of the k ij constants of the neighboring spatial frequencies and a new estimate of the displacement based on a larger set of spatial frequencies is made.This prediction-correction procedure is repeated by considering an additional spatial frequency at each iteration.The estimate converges uniformly to the actual one.This algorithm is implemented with a specific monitoring of the noise.The phase of a Fourier spectrum is known to be very sensitive to noise, especially for lowmodulus spectral components.In the recursive algorithm we used the phase values are weighted by their modulus to give the largest importance to the spatial frequencies that are the most representative of the object.The image processing software and demonstration images are available. 15

C. Reconstructed displacements and discussion
Figure 3 presents a typical example of the convergence of the algorithm to the actual displacement values.As we discussed, the displacement of each image of the recorded video sequences is computed with respect to the first image which is taken as a reference.Figure 4 shows a typical result of a prong displacement measurement which was reconstructed using the spectral phase algorithm.
Discontinuities can be observed in the displacement curve which results from missing images in the video sequences and appears because of excessive computer load.These discontinuities can be avoided by properly managing the activity of the central processing unit.A practical solution is to record the same sequence twice, because cache memory has been allocated during the first execution of the software and is still available for immediate access during the second run: the second one overwrites the memory space used for the first one and in our case no images were missing.
The accuracy of the spectral phase method was validated by using another method. 19For that purpose a dot pattern printed on a small piece of paper was stuck on the prong end and results obtained with the two methods were compared successfully.
The spectral phase algorithm was also compared with image cross-correlation. 18The spectral phase algorithm was found to be a little faster than image cross-correlation with peak interpolation methods and achieved the same accuracy in displacement measurements.
The spectral phase algorithm we used assumes that the object images are the same before and after displacement.The analytical definition of the acceptance limits of this assumption is difficult to define.In a black and white image ͑black means low level, white means high level͒ the energy distribution in the image is directly related to the local brightness of the image.A bright area contains more energy and therefore affects more significantly the Fourier spectrum than a black area.If bright spots are close to the edge of the image, they will appear and disappear during vibration.Therefore, the image Fourier spectrum will evolve significantly and the algorithm hypothesis is less valid.In contrast, if the image areas close to the edges remain dark, the impact of vibration on the Fourier spectrum is minimal and the algorithm will work well and hence yield more accurate vibration amplitude measurements.Experimentally, the algorithm was found to be very robust for object displacements up to 8 to 15 pixels and for computations based on a region of interest of 128ϫ 128 pixels.The object dependence of the robustness of the algorithm can be easily demonstrated experimentally.
If the region of interest is selected in such a way that one or several bright spots are close to the edge, we observe that the maximum vibration amplitude which leads to the convergence of the algorithm is reduced to 5 pixels or less.In contrast, if the region of interest is shifted to remain dark near the edges, then much larger displacements are acceptable ͑more than 20 pixels͒ for the same vibration amplitude.The observation of the dependence of the algorithm convergence on the object features is of particular interest in a teaching environment.Similar behavior is known to occur in image cross-correlation.Both methods do not work for image rotations.

IV. RESULTS
As described in the following, the setup and the image processing software allow a complete exploration of the tuning fork's behavior, a characterization of the tuning fork excitation used, as well as the didactic observation of the known properties of signal theory.

A. Tuning fork excitation and resonance curve
The description of the resonance curve of the tuning fork is the primary result expected from a frequency domain analysis.This study was done by measuring the prong vibration amplitude versus the frequency of the sine wave applied to the speaker.Figure 5 shows the plot obtained.The resonance frequency is close to 439.9 Hz and the estimated quality factor Q = 2500Ϯ 200.
We now investigate the physical processes involved in the noncontact energy transfer from the speaker to the tuning fork.This analysis was carried out by progressively increasing the distance between the speaker and the prong.We assume that the relative vibration amplitude versus distance is representative of the coupling efficiency between the speaker and tuning fork.The tuning fork vibration amplitude was found to depend on this distance as shown in Fig. 6 for two excitation frequencies ͑in and out of resonance͒.Although artefacts are present at 439.9 Hz ͑for instance at d = 5.5 mm͒ we observe the same behavior in both cases.The efficiency of the energy transfer is highest when the prong is closest to the speaker.As the distance is increased, the energy transfer efficiency decreases rapidly, experiences a minimum, and then increases to an efficiency which slowly decreases as a function of the distance.We interpret this dependence as a combination of magnetic and acoustic coupling.At very small distances the dominant effect is due to the modulation of the magnetic attraction exerted on the ferromagnetic material of the prong.This modulation results from the alternating current flowing through the coil.This effect vanishes  rapidly as the distance is increased.The second phenomenon is acoustic coupling.Because of the dimensions of the speaker ͑diameter 55 mm͒, tuning fork ͑prong length 80 mm͒, and the acoustic wavelength ͑0.775 m, no significant variation of the acoustic coupling is expected with a variation of the speaker-prong distance of a few millimeters͒. 20The efficiency of the acoustic coupling varies slowly in the centimeter range of distances considered here.The observed minimum in the curve is due to the superposition of the two phenomena with opposite phases.The acoustic and magnetic forces produced by the speaker can be either in or out of phase depending on the relative position of the different parts.The actual phase of the coil displacement is determined by the orientation of the permanent magnetic field and the current flowing through the coil.In contrast, the phase of the ac magnetic field produced by the coil is determined only by the orientation of the current flowing through it.By reversing the magnet poles, the direction of the coil motion can be changed without modifying the alternating magnetic field.The motion of the coil and the alternating magnetic field can be oriented either in the same direction or in opposite directions.Figure 7 presents the two possibilities by changing the relative position of the coil and the membrane with respect to the magnet.These consideration are not relevant for the intrinsic, that is, acoustic, specifications of the speaker.There is probably a random distribution of in phase or out of phase cases for different speakers.The distribution can be verified experimentally.

B. Experimental observation of the spectral distribution of common signals
Because of its high quality factor, the tuning fork is a very selective frequency filter.Its vibration amplitude is a good measure of the presence of its resonance frequency band in the spectrum of the excitation signal.We have used this measure to demonstrate well known signal theory properties.Figure 8 presents two examples of measured vibration amplitudes when the excitation is turned on.We observe that the vibration amplitude does not increase monotonically, but undergoes oscillations that are more intense than the final forced regime.This observation illustrates the broadening of the Fourier spectrum of sine signals because of their short time duration. 21The spectrum of a sine wave at angular fre-quency =2f generated during the time T is sin͑T͒ / ͑T͒, which is a broadband signal for small T. In our case this broadband excitation means that the sharp initialization of the sound card induces the vibration of the tuning fork on its resonance frequency f r , while further excitation at f f r induces a beat with period ͉f − f r ͉ −1 .The amplitude modulation observed here provides the difference between the forced regime frequency f and the resonance frequency f r .The beat signal will decrease with a decay time constant of Q / ͑f͒.If we wait long enough for the forced regime to be established ͑that is, for the natural resonance frequency component to die out͒, we observe that the vibration amplitude is constant for a constant excitation voltage sent to the speaker.Such These examples also illustrate that a gated sine wave induces a broadband signal; the shorter the duration of the excitation, the broader the range of frequencies generated.The two asymptotic cases are the pulse, which generates all frequencies within the frequency range of the amplifier, and continuous frequency generation, which induces a forced regime at a fixed frequency.Other common cases are triangular and square shaped excitation signals which are easily synthesized by the sound card and for which the energy distribution in the overtone frequencies is well known: 1 / ͑2N +1͒ 2 and 1 / ͑2N +1͒ respectively for overtone ͑2N +1͒ of the excitation frequency. 22We observed these properties by sending various signal shapes to the speaker at frequency f r / 3. The results presented in Fig. 9 demonstrate that the tuning fork can be excited at its resonant frequency by a nonsinusoidal excitation signal at f r / 3. The vibration amplitude was found to be 4.25 times larger for the square signal than for the triangular signal; the sine signal does not induce vibrations.͑We might expect the ratio to be 3 instead of 4.25 because of the relative power of the harmonics.The former ratio requires that the power contained in the fundamental frequency is the same for both signal shapes, which is not satisfied because we work at constant amplitude.͒The power of the overtones of a triangular signal with respect to a square signal depends on the mean power carried by each signal.In our case we worked at constant amplitude and the square signal supplies more power than the triangular one.
We evaluated these measurements of the tuning fork amplitude by doing a spectrum analysis of the excitation signals.The results are summarized in Table I.The case of the sine signal is obvious because there are no harmonics.Square and triangular signals have overtones as expected, and their relative power with respect to the fundamental component agrees with the theoretical prediction of 1 / ͑2N +1͒ and 1 / ͑2N +1͒ 2 , respectively.The ratio of 4.4 between the square and triangular shapes at the tuning fork resonant frequency is consistent with the 4.25 factor seen in Fig. 9.
To assess the resonance frequency drift with temperature, we performed several resonance frequency measurements at temperatures 21.4 °C and 25.0 °C ͑see Fig. 10͒.For each temperature we fitted the data to a damped oscillator curve to identify the resonant frequency.We observed a resonance frequency shift of −0.016 Hz/ °C.We know 23 that the resonance frequency f of a tuning fork is given by f ϰ ͑a / ᐉ 2 ͒ ͱ E / , where a is the thickness of the tuning fork, ᐉ its length, and E and are respectively the Young modulus and the density of the material of the tuning fork.Most metals display a thermal coefficient of expansion around ␣ =2ϫ 10 −5 °C−1 so that the contribution of the dimension of the prongs to the frequency shift is ⌬f / f =−⌬ᐉ / ᐉ = ␣; that is, ⌬f = f␣ Ӎ 0.01 Hz/ °C, assuming that E and are independent of temperature.This result is in agreement with the measured value of 0.016 Hz/ °C considering the uncertainty of the thermal expansion coefficient and the prong temperature which was measured with a Pt100 probe located in an air-conditioned room.

V. CONCLUSION
We have demonstrated a digital image processing method for characterizing in-plane two-dimensional vibration amplitudes in the audio frequency range with subpixel accuracy.We applied this method to the characterization of a tuning    fork.The method uses surface defects for motion detection and requires no additional patterning of the sample being observed.
We used the result of signal processing to illustrate several quantities that characterize a high quality factor resonatorthe value of Q, the forced regime stabilization time, the energy distribution of the overtones of common signal shapes, and the temperature dependence of the resonance frequency.
We used as little hardware as possible to keep the experimental setup compatible with a teaching budget; the stroboscopic illumination signal and the acoustic excitation signal are both generated by the two stereo channels of a computer sound card, and images are recorded by a camera connected to a USB port of the same computer.The software for sound generation and signal processing are available.

Fig. 2 .
Fig. 2. ͑a͒ Image of the prong end face ͑5 ϫ 4 mm 2 ͒ recorded during oscillation.͑b͒ 128ϫ 128 pixel image acquired with a higher magnification for digital processing to extract the image displacement with respect to a reference image ͑actual size: 742ϫ 742 m 2 ͒.Note that no artificial pattern is visible; the displacement retrieval is based on natural features such as surface roughness and defects.95 96 97 98 99 100 101 102 103 104 105

Fig. 3 .Fig. 4 .
Fig. 3. Evolution of the estimated displacement during the iterative process of the spectral phase algorithm.

Fig. 7 .Fig. 8 .
Fig. 7. Combination of the acoustic and magnetic forces produced by a speaker.m: membrane; M: permanent magnet; dashed lines: lines of the magnetic field; C: coil; T: tuning fork; B: induction due to M; I: current flowing through C; D: coil displacement resulting from I and B. b: induction due to C and I. Fm: permanent force exerted on the prong by the magnet; f: modulation of the magnetic force due to the coil.The acoustic force produced by the membrane motion is in the same direction as D. b and f change direction with I.The magnetic and acoustic forces are in phase in the left case, while they are out of phase in the right case.The coil is placed on the side of the magnet to optimize the projection of the vector product of B and I in the displacement direction.

Fig. 9 .
Fig. 9. Vibration amplitude with an excitation at 146.6 Hz for different signal shapes.The observations were done at a stroboscope frequency of 437.8 Hz.

Fig. 10 .
Fig.10.Thermal drift of the resonance frequency as found experimentally.The data were fitted with a resonance curve function to accurately identify the resonance frequency.

Table I .
Power spectral distribution for different signal shapes measured with a spectrum analyzer.The ratio f / f 0 is compared to the expected value given in parentheses.The curves in Fig.9should be compared to the ratio of 4.4 at the resonant frequency.