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

Functions

 NoveltyLaroche (X, f_s)
 computes the novelty measure intnroduced by Laroche
 

Function Documentation

◆ NoveltyLaroche()

NoveltyLaroche ( X,
f_s )

computes the novelty measure intnroduced by Laroche

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

Definition at line 12 of file NoveltyLaroche.py.

12def NoveltyLaroche(X, f_s):
13
14 # difference spectrum (set first diff to zero)
15 X = np.c_[np.sqrt(X[:, 0]), np.sqrt(X)]
16
17 afDeltaX = np.diff(X, 1, axis=1)
18
19 # half-wave rectification
20 afDeltaX[afDeltaX < 0] = 0
21
22 # flux
23 d_lar = np.sum(afDeltaX, axis=0) / X.shape[0]
24
25 return d_lar