nnAudio2.utils.downsampling_by_n
- nnAudio2.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.Tensortype with shape(batch, 1, len_audio)filterKernel (str) – Filter kernel in
torch.Tensortype 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)