Help for FFTMAG

PURPOSE:
"fftmag" will expand a picture's size by a factor of 2^N by enlarging
the Fourier Transform of the picture.  This technique provides correct 
interpolation using the Sampling Theorem.

 
EXECUTION:

Examples

fftmag  INP=FFTIN  OUT=FFTOUT  BY=2

This command will enlarge input transform FFTIN by a factor of two in both the
line and sample directions.

fftmag  INP=FFTIN  OUT=FFTOUT  BYL=5  BYS=2

This command will enlarge the transform by a factor of two in the sample
direction, but by a factor of four in the line direction.  This is because 
expansion factors must be powers of 2, and are rounded down to the next-lower 
power, as necessary.

Note that ALLOC must be used to allocate space for the output transform before
"fftmag" is run.


OPERATION:
"fftmag" expands a picture by partitioning the Fourier Tranform and placing the 
four quadrants into a larger transform array.  The details of the partitioning
are illustrated in the figure.  The expansion of the spatial dimension is
accomplished by a reduction in the apparent frequency (apparent because of the
larger format of the new FFT) according to the Similarity Theorem:

					       1      fx fy
If FT(g(x,y)) = G(fx,fy), then FT(g(ax,by)) = ---- G (--,--)
					      |ab|     a  b

where a = the sample magnification and b = the line magnification as specified
by the magnification keywords.

The interpolation algorithm which results in the above operation is the
Sampling Theorem, or optimal interpolation method for band limited data.  By
partitioning the FFT we equivalently band limit the larger image of the scene
until it contains the same frequencies we actually possess.  For BY=2, for 
example:
				    ____
	FT(I(i,j)) = FT(I(i,j)) * __|  |__0.25 cps
	  actual       double

Taking the FFT of both sides results in the Sampling Theorem, which is superior
to all other interpolation theorems.


+--+------------+--+------------+--+	\
|DC|		|  |		|DC|	|
+--+------------+--+------------+--+	|
|  |            |  |		|	|
|  | FFT        |  |		|	| N/2+1
|  | INPUT      |  |		|	|
|  | FORMAT     |  |		|	|
|  |            |  |		|	|
|  |            |  |		|	|
+--+------------+--+------------+	|	
|  |		|XX|		|	/
+--+------------+--+------------ |  |            |  |		|	\
|  |            |  |		|	|
|  |            |  |		|	| N/2-1
|  |            |  |		|	|
|  |            |  |		|	|
|  |            |  |		|	/
+--+------------+--+------------+-- |DC|				|DC|
+--+                            +-- 
\-----------------/ \-----------/
      8(M/2+1)         8(M/2-1)


+--+------------+--+----------------------------+--------------- |DC|		|  |				|		|
+--+------------+--+                            +--------------- |  |            |  |				|		|
|  |            |  |				|		|
|  |            |  |				|		|
|  |            |  |				|		|
|  |            |  |				|		|
|  |            |  |				|		|
+--+------------+--+                            +--------------- |  |            |XX|                            |               |
+--+------------+--+				+--------------- |								|
|			FFT OUTPUT FORMAT			|
|								|
|								|
|								|
|								|
+--+------------+--+                            +--------------- |  |            |  |				|		|
|  |            |  |				|		|
|  |            |  |				|		|
|  |            |  |				|		|
|  |            |  |				|		|
|  |            |  |				|		|
+--+------------+--+----------------------------+--------------- 
WRITTEN BY:  J. J. Lorre, 1 April 1980
COGNIZANT PROGRAMMER:  A. S. Mazer
REVISION:  New
Made portable for UNIX: A. Scop (CRI) 1 July 1994
27.04.98.....RRP.....Changed COMPLEX format keyword to COMP as per AR-9582.

PARAMETERS:


INP

STRING - Input FFT

OUT

STRING - Output FFT

SL

INTEGER - Starting line

SS

INTEGER - Starting sample

NS

INTEGER - Number of lines

NL

INTEGER - Number of samples

SIZE

INTEGER - Standard VICAR size field

BY

INTEGER - Line/sample magnification

BYL

INTEGER - Line magnification

BYS

INTEGER - Sample magnification

See Examples:


Cognizant Programmer: