code: def downsampling_by_n(x, filterKernel, n):
      """A helper function that downsamples the audio by a arbitary factor n.
      It is used in CQT2010 and CQT2010v2.
  
      Parameters
      ----------
      x : torch.Tensor
          The input waveform in ``torch.Tensor`` type with shape ``(batch, 1, len_audio)``
  
      filterKernel : str
          Filter kernel in ``torch.Tensor`` type with shape ``(1, 1, len_kernel)``
  
      n : int
          The downsampling factor
  
      Returns
      -------
      torch.Tensor
          The downsampled waveform
  
      Examples
      --------
      >>> x_down = downsampling_by_n(x, filterKernel)
      """
  
      padding = int((filterKernel.shape[-1] - 1) // 2)
      x = conv1d(x, filterKernel, stride=(n,), padding=(padding,))
      return x
  
imports: import sys
  import torch
  from torch.nn.functional import conv1d, fold
  import numpy
  from time import time
  import math
  from scipy.signal import get_window
  from scipy import signal
  from scipy.fftpack import fft
  import warnings
  from nnAudio.librosa_functions import *
label_desc: Use image node_id 6 for calling a global function with example usage: downsampling_by_n(x, filterKernel, n) and returns: x