class_docstr: STFT encoder for speech enhancement and separation
code: def spec_transform_func(self, spec):
      if self.spec_transform_type == "exponent":
          if self.spec_abs_exponent != 1:
              # only do this calculation if spec_exponent != 1,
              # otherwise it's quite a bit of wasted computation
              # and introduced numerical error
              e = self.spec_abs_exponent
              spec = spec.abs() ** e * torch.exp(1j * spec.angle())
          spec = spec * self.spec_factor
      elif self.spec_transform_type == "log":
          spec = torch.log(1 + spec.abs()) * torch.exp(
              1j * spec.angle()
          )
          spec = spec * self.spec_factor
      elif self.spec_transform_type == "none":
          spec = spec
      return spec
  
file_path: espnet/espnet2/enh/encoder/stft_encoder.py
imports: import torch
  from packaging.version import parse
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.encoder.abs_encoder import AbsEncoder
  from espnet2.layers.stft import Stft
label_desc: Use image node_id 2 for calling the STFTEncoder obj's underlying member method code with example usage: obj.spec_transform_func(spec) and returns: spec