Fourier-based resampling similar to scipy.signal.resample

The signal resample function of SciPy (scipy.signal.resample) uses a Fourier method for up/downsampling. For many cases, it is observed that the performance of Fourier-based methods are better when compared against nearest, linear etc. interpolation (which are present under torch.nn.functional. interpolate).

My implimentation of the same can be found at:
My GitHub code

This resample has one extra functionality than the scipy version. This can work with multiple axes for interpolation. The scipy version can only work with one axis. With this, one can just send multiple dimension sizes as a list to “num” and the axes list to “axis”.