Miscellaneous

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

This module provides utilities to perform various types of operations on audio data, acting either in the time domain (waveform) or in the frequency domain (spectrogram), or both.

cqt(x, rate, step, bins_per_oct, freq_min[, ...])

Compute the CQT spectrogram of an audio signal.

from_decibel(y)

Convert any data array, y, typically a spectrogram, from decibel scale

hz_to_mel(freq)

Convert frequency to position on Mel scale

mag2mel(img, num_fft, rate, num_filters)

Convert a Magnitude spectrogram to a Mel spectrogram.

mag2mfcc(img, num_fft, rate, num_filters, ...)

Convert a Magnitude spectrogram to a Mel-frequency cepstrum.

mag2pow(img, num_fft)

Convert a Magnitude spectrogram to a Power spectrogram.

mel_filter_bank(num_fft, rate, num_filters)

Compute Mel-scale filter bank

mel_to_hz(mel)

Convert position on Mel scale to frequency

num_samples(time, rate[, even])

Convert time interval to number of samples.

pad_reflect(x[, pad_left, pad_right, invert])

Pad array with its own (inverted) reflection along the first axis (0).

pad_zero(x[, pad_left, pad_right])

Pad array with zeros along the first axis (0).

segment(x, win_len, step_len[, num_segs, ...])

Divide an array into segments of equal length along its first axis (0), each segment being shifted by a fixed amount with respetive to the previous segment.

segment_args(rate, offset, window, step, ...)

Computes input arguments for audio.utils.misc.make_segment() to produce a centered spectrogram with properties as close as possible to those specified.

spec2wave(image, phase_angle, num_fft, ...)

Estimate audio signal from magnitude spectrogram.

stft(x, rate[, window, step, seg_args, ...])

Compute Short Time Fourier Transform (STFT).

to_decibel(x)

Convert any data array, y, typically a spectrogram, from linear scale