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

Functions

 FeatureSpectralDecrease (X, f_s)
 computes the spectral decrease from the magnitude spectrum
 

Function Documentation

◆ FeatureSpectralDecrease()

FeatureSpectralDecrease ( X,
f_s )

computes the spectral decrease from the magnitude spectrum

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

Definition at line 12 of file FeatureSpectralDecrease.py.

12def FeatureSpectralDecrease(X, f_s):
13
14 # compute index vector
15 kinv = np.arange(0, X.shape[0])
16 kinv[0] = 1
17 kinv = 1 / kinv
18
19 norm = X[1:].sum(axis=0, keepdims=True)
20 norm[norm == 0] = 1
21
22 # compute slope
23 vsd = np.dot(kinv, X - X[0]) / norm
24
25 return np.squeeze(vsd, axis=0)