cepstrum()

audplot.cepstrum(cc_matrix, hop_duration, *, channel=0, ax=None, cmap='magma')[source]

Cepstrum.

Parameters
  • cc_matrix (ndarray) – cepstral coefficients matrix with magnitude values

  • hop_duration (float) – hop duration in seconds

  • channel (int) – channel index

  • ax (Optional[Axes]) – pre-existing axes for the plot. Otherwise, calls matplotlib.pyplot.gca() internally

  • cmap (str) – color map

Return type

AxesImage

Returns

Image object

Examples

>>> import librosa
>>> import matplotlib.pyplot as plt
>>> x, sr = librosa.load(librosa.ex("trumpet"))
>>> y = librosa.feature.mfcc(y=x, sr=sr)
>>> hop_dur = 512 / sr  # default hop length is 512
>>> image = cepstrum(y, hop_dur)
>>> cb = plt.colorbar(image)
>>> cb.outline.set_visible(False)
>>> plt.tight_layout()
../_images/audplot-cepstrum-2.svg