%% Output Spectral Shape Features
% Use |transform| to create an audio datastore that returns feature
% vectors.

% Copyright 2018 The MathWorks, Inc.

%%
% Specify the file path to the audio samples included with Audio
% Toolbox(TM). Create an audio datastore that points to the specified
% folder.
folder = fullfile(matlabroot,'toolbox','audio','samples');
ADS = audioDatastore(folder);

%%
% Define a function, |extractFeatureVector|, that transforms the
% audio data from a time-domain representation to feature vectors.
%
% <include>extractFeatureVector.m</include>
%

%%
% Call |transform| to create a |TransformedDatastore| with |Transforms|
% set to |extractFeatureVector|.

ADSnew = transform(ADS,@extractFeatureVector,'IncludeInfo',true)

%%
% Call |read| to return the feature vectors for the audio over time.

featureMatrix = read(ADSnew);
[numFeatureVectors,numFeatures] = size(featureMatrix)