Main Content

Extract Spectral Features

Interactively extract spectral fault band metrics in the Live Editor

Since R2021a

Description

The Extract Spectral Features task lets you interactively extract spectral fault band metrics. The task helps with analyzing and understanding spectral data. Using a comprehensive interface, you can add components to represent various bearings, gear meshes, or other parts of your hardware setup.

As you set the physical parameters of these components, the Extract Spectral Features Live Editor task plots fault frequency bands at the characteristic frequencies of the components. You can overlay power spectrum data on the fault band plot to associate various peaks in the data with the components' characteristic frequencies. These correlations can make fault detection and fault isolation easier, as changes in the power spectrum data can easily be traced back to the physical components causing them. You can also have the task determine the harmonics and sidebands automatically.

In addition to a plot of the characteristic frequencies and the power spectrum data, the task generates spectral metrics of the data within each characteristic frequency band. The output metrics table, which contains the peak amplitude, peak frequency, and band power of each band, aids in characterizing potential mechanical faults. The task automatically generates MATLAB® code for your live script. For more information about Live Editor tasks in general, see Add Interactive Tasks to a Live Script

Extract Spectral Features task in Live Editor

Open the Task

To add the Extract Spectral Features task to a live script in the MATLAB Editor:

  1. On the Live Editor tab, select Task > Extract Spectral Features.

  2. In a code block in your script, type a relevant keyword, such as fault bands or metrics. Select Extract Spectral Features from the suggested command completions.

Examples

expand all

Use Extract Spectral Features to automatically identify the harmonics and sidebands of an imported signal.

Load the data TVel. Tvel is a timetable that contains the combined vibration signal for a machine.

load velocity_data TVel

Specify Time-Domain for Data Type and import Tvel.

The task computes and plots the power spectrum.

The task allows you to add individual components that represents machine components such as shafts. In this case, the TVel signal combines the vibration data of all components. Add a single custom component that represents the machine.

You can manually specify information about the frequency, harmonics, and sidebands. You can also click Auto to have the task compute the values automatically.

The plot shows the harmonics and sidebands, but they are not well grouped with respect to the major peaks.

The detection level, indicated for this component by the blue line, is at around -25 dB. Use the Detection Level slider to move the level to around -10 dB. Alternatively, you can click the blue line in the plot and move it up by dragging.

The band grouping improves somewhat relative to the major peaks.

Cycle through the harmonics by clicking the right arrow in the component section.

This set of frequency bands clearly align with most of the major peaks, but exclude the lower frequency peaks.

Add a new component to capture the fault bands in the lower frequency region. Select Auto and increase the detection level.

Cycle through the harmonics in the new component to find the low frequency harmonics.

The task displays the spectral metrics.

Click Show Code to display the generated code.

Related Examples

Parameters

expand all

Select Data

The task accepts data in the form of both power spectrum and time-domain data. Time-domain data can be numeric or packaged in a timetable.

The data type you choose determines the additional parameters you must specify.

  • Power Spectrum — Specify variable names for Frequency vector and Magnitude vector. The variables must already be in your MATLAB workspace.

  • Time-Domain — Specify the following parameters.

    • Signal — Variable name for the signal.

    • Variable — For timetable data, the timetable variable that represents the signal.

    • Sampling rate — Sampling rate in Hz. For timetable data, the task extracts the sampling rate automatically.

    • Resolution — Spectral resolution. This parameter allows you to trade off spectral leakage due to windowing for separation of nearby spectral peaks.

Configure Components

Choose between adding a bearing, gear mesh, or custom component. You can name your component and then click the Add button. You can set the physical characteristics of these components using their corresponding parameters. For custom components, you can have the task automatically compute harmonics and sidebands. The Extract Spectral Features Live Editor task plots fault frequency bands at the characteristic frequencies of the components.

Bearing Component Parameters

You can toggle this option to enable or disable the component from being included in the spectral metrics computation. Disabling the component also removes its fault bands from the plot. Use the Delete button to permanently remove a component.

Specify the number of rolling elements in the bearing as a positive integer.

Specify the pitch diameter of the bearing as a positive scalar. The pitch diameter is the diameter of the circle that the center of the ball or roller travels during the bearing rotation.

Specify the rotational speed of the shaft or inner race of the bearing as a positive scalar. The rotational speed is the fundamental frequency around which the Extract Spectral Features live task generates the fault frequency bands. The units must be consistent with the unit of the frequency vector.

