onsetsAubio¶
- maelzel.snd.features.onsetsAubio(samples, sr, method='mkl', winsize=1024, hopsize=512, threshold=0.03, mingap=0.05, silencedb=-70)[source]¶
Detect onsets in samples
- Parameters:
samples (
ndarray
) – the samples, as numpy array (1D), between -1 and 1sr (
int
) – the sample rate of sampleswinsize – the size of the fft window size, in samples
hopsize – the hop size, in samples
threshold – depends on the method. The lower this value, the more probable is it that an onset is detected
method – the method to detect onsets. One of: -
energy
: local energy, -hfc
: high frequency content, -complex
: complex domain, -phase
: phase-based method, -wphase
: weighted phase deviation, -specdiff
: spectral difference, -kl
: Kullback-Liebler, -mkl
: modified Kullback-Liebler, -specflux
: spectral flux.mingap – the min. amount of time (in seconds) between two onsets
silencedb – onsets will only be detected if the amplitude exceeds this value (in dB)
- Return type:
list
[float
]- Returns:
a list of floats, representing the times of the onsets