Main Content

setExtractorParams

(To be removed) Set nondefault parameter values for individual feature extractors

Since R2019b

The setExtractorParams function will be removed in a future release. Use setExtractorParameters instead. For more information, see Compatibility Considerations.

Description

example

setExtractorParams(aFE,featureName,params) specifies parameters used to extract featureName.

example

setExtractorParams(aFE,featureName) returns the parameters used to extract featureName to default values.

Examples

collapse all

Read in an audio signal.

[audioIn,fs] = audioread("Counting-16-44p1-mono-15secs.wav");

Create an audioFeatureExtractor object to extract pitch. Set the method of pitch extraction to "LHS".

aFE = audioFeatureExtractor(SampleRate=fs,pitch=true);
setExtractorParameters(aFE,"pitch",Method="LHS")

Call extract and plot the results.

f0 = extract(aFE,audioIn);
plot(f0)

Read in an audio signal.

[audioIn,fs] = audioread("Counting-16-44p1-mono-15secs.wav");

Create an audioFeatureExtractor object to extract the melSpectrum and spectralRolloffPoint. Specify ten bands for the mel spectrum and set the threshold for the rolloff point to 50% of the total energy.

aFE = audioFeatureExtractor(SampleRate=fs,melSpectrum=true,spectralRolloffPoint=true);
setExtractorParameters(aFE,"melSpectrum",NumBands=10)
setExtractorParameters(aFE,"spectralRolloffPoint",Threshold=0.5)

Call extract and plot the results.

features = extract(aFE,audioIn);
idx = info(aFE);

surf(10*log10(features(:,idx.melSpectrum)))
title("Mel Spectrum")

plot(features(:,idx.spectralRolloffPoint))
title("Spectral Rolloff Point")

To return individual audio feature extractors to their default values, call setExtractorParameters without specifying any parameters to set.

setExtractorParameters(aFE,"melSpectrum")
setExtractorParameters(aFE,"spectralRolloffPoint")

Call extract and plot the results.

features = extract(aFE,audioIn);
idx = info(aFE);

surf(10*log10(features(:,idx.melSpectrum)))
title("Mel Spectrum")

plot(features(:,idx.spectralRolloffPoint))
title("Spectral Rolloff Point")

Input Arguments

collapse all

Name of feature extractor, specified as a character array or string.

Data Types: char | string

Parameters to set, specified as comma-separated name-value pairs or as a struct.

Version History

Introduced in R2019b

expand all

R2024a: Warns

The setExtractorParams function issues a warning that it will be removed in a future release. Use setExtractorParameters instead.