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 with shape (n_freqs, n_mels).

Parameters
  • n_freqs (int) – Number of frequency.

  • 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.

  • norm (NormType, optional) – Norm to use, 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: NormType.SLANEY).

Returns

numpy.ndarray, the frequency transformation matrix.

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)