dcase_util.features.SpectralCentroidExtractor
- class dcase_util.features.SpectralCentroidExtractor(fs=44100, win_length_samples=None, hop_length_samples=None, win_length_seconds=0.04, hop_length_seconds=0.02, spectrogram_type='magnitude', n_fft=2048, window_type='hamming_asymmetric', center=True, **kwargs)[source]
Feature extractor class to extract Centroid features
Constructor
- Parameters
- fsint
Sampling rate of the incoming signal. Default value 44100
- win_length_samplesint
Window length in samples. Default value None
- hop_length_samplesint
Hop length in samples. Default value None
- win_length_secondsfloat
Window length in seconds. Default value 0.04
- hop_length_secondsfloat
Hop length in seconds. Default value 0.02
- spectrogram_typestr
Spectrogram type, magnitude or power spectrogram. Default value ‘magnitude’
- n_fftint
Length of the FFT window. Default value 2048
- window_typestr
Window function type. Default value ‘hamming_asymmetric’
- centerbool
If true, input signal is padded so to the frame is centered at hop length Default value True
- __init__(fs=44100, win_length_samples=None, hop_length_samples=None, win_length_seconds=0.04, hop_length_seconds=0.02, spectrogram_type='magnitude', n_fft=2048, window_type='hamming_asymmetric', center=True, **kwargs)[source]
Constructor
- Parameters
- fsint
Sampling rate of the incoming signal. Default value 44100
- win_length_samplesint
Window length in samples. Default value None
- hop_length_samplesint
Hop length in samples. Default value None
- win_length_secondsfloat
Window length in seconds. Default value 0.04
- hop_length_secondsfloat
Hop length in seconds. Default value 0.02
- spectrogram_typestr
Spectrogram type, magnitude or power spectrogram. Default value ‘magnitude’
- n_fftint
Length of the FFT window. Default value 2048
- window_typestr
Window function type. Default value ‘hamming_asymmetric’
- centerbool
If true, input signal is padded so to the frame is centered at hop length Default value True
Methods
__init__
([fs, win_length_samples, ...])Constructor
extract
(y)Extract features for the audio signal.
get_spectrogram
(y[, n_fft, ...])Spectrogram
get_window_function
(n[, window_type])Window function
log
([level])Log container content
show
([mode, indent, visualize])Print container content
to_html
([indent])Get container information in a HTML formatted string
to_string
([ui, indent])Get container information in a string
Attributes
description
Extractor description
label
Extractor label
logger
Logger instance