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

Functions

 NoveltyHainsworth (X, f_s)
 computes the novelty measure introduced by Hainsworth
 

Function Documentation

◆ NoveltyHainsworth()

NoveltyHainsworth ( X,
f_s )

computes the novelty measure introduced by Hainsworth

Parameters
Xspectrogram (dimension FFTLength X Observations)
f_ssample rate of audio data
Returns
d_hai: novelty measure

Definition at line 12 of file NoveltyHainsworth.py.

12def NoveltyHainsworth(X, f_s):
13
14 epsilon = 1e-5
15
16 # difference spectrum (set first diff to zero)
17 X = np.c_[X[:, 0], X]
18 X[X <= 0] = epsilon
19
20 afDiff = np.log2(X[:, np.arange(1, X.shape[1])] / X[:, np.arange(0, X.shape[1] - 1)])
21
22 # flux
23 d_hai = np.sum(afDiff, axis=0) / X.shape[0]
24
25 return d_hai