# Extract Spectral Features

Interactively extract spectral fault band metrics in the Live Editor

## Description

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

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

• 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.

## Parameters

Select Power Spectrum Data

Select a vector of frequencies from the MATLAB workspace that correspond to your power spectrum data.

Select a vector containing the power spectrum magnitudes from the MATLAB workspace.

Configure Components

Choose between adding a bearing, gear mesh, or custom component. You can name your component and then click the button. You can set the physical characteristics of these components using their corresponding parameters. 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 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. Uncheck 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 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. Uncheck 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 button to permanently remove a component.

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. Uncheck 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. Uncheck 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 , 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