computes the spectral flux from the magnitude spectrum > called by ::ComputeFeature > > @param X: spectrogram (dimension FFTLength X Observations) > @param f_s: sample rate of audio data (unused) > > @retval v spectral flux ======================================================================
0001 %computes the spectral flux from the magnitude spectrum 0002 %> called by ::ComputeFeature 0003 %> 0004 %> @param X: spectrogram (dimension FFTLength X Observations) 0005 %> @param f_s: sample rate of audio data (unused) 0006 %> 0007 %> @retval v spectral flux 0008 % ====================================================================== 0009 function [vsf] = FeatureSpectralFlux (X, f_s) 0010 0011 % difference spectrum (set first diff to zero) 0012 afDeltaX = diff([X(:, 1), X], 1, 2); 0013 0014 % flux 0015 vsf = sqrt(sum(afDeltaX.^2)) / size(X, 1); 0016 end