dcase_util.processors.MelExtractorProcessor
- class dcase_util.processors.MelExtractorProcessor(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', n_mels=40, fmin=0, fmax=None, normalize_mel_bands=False, htk=False, logarithmic=True, **kwargs)[source]
Constructor
- Parameters
- fsint
Sampling rate of the incoming signal.
- win_length_samplesint
Window length in samples.
- hop_length_samplesint
Hop length in samples.
- win_length_secondsfloat
Window length in seconds.
- hop_length_secondsfloat
Hop length in seconds.
- spectrogram_typestr
Spectrogram type, magnitude or power spectrogram.
- n_fftint
Length of the FFT window.
- window_typestr
Window function type.
- n_melsint
Number of mel bands to generate
- fminint
Lowest frequency in mel bands (in Hz)
- fmaxint
Highest frequency in mel bands (in Hz), if None, fmax = fs/2.0
- normalize_mel_bandsbool
Normalize mel band to have peak at 1.0
- htkbool
Use HTK formula for mel band creation instead of Slaney
- logarithmicbool
Switch for log mel-band energies
- __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', n_mels=40, fmin=0, fmax=None, normalize_mel_bands=False, htk=False, logarithmic=True, **kwargs)[source]
Constructor
- Parameters
- fsint
Sampling rate of the incoming signal.
- win_length_samplesint
Window length in samples.
- hop_length_samplesint
Hop length in samples.
- win_length_secondsfloat
Window length in seconds.
- hop_length_secondsfloat
Hop length in seconds.
- spectrogram_typestr
Spectrogram type, magnitude or power spectrogram.
- n_fftint
Length of the FFT window.
- window_typestr
Window function type.
- n_melsint
Number of mel bands to generate
- fminint
Lowest frequency in mel bands (in Hz)
- fmaxint
Highest frequency in mel bands (in Hz), if None, fmax = fs/2.0
- normalize_mel_bandsbool
Normalize mel band to have peak at 1.0
- htkbool
Use HTK formula for mel band creation instead of Slaney
- logarithmicbool
Switch for log mel-band energies
Methods
__init__
([fs, win_length_samples, ...])Constructor
delimiter
([exclude_delimiters])Use csv.sniffer to guess delimiter for CSV file
detect_file_format
([filename])Detect file format from extension
empty
()Check if file is empty
exists
()Checks that file exists
extract
(y)Extract features for the audio signal.
get_file_information
()Get file information, filename
get_processing_chain_item
()Get processing chain item with current Processor data.
get_spectrogram
(y[, n_fft, ...])Spectrogram
get_window_function
(n[, window_type])Window function
is_package
([filename])Determine if the file is compressed package.
load
([filename])Load file
log
([level])Log container content
process
([data, store_processing_chain])Extract features
save
([filename])Save file
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
validate_format
()Validate file format
Attributes
bytes
File size in bytes
description
Extractor description
input_type
Input data type
label
Extractor label
logger
Logger instance
md5
Checksum for file.
output_type
Output data type
valid_formats
Valid file formats