computes the spectral crest from the magnitude spectrum > called by ::ComputeFeature > > @param X: spectrogram (dimension FFTLength X Observations) > @param f_s: sample rate of audio data (unused) > > @retval vtsc spectral crest factor ======================================================================
0001 %computes the spectral crest 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 vtsc spectral crest factor 0008 % ====================================================================== 0009 function [vtsc] = FeatureSpectralCrestFactor (X, f_s) 0010 0011 % get maximum 0012 vtsc = max(X, [], 1) ./ sum(X, 1); 0013 0014 % avoid NaN for silence frames 0015 vtsc (sum(X, 1) == 0) = 0; 0016 end 0017 0018