dcase_util.containers.AudioContainer.plot_spec

AudioContainer.plot_spec(spec_type='log', hop_length=512, cmap='magma', show_filename=True, show_xaxis=True, show_colorbar=False, plot=True, figsize=None, channel_labels=None)[source]

Visualize audio data as spectrogram.

Parameters
spec_typestr

Spectrogram type, use ‘linear’, ‘log’, ‘cqt’, ‘cqt_hz’, and ‘cqt_note’. Default value ‘log’

hop_lengthfloat

Hop length, also used to determine time scale in x-axis (see librosa.display.specshow). Default value 512

cmapfloat

Color map (see librosa.display.specshow). Default value ‘magma’

show_filenamebool

Show filename as figure title. Default value True

show_xaxisbool

Show X-axis. Default value True

show_colorbarbool

Show color bar next to plot. Default value False

plotbool

If true, figure is shown automatically. Set to False if collecting multiple plots into same figure outside this method. Default value True

figsizetuple

Size of the figure. If None given, default size (10,5) is used. Default value None

channel_labelslist

Channel names Default value None

Returns
self