# Time synchronous averaging - MATLAB

I have a time domain signal that corresponds to a vibration signal of a machine. I have a second signal that corresponds to a tachometer signal (There is a pulse every one revolution of the shaft). I'd like to use time synchronous averaging under MATLAB. I'd like to take all blocks of time from the time domain signal whose durations is the duration of one revolution of the signal and average them out. The problem I have is that the speed of the shaft is slightly fluctuating. I've set it to 900RPM but it goes from 895RPM to 904RPM during the acquisition and so the duration of one revolution fluctuates as well (some miliseconds). My question is would averaging blocks of signals of different durations be a problem? And if so, how should I deal with this?

• What is your sample rate? – Stanley Pawlukiewicz Jul 11 '17 at 20:57
• Good afternon sir ; I am using matlab R2017a. and the tsa function dosen't work .what to do? Greetings – SAFA BOUDHRAA May 28 '18 at 13:35

The answer to your question "is it a problem" is really up to you to determine. Sometimes the simple things work well enough.

There is a technique called Dynamic Time Warping:

https://en.wikipedia.org/wiki/Dynamic_time_warping

and Matlab has a function dtw

https://www.mathworks.com/help/signal/ref/dtw.html

which can use to figure out if it is a problem.

I suggest you pick a reference interval, that would be the closest to the average shaft interval and use that to warp the rest against.

• I didn't know about the DTW algorithm till you'd mentioned it. I've found a paper on the subject which states a method that works even if the speed fluctuates and we have no tachometer signal. Here is the link to the paper citeseerx.ist.psu.edu/viewdoc/… DTW is just one brick out of three in the mehod proposed by this paper – chsafouane Jul 12 '17 at 7:32

You sample your data at fixed sampling rate in time?

However, the time delay between 2 revolutions is not constant as you mentionned your RPM is not constant.

If you split the data in blocks that correspond to one revolution, your blocks won't have the same length in time.

• That is exactly the problem. Is there a way to get something out of the tachometer signal and apply the TSA algorithm? – chsafouane Jul 11 '17 at 21:16
• You likely need to resample the data by converting the data to a position-based sampling instead of a time-based sampling. You would need to estimate the position of your shaft for each of the time sample. – Ben Jul 11 '17 at 21:21

In this type of problem the common approach is to resample the data from the time domain to the angle domain. The steps involved are:

1. Use the tachometer signal to obtain a speed signal. This is the inverse of the difference in time for each trigger point.
2. Depending upon the variability of the tachometer signal least squares cubic spline fitting is often used. Matlab spline library will work as will matlab central libraries. I use the fastBspline library.
3. Integrate the speed signal to obtain shaft angle position.
4. Determine the equal angle increments that you want to use. Keep the Nyquist theorum in mind, in other words there should be roughly the same number of points in the angle domain as in the time domain.
5. Switch the (time, angle) data to (angle, time).
6. Resample the (angle, time) data to obtain uniform angle increments.

Once this is done, do all the same processing you would have done, but now you are in the angle order domain.