Skip to content

core.spectrogram

AudioSpectrogram

class fastaudio.core.spectrogram.AudioSpectrogram(x, **kwargs)

Semantic torch tensor that represents an Audio Spectrogram. Contains all of the functionality of a normal tensor, but has extra properties and knows how to show itself.

create(sg_tensor, settings=None)

Create an AudioSpectrogram from a torch tensor

duration
height
width
show(self, ctx=None, ax=None, title='', **kwargs)

Show spectrogram using librosa

AudioToSpec

class fastaudio.core.spectrogram.AudioToSpec(self, pipe, settings)

Transform to create spectrograms from audio tensors.

from_cfg(audio_cfg)

Creates AudioToSpec from configuration file

SpectrogramTransformer

fastaudio.core.spectrogram.SpectrogramTransformer(mel=True, to_db=True)

Creates a factory for creating AudioToSpec transforms with different parameters

AudioToMFCC

class fastaudio.core.spectrogram.AudioToMFCC(self, sample_rate=16000, n_mfcc=40, dct_type=2, norm='ortho', log_mels=False, melkwargs=None)

Transform to create MFCC features from audio tensors.

from_cfg(audio_cfg)

Creates AudioToMFCC from configuration file