clMatrix.PhaseSpectrum Method

function PhaseSpectrum(const Vec: TOpenCLMtxVec): TOpenCLMtxVec;

The phase angles (spectrum) of object elements.

#NameTypeDescription
1VecTOpenCLMtxVec

Result: stored in self (calling object), returns self for chaining

Remarks:

Calculates the phase angles (spectrum) of all Vec object elements. Phase values are returned in radians and are in the range -PI,PI. Size and clMatrix.Complex properties of the calling object are set implicitly to match Vec object. The phase angles are calculated from the following equation:

Phase[k]=arctan(Vec[k])(Vec[k])\text{Phase}[k] = \arctan \frac{\Im (\text{Vec}[k])}{\Re (\text{Vec}[k])}
Examples
var a,b: clMatrix;
begin
    a.CopyCplxFromArray(1,2,TSingleArray.Create(1,2,3,-4));  // a = [1 + 2i, 3 - 4i]
    b.PhaseSpectrum(a);  // b = [arctan2(1,2), arctan2(3,-4)];
end;
See Also: clMatrix.PowerSpectrum, clMatrix.ArcTan2

Indexed: function PhaseSpectrum(const Vec: TOpenCLMtxVec; VecIndex: Integer; Index: Integer; Len: Integer): TOpenCLMtxVec;

Calculates the power spectrum from the Vec elements [VecIndex]..[VecIndex+Len-1].

#NameTypeDescription
1VecTOpenCLMtxVec
2VecIndexInteger
3IndexIntegerstart index
4LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Remarks:

Store the results in calling object elements [Index]..[Index+Len-1]. An exception is raised if array borders are overrun/underrun.