Calculates the single-precision elementwise phase values, in radians, of the supplied complex vector using the specified stride.
SDKs
- iOS 4.0+
- macOS 10.4+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Accelerate
Declaration
void vDSP_zvphas(const DSPSplit Complex *__A, v DSP _Stride __IA, float *__C, v DSP _Stride __IC, v DSP _Length __N);
Parameters
__A
Single-precision complex input vector.
__IA
Stride for
A
.__C
Single-precision real output vector.
__IC
Stride for
C
.__N
The number of elements to process.
Discussion
Finds the phase values, in radians, of complex vector A
and store the results in real vector C
. The results are between -pi and +pi. The sign of the result is the sign of the second coordinate in the input vector, except that the v
function does not necessarily respect the sign of a zero input.
This performs the following operation:
for (n = 0; n < N; ++n)
C[n] = atan2(Im(A[n]), Re(A[n]));
Note
If both the inputs are +0
or -0
, the vDSP_zvphas function may return any value in [-pi, +pi]
. If only one input is zero, the vDSP_zvphas function may return the result atan2 returns when the corresponding input is +0
or -0
.