Vibration studying and analysis can help in identifying some of the major problems in the industrial rotating machines, vehicles, home appliances, and buildings. Technicians use meters or tools to monitor vibration at regular intervals and report vibration read- ings in real time  . New smart devices have embedded sensors that can help in vibra- tion analysis and monitoring. Smart devices refer to power computing devices that have a platform contains a microprocessor and memory and able to run with an operating system. It could be a smartphone, tablet, smartwatch, or any other smart wearable devices. With the increasing pervasiveness and computing power of the smart devices, it has become a part of the daily life activities of the user. In many areas of applications, smart devices can provide an alternative measurement or analysis tools. Of course, the quality of the quality of the results based on the smart devices with low-cost sensors will not be the same the dedicated devices with high-quality sensors. However, the smart devices can be used as a multi-purpose device in uncountable applications. Smart devices have started replacing the personal computer in most of the daily tasks  -  . In the field of sport and fitness, smartphones and wearable smart devices are widely used to provide a complete analysis of the user’s performance including distance, speed, track, and calories. In another area, smartphones are involved in different applications and tools such as a measuring tool for displacement, light intensity, magnetic field intensity, and compassing. In the last few years, researchers have got attracted to use the smartphone with low-cost Micro Electro-Mechanical Sensors (MEMS) in the field of mechanical vibration analysis which gains new achievements day after day. The use of smartphones for vibrations analysis allows researchers of developing new applications for the different rotating machinery devices ranging from small home appliances to industrial factory level.
Machine or structural vibration can take various forms. A particular machine part may vibrate over small or large distances, slowly or quickly, resulting or not resulting a noticeable heat or sound  . Vibrations are not always undesirable; sometimes machine vibrations are designed to have a function purpose such as conveyors, surface finishers, musical instruments and loudspeakers, and ultrasonic probes. However, in other cases, machine vibrations occur unintentionally and could lead to machine damage. Figure 1 shows some examples for undesirable machine vibration. Vibrations
Figure 1. Examples of undesirable machine vibration.
could happen due to numerous conditions which may act individually or in combination. These are some leading causes of vibration such as looseness, imbalance, misalignment, or wear. The consequences of unwanted vibration can be severe which it can speed the equipment damage rate and lead to reducing the performance conditions and production of the working place.
Detailed vibration analysis can be used to observe and make concerning about the health and performance of a rotating machine. If it is measured and analyzed correctly, vibration can be used as an indicator of machine condition, and help guide to take pre-emptive steps to maintain and prevent damages. Vibration is a continuous cyclic motion of a structure or a component that has some important attributes for developing a vibration analysis tool. The low cost MEMS accelerometers can measure object motion information. As any periodic signal, vibration can be analyzed using the frequency domain analysis. A 3D accelerometer is mounted at a point on the vibrating machine or structure to measure accelerations in three orthogonal directions. Then, the velocity and displacement are derived from the measured acceleration. Acceleration, velocity, and displacement are different ways to express the unit of vibration measuring.
In this paper, a novel technique is presented that used for rotating machinery vibration analysis. This method uses Fast Fourier Transformation as a feature extraction algorithm and Fuzzy Logic System (FLS) as the classifier algorithm. A smartphone accelerometer is used to collect the data from the vibrating machine. The rest of the paper is organized as follows. Section 2 explains the importance of the smartphone accelerometer. In Section 3 and Section 4, brief explanations of the FLS and FFT basics are explained, respectively. The detailed steps of the proposed technique are described in Section 5. Results and discussion are presented in Section 6 while Section 7 gives the conclusion of the work.
2. Smart Device Sensors and Measurements
Sensor is a converter that measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument. The vast majority of the smart devices contains a huge variety of sensors. Smart devices have become a favorite tool around the world and even an important part of the daily life activities. There were more than a billion smartphones were sold worldwide in 2014, a 23% increase in shipments for the full year 2013 and 2014   . The sharp decline in the cost of the smart device parts allows growth in the emerging markets. The sensor group includes motion sensors such as accelerometer and gyroscope, magnetic field measurement, light and proximity sensing. Besides that, sound can be sensed using a microphone while images are captured using a camera. Sensors have been used in smartphones since they were presented. New smart mobile devices such as smartphones, tablets, and smartwatches are powerful computing devices which always are held or carried around and have access to a wireless connection  . Every day the smart devices are getting more capabilities to be added to the present ones. So, the user carries only one device, smartphone, instead of carrying different devices each has an individual task. The rapid progress in the smartphones technology allows emerging of new applications. Nowadays, most of the smartphones are programmable and equipped with self-contained, low cost, small size, and power-efficient sensors, such as magnetometers, gyroscopes, and accelerometers. Smart devices technology is continually advancing and growing, attracting developers to new trends of applications. Nowadays, most of the smart devices are programmable and equipped with self-contained, low cost, small size, and power-efficient sensors. All these factors lead to a real opportunity to embed them in many of the personal applications trends.
The earlier versions of smart devices, smartphone, models contained a single MEMS sensor, an accelerometer. The integration of 6 degrees of freedom inertial measurement unit (IMU) within the smart devices enabled the development of new methods dependent on the measurements from the IMU to estimate the human physical movement. The accelerometer is considered one of the most popular components in the smart devices. It can measure the earth gravity and the platform acceleration. In one application, it is used to sense enable the screen rotation of the device from one view to another view (for example from portrait to horizontal) based on the gravity measurements. In other application, it is used in falling protection application. A tri-ad accelerometer axes can be represented in the Cartesian coordinates where each accelerometer provides a measurement for one of the x, y, and z directions as shown in Figure 2. In most of the applications, it is used for estimating the device tilt by measuring the roll and pitch angles. Also, it has been used widely in the navigation applications by determining the travelled distance. The accelerometer is measured in g-force where 1 g = 9.81 m/s2.
There are several important specifications should be taken into account to choose the appropriate accelerometer for any application. The performance of the acceleration sensors are measured in range, accuracy, quantization, sampling rate, noise, and power
Figure 2. Smartphone axes definition.
consumption  . The need for these features is determined based on the nature of the application in which the accelerometer is incorporated. New generations of accelerometers have a selectable range of g-forces they can measure. Most of the smart devices have accelerometers with ranges can vary from ±1 g up to ±8 g. Nowadays, there are different smartphones are working at different ranges such as Samsung Galaxy S4 at ±2 g, Nexus 4 at ±4 g, iPhone 6 at ±8 g, and Moto x 2nd generation at ±16 g. Also, these devices come with different resolutions, for example, 10-bit, 12-bit, 14-bit, and 16-bit for the internal Analog to Digital Converter (ADC). Characteristically, the smaller the range, the more sensitive the readings will be from the accelerometer while, the more resolution, the more readings accuracy. Table 1 shows a comparison between two accelerometers which are found in iPhone 6 plus.
Theoretically, the displacement can be calculated using Equation (1)  :
where d(t) is the total displacement at time t, 𝑑0 is the initial displacement, v0 is the initial velocity, and a(t)is the measured acceleration.
Equation s1 is a continuous function while a(t) is discrete measurement due to sampling. To calculate the discrete displacement, Equation (2) has to be used  .
where ai is 𝑖th sample, and Δ𝑡 is the time interval. Then, the velocity and displacement can be calculated as the following  :
In Equations (3) and (4), i refers to the current value and i − 1 refers to the previous value.
The 3D accelerometer measures the acceleration in three dimensions where the total acceleration is represented by the vector summation of the three components in the three directions as in Equation (5).
Table 1. Comparison between Bosch BMA280 and InvenSense MPU-6500 important specification.
3. Fuzzy Logic System
Fuzzy logic  uses graded or quantified statements rather than ones that are strictly true or false. The results of fuzzy reasoning are not definite as those derived by strict logic. The fuzzy sets allow objects to have grades of membership from 0 to 1. These sets are represented by linguistic variables, which are ordinary language terms. They are used to represent a particular fuzzy set in a given problem, such as “large”, “medium”, and “small”  . Fuzzy Logic System (FLS) had been one of the most important fields in artificial intelligence. It is much closer to human thinking and natural language than the traditional logical systems. Basically, it provides an effective means of capturing the approximate inexact nature of the real world. The essential part of FLS is a set of linguistic rules related by the dual concepts of fuzzy implication and the compositional rule of inference. The methodology of the FLS appears very useful when the process under control is very complex for analysis using the conventional mathematical modeling. So, FLS may be viewed as a step toward a rapprochement between conventional mathematical control and human-like decision making. Experience shows that the FLS is superior to conventional control methods for ill-defined systems or for systems with no mathematical model at all.
Figure 3 shows the basic configuration of an FLS. The fuzzifier maps crisp inputs into fuzzy sets, and the defuzzifier maps fuzzy sets into crisp outputs again. The fuzzy rule base consists of a collection of fuzzy IF-THEN rules, then the fuzzy inference engine uses theses fuzzy IF-THEN rules to determine a mapping from fuzzy sets in the input universe of discourse to fuzzy sets in the output universe of discourse based on fuzzy logic principles  .
Fuzzifier and defuzzifierare based on using a Membership Function (MF) to map the variables between crisp values and linguistic expressions. Each variable at the input side or the output side is assigned for a membership function. There are several possible choices of membership function shape (triangular, trapezoidal, singleton, and Gaussian) as shown in Figure 4. Each variable value is converted into a corresponding linguistic value. For example, N is used for Negative, P for Positive, and Z for zero while B and S refer to Big and small, respectively. In a different way, the linguistic values may take different symbols based on the nature of the variable. For example, terms such as “Very Cool”, “Cool”, “Normal”, “Hot”, and “Very Hot” are used to express temperature. In another example, “Fast”, “Slow”, and “Normal” are used to express the speed of rotor or person.
Figure 3. Basic configuration of the fuzzy logic system.
Figure 4. Some examples for the membership function. (a) Triangle; (b) Trapezoidal; (c) Exponential.
Different characteristics are needed to be considered for the selection and design of the MF shape. First of all, the selection of the MF shape depends on the problem size and type. While the MF value is ranging from 0 to 1, the width of the MF can be varied and different from one MF to another based on the represented variable value ranges. Also, the selection of the suitable MF may consider the simplicity to implement and fast for computation such as triangle and trapezoidal shapes.
There are four basic elements of the FLS; Fuzzifier, Rule Base, Inference Engine, and Defuzzifier. A brief description of each part is given below.
A fuzzifier measures and converts crisp input variables into a fuzzy variable represented by membership grades in some fuzzy sets. To convert from crisp inputs to fuzzy inputs, fuzzy sets and associated membership functions must first be determined for each input.
3.2. Fuzzy Rule Base
A fuzzy system is characterized by a set of linguistic statements based on expert knowledge. The expert knowledge is usually in the form of IF-THEN rules, which are easily implemented by fuzzy conditional statements in fuzzy logic. These rules have the form of Equation (6):
where and are fuzzy sets in and, respectively, and are linguistic variables. Let N be the number of fuzzy IF-THEN with the form of Equation (6) in the fuzzy rule base, then. The variables x and y are the input and output of the fuzzy logic system, respectively.
3.3. Fuzzy Inference Engine
In fuzzy inference engine, fuzzy logic principles are used to combine the fuzzy IF- THEN rules in the fuzzy rule base into a mapping from fuzzy sets in to fuzzy sets in V. A fuzzy IF-THEN rule is interpreted as a fuzzy implication in U × V. Let a fuzzy set A in U be the input to the fuzzy inference engine, then each IF-THEN rule determines a fuzzy set Bl in V using the sup-star composition as in Equation (7).
There are several interpretations  for a fuzzy implication, and in each interpretation we may employ different t-norm or t-conorms; therefore, a fuzzy IF-THEN rule (1) can be interpreted in a number of ways. For simplicity, suppose that and, and the rule (1) is denoted by.
a) Mini-operation rule of fuzzy implication:
b) Product-operation rule of fuzzy implication:
where is define either according to the mini-operation rule:
Or according to the product-operation rule:
The defuzzifier performs a scale mapping from fuzzy sets in V to a crisp point. There are three possible choices of this mapping at least:
a) Maximum defuzzifier
The maximum method produces the point at which the membership function of the fuzzy output reaches a maximum value.
b) Center average defuzzifier
where y−l is the center of the fuzzy set G−l as a point in V at which achieves its maximum value, and assumed that.
c) Modified center average defuzzifier
where is a parameter characterizing the shape of.
4. Frequency Domain Analysis
The signal behavior can be viewed and analyzed in both time domain (TD) and frequency domain (FD) where each domain provides remarkable and unique details about the measures that compose the signal. In TD, data is analyzed over a time period where the variable is always measured versus time. On the other hand, FD analysis refers to refers to analyzing a data with respect to the frequency. It is mostly useful to be used with signals or functions that are periodic over time. FD analysis is widely used in fields such as control systems engineering, electronics, and statistics. There are several transformations to convert from the time domain to the frequency domain and vice versa such as Fourier Transformation (FT) and Wavelet Transformation (WT). The frequency domain contains exactly the same information as the time domain, just in a different form. If the information about one domain is available, then the other domain can be calculated. Given the signal in the time domain, the process of calculating the frequency domain is called decomposition analysis or simply forward FT. If the signal is represented in frequency domain, the calculation of the time domain is called synthesis or simply the inverse FT (IFT). Both synthesis and forward analysis can be represented in equation form and computer algorithms.
Fourier analysis is a family of mathematical techniques, all based on decomposing signals into sinusoids. FT is used to convert a signal of any shape into a sum of an infinite number of sinusoidal waves based on the theory that all complex waves are made up of sine waves combined in various amplitudes, phases, and frequencies. All symmetrical waveforms, like triangle waves, and non-symmetrical waveforms, rectangular pulses with a skewed duty cycle, exhibit the same harmonic distribution with different amplitudes. Figure 5 shows an example of the transformation between the time domain and frequency domain. The signal has two main frequencies at 50 Hz and 100 Hz. The left side shows pure signal while the right side shows the same signal after adding noise.
Fast Fourier Transform (FFT) is one of the most important algorithms in signal processing and data analysis. FFT transforms the sampled signal in the time domain to represent it as a series of spectral peaks in the frequency domain as shown in Figure 5. Each peak denotes the magnitude (expressed in decibels, dB) of the sine wave representing a specific frequency. Given a sequence of N samples f(n), indexed by, the Discrete Fourier Transform (DFT) is defined as F(k), where:
Figure 5. Example for transformation from time domain and frequency domain.
where F(k)components are called the “Fourier Coefficients” or “harmonics”.
The sequence f(n) can be calculated from F(k) using the Inverse Discrete Fourier Transform (IDFT) as shown in Equation (15):
Usually, the sequences f(n) and F(k) are referred to as time domain data and frequency domain data, respectively where both f(n) and F(k) are complex. In most cases, the FFT size is chosen to be a power of 2 (N = 2p).
5. Vibration Analysis Technique
The proposed technique uses the accelerometer data to estimate the vibration level for the rotating machinery. Figure 6 shows the main steps of the proposed method. First of all, he collected data is manipulated with different preprocessing methods to eliminate the unwanted components. This is followed by transforming the data to the frequency domain to extract the important features that characterize the behavior of the signal. Finally, a fuzzy logic system is used to classify the different ranges of the vibration.
Figure 6. The outline of the proposed vibration analysis technique.
5.1. Data Pre-Processing
Pre-processing the low-cost accelerometer data is important to ensure the quality of the measured data. It is recommended to remove the gravity component from the measurements. This can happen by using leveled accelerometer data. The leveling process requires the knowledge of the device tilt angles, roll and pitch. These angles can be estimated using a static period of the data for about 30 seconds to be collected at the beginning of the test as shown in Equation (16).
where represent the mean values of the accelerometer data while ϕo and θo represent the values of the roll and pitch angles respectively.
In order to transfer observations into a horizontal plane, the direct cosine matrix is built by using Euler angle (roll (), pitch () and azimuth ()) as shown in Equation (17). Once the raw accelerometers’ data are leveled, the gravity value g is subtracted from the vertical acceleration component.
Another component to be considered for removal is the total acceleration mean. The total acceleration is calculated using Equation (18).
where fx, fy, and fz are the acceleration vectors in the main directions.
5.2. Feature Extraction Using Frequency Domain
From the signal processing perspective, vibration is defined as a cyclic mechanical motion. Frequency domain provides an idea about the signal main frequency and the different harmonics. The MEMS accelerometers collected data is sufficient for capturing motion information from a rotating machine. Therefore, a 3D accelerometer can offer a good opportunity for mounting flexibility than single accelerometer as the orthogonal orientation of the different axes enables calculating the total frequency regardless the vibration direction. The power spectral plot provides an appropriate way to describe the vibration shape (the relationship between vibration magnitude and frequency). The plot in Figure 7 has both main frequency component the different harmonics of the signal with a primary frequency at 50 Hz.
Figure 7. Power spectral density for periodic signal.
The effect frequencies of the frequency domain are used to analyze the vibration level of the signal. The primary frequency, main frequency, and the average of the harmonics are selected to be inputs for the fuzzy system. The average of the harmonics is calculated for the harmonics above acertain threshold. This threshold is selected based on the experience about the different dynamics and system behavior.
5.3. Frequency Features Based Fuzzy System
The proposed fuzzy system and its main parts are shown in Figure 8. It consists of input, rule base, and output. The inputs are fed from the frequency domain analysis with the magnitude of the main component as first input and the average magnitude of the harmonics magnitudes that are greater than thresholds. The output represents the signal level of vibration.
Figure 9 shows details about the design of the membership functions that represent the input and output variables. Both membership functions are chosen to be repre- sented by Gaussian function while a triangle membership function represents the output variable. Different levels are set for the inputs to cover a wide range of the magnitude values. The ranges are set from very low till very high with a total of six memberships. On the other hand, the output has set to six membership functions ranging from “very weak” to “super high”.
The different rule bases that used for the FIS are shown in Table 2. The rule bases
Figure 8. Fuzzy inference system design.
Table 2. The rule base for the FIS.
Figure 9. Membership functions to represent the input and output variables.
reflect the relation between the different inputs with the output. Figure 10 shows the rule surface viewer for the entire system between the input and output. This plot shows the effect of each membership function on the output.
6. Results and Discussion
In this section, different tests are conducted for the purpose of evaluating the proposed algorithm performance in order to examine the capabilities of the smartphone sensors for measuring different levels of vibration.
The data is collected using a Galaxy s4 smartphone from different speeds of a small rotary machine. The accelerometer measurements are obtained and processed. The sliding window technique is used with window size of 1 second of data. The first step of processing is obtaining the roll and pitch angles from a static period at the beginning. The calculated angles are used to level the data to obtain the vertical and horizontal components of acceleration. The vertical acceleration is used where the gravity component is removed by subtracting 1 g (9.8) m/s2 from the vertical component. The next step is to convert the time domain vertical acceleration into its equivalent frequency domain using the FFT transformation. Using a threshold, all frequencies above the threshold are obtained to calculate the input variables values to the FIS. The first input is the summation of strengths above the threshold while the second input is the number of frequencies with strengths greater than or equal to the threshold. The value of the threshold is determined as a portion of the dc component of the frequency domain, approximately 1.4 of the dc component strength. The strength of all frequencies which are greater than this value is summed to provide input 1 while their number provide input 2 for the fuzzy system.
Figure 11 shows the vertical acceleration data for the first dataset. The figure shows
Figure 10. Surface plot for the rule base.
Figure 11. Vertical acceleration for the first dataset.
that the vertical data is provided after the removal of the gravity component. The acceleration values depict the change in the vibration level as the values are increased at different periods of time. The input to the FIS is shown in Figure 12. The change in the acceleration value is reflected on the frequency domain parameters as illustrated in the figure. The resulted vibration levels are shown in Figure 13. The levels are divided into six different categories ranged from “very weak” to “very strong”.
The second dataset is somehow longer that the first dataset. Figure 14 shows the vertical acceleration data which has varying amplitudes. The input values for the FIS membership at the input side are shown in Figure 15. The resulted vibration levels for the second dataset are shown in Figure 16.
Figure 12. Input 1 and input 2 to the FIS for the first dataset.
Figure 13. The resulted vibration levels from the FIS for the first dataset.
Figure 14. Vertical acceleration for the first dataset.
Figure 15. Input 1 and input 2 to the FIS for the first dataset.
Figure 16. The resulted vibration levels from the FIS for the first dataset.
Vibration analysis is growing and developing and becomes an important characteristic to monitor the performance and condition of most of the machines. It could be used to indicate the need for an immediate maintenance or further assessment of causes. The new technology of low cost MEMS sensors is emerging new trends for vibration analysis where it is facilitating a wider usage for this type of measurements. This paper presents a new technique for vibration level estimation using the FFT feature extractions and fuzzy inference system. The data transforms into the frequency domain to select the appropriate features to identify the level of vibrations. The features are selected based on an adaptive threshold value which is a ratio of the primary frequency strength. The FIS based system estimates the vibration level using the different membership functions. The results show the ability of the algorithm to provide the different vibration levels which reflect the change in the input data correctly. Also, the adaptive selection of the threshold values helps in picking the appropriate vibration level corresponding to the strength of the input data.