Specify the contact angle in degrees between a plane perpendicular to the ball or roller axis and the line joining the two raceways.

Specify the diameter of the ball or roller in the bearing as a positive scalar.

Specify the harmonics of the fundamental frequency to be included in the plot and in the spectral metrics computation.

Specify the sidebands around the fundamental frequency and its harmonics to be included in the plot and in the spectral metrics computation.

Specify the units of the fault band frequencies as either 'frequency' or 'order'. Select:

  • 'frequency' if you have the fault bands in the same units as the Rotational speed.

  • 'order' if you have the fault bands as a number of rotations relative to the inner race rotation Rotational speed.

Specify the width of the frequency bands centered at the nominal fault frequencies as a positive scalar. Clear the Auto option to specify the width value manually.

Gear Mesh Component Parameters

You can toggle this option to enable or disable the component from being included in the spectral metrics computation. Disabling the component also removes its fault bands from the plot. Use the Delete button to permanently remove a component.

Specify the number of teeth on the input gear as a positive integer.

Specify the number of teeth on the output gear as a positive integer.

Specify the rotational speed of the input gear as a positive scalar. The rotational speed is the fundamental frequency around which the Extract Spectral Features live task generates the fault frequency bands. The units must be consistent with the unit of the frequency vector.

Specify the harmonics of the fundamental frequency to be included in the plot and in the spectral metrics computation.

Specify the sidebands around the fundamental frequency and its harmonics to be included in the plot and in the spectral metrics computation.

Specify the units of the fault band frequencies as either 'frequency' or 'order'. Select:

  • 'frequency' if you have the fault bands in the same units as the Rotational speed.

  • 'order' if you have the fault bands as a number of rotations relative to the Rotational speed.

Specify the width of the frequency bands centered at the nominal fault frequencies as a positive scalar. Clear the Auto option to specify the width value manually.

Custom Component Parameters

You can toggle this option to enable or disable the component from being included in the spectral metrics computation. Disabling the component also removes its fault bands from the plot. Use the Delete button to permanently remove a component.

Automatically compute harmonic and sideband values for harmonically related groups of spectral peaks. Use the arrows to cycle through each set of frequency groups.

Use Detection Level to raise or lower the threshold of detection so that you control the alignment of the harmonics with the major peaks. You can also change the detection level by dragging the detection line within the spectral plot.

Specify the fundamental frequency of interest as a positive scalar. The Extract Spectral Features live task constructs the fault frequency bands around the fundamental frequency. For instance, to construct fault bands for a faulty induction motor, the mains frequency of 60 Hz is the fundamental frequency of interest. Similarly, to generate fault bands for a faulty gear train, the input shaft frequency is the fundamental frequency.

Specify the harmonics of the fundamental frequency to be included in the plot and in the spectral metrics computation.

Specify the sidebands around the fundamental frequency and its harmonics to be included in the plot and in the spectral metrics computation.

Specify the type of separation between successive sidebands as either 'additive' or 'multiplicative'. Select:

  • 'additive', to set the separation between successive sidebands to a value of 0.1 times the F1 frequency value, where F1 is the distance of the first sideband from the fundamental frequency.

  • 'multiplicative', to set the separation between successive sidebands proportional to both the harmonic order and the sideband value.

Specify the separation value between successive sidebands as a positive scalar. Clear the Auto option to specify the separation value manually.

Specify the width of the frequency bands centered at the nominal fault frequencies as a positive scalar. Clear the Auto option to specify the width value manually.

Toggle this option to specify whether negative nominal fault frequencies are folded about the frequency origin. If you turn Folding on, then the Extract Spectral Features live task folds the negative nominal fault frequencies about the frequency origin by taking their absolute values such that the folded fault bands always fall in the positive frequency intervals. The folded fault bands are computed as [max(0, |F|W2), |F|+W2], where W is the Band width and F is the Frequency.

Display Results

Toggle this option to enable or disable the display of spectral metrics. When the option is checked, then the Extract Spectral Features live task displays the metrics as a 1-by-N table, where N = 3*size((F+S),1)+1. That is, it displays three metrics per frequency range and the total band power over the frequency range.

The live task returns the following spectral metrics:

  • Peak Amplitude — Peak amplitude value for each specified frequency range.

  • Peak Frequency — Peak frequency value for each specified frequency range.

  • Band Power — Average power of each specified frequency range. For more information on band power, see bandpower.

  • Total Band Power — Sum of individual band powers for the set of specified frequency ranges.

Version History

Introduced in R2021a

expand all