computes the spectral slope from the magnitude spectrum > called by ::ComputeFeature > > @param X: spectrogram (dimension FFTLength X Observations) > @param f_s: sample rate of audio data (unused) > > @retval vssl spectral slope ======================================================================
0001 %computes the spectral slope 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 vssl spectral slope 0008 % ====================================================================== 0009 function [vssl] = FeatureSpectralSlope (X, f_s) 0010 0011 % compute mean 0012 mu_x = mean(abs(X), 1); 0013 0014 % compute index vector 0015 kmu = (0:size(X, 1)-1) - size(X, 1)/2; 0016 0017 % compute slope 0018 X = X - repmat(mu_x, size(X, 1), 1); 0019 vssl = (kmu*X) / (kmu*kmu'); 0020 end 0021 0022