You are here: Symbol Reference > AbstractMtxVec Namespace > Classes > TMtxVec Class > public > PowerSpectrum Method > TMtxVec.PowerSpectrum Method (TMtxVec)
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtxVec.PowerSpectrum Method (TMtxVec)

The power spectrum from object complex values.

Pascal
function PowerSpectrum(const Vec: TMtxVec): TMtxVec; overload;

Calculates the power spectrum from the Vec object complex values and stores the results (power spectrum) in the real calling object. Size and Complex properties of the calling object are set implicitly to match Vec object. The spectrum elements are squares of the magnitudes of the complex input elements: 

 

var a,b: TVec; begin CreateIt(a,b); try a.SetIt(True,[1,2,3,-4]); // a = [1 + 2i, 3 - 4i] b.PowerSpectrum(a); // b = [1*1 + 2*2, 3*3+(-4)*(-4)] finally FreeIt(a,b); end; end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!