class_docstr: Computes the discrete cosine transform.
  
  This class is primarily used to compute MFCC features of an audio signal
  given a set of FBANK features as input.
  
  Arguments
  ---------
  input_size : int
      Expected size of the last dimension in the input.
  n_out : int
      Number of output coefficients.
  ortho_norm : bool
      Whether to use orthogonal norm.
  
  Example
  -------
  >>> import torch
  >>> inputs = torch.randn([10, 101, 40])
  >>> compute_mfccs = DCT(input_size=inputs.size(-1))
  >>> features = compute_mfccs(inputs)
  >>> features.shape
  torch.Size([10, 101, 20])
class_docstr_tok: ["Computes","the","discrete","cosine","transform",".","This","class","is","primarily","used","to","compute","MFCC","features","of","an","audio","signal","given","a","set","of","FBANK","features","as","input",".","Arguments","--","--","--","--","-","input_size",":","int","Expected","size","of","the","last","dimension","in","the","input",".","n_out",":","int","Number","of","output","coefficients",".","ortho_norm",":","bool","Whether","to","use","orthogonal","norm",".","Example","--","--","--","-",">",">",">","import","torch",">",">",">","inputs","=","torch.randn","(","[","10",",","101",",","40","]",")",">",">",">","compute_mfccs","=","DCT","(","input_size=inputs.size","(","-1",")",")",">",">",">","features","=","compute_mfccs","(","inputs",")",">",">",">","features.shape","torch.Size","(","[","10",",","101",",","20","]",")"]
code: def __init__(
      self,
      input_size,
      n_out=20,
      ortho_norm=True,
  ):
      super().__init__()
  
      if n_out > input_size:
          raise ValueError(
              "Cannot select more DCT coefficients than inputs "
              "(n_out=%i, n_in=%i)" % (n_out, input_size)
          )
  
      # Generate matix for DCT transformation
      n = torch.arange(float(input_size))
      k = torch.arange(float(n_out)).unsqueeze(1)
      dct = torch.cos(math.pi / float(input_size) * (n + 0.5) * k)
  
      if ortho_norm:
          dct[0] *= 1.0 / math.sqrt(2.0)
          dct *= math.sqrt(2.0 / float(input_size))
      else:
          dct *= 2.0
  
      self.dct_mat = dct.t()
  
imports: import math
  import torch
  import logging
  from speechbrain.utils.checkpoints import mark_as_saver, mark_as_loader, mark_as_transfer, register_checkpoint_hooks
  from speechbrain.dataio.dataio import length_to_mask
label_desc: Use image node_id 1 to create a new DCT object from inherited base classes: torch.nn with example: obj = DCT(input_size, n_out, ortho_norm)