nnAudio.utils.downsampling_by_n

nnAudio.utils.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

The downsampled waveform

Return type

torch.Tensor

Examples

>>> x_down = downsampling_by_n(x, filterKernel)