class_docstr: Turn a normal STFT into a bark frequency STFT with triangular filter banks.
  
  .. devices:: CPU CUDA
  
  .. properties:: Autograd TorchScript
  
  Args:
      n_barks (int, optional): Number of bark filterbanks. (Default: ``128``)
      sample_rate (int, optional): Sample rate of audio signal. (Default: ``16000``)
      f_min (float, optional): Minimum frequency. (Default: ``0.``)
      f_max (float or None, optional): Maximum frequency. (Default: ``sample_rate // 2``)
      n_stft (int, optional): Number of bins in STFT. See ``n_fft`` in :class:`Spectrogram`. (Default: ``201``)
      norm (str or None, optional): If ``"slaney"``, divide the triangular bark weights by the width of the bark band
          (area normalization). (Default: ``None``)
      bark_scale (str, optional): Scale to use: ``traunmuller``, ``schroeder`` or ``wang``. (Default: ``traunmuller``)
  
  Example
      >>> waveform, sample_rate = torchaudio.load("test.wav", normalize=True)
      >>> spectrogram_transform = transforms.Spectrogram(n_fft=1024)
      >>> spectrogram = spectrogram_transform(waveform)
      >>> barkscale_transform = transforms.BarkScale(sample_rate=sample_rate, n_stft=1024 // 2 + 1)
      >>> barkscale_spectrogram = barkscale_transform(spectrogram)
  
  See also:
      :py:func:`torchaudio.prototype.functional.barkscale_fbanks` - The function used to
      generate the filter banks.
class_docstr_tok: ["Turn","a","normal","STFT","into","a","bark","frequency","STFT","with","triangular","filter","banks",".","..","devices",":",":","CPU","CUDA","..","properties",":",":","Autograd","TorchScript","Args",":","n_barks","(","int",",","optional",")",":","Number","of","bark","filterbanks",".","(","Default",":","``","128","``",")","sample_rate","(","int",",","optional",")",":","Sample","rate","of","audio","signal",".","(","Default",":","``","16000","``",")","f_min","(","float",",","optional",")",":","Minimum","frequency",".","(","Default",":","``","0.","``",")","f_max","(","float","or","None",",","optional",")",":","Maximum","frequency",".","(","Default",":","``","sample_rate","\/\/","2","``",")","n_stft","(","int",",","optional",")",":","Number","of","bins","in","STFT",".","See","``","n_fft","``","in",":","class",":","`","Spectrogram","`",".","(","Default",":","``","201","``",")","norm","(","str","or","None",",","optional",")",":","If","``","``","slaney","''","``",",","divide","the","triangular","bark","weights","by","the","width","of","the","bark","band","(","area","normalization",")",".","(","Default",":","``","None","``",")","bark_scale","(","str",",","optional",")",":","Scale","to","use",":","``","traunmuller","``",",","``","schroeder","``","or","``","wang","``",".","(","Default",":","``","traunmuller","``",")","Example",">",">",">","waveform",",","sample_rate","=","torchaudio.load","(","``","test.wav","''",",","normalize=True",")",">",">",">","spectrogram_transform","=","transforms.Spectrogram","(","n_fft=1024",")",">",">",">","spectrogram","=","spectrogram_transform","(","waveform",")",">",">",">","barkscale_transform","=","transforms.BarkScale","(","sample_rate=sample_rate",",","n_stft=1024","\/\/","2","+","1",")",">",">",">","barkscale_spectrogram","=","barkscale_transform","(","spectrogram",")","See","also",":",":","py",":","func",":","`","torchaudio.prototype.functional.barkscale_fbanks","`","-","The","function","used","to","generate","the","filter","banks","."]
docstr: Args:
      specgram (torch.Tensor): A spectrogram STFT of dimension (..., freq, time).
  
  Returns:
      torch.Tensor: Bark frequency spectrogram of size (..., ``n_barks``, time).
docstr_tok: ["Args",":","specgram","(","torch.Tensor",")",":","A","spectrogram","STFT","of","dimension","(","...",",","freq",",","time",")",".","Returns",":","torch.Tensor",":","Bark","frequency","spectrogram","of","size","(","...",",","``","n_barks","``",",","time",")","."]
code: def forward(self, specgram: torch.Tensor) -> torch.Tensor:
      r"""
      Args:
          specgram (torch.Tensor): A spectrogram STFT of dimension (..., freq, time).
  
      Returns:
          torch.Tensor: Bark frequency spectrogram of size (..., ``n_barks``, time).
      """
  
      # (..., time, freq) dot (freq, n_mels) -> (..., n_mels, time)
      bark_specgram = torch.matmul(
          specgram.transpose(-1, -2), self.fb
      ).transpose(-1, -2)
  
      return bark_specgram
  
imports: from typing import Callable, Optional
  import torch
  from torchaudio.prototype.functional import barkscale_fbanks, chroma_filterbank
  from torchaudio.transforms import Spectrogram
label_desc: Use image node_id 2 for calling the BarkScale obj's underlying member method code with example usage: obj.forward(specgram) and returns: bark_specgram