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 uselinear_axis
to speed up the calculation by only calculatingexp(j*indep[0]*transform)
andexp(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 ofindep
. 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 taketransform
to be linearly spaced (along a single axis, e.g., shape(n, 1, 1)
).