resample_t#

pynlo.utility.resample_t(t_grid, f_t, n)[source]#

Resample time-domain data to the given number of points.

The complementary frequency data is assumed to be band-limited, so the resampling is accomplished by adding or removing high frequency bins. Discontinuities in the time-domain amplitude will manifest as ringing when resampled.

Parameters:
t_gridarray_like of float

The time grid of the input data.

f_tarray_like of real or complex

The time-domain data to be resampled.

nint

The number of points at which to resample the input data.

Returns:
t_gridndarray of float

The resampled time grid.

f_tndarray of real or complex

The resampled time-domain data.

dtfloat

The spacing of the resampled time grid.

Notes

If real, the resampling is accomplished by adding or removing the largest magnitude frequency components (both positive and negative). If complex, the input data is assumed to be analytic, so the resampling is accomplished by adding or removing the largest positive frequencies. This method checks the input data’s type, not the magnitude of its imaginary component, to determine if it is real or complex.

The returned time axis is defined symmetrically about the input’s reference, such as in the TFGrid class.