pyACA: Documentation 0.3.1
Source Code for Audio Content Analysis
Loading...
Searching...
No Matches
Functions
pyACA.FeatureSpectralSlope Namespace Reference

Functions

 FeatureSpectralSlope (X, f_s)
 computes the spectral slope from the magnitude spectrum
 

Function Documentation

◆ FeatureSpectralSlope()

FeatureSpectralSlope ( X,
f_s )

computes the spectral slope from the magnitude spectrum

Parameters
Xspectrogram (dimension FFTLength X Observations)
f_ssample rate of audio data
Returns
vssl: spectral slope

Definition at line 13 of file FeatureSpectralSlope.py.

13def FeatureSpectralSlope(X, f_s):
14
15 # compute mean
16 vsc = FeatureSpectralCentroid(X, f_s) * 2 / f_s * (X.shape[0] - 1)
17
18 # compute index vector
19 kmu = np.arange(0, X.shape[0]) - (X.shape[0]+1) / 2
20
21 # compute slope
22 X = X - vsc
23 vssl = np.dot(kmu, X) / np.dot(kmu, kmu)
24
25 return vssl