computes the spectral decrease from the magnitude spectrum > called by ::ComputeFeature > > @param X: spectrogram (dimension FFTLength X Observations) > @param f_s: sample rate of audio data (unused) > > @retval vsk spectral decrease ======================================================================
0001 %computes the spectral decrease 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 vsk spectral decrease 0008 % ====================================================================== 0009 function [vsd] = FeatureSpectralDecrease (X, f_s) 0010 0011 % compute index vector 0012 k = 0:size(X, 1)-1; 0013 k(1) = 1; 0014 kinv = 1 ./ k; 0015 0016 % compute slope 0017 vsd = (kinv*(X-repmat(X(1, :), size(X, 1), 1))) ./ sum(X(2:end, :), 1); 0018 0019 % avoid NaN for silence frames 0020 vsd (sum(X(2:end, :),1) == 0) = 0; 0021 0022 end