power

[ XITE Reference Manual | XITE home ]

Name

power, fftPower - take the power of each pixel value

Syntax

 #include <xite/arithmetic.h>

 int power( IBAND input, IBAND output,
    double scale );

 #include <xite/fft.h>

 int fftPower( IC_BAND in_band,
    IR_BAND out_band );

Description

power finds the absolute magnitude squared of each pixel in input and inserts this value in output.

 output(x,y) = |input(x,y)| * |input(x,y)| * scale

Only the largest rectangle common to the two bands is powerd.

Accepts all pixel types. Both bands must have the same pixel type, except that if input is complex, then output may be either complex or real, and if input is double complex, then output may be either double complex or double.

If the result is outside the domain of the actual pixel type, the result is rounded.

Identical arguments for input and output are allowed.

power is identical to square for non-complex bands.

fftPower is retained for compatibility with previous XITE versions. It is a macro call to power with scale equal to 1.0

Return value

 0 => ok
 1 => Illegal combination of pixel types
 2 => Unknown pixel type

See also

power(1), square(3), squareRoot(3), phase(3), absValue(3), imag(3), real(3), multiply(3), divide(3), scale(3), convertBand(3)

Author

Svein Bøe, BLAB, Ifi, UiO

Id

$Id: power.c,v 1.8 1997/04/23 20:47:02 svein Exp $