phasor

screens.fields.phasor(indep, transform, linear_axis=None)[source] [edit on github]

Calculate phase part of a Fourier transform like operation.

Simply calculates exp(j*indep*transform), where generally the two inputs will be on different dimensions, so that they broadcast against each other. If the independent variable spans a linearly spaced range, one can use linear_axis to speed up the calculation by only calculating exp(j*indep[0]*transform) and exp(j*(indep[1]-indep[0])*tranform) and filling the array by cumulative multiplication.

Parameters:
indeparray_like

Independent variable.

transformarray_like

Transformed variable. If an Quantity, it must have the inverse units of indep. It should not include a factor 2pi.

linear_axisint, “transform”, or None, optional

Possible axis along which indep changes by linear steps, and for which the calculation can be sped up using cumulative multiplication. This will lead to inaccuracies at the 1e-9 level, which should not matter for most purposes. If “transform”, then take transform to be linearly spaced (along a single axis, e.g., shape (n, 1, 1)).