Envelope Analysis with Python: Extracting Fault Frequencies from Raw Signals
JUL 16, 2025 |
Introduction to Envelope Analysis
In the realm of condition monitoring and predictive maintenance, envelope analysis plays a crucial role in detecting faults in rotating machinery. It is a powerful technique for identifying characteristic fault frequencies in bearings and gears from raw vibration signals. By focusing on high-frequency resonance bands, envelope analysis filters out noise and allows engineers to pinpoint specific issues before they lead to machinery failure. In this blog, we will explore how to implement envelope analysis using Python to extract fault frequencies from raw signals.
Understanding the Basics of Vibration Signals
Vibration signals from rotating machinery consist of a mixture of different frequency components, including the fundamental rotational frequencies and noise. When a fault occurs, such as a crack or spall in a bearing, it generates periodic impulses in the vibration signal. These impulses excite the resonance frequencies of the system, which can be captured and analyzed through envelope analysis. The main challenge is to isolate and identify these specific frequencies from a complex signal.
Setting Up the Python Environment
To begin our envelope analysis, we need to set up a Python environment with the necessary libraries. We will primarily use NumPy for numerical computations, SciPy for signal processing, and Matplotlib for visualization.
```python
import numpy as np
import scipy.signal as signal
import matplotlib.pyplot as plt
```
Ensure you have these libraries installed in your Python environment. You can install them using pip if they are not already available.
Preprocessing the Raw Signals
Before performing envelope analysis, it's essential to preprocess the raw signals. This involves filtering out low-frequency components and noise that might obscure the fault frequencies. A common approach is to use a high-pass filter to remove these unwanted components.
```python
def high_pass_filter(signal, cutoff_frequency, sampling_rate):
nyquist = 0.5 * sampling_rate
normal_cutoff = cutoff_frequency / nyquist
b, a = signal.butter(2, normal_cutoff, btype='high', analog=False)
filtered_signal = signal.filtfilt(b, a, signal)
return filtered_signal
```
Applying this filter prepares the signal for envelope analysis by emphasizing the higher frequency components where fault-related impulses are found.
Performing Envelope Detection
Envelope detection is the core step in envelope analysis. It extracts the amplitude envelope of the high-frequency signal, making it easier to identify fault-related frequency components. We use the Hilbert transform to perform this step.
```python
def envelope_detection(filtered_signal):
analytic_signal = signal.hilbert(filtered_signal)
envelope = np.abs(analytic_signal)
return envelope
```
The Hilbert transform converts the signal into its analytic form, allowing us to compute the envelope as the magnitude of this complex signal.
Extracting Fault Frequencies
With the envelope obtained, the next step is to analyze its frequency content. Applying the Fast Fourier Transform (FFT) allows us to extract the characteristic fault frequencies.
```python
def extract_fault_frequencies(envelope, sampling_rate):
envelope_fft = np.fft.fft(envelope)
frequency_axis = np.fft.fftfreq(len(envelope), d=1/sampling_rate)
return frequency_axis, np.abs(envelope_fft)
```
By examining the FFT of the envelope, we can identify peaks corresponding to fault frequencies, which are typically integer multiples of the shaft rotation frequency.
Visualization of Results
Visualizing the results is a crucial aspect of envelope analysis. It aids in understanding the frequency spectrum and identifying specific fault frequencies.
```python
def plot_results(signal, envelope, frequency_axis, envelope_fft):
plt.figure(figsize=(12, 8))
plt.subplot(3, 1, 1)
plt.title("Original Signal")
plt.plot(signal)
plt.xlabel("Time")
plt.ylabel("Amplitude")
plt.subplot(3, 1, 2)
plt.title("Envelope of Filtered Signal")
plt.plot(envelope)
plt.xlabel("Time")
plt.ylabel("Amplitude")
plt.subplot(3, 1, 3)
plt.title("Frequency Spectrum of Envelope")
plt.plot(frequency_axis[:len(frequency_axis)//2], envelope_fft[:len(frequency_axis)//2])
plt.xlabel("Frequency")
plt.ylabel("Magnitude")
plt.tight_layout()
plt.show()
```
By plotting the original signal, the envelope, and its frequency spectrum, we gain a visual understanding of how envelope analysis isolates fault frequencies.
Conclusion
Envelope analysis is a powerful technique for extracting fault frequencies from raw signals in rotating machinery. By implementing it in Python, we can effectively preprocess signals, detect envelopes, and extract meaningful frequency information. This approach not only enhances our ability to diagnose machinery faults but also contributes significantly to predictive maintenance strategies. With the right tools and techniques, engineers can ensure the longevity and reliability of critical equipment, preventing costly downtime and repairs.In the world of vibration damping, structural health monitoring, and acoustic noise suppression, staying ahead requires more than intuition—it demands constant awareness of material innovations, sensor architectures, and IP trends across mechanical, automotive, aerospace, and building acoustics.
Patsnap Eureka, our intelligent AI assistant built for R&D professionals in high-tech sectors, empowers you with real-time expert-level analysis, technology roadmap exploration, and strategic mapping of core patents—all within a seamless, user-friendly interface.
⚙️ Bring Eureka into your vibration intelligence workflow—and reduce guesswork in your R&D pipeline. Start your free experience today.

