plotFeatures
Plot extracted audio features
Description
plotFeatures(
extracts the enabled features of the afe
,audioIn
)audioFeatureExtractor
object afe
from the audio input and
plots them.
plotFeatures(___,
specifies properties of the plot using one or more name-value arguments. For example, to
plot the audio signal along with the features, set Name=Value
)PlotInput
to
true
.
returns a handle to the figure containing the plot.figureHandle
= plotFeatures(___)
Examples
Visualize Extracted Audio Features
Use plotFeatures
to visualize audio features extracted with an audioFeatureExtractor
object.
Read in an audio signal from a file.
[audioIn,fs] = audioread("Counting-16-44p1-mono-15secs.wav");
Create an audioFeatureExtractor
object that extracts the gammatone cepstral coefficients (GTCCs) and the delta of the GTCCs. Set the SampleRate
property to the sample rate of the audio signal, and use the default values for the other properties.
afe = audioFeatureExtractor(SampleRate=fs,gtcc=true,gtccDelta=true);
Plot the features extracted from the audio signal.
plotFeatures(afe,audioIn)
Plot Audio Signal with Extracted Features
Read in an audio signal from a file.
[audioIn,fs] = audioread("SingingAMajor-16-mono-18secs.ogg");
Create an audioFeatureExtractor
object that extracts the pitch and harmonic ratio. Set the SampleRate
property to the sample rate of the audio signal, and use the default values for the other properties.
afe = audioFeatureExtractor(SampleRate=fs,pitch=true,harmonicRatio=true);
Plot the features with PlotInput
set to true
to include the audio signal in the plot.
plotFeatures(afe,audioIn,PlotInput=true)
Input Arguments
afe
— Input object
audioFeatureExtractor
object
Input object, specified as an audioFeatureExtractor
object. The audioFeatureExtractor
object must have at least one feature enabled.
audioIn
— Input audio
column vector | matrix
Input audio, specified as a column vector or matrix of independent channels
(columns). If the input has multiple channels, then the function plots only the features
of the first channel. The length of the audio signal must be greater than or equal to
the length of the Window
property of the audioFeatureExtractor
object.
Data Types: single
| double
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: plotFeatures(afe,audioIn,PlotInput=true)
PlotInput
— Plot input audio signal
false
(default) | true
Plot the input audio signal in addition to the extracted features, specified as
true
or false
. If audioIn
has multiple channels (columns), then the function plots only the first
channel.
Data Types: logical
Parent
— Parent container
container object
Parent container for the plot, specified as an object that is a valid Parent
of a TiledChartLayout
object.
Output Arguments
figureHandle
— Figure handle
Figure
object
Handle to the figure containing the plot, returned as a Figure
object.
If the Parent
argument is specified, plotFeatures
returns the specified
parent.
Version History
Introduced in R2022b
See Also
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
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)