setExtractorParameters
Description
setExtractorParameters(
sets all the parameters of the feature specified in sFE,featureName)featureName to
their default values.
setExtractorParameters(
sets the parameters specified in sFE,featureName,params)params.
Examples
Create a signalFrequencyFeatureExtractor object to extract the Welch power spectral density (PSD) estimate of a signal consisting of a 100 Hz sinusoid in additive N(0,1) white noise. The sample rate is 1 kHz and the signal has a duration of 5 seconds.
fs = 1000; t = 0:1/fs:5-1/fs; x = cos(2*pi*100*t) + randn(size(t)); sFE = signalFrequencyFeatureExtractor(SampleRate=fs,WelchPSD=true);
For the PSD computation, set the OverlapLength to 25 samples and the FFTLength to 512 samples. Call the getExtractorParameters function on the object to view the PSD parameters.
setExtractorParameters(sFE,"WelchPSD",OverlapLength=25,FFTLength=1024) params = getExtractorParameters(sFE,"WelchPSD")
params = struct with fields:
FFTLength: 1024
FrequencyVector: []
OverlapLength: 25
Window: []
Use the extract function to extract the Welch's PSD estimate of the signal. Plot the result.
feature = extract(sFE,x); fvec = linspace(0,fs/2,length(feature)); plot(fvec,pow2db(abs(feature))) xlabel("Frequency (Hz)") ylabel("PSD (dB/Hz)") grid

Input Arguments
Feature extractor object, specified as a signalFrequencyFeatureExtractor object or a signalTimeFrequencyFeatureExtractor object.
Name of feature, specified as a string scalar or a character vector.
Specify featureName based on the feature extractor object
specified in sFE.
If you specify
sFEas asignalFrequencyFeatureExtractorobject, specifyfeatureNameas one of these:Frequency-domain features:
"OccupiedBandwidth","PowerBandwidth","PeakAmplitude","PeakLocation", or"WelchPSD".
If you specify
sFEas asignalTimeFrequencyFeatureExtractorobject, specifyfeatureNameas one of these:Time-frequency analysis methods:
"spectrogram","synchrosqueezedspectrogram","emd","vmd","scalogram","synchrosqueezedscalogram","wavelet", or"waveletpacket".Time-frequency features:
"SpectralEntropy","TFRidges","InstantaneousBandwidth","InstantaneousFrequency","InstantaneousEnergy","WaveletEntropy","TimeSpectrum", or"ScaleSpectrum".
Data Types: char | string
Parameters, specified as name-value arguments or as a structure. Use this argument
to set the parameters to extract the feature specified in
featurename.
You can specify multiple parameters for a feature at a time. The order of the parameters does not matter.
setExtractorParametersupdates all parameters of the feature specified infeatureName. It sets the specified parameters to the specified values and the unspecified parameters to default values.
Specify params based on the feature specified in
featurename.
Specify the parameters in this table to customize extracting signal features in frequency domain.
| Feature Name | Parameter Name | Parameter Value |
|---|---|---|
"OccupiedBandwidth" | Percentage |
|
"PowerBandwidth" | RelativeAmplitude |
|
"PeakAmplitude""PeakLocation" | PeakType |
|
MaxNumExtrema |
| |
MinProminence |
| |
MinSeparation |
| |
FlatSelection |
| |
"WelchPSD" | Window | Integer scalar | vector |
OverlapLength | Positive integer scalar | |
FFTLength | Positive integer scalar | |
FrequencyVector | Real-valued vector
|
Example: setExtractorParameters(sfFE,"PeakAmplitude",PeakType="maxima",MaxNumExtrema=2)
specifies the peak type and the maximum number of extrema as extraction parameters
for the peak amplitude feature, and sets up the frequency-domain feature extractor
object sfFE for extraction.
Example: PeakAmplitudeParams =
struct("PeakType","maxima","MaxNumExtrema",2);
setExtractorParameters(fFE,"PeakAmplitude",PeakAmplitudeParams)
specifies a structure array PeakAmplitudeParams consisting
of the peak type and the maximum number of extrema as extraction parameters for
the peak amplitude feature. Then, setExtractorParameters uses
PeakAmplitudeParams to set up the frequency-domain
feature extractor object sfFE for
extraction.
Specify the parameters in this table to customize computing the time-frequency domain representation of the signal.
| Feature Name | Parameter Name | Parameter Value |
|---|---|---|
"spectrogram" | Leakage |
|
OverlapPercent | Positive scalar less than 100 | |
TimeResolution | Scalar greater than 1 and less than signal duration. | |
"synchrosqueezedspectrogram" | Window | Vector of nonnegative scalars |
"emd" | MaxNumIMF |
|
MaxNumExtrema |
| |
MaxEnergyRatio |
| |
Interpolation |
| |
"vmd" | NumIMFs |
|
CentralFrequencies | Vector of | |
PenaltyFactor |
| |
InitializeMethod |
| |
"scalogram" | Wavelet |
|
VoicesPerOctave |
| |
WaveletParameters |
| |
Frequencylimits | Two-element row vector of real-valued scalars | |
"synchrosqueezedscalogram" | Wavelet |
|
VoicesPerOctave |
| |
ExtendSignal |
| |
"wavelet""waveletpacket" | FullTree( "waveletpacket"
only) |
|
Wname |
| |
LowPassHighPass | Vectors of at least two scalars You must specify
| |
Level | Positive integer scalar | |
Reflection( "wavelet"
only) |
|
Example: setExtractorParameters(stfFE,"emd",Interpolation="spline",MaxNumExtrema=2)
specifies the interpolation method and the maximum number of extrema as extraction
parameters for the empirical mode decomposition (EMD), and sets up the
time-frequency feature extractor object stfFE for
extraction.
Specify the parameters in this table to customize extracting signal features in time-frequency domain.
| Feature Name | Parameter Name | Parameter Value |
|---|---|---|
"SpectralEntropy" | Range | Two-element row vector of nonnegative scalars |
"TFRidges" | NumRidges |
|
NumFrequencyBins |
| |
Penalty | Nonnegative real-valued scalar | |
"InstantaneousBandwidth" | FrequencyLimits | Two-element row vector of real-valued scalars |
ScaleFactor |
| |
"InstantaneousFrequency""InstantaneousEnergy" | FrequencyLimits | Two-element row vector of real-valued scalars |
FrequencyResolution |
| |
MinThreshold | Real-valued scalar | |
"WaveletEntropy" | Entropy |
|
Exponent |
| |
Distribution |
| |
Scaled |
| |
"TimeSpectrum" | Normalization |
|
SpectrumType |
| |
TimeLimits | Two-element vector of real-valued scalars | |
"ScaleSpectrum" | Normalization |
|
SpectrumType |
| |
FrequencyLimits | Two-element vector of real-valued scalars |
Note
The
InstantaneousFrequencyfeature supports theFrequencyResolutionandMinThresholdparameters only whenTransformis"emd","vmd","wavelet", or"waveletpacket".The
InstantaneousEnergyfeature supports feature extraction parameters only whenTransformis"emd".
Example: setExtractorParameters(stfFE,"TFRidges",NumRidges=3,NumFrequencyBins=10)
specifies the number of ridges and number of frequency bins as extraction
parameters for the time-frequency-ridges feature, and sets up the time-frequency
feature extractor object stfFE for
extraction.
Data Types: string | struct
Tips
Use the
getExtractorParametersfunction to get the list of available parameters to use when extracting the features that you enabled when creating the feature extractor object.
Version History
Introduced in R2021b
See Also
Objects
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)