code: def __init__(
      self,
      sr=22050,
      hop_length=512,
      fmin=32.70,
      fmax=None,
      n_bins=84,
      filter_scale=1,
      bins_per_octave=12,
      norm=True,
      basis_norm=1,
      gamma=0,
      window="hann",
      pad_mode="reflect",
      earlydownsample=True,
      trainable=False,
      output_format="Magnitude",
      verbose=True,
  ):
      super().__init__()
  
      self.norm = norm
      self.hop_length = hop_length
      self.pad_mode = pad_mode
      self.n_bins = n_bins
      self.earlydownsample = earlydownsample
      self.trainable = trainable
      self.output_format = output_format
      self.filter_scale = filter_scale
      self.bins_per_octave = bins_per_octave
      self.sr = sr
      self.gamma = gamma
      self.basis_norm = basis_norm
  
      # It will be used to calculate filter_cutoff and creating CQT kernels
      Q = float(filter_scale) / (2 ** (1 / bins_per_octave) - 1)
  
      # Creating lowpass filter and make it a torch tensor
      if verbose == True:
          print("Creating low pass filter ...", end="\r")
      start = time()
      lowpass_filter = torch.tensor(
          create_lowpass_filter(
              band_center=0.50,
              kernelLength=256,
              transitionBandwidth=0.001,
          )
      )
  
      self.register_buffer(
          "lowpass_filter", lowpass_filter[None, None, :]
      )
      if verbose == True:
          print(
              "Low pass filter created, time used = {:.4f} seconds".format(
                  time() - start
              )
          )
  
      n_filters = min(bins_per_octave, n_bins)
      self.n_filters = n_filters
      self.n_octaves = int(np.ceil(float(n_bins) / bins_per_octave))
      if verbose == True:
          print("num_octave = ", self.n_octaves)
  
      self.fmin_t = fmin * 2 ** (self.n_octaves - 1)
      remainder = n_bins % bins_per_octave
  
      if remainder == 0:
          # Calculate the top bin frequency
          fmax_t = self.fmin_t * 2 ** (
              (bins_per_octave - 1) / bins_per_octave
          )
      else:
          # Calculate the top bin frequency
          fmax_t = self.fmin_t * 2 ** (
              (remainder - 1) / bins_per_octave
          )
  
      # Adjusting the top minimum bins
      self.fmin_t = fmax_t / 2 ** (1 - 1 / bins_per_octave)
      if fmax_t > sr / 2:
          raise ValueError(
              "The top bin {}Hz has exceeded the Nyquist frequency, \
                              please reduce the n_bins".format(
                  fmax_t
              )
          )
  
      if (
          self.earlydownsample == True
      ):  # Do early downsampling if this argument is True
          if verbose == True:
              print("Creating early downsampling filter ...", end="\r")
          start = time()
          (
              sr,
              self.hop_length,
              self.downsample_factor,
              early_downsample_filter,
              self.earlydownsample,
          ) = get_early_downsample_params(
              sr, hop_length, fmax_t, Q, self.n_octaves, verbose
          )
          self.register_buffer(
              "early_downsample_filter", early_downsample_filter
          )
  
          if verbose == True:
              print(
                  "Early downsampling filter created, \
                          time used = {:.4f} seconds".format(
                      time() - start
                  )
              )
      else:
          self.downsample_factor = 1.0
  
      # For normalization in the end
      # The freqs returned by create_cqt_kernels cannot be used
      # Since that returns only the top octave bins
      # We need the information for all freq bin
      alpha = 2.0 ** (1.0 / bins_per_octave) - 1.0
      freqs = fmin * 2.0 ** (
          np.r_[0:n_bins] / np.double(bins_per_octave)
      )
      self.frequencies = freqs
      lenghts = np.ceil(Q * sr / (freqs + gamma / alpha))
  
      # get max window length depending on gamma value
      max_len = int(max(lenghts))
      self.n_fft = int(2 ** (np.ceil(np.log2(max_len))))
  
      lenghts = torch.tensor(lenghts).float()
      self.register_buffer("lenghts", lenghts)
  
      my_sr = self.sr
      for i in range(self.n_octaves):
          if i > 0:
              my_sr /= 2
  
          Q = float(self.filter_scale) / (
              2 ** (1 / self.bins_per_octave) - 1
          )
  
          basis, self.n_fft, lengths, _ = create_cqt_kernels(
              Q,
              my_sr,
              self.fmin_t * 2**-i,
              self.n_filters,
              self.bins_per_octave,
              norm=self.basis_norm,
              topbin_check=False,
              gamma=self.gamma,
          )
  
          cqt_kernels_real = torch.tensor(
              basis.real.astype(np.float32)
          ).unsqueeze(1)
          cqt_kernels_imag = torch.tensor(
              basis.imag.astype(np.float32)
          ).unsqueeze(1)
  
          self.register_buffer(
              "cqt_kernels_real_{}".format(i), cqt_kernels_real
          )
          self.register_buffer(
              "cqt_kernels_imag_{}".format(i), cqt_kernels_imag
          )
  
file_path: nnAudio/Installation/nnAudio/features/vqt.py
imports: import torch
  import torch.nn
  import numpy
  from time import time
  from ..librosa_functions import *
  from ..utils import *
label_desc: Use image node_id 1 to create a new VQT object from inherited base classes: torch.nn with example: obj = VQT(sr, hop_length, fmin, fmax, n_bins, filter_scale, bins_per_octave, norm, basis_norm, gamma, window, pad_mode, earlydownsample, trainable, output_format, verbose)