%% Spectral Spread of Frequency-Domain Audio Data
% Read in an audio file and then calculate the mel spectrogram using the melSpectrogram function. Calculate the spread of the mel spectrums over time. Plot the results.

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

[s,cf,t] = melSpectrogram(audioIn,fs);

spread = spectralSpread(s,cf);

plot(t,spread)
xlabel('Time (s)')
ylabel('Spread (Hz)')

%
% Copyright 2018 The MathWorks, Inc.