Axis

‘audio.utils.axis’ module within the ketos library

This module provides utilities to convert bin numbers to continuous variable values and vice versa.

Bins are numbered 0,1,2,3,…,N-1, counting from lower to higher values, where N is the number of bins.

By default, each bin represents a half-open interval, including the lower (left) boundary while excluding the upper (right) boudary, i.e., [a,b), except for the last bin, which represents a closed interval with both boundaries included, i.e. [a,b].

Contents:

Axis class: LinearAxis class: Log2Axis class: MelAxis class:

Axis(bins, x_min, label)

Base class for all Axis classes.

LinearAxis(bins, extent[, label])

Linear axis.

Log2Axis(bins, bins_per_oct, min_value[, label])

Logarithmic axis with base 2.

MelAxis(num_filters, freq_max[, start_bin, ...])

Mel-spectrogram axis.

bin_number(x, pos_func, bins[, truncate, ...])

Helper function for computing the bin number corresponding to a given axis value.