Spectrogram

‘audio.spectrogram’ module within the ketos library.

This module provides utilities to work with spectrograms.

Spectrograms are two-dimensional visual representations of sound waves, in which time is shown along the horizontal axis, frequency along the vertical axis, and color is used to indicate the sound amplitude. Read more on Wikipedia: https://en.wikipedia.org/wiki/Spectrogram

The module contains the parent class Spectrogram, and four child classes (MagSpectrogram, PowerSpectrogram, MelSpectrogram, CQTSpectrogram), which inherit methods and attributes from the parent class.

Note, however, that not all methods (e.g. crop) work for all child classes. See the documentation of the individual methods for further details.

Contents:

Spectrogram class: MagSpectrogram class: PowerSpectrogram class: MelSpectrogram class: CQTSpectrogram class

CQTSpectrogram(data, time_res, bins_per_oct, ...)

Magnitude Spectrogram computed from Constant Q Transform (CQT).

MagSpectrogram(data, time_res, freq_min, ...)

Magnitude Spectrogram.

MelSpectrogram(data, num_filters, time_res, ...)

Mel Spectrogram.

PowerSpectrogram(data, time_res, freq_min, ...)

Power Spectrogram.

Spectrogram(data, time_res, type, freq_ax[, ...])

Spectrogram.

add_specs(a, b[, offset, scale, make_copy])

Place two spectrograms on top of one another by adding their pixel values.

load_audio_for_spec(path, channel, rate, ...)

Load audio data from a wav file for the specific purpose of computing the spectrogram.