The cepstrum (pronounced KEP-strum or SEP-strum) is a signal processing technique performed on a time-domain signal to look at periodic content in data, such as harmonics, sidebands, and orders.
The cepstrum is sometimes referred to as a “spectrum of a spectrum” because it involves calculating the spectrum of the time signal and then performing another spectral operation. It is calculated by first taking the Fourier transform of a time signal to create a frequency spectrum, converting it to a log scale, and then performing an inverse Fourier transform on the spectrum (Figure 1).
Figure 1: Flowchart for implementing a basic cepstral algorithm.
Because the cepstrum comes from an inversion of spectrum, the name “cepstrum” is derived by reversing the first few letters of “spectrum”.
Cepstrum analysis is widely used in a number of applications including diagnostic of gear and bearing noise, voice recognition software, and seismic analysis.
In gear analysis, they are useful for
Fault Detection: Gears output a specific vibration signature that directly relates to the speed of rotation, the gear ratio, and the number of teeth or elements a gear can have. Gears can create what are called “Side Bands” that are unique spectral signatures that can indicate if a gear is defective. In complex rotating systems that exhibit a lot of noise and vibration, cepstral processing can help identify the noise issues.
Condition monitoring: Cepstral analysis can be used for preventative maintenance, allowing parts to be replaced or repaired before they fail. This is done by tracking cepstral changes over time for gears and rotating components as they wear.
This article will provide a brief history, some background, examples, and applications of the cepstrum: 1. Background 1.1 Common Terms 1.2 History 1.3 Harmonics 1.4 The Fourier Transform 2. Cepstral Algorithm 3. Signals and Their Cepstrum Transforms 4. Application Examples 4.1 Gear Pair Defect 4.2 Sideband Analysis 4.3 Order Analysis and Cepstrum
1. Background
Background, history, and terminology for cepstrum analysis.
1.1 Terms
Since the name cepstrum comes from reordering the first few letters of “spectrum”, many of the terms related to the cepstral domain have also been altered to indicate that cepstral processing has occurred. Some common ones include:
Quefrency from frequency
Saphe from phase
Liftering from filtering
Rahmonics from harmonics
Because only the log of the amplitude is kept when the signal is in the frequency domain, it doesn’t translate back to the same time signal when a inverse Fourier transform is performed. Instead, the signal is now in the “quefrency” domain.
1.2 History
Cepstrum analysis has been described in several published papers for voice recognition and defect detection:
1963 - Mathematicians Bogert, Healy, and Tukey. Its original application was in voice analysis. Human voices often consist of multiple harmonics, making cepstral analysis particularly useful for analyzing voice pitch, and even separating multiple voices present on a recording.
1980s and onward - Professor Robert Randall published multiple papers on use of cepstrum to identify faults in gears.
1.3 Harmonics
To understand exactly how the cepstrum works, it is helpful to understand the concept of harmonics. Harmonics are integer multiples of a fundamental frequency. Imagine striking a 440 Hz tuning fork against an object and listening to the sounds it makes. The spectrum of the tuning fork sound will not only contain the fundamental 440 Hz frequency but harmonics of 440 Hz as well (Figure 2),
Figure 2: Frequency spectrum of a 440 Hz tuning fork.
Notice how the harmonics are all evenly spaced at a frequency of 440 Hz. Each harmonic is a positive integer multiple of the fundamental frequency of 440 Hz (880 Hz is 440 Hz multiplied by 2, 1320 Hz is 440 Hz multiplied by 3, and so on). Defects in rotating machinery often create harmonic content. Instead of a single fundamental frequency that corresponds to the speed of rotation, the defect will create harmonics with similar magnitude to the fundamental frequency magnitude in the rotating system.
Harmonics can be difficult to identify in a frequency spectrum plot with lots of other sounds and noise in complex systems. The consistent spacing between harmonics makes the cepstral domain particularly useful in harmonic analysis.
More information on harmonics in the knowledge articles:
Cepstral analysis uses the Fourier transform. A Fourier transform works by taking a signal and breaking it down into a unique combination of sinewaves. Looking at the red signal in Figure 3, it can be difficult to determine the different frequencies that make up the waveform. This gets exponentially more complicated for real signals.
Figure 3: An example of the deconstruction of a wave into its sinusoidal components using a Fourier transform.
A Fourier transform will find the different sinewaves that, when added together, will recreate the original signal. It does this by deconstructing a signal into its frequency components.
Notice on frequency axis, a sinewave will appear as a single line with an amplitude and phase. Looking at things in terms of frequency instead of time can give a lot of insight to a noise and vibration problem. By fitting the data to sines and cosine waves, as the Fourier transform does, it can identify the periodic components of a signal.
2. Cepstral Algorithm
Cepstral analysis entails performing a Fourier transform of the signal, taking the log of the resulting spectrum, and then performing an inverse Fourier transform of the log function.
The Fourier transform extracts the periodic components from a signal by comparing the signal to sine waves of various frequencies. Sine waves are, by their nature, periodic functions, so when there is a high degree of similarity between the original signal and the comparative sine wave, this similarity results in higher amplitude in the frequency domain at the assessed frequency. When there is not much similarity between the signal and the sine wave, little to no amplitude will appear in the frequency spectrum.
The cepstrum transform operates in a very similar way. However, instead of looking for similarity to periodic components in the time domain, the cepstrum looks for periodic components in the frequency domain. As harmonic content in a frequency spectrum is evenly spaced, the cepstrum transform is particularly good at identifying harmonics.
There are three main steps to transform a time signal into the cepstral domain are illustrated in Figure 4.
Figure 4: Basic steps in cepstral analysis.
STEP 1: First take the time signal and apply a Fast Fourier Transform (FFT) on the data to translate the time data into frequency data.
STEP 2: Next, in the frequency domain, discard the phase portion of the FFT by converting the amplitude to a Log¬10¬ of the data. This step reduces the dynamic range of the data by compressing it to a logarithm and makes it easier to find harmonic components that may otherwise not appear due to the amplitude differences between noise and the signal.
STEP 3: Convert the frequency signal to the quefrency domain using an Inverse Fourier Transform. This is the same process as a Fourier Transform, it just works in reverse. The key difference is that the phasing portion of an Inverse Fourier Transform rotates in the opposite direction of a Fourier Transform. In a regular application, applying an Inverse Fast Fourier Transform (IFFT) to the frequency domain would give the original time signal. In this instance, since only the amplitude was kept and the log of the amplitude was applied, it converts to the quefrency domain. An inverse Fourier transform is being performed on a Fourier transform, which is why the cepstrum is often described as a “spectrum of a spectrum”.
The formula for a cepstrum is shown in Equation 1 below:
Equation 1: Formula for performing a cepstrum.
The color coding in Equation 1 corresponds to the basic steps shown in Figure 4.
Note that the inverse Fourier transform works exactly the same as a Fourier transform, except that the phasor (j versus the -j in the equation) is rotating in the opposite direction. The equations are nearly identical, and for the purposes of cepstrum, function the exactly same way, which is matching frequency content with its corresponding sinewave.
Performing cepstral analysis involves moving between time, frequency, and the cepstral domain as shown in Figure 5 below.
Figure 5: Representation of different operations used in cepstrum analysis and some common engineering units of each.
The convolution of two signals (Gx and Fx) in the time domain, is equal to multiplying the signals in the frequency domain. Due to the logarithmic nature of the cepstrum, this is equal to the addition of two signals (Gx + Fx) in the cepstral domain. This can make cepstrum useful for separating signals in a mathematically more efficient way. This is commonly used in voice analysis for determining a voice against a background. Though more complicated, this principle is how a voice track can be separated from a music track in karaoke for example.
Important note: While the units for the cepstral domain technically appear in seconds, it is a mistake to interpret them as time. This is because the phase portion was lost when converting back from the frequency domain, since the log magnitude of the signal is used. Instead, the units are called “quefrency”. In this domain, all periodic frequencies are located at a quefrency of 1/f (where f is the distance in frequency between harmonics).
3. Signals and Their Cepstrum Transforms
In Figure 6, both the Fourier transform and cepstrum of different signals were analyzed.
Figure 6: Different signals in their respective domains (time, frequency, and cepstrum).
Sinewaves, square waves, sawtooth waves, and random signals were analyzed:
Sine: For a sinewave, it appears periodic in the time domain (it oscillates up and down at a constant frequency). In the frequency domain, this is a single peak, since a sinewave is made up of one frequency. Because there are no harmonics in a single sinewave, the cepstrum will appear a noisy flat spectrum.
Sawtooth: A sawtooth wave is sum of multiple harmonics. If the fundamental frequency of a sawtooth wave is 100 Hz, the waveform is made up a combination of sinewave harmonics of 100 Hz. So in this case, it would be the same as adding 100 Hz, 200 Hz, 300 Hz, 400 Hz, etc. In the time domain, these appear as a jagged sawtooth wave. In the frequency domain, these appear as infinite evenly spaced peaks that are 100 Hz apart. Because the frequency domain contains evenly spaced periodic components, the cepstrum has peaks that correspond to the frequency domain spacings between harmonics.
Square: A square wave is similar to the sawtooth wave, except that instead of all harmonics, square waves are a combination of oddly spaced harmonics. So if the square wave had a fundamental frequency of 100 Hz, it would be a combination of 100 Hz, 300 Hz, 500 Hz, etc. In the time domain, it produces a square wave. In the frequency domain, it is a series of uniformly spaced peaks that are spaced apart by twice the frequency of the original signal (since even harmonics are skipped). For a 100 Hz square wave, the harmonics would be spaced 200 Hz apart. In the cepstral domain, there will be a dominant peak corresponding to the spacing between harmonics. All other peaks shown are mathematical artifacts of the Fast Fourier transform algorithm and can ultimately be ignored. The same is true for a sawtooth wave.
Random: A random wave, depending on frequency content, typically has a flat and noisy frequency spectrum, especially in the case of white noise. Since there are no periodic components in this wave’s frequency domain, a flat and noisy cepstrum can be expected here as well.
4. Application Examples
This section contain several examples of how the cepstral analysis can be utilized to diagnosis noise and vibration issues in rotating machinery.
4.1 Gear Pair Defect
Consider a simple two gear system. In this example, time and FFT analysis will not identify a defect in the gear pair as readily as a cepstral analysis.
The driving or pinion gear, Gear A, has 42 teeth and spins at 68.57 RPM, while Gear B has 72 teeth and rotates at 40 RPM (Figure 7).
Figure 7: Example gears, Gear A has 42 teeth and spins at 68.57 RPM, and Gear B has 72 teeth and spins at 40 RPM.
In a gear pair, a common frequency to analyze is the "Gear Mesh Frequency". The "Gear Mesh Frequency" is the frequency that tracks how many gear teeth are making vibrational pulses per second as they rotate and connect with other teeth. If vibration data on the gear system is measured, one can trace the frequencies back to the individual gears to see if there is increased vibrational amplitude.
In this example, the following equation relates the rotational speed of the two gears (Equation 2):
Equation 2: Gear pair rotational speeds and number of teeth relationships.
Where:
fGear B is the rotational speed of gear B
fGear A is the rotational speed of gear A
NA is number of teeth on gear A
NB is number of teeth on gear B
The gear mesh frequency is calculated using Equation 3:
Equation 3: Gear mesh frequency.
The gear mesh frequency is usually expressed in Hertz rather than revolutions per minute (RPM). To calculate the gear mesh frequency based on Gear A, the RPM is converted to Hertz (by dividing by 60) as shown in Equation 4 below:
Equation 4: Gear mesh frequency for Gear A expressed in Hertz.
The same holds for Gear B as shown in Equation 5:
Equation 5: Gear mesh frequency for Gear B expressed in Hertz.
For both Gear A and Gear B, the mesh frequency is the same: 48 Hz. Both the fundamental frequency of 48 Hz and harmonics of 48 Hertz will be important in the cepstral analysis.
Below is an image of two time signals (microphone recording near the machinery) from this gear pair (Figure 8). One time trace shows the system working with no gear defect (blue) and one shows the system with a gear defect (orange).
Figure 8: Time domain microphone recordings of rotating machinery containing gear pair with defect (top, orange) and without defect (bottom, blue).
At first glance, it seems impossible to tell which time trace has the defect. Upon closer inspection, it appears that the blue trace (without defect) even has a slightly higher amplitude than the orange trace (with defect). The blue signal has no defect and the orange signal has a specific gear defect.
In an attempt to gain a deeper understanding, the data can be transformed into the frequency domain by using an FFT, as shown in Figure 9.
Figure 9: Spectrum of 2 gear systems: One with a defect (orange), and one without a defect (blue). With all the noise in the system it is difficult to tell if a defect in the gear pair is present or not.
In the frequency plot above, the gear chatter defect is creating what may look like harmonic peaks. It is difficult to which harmonics are due to the gear pair versus other noises:
Other Components: It is likely that the equipment that contains the gear pair has other rotating components (valves, motors, etc) that also produce additional frequency content.
Other Noise Sources: The microphone recording might be performed in a factory with other noise producing equipment nearby. The additional noise can disguise the harmonics of the gear pair in the object being tested.
As a result of these additional noise sources, it is difficult to identify the frequency content related to the gear pair by simply looking at the frequency spectrum. The presence or lack of harmonics is disguised by the additional frequency content from other sources in the microphone recordings.
If cepstral processing is applied, it becomes easier to identify issues in the data. Figure 10 shows the cepstrum of the same recordings.
Figure 10: Cepstrum plot (Amplitude versus Quefrency) of gear pair data with defect (orange) and without defect (blue).
In the cepstral domain, instead of many peaks in the frequency domain, only a few peaks appear in the cepstral domain that correspond to the gear mesh frequency harmonics. The defect trace (orange) has a higher peak than the non-defect trace (blue).
In this case, the quefrency (q) peak of the cepstrum is at 0.02083. The corresponding frequency for a peak in the quefrency domain is the inverse of the quefrency value (f=1/q) as shown in Figure 11.
Figure 11: The quefrency peak in the defective gear pair data (orange) has a peak at 0.02083 which when inverted corresponds to the gear mesh frequency of 48 Hz.
In this case, the defect is present at 48 Hz, which not only corresponds to the gear mesh frequency, but also indicates the strength of the harmonics related to the gear mesh. The high amplitude of the peak in the cepstrum indicates that there are more harmonics of the 48 Hz gear mesh frequency in the defective gear recording (orange) than in the recording with no defect (blue).
The last peak in the graph is a rahmonic (harmonic in the cepstrum domain) of the first peak. Those can be calculated as well using the same equation which gives values of 24 Hz. This value is exactly half of the gear mesh frequency. However, there is no physical system operating at 24 Hz in the machinery. This peak is an artifact of the cepstrum algorithm and can be ignored.
4.2 Sideband Analysis
Sidebands are a type of harmonic frequency that appear in a spectrum usually due to defects with rotating machinery. They are commonly seen with both gears and ball bearings.
A sideband consists of the carrier frequency (Fc) plus or minus the modulated frequency (Fm) as shown in Figure 12.
Figure 12: Example of sidebands and a carrier frequency.
The reason sidebands occur is typically because of defects that modulate the fundamental frequency of the spinning component. Modulation of a frequency is illustrated in Figure 13 below:
Figure 13: A frequency with no modulation (top, red) versus a modulated frequency (bottom, purple). The spectrum of the modulated signal has sidebands.
Take for example a ball bearing. If a ball bearing was spinning freely with no issues, the frequency spectrum would show a single peak at the frequency it spins at. In the case of a ball bearing this is called the Ball Pass Frequency or BPF. This can be imagined as a single sinewave (i.e., the fundamental or carrier frequency Fc).
If however, there was a defect, there will be uneven load and vibration as the ball bearing passes along the inner and outer races of the bearing. Every time it hits a defect, it will modulate or change the amplitude of the sine wave. The sinewave is no longer a simple peak in the frequency domain. Since the amplitude has changed, it will appear as a group of peaks or harmonics. This phenomenon is similar to how a sinewave appears as a single peak in the frequency domain, but a different shape, such as a triangle wave, appears as multiple peaks because the shape is different and no longer a simple sinewave.
These groups of peaks are mathematically related to the speed of rotation. Specifically a sideband will appear at plus or minus of the modulation rate around the fundamental frequency. Figure 14 illustrates the sidebands for a ball bearing defect.
Figure 14: A ball bearing defect creates sidebands which increase the amount of harmonic content of a vibration signal taken on the bearing.
Since the side bands are equally spaced from the Ball Pass Frequency (BPF), these too can be analyzed in the cepstral domain to quickly check if there are faults or issues with the specific rotating machinery component. In cases where the frequency spectrum is particularly noisy (which is almost always the case in real life applications), this type of analysis can be useful for separating components.
Cepstral processing can be used to find these evenly spaced sidebands which are typically present due to defect. Figure 15 shows multiple vibration spectrums measured from a transmission production line using a Simcenter Anovis system.
Figure 15: Vibration spectrums from end of line inspection test. Transmission with defective gear set (red) shows side bands while non-defective transmissions (blue) do not. The additional harmonic content from the sidebands can be captured by cepstral analysis.
The following can be observed from the production vibration data:
The blue traces are production measurements with no defects and thus no sidebands.
The red trace shows sidebands around the fundamental frequency of the gear pair.
The blue "normal" production vibration spectrums do contain harmonics, but the defective gear measurements have additional harmonic content from the sidebands.
In this case, tracking the sideband energy may be enough to identify a defective gear pair from a normal production gear pair. In other cases, the sidebands may not distinctly stand out in the spectrum in which case a cepstrum analysis would be helpful as will be shown in the next section.
More about modulation and sidebands in the knowledge articles:
If the speed of the machine is changing, even small amounts over time, the frequency will change as well. This will cause the frequency domain to smear and prevent the cepstrum from functioning properly. The results are shown in Figure 16.
Figure 16: How frequency smearing can occur if measuring in the frequency domain, as opposed to the order domain. Each plot shows what happens as speed changes or remains the same.
For a single gear spinning at a specific frequency, it will appear as one line or peak in the frequency spectrum. For a changing gear speed over time, it will appear as multiple lines causing the smearing effect.
Because of this frequency smearing phenomenon it is recommended to do analysis in the order domain using synchronous sampling. The math behind the order domain works exactly the same as it does in the frequency domain. The key is to convert the time data to the revolution domain using the changing rpm as shown in Figure 17.
Figure 17: Frequency analysis and revolution based analysis are very similar. The main difference is that frequency based analysis (left) is over time while order analysis (right) is over revolutions.
Starting with revolution based data, the cepstrum will give a quefrency that corresponds to 1 over the order (1/o), instead of 1 over frequency (1/f). The orders can be tracked to many things including gear ratios and gear mesh frequencies.
There is no smearing effect here, since the data is being analyzed based on the number of rotations, not on time.
Consider the vibration data from an end-of-line Simcenter Anovis testing system shown in Figure 18.
Figure 18: Order spectrum from production data of rotating machinery with multiple gear pairs. The defect and production data all contain many peaks spread across the spectrum that are similar in amplitude.
One of the challenges of performing end-of-line inspection on rotating machinery in a production environment is that a typical factory has a lot of background noise and vibration. Production equipment, forklifts, doors opening and closing all contribute to the vibration measured at the end of line. This background noise is in addition to the multiple rotating components in the equipment being produced. For example, in this case there are multiple gear pairs present in the produced item.
In the data shown in Figure 17, there is a high overlap between the spectral content and amplitude of the both the normal production data and the defect data. It would be difficult to simply look at sideband levels only to distinguish the data containing a defect from the normal production data. There are many peaks and harmonics in the data.
Performing cepstral analysis in the order domain, the many peaks of the order spectrum are reduced to a few peaks. This makes the data easier to interpret as shown in Figure 19.
Figure 19: Cepstrum analysis of production vibration data for a complex gear system. Orange trace specific to gear pair 1, pink is specific to gear pair 2, and blue shows normal operation.
In the cepstral order domain analysis, the curves are as follows:
Blue: Normal production data without defects.
Orange: The orange traces shows the cepstral order plot of a defect from gear pair 1.
Pink: The pink traces show shows the cepstral order plot of a defect from gear pair 2.
The peaks in the cepstral domain are specific to the gear ratios of the gear pairs. This makes it possible to put limits on the lines in the cepstrum domain, to ensure that gear function in the machine is healthy.
Simcenter Anovis is able to quickly analyze these complex gear systems in noisy environments for production testing by utilizing the cepstrum domain, and setting pass/fail limits on the cepstrum outputs for these systems.