tophu.upsample_fft

tophu.upsample_fft(data, out_shape)

Upsample using a Fast Fourier Transform (FFT)-based interpolation method.

Upsample a discrete-time N-dimensional signal by zero-padding in the frequency domain. The input signal is assumed to be band-limited.

Parameters
dataarray_like

The input array.

out_shapeint or iterable of int

The desired shape of the output array after upsampling. Must be greater than or equal to the input array shape.

Returns
outnumpy.ndarray

The upsampled array with shape out_shape.

See also

upsample_nearest

Notes

If the length of data along any upsample axis is even-valued, the Discrete Fourier Transform (DFT) of data contains the Nyquist frequency bin, which can be ambiguously interpreted as a positive or negative frequency. In this case, the implementation follows the common approach of splitting the value of this cell in half among the positive and negative Nyquist bins when extending the frequency domain of the signal. This preserves Hermitian symmetry so that a resampled real-valued signal remains real-valued.