IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 1, 2004, 3:22:02 PM (22 years ago)
Author:
Paul Price
Message:

Added psFFTFlags to specify direction of FFTs, and added output
variables for the FFT APIs (both image and vector to make consistent).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/psLibSDRS.tex

    r792 r826  
    1 %%% $Id: psLibSDRS.tex,v 1.48 2004-05-27 02:34:32 eugene Exp $
     1%%% $Id: psLibSDRS.tex,v 1.49 2004-06-02 01:22:02 price Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    23392339
    23402340\begin{verbatim}
    2341 psVector *psVectorFFT(const psVector *in, int direction);
     2341psVector *psVectorFFT(psVector *out, const psVector *in, psFFTFlags direction);
    23422342psVector *psVectorReal(psVector *out, const psVector *in);
    23432343psVector *psVectorImaginary(psVector *out, const psVector *in);
    2344 psVector *psVectorComplex(psVector *real, psVector *imag);
     2344psVector *psVectorComplex(psVector *out, psVector *real, psVector *imag);
    23452345psVector *psVectorConjugate(psVector *out, const psVector *in);
    2346 psVector *psVectorPowerSpectrum(const psVector *in);
     2346psVector *psVectorPowerSpectrum(psVector *out, const psVector *in);
    23472347\end{verbatim}
    23482348
    23492349The forward and reverse FFT is calculated using \code{psVectorFFT},
    23502350which takes as input the vector of interest (\code{in}) and the
    2351 direction (\code{direction}; 1 is forward, -1 is reverse).  The input
    2352 vector may be of type \code{psF32} or \code{psC32}, the result is
    2353 always \code{psC32}.  If the input vector is \code{psF32}, the
    2354 direction must be forward.  Neither the forward or inverse transforms
    2355 must multiply by $1/N$ (or $1/N^{1/2}$), and so it falls to the
    2356 responsibility of the user to multiply a vector that has been forward-
    2357 and reverse-transformed by $1/N$.
     2351direction (\code{direction}), which is specified by an enumerated type
     2352defined below.  The input vector may be of type \code{psF32} or
     2353\code{psC32}, the result is always \code{psC32}.  If the input vector
     2354is \code{psF32}, the direction must be forward.  Neither the forward
     2355or inverse transforms must multiply by $1/N$ (or $1/N^{1/2}$), and so
     2356it falls to the responsibility of the user to multiply a vector that
     2357has been forward- and reverse-transformed by $1/N$.
    23582358
    23592359Conversions between complex and real vectors requires the functions
     
    23702370(\code{psF32}) vectors of the input complex vector (\code{psC32}).
    23712371
     2372The direction of an FFT performed by \code{psVectorFFT} is specified
     2373by an enumerated type, \code{psFFTFlags}:
     2374
     2375\begin{verbatim}
     2376/** Specify direction of FFT, and if the result is real or not */
     2377typedef enum {
     2378    PS_FFT_FORWARD = 0,                 ///< psImageFFT/psVectorFFT should perform a forward FFT.
     2379    PS_FFT_REVERSE = 1,                 ///< psImageFFT/psVectorFFT should perform a reverse FFT.
     2380    PS_FFT_REAL_RESULT = 2              ///< psImageFFT/psVectorFFT should return a real image. This is valid
     2381                                        ///< for only reverse FFT, i.e., the psImageFFT/psVectorFFT flag
     2382                                        ///< parameter should appear as PS_FFT_REVERSE+PS_FFT_REAL_RESULT.
     2383} psFFTFlags;
     2384\end{verbatim}
     2385
     2386The entry \code{PS_FFT_REAL_RESULT} means that the output of an
     2387inverse FFT is to be purely real.  An example of its use is:
     2388\begin{verbatim}
     2389out = psImageFFT(in, PS_FFT_REVERSE | PS_FFT_REAL_RESULT);
     2390\end{verbatim}
     2391
     2392The output from a FFT and power spectrum shall be of the same size as
     2393the input.  In the future, if this adversely affects performance, this
     2394will be revised so that the redundant information will be neglected.
     2395
    23722396In analogy with the vector FFT operations, we also define matching
    23732397image operations as follows:
    23742398\begin{verbatim}
    2375 psImage *psImageFFT(const psImage *image, int direction);
     2399psImage *psImageFFT(psImage *out, const psImage *image, psFFTFlags direction);
    23762400psImage *psImageReal(psImage *out, const psImage *in);
    23772401psImage *psImageImaginary(psImage *out, const psImage *in);
    2378 psImage *psImageComplex(psImage *real, const psImage *imag);
     2402psImage *psImageComplex(psImage *out, psImage *real, const psImage *imag);
    23792403psImage *psImageConjugate(psImage *out, const psImage *in);
    2380 psImage *psImagePowerSpectrum(const psImage *in);
     2404psImage *psImagePowerSpectrum(psImage *out, const psImage *in);
    23812405\end{verbatim}
    23822406
Note: See TracChangeset for help on using the changeset viewer.