compute_fbank_matrix

paddle.audio.functional. compute_fbank_matrix ( sr: int, n_fft: int, n_mels: int = 64, f_min: float = 0.0, f_max: Optional[float] = None, htk: bool = False, norm: Union[str, float] = 'slaney', dtype: str = 'float32' ) paddle.Tensor [source]

Compute fbank matrix.

Parameters
  • sr (int) – Sample rate.

  • n_fft (int) – Number of fft bins.

  • n_mels (int, optional) – Number of mel bins. Defaults to 64.

  • f_min (float, optional) – Minimum frequency in Hz. Defaults to 0.0.

  • f_max (Optional[float], optional) – Maximum frequency in Hz. Defaults to None.

  • htk (bool, optional) – Use htk scaling. Defaults to False.

  • norm (Union[str, float], optional) – Type of normalization. Defaults to ‘slaney’.

  • dtype (str, optional) – The data type of the return matrix. Defaults to ‘float32’.

Returns

Mel transform matrix with shape (n_mels, n_fft//2 + 1).

Return type

Tensor

Examples

>>> import paddle

>>> sr = 23
>>> n_fft = 51
>>> fbank = paddle.audio.functional.compute_fbank_matrix(sr, n_fft)