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

Functions

 FeatureSpectralCrestFactor (X, f_s)
 computes the spectral crest from the magnitude spectrum
 

Function Documentation

◆ FeatureSpectralCrestFactor()

FeatureSpectralCrestFactor ( X,
f_s )

computes the spectral crest from the magnitude spectrum

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

Definition at line 12 of file FeatureSpectralCrestFactor.py.

12def FeatureSpectralCrestFactor(X, f_s):
13
14 norm = X.sum(axis=0, keepdims=True)
15 norm[norm == 0] = 1
16
17 vtsc = X.max(axis=0) / norm
18
19 return np.squeeze(vtsc, axis=0)