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

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

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

kurtosis = spectralKurtosis(s,cf);

plot(t,kurtosis)
xlabel('Time (s)')
ylabel('Kurtosis')

%
% Copyright 2018 The MathWorks, Inc.