mindspore.dataset.audio.melscale_fbanks
- mindspore.dataset.audio.melscale_fbanks(n_freqs, f_min, f_max, n_mels, sample_rate, norm=NormType.NONE, mel_type=MelType.HTK)[source]
Create a frequency transformation matrix.
- Parameters
n_freqs (int) – Number of frequencies to highlight/apply.
f_min (float) – Minimum of frequency in Hz.
f_max (float) – Maximum of frequency in Hz.
n_mels (int) – Number of mel filterbanks.
sample_rate (int) – Sample rate of the audio waveform.
norm (NormType, optional) – Normalization method, can be NormType.NONE or NormType.SLANEY. Default: NormType.NONE.
mel_type (MelType, optional) – Scale to use, can be MelType.HTK or MelType.SLANEY. Default: MelType.HTK.
- Returns
numpy.ndarray, the frequency transformation matrix with shape ( n_freqs , n_mels ).
Examples
>>> from mindspore.dataset.audio import melscale_fbanks >>> >>> fbanks = melscale_fbanks(n_freqs=4096, f_min=0, f_max=8000, n_mels=40, sample_rate=16000)