dcase_util.features.SpectralFeatureExtractor.get_spectrogram

SpectralFeatureExtractor.get_spectrogram(y, n_fft=None, win_length_samples=None, hop_length_samples=None, window=None, center=True, spectrogram_type=None)[source]

Spectrogram

Parameters
ynumpy.ndarray

Audio data

n_fftint

FFT size Default value 2048

win_length_samplesint

Window length in samples Default value None

hop_length_samplesint

Hop length in samples Default value None

windownumpy.array

Window function Default value None

centerbool

If true, input signal is padded so to the frame is centered at hop length Default value True

spectrogram_typestr

Type of spectrogram “magnitude” or “power” Default value None

Returns
numpy.ndarray [shape=(1 + n_fft/2, t), dtype=dtype]

STFT matrix