add_cpx

USAGE add_cpx infile1 infile2 outfile width length sign

sign: 1 (add) or -1 (subtract)

infiles must be of same width and length, in cpx format.
cpx format contains alternating real and imaginary pixels.
Lines have width*2 pixels.
FUNCTION Add or subtract cpx image files.
PROCESS Reads complex pixels from infile1 and infile2 and creates a complex pixel in outfile.
From infile1 we have in_real1 and in_imag1
From infile2 we have in_real2 and in_imag2
print out_realand out_imag to outfile

amp = (in_real1^2 + in_imag1^2)^.5
phi1 = arctan(in_real1, in_imag1)
phi2 = arctan(in_real2, in_imag2)

out_real = amp*cos(phi1 + sign*phi2)
out_imag = amp*sin(phi1 + sign*phi2)
CALLED BY filtNcor.pl
FILES USED infile1
infile2
FILES CREATED outfile


LAST UPDATE May 29, 1998
This software is part of the JPL/Caltech ROI_PAC suite.
Not for general distribution.
For more info:
roi_pac@gps.caltech.edu
roi_pac@jpl.nasa.gov