Filter results from force measurements
Signal processing becomes more valuable and useful when applied into the problems of different fields such as mining, seismology, oceaonography, climatology etc (apart from the obvious applications in multimedia, communications and control). 

There are devices used to test and measure strength, stress and fracture behaviour of materials that's to be encountered in nature or in man made structures so that a good understanding of the materials stress strain behaviour enables stronger, durable and safer constructions.

One method of obtaining such important information of materials comes from specific lab equipments that test a sample material by providing a controlled force and measure resulting displacements. And the material characteristics is analysed according to the recorded force and displacement measurements.

Therefore the method requires these measurements to reflect the true conditions as accurate as possible in order to make reliable and precise conclusions from them.

There are many reasons why the measurements can be imperfect however. The distortions must have been analysed considering the sample-device mechanical dynamic interactions and any electronic noise or device nonlinearities that can also interfere with the measurements.

Under these circumstances, consider the following imperfect measurement results of a given sample test run:


As can be seen, this is quite an unexpected result from seemingly such a stable (slowly moving) device. One would for example expect a more monotonic curve (though not necessarily a strictly monotonic curve but at least not so much oscillatory either...)

Looking in detail to the first 8000 samples gives the following plot:


A Fourier analysis at this point could be of great help, revealed by the following plot:


Now we are enlightened by the presence of those harmonic spikes that are present at about 8 Hz, 16 Hz and 24 Hz respectively. In addition, there is also a DC looking spike at the origin, but that's actually the signal of interest that we consider as the true measurment which is very slowly (hence DC looking) moving down from -0.5 mV to -1.5 mV on the previous figure.

To verify the presence of 8, 16 and 24 Hz oscillations we further zoom into the signal to observe them directly in time domain rather than indirectly provided by the Fourier analysis computation...


In this very clear cropped portion of length about 100 samples, from the sample 1460 to sample 1560, there are approximately 8 periods of a fundamental oscillation. (And it's also understood from its waveshape that this is not a pure sine wave but involves harmonics of it which create the unsymmetric up down appearence). 

Given the sampling period of $Ts=0.01$ seconds approximateley, this makes the fundamental period of oscillations to be $T_0 = 0.01*100/8 = 0.125$ seconds and therefore the fundamental frequency of the oscillations is found about $F_0 = 1/T_0 = 1/0.125 = 8$ Hz, Just as predicted from the Fourier analysis plot.

So therefore we are convinced both directly from the time domain measurement and also indirectly from the frequency domain computation that there are three quasi-oscillatory components at about 8Hz, 16Hz and 24Hz in addition to the signal itself around DC frequencies. 

So in this case most probably due to mechanical interaction of the force piston and the sample material, there are uncontrolled vibrations occuring, which are casuing the oscillatory measurements. Or it could as well be electronic noise picked up by some reasons undecidable from the measurements alone.

Now, the are a number of solutions which would enable us to get rid of the unwanted oscillations (provied that these oscillations are indeed unwanted !) One of the simplest of them is to use a lowpass filter with an appropriate cutoff frequency. In the following I'm using a simple FIR lowpass filter of cutoff frequency below 8 Hz so that those oscillaitons are removed, but the useful signal is retained. The resulting plot is the following: 

Clearly (or not!) this is an improvement, but a number of extra trials must have been performed in order to decide on the best solutions. The number of taps used was quite high approaching 256. This would induce a group delay of 128 samples, hence care must be taken to interpret the exact timing of the resulting samples. But this is not at all a problem, as long as you can perform non-real time (offline , non-causal) filering and that you know precisely how much delay there will be in the output which is the case here.

A much shother filter could have been designed which would yield much less sample shifts. Also instead of a lowpass filter a harmonic notch filter could also be designed, the decision of which is guided by the useful signal charactheristics.