resample_v#

pynlo.utility.resample_v(v_grid, f_v, n)[source]#

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

The complementary time data is assumed to be of finite support, so the resampling is accomplished by adding or removing trailing and leading time bins. Discontinuities in the frequency-domain amplitude will manifest as ringing when resampled.

Parameters:
v_gridarray_like of float

The frequency grid of the input data.

f_varray_like of complex

The frequency-domain data to be resampled.

nint

The number of points at which to resample the input data. When the input corresponds to a real-valued time domain representation, this number is the number of points in the time domain.

Returns:
v_gridndarray of float

The resampled frequency grid.

f_vndarray of real or complex

The resampled frequency-domain data.

dvfloat

The spacing of the resampled frequency grid.

dtfloat

The spacing of the resampled time grid.

Notes

If the number of points is odd, there are an equal number of points on the positive and negative side of the time grid. If even, there is one extra point on the negative side.

This method checks if the origin is contained in v_grid to determine whether real or complex transformations should be performed. In both cases the resampling is accomplished by removing trailing and leading time bins.

For analytic representations, the returned frequency grid is defined symmetrically about its reference, as in the TFGrid class, and for real-valued representations the grid is defined starting at the origin.