functional_create_fb_matrix: Frequency Bin Conversion Matrix (functional)

View source: R/functional.R

functional_create_fb_matrixR Documentation

Frequency Bin Conversion Matrix (functional)

Description

Create a frequency bin conversion matrix.

Usage

functional_create_fb_matrix(
  n_freqs,
  f_min,
  f_max,
  n_mels,
  sample_rate,
  norm = NULL
)

Arguments

n_freqs

(int): Number of frequencies to highlight/apply

f_min

(float): Minimum frequency (Hz)

f_max

(float or NULL): Maximum frequency (Hz). If NULL defaults to sample_rate %/% 2

n_mels

(int): Number of mel filterbanks

sample_rate

(int): Sample rate of the audio waveform

norm

(chr) (Optional): If 'slaney', divide the triangular mel weights by the width of the mel band (area normalization). (Default: NULL)

Value

tensor: Triangular filter banks (fb matrix) of size (n_freqs, n_mels) meaning number of frequencies to highlight/apply to x the number of filterbanks. Each column is a filterbank so that assuming there is a matrix A of size (..., n_freqs), the applied result would be A * functional_create_fb_matrix(A.size(-1), ...).


torchaudio documentation built on Feb. 16, 2023, 9:41 p.m.