Skip to main content

magsqr

magsqr (z)

The magsqr function returns the sum of the squares of the real and imaginary parts of the complex number z, that is, the magnitude squared.

Examples

Assume waveCmplx is complex and waveReal is real.

waveReal= sqrt(magsqr(waveCmplx))

sets each point of waveReal to the magnitude of the complex points in waveCmplx.

You may get unexpected results if the number of points in waveCmplx differs from the number of points in waveReal. See Mismatched Waves for details.

See Also

cabs

WaveMetrics provides Igor Technical Note 006, "DSP Support Macros" which uses the magsqr function to compute the magnitude of FFT data, and Power Spectral Density with options such as windowing and segmenting. See the Technical Notes folder. Some of the techniques discussed there are available as Igor procedure files in the WaveMetrics Procedures:Analysis folder.

Demos

Open PSD Demo