IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 7, 2007, 6:17:58 PM (19 years ago)
Author:
Paul Price
Message:

Reworked image convolution (split direct and FFT methods into separate functions) and FFT functions. psVectorFFT needs a bit more work to clean up the N/2 issues from FFTW's r2c and c2r.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fft/psVectorFFT.h

    r11248 r11703  
    1 /* @file  psVectorFFT.h
    2  * @brief Contains FFT transform related functions for psVector
    3  *
    4  * @author Robert DeSonia, MHPCC
    5  *
    6  * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-01-23 22:47:22 $
    8  * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    9  */
     1/// @file  psVectorFFT.h
     2/// @brief Contains FFT transform related functions for psVector
     3///
     4/// @author Paul Price, IfA
     5/// @author Robert DeSonia, MHPCC
     6///
     7/// @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     8/// @date $Date: 2007-02-08 04:17:58 $
     9/// Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     10///
    1011
    1112#ifndef PS_VECTOR_FFT_H
     
    1718/// @{
    1819
    19 /** Specify direction of FFT */
    20 typedef enum {
    21     /// psImageFFT/psVectorFFT should perform a forward FFT.
    22     PS_FFT_FORWARD = 1,
     20/// Forward FFT of a vector
     21///
     22/// Applies a forward FFT (exponent -1), with the result returned in both real and imaginary parts.  The FFT
     23/// is not normalised (a forward followed by a reverse is the original scaled by the number of elements).  The
     24/// FFT takes advantage of the fact that the input is purely real; hence the output size is N/2 + 1 (with
     25/// division rounding down).  Only implemented for F32 input.
     26bool psVectorForwardFFT(psVector **real,///< Real part of FFT
     27                        psVector **imag,///< Imaginary part of FFT
     28                        const psVector *in ///< Input vector (F32)
     29    );
    2330
    24     /// psImageFFT/psVectorFFT should perform a reverse FFT.
    25     PS_FFT_REVERSE = 2,
     31/// Backward FFT of a vector
     32///
     33/// Applies a backward FFT (exponent +1) from the real and imaginary parts with the (purely) real result
     34/// returned.  The FFT is not normalised (a forward followed by a reverse is the original scaled by the number
     35/// of elements).  The FFT takes advantage of the fact that the output will be purely real; hence the input
     36/// size is N/2 + 1 (with division rounding down); to manage the redundancy (is the original size even or
     37/// odd?), we need the original size (the size of the array that was input to psVectorForwardFFT) to be
     38/// provided.  Only implemented for F32 input.
     39bool psVectorBackwardFFT(psVector **out,///< Output vector
     40                         const psVector *real, ///< Real input (F32)
     41                         const psVector *imag, ///< Imaginary input (F32)
     42                         int origN      ///< Original number of elements
     43    );
    2644
    27     /// psImageFFT/psVectorFFT should perform a reverse FFT with a real result.
    28     PS_FFT_REAL_RESULT = 4
    29 } psFFTFlags;
     45/// Power spectrum of a vector
     46///
     47/// Generates the power spectrum of a vector.  Only implemented for F32 input.
     48psVector *psVectorPowerSpectrum(psVector *out, ///< Output power spectrum, or NULL
     49                                const psVector* in ///< Input vector (F32)
     50    );
    3051
    31 
    32 /** Forward and reverse FFT calculations.
    33  *
    34  *  This takes as input the vector of interest (in) and the direction
    35  *  (direction), which is specified by an enumerated type psFftDirection.
    36  *  The input vector may be of type psF32 or psC32, the result is always
    37  *  psC32. If the input vector is psF32, the direction must be forward.
    38  *
    39  *  @return psVector* the FFT transformation result
    40  */
    41 psVector* psVectorFFT(
    42     psVector* out,                     ///< a psVector to recycle.  If NULL, a new psVector is made.
    43     const psVector* in,                ///< the vector to apply transform to
    44     psFFTFlags direction               ///< the direction of the transform
    45 );
    46 
    47 /** extract the real portion of a complex vector
    48  *
    49  *  @return psVector*   real portion of the input vector.
    50  */
    51 psVector* psVectorReal(
    52     psVector* out,                     ///< a psVector to recycle.  If NULL, a new psVector is made.
    53     const psVector* in                ///< the psVector to extract real portion from
    54 );
    55 
    56 /** extract the imaginary portion of a complex vector
    57  *
    58  *  @return psVector*   imaginary portion of the input vector.
    59  */
    60 psVector* psVectorImaginary(
    61     psVector* out,                     ///< a psVector to recycle.  If NULL, a new psVector is made.
    62     const psVector* in                 ///< the psVector to extract imaginary portion from
    63 );
    64 
    65 /** creates a complex vector from separate real and imaginary vectors
    66  *
    67  *  @return psVector*   resulting complex vector
    68  */
    69 psVector* psVectorComplex(
    70     psVector* out,                     ///< a psVector to recycle.  If NULL, a new psVector is made.
    71     const psVector* real,              ///< the real vector
    72     const psVector* imag               ///< the imaginary vector
    73 );
    74 
    75 /** computes the complex conjugate of a vector
    76  *
    77  *  @return psVector*   the complex conjugate of the 'in' vector
    78  */
    79 psVector* psVectorConjugate(
    80     psVector* out,                     ///< a psVector to recycle.  If NULL, a new psVector is made.
    81     const psVector* in                 ///< the psVector to compute conjugate of
    82 );
    83 
    84 /** computes the power spectrum of a vector
    85  *
    86  *  @return psVector*   the power spectrum of the 'in' vector
    87  */
    88 psVector* psVectorPowerSpectrum(
    89     psVector* out,                     ///< a psVector to recycle.  If NULL, a new psVector is made.
    90     const psVector* in                 ///< the psVector to power spectrum of
    91 );
     52/// Multiply complex vectors
     53///
     54/// The input vectors are the real and imaginary parts of each of two vectors.  The real and imaginary parts
     55/// of the output vector are returned.  Only implemented for F32 input.
     56bool psVectorComplexMultiply(psVector **outReal, ///< Real part of output
     57                             psVector **outImag, ///< Imaginary part of output
     58                             const psVector *in1Real, ///< Real part of input 1
     59                             const psVector *in1Imag, ///< Imaginary part of input 1
     60                             const psVector *in2Real, ///< Real part of input 2
     61                             const psVector *in2Imag ///< Imaginary part of input 2
     62    );
    9263
    9364/// @}
Note: See TracChangeset for help on using the changeset viewer.