/*M*
//
//               INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 1995 Intel Corporation. All Rights Reserved.
//
//  RCS:
//      $Source: d:/rcs/nsp20/include/nspfft.h $
//      $Revision: 1.4 $
//      $Date: 1995/08/12 16:35:00 $
//
//  Purpose: NSP Fourier Transforms 
*M*/

/*===========================================================================*/

#if !defined _NSPFFT_H || defined _NSP_BLDPCS
#define _NSPFFT_H

/*---------------------------------------------------------------------------*/

#define NSP_Forw         1
#define NSP_Inv          2
#define NSP_Init         4
#define NSP_NoScale      8
#define NSP_NoBitRev    16
#define NSP_InBitRev    32
#define NSP_OutBitRev   64
#define NSP_OutRCPack  128
#define NSP_OutRCPerm  256
#define NSP_InRCPack   512
#define NSP_InRCPerm  1024
#define NSP_RADIX     4096

/*---------------------------------------------------------------------------*/
/*                                                                           */
/*        Dft                                                                */
/*                                                                           */
/* Compute the forward  or inverse discrete Fourier transform  (DFT) of a    */
/* signal.                                                                   */

NSPAPI(void,nspcDft,(const SCplx *inSamps, SCplx *outSamps,
                           int    length,  int    flags));
NSPAPI(void,nspzDft,(const DCplx *inSamps, DCplx *outSamps,
                           int    length,  int    flags));

/*---------------------------------------------------------------------------*/
/*        Fft                                                                */
/*                                                                           */
/* Compute  the forward  or inverse   fast Fourier  transform (FFT)  of a    */
/* signal.                                                                   */

NSPAPI(void,nspcFft,(SCplx  *samps, int order, int flags));
NSPAPI(void,nspzFft,(DCplx  *samps, int order, int flags));

NSPAPI(void,nspcFftNip,(const SCplx *inSamps, SCplx  *outSamps,
                              int    order,   int     flags));

NSPAPI(void,nspzFftNip,(const DCplx *inSamps, DCplx  *outSamps,
                              int    order,   int     flags));

NSPAPI(void,nspcrFft,(float  *reSamps, float  *imSamps, int order, int flags));
NSPAPI(void,nspzrFft,(double *reSamps, double *imSamps, int order, int flags));

NSPAPI(void,nspcrFftNip,(const float  *reInSamps, const float  *imInSamps,
                               float  *reOutSamps,      float  *imOutSamps,
                               int     order,           int     flags));

NSPAPI(void,nspzrFftNip,(const double *reInSamps, const double *imInSamps,
                               double *reOutSamps,      double *imOutSamps,
                               int     order,           int     flags));

/*---------------------------------------------------------------------------*/
/*        RealFftl, RealFftlNip                                              */
/*                                                                           */
/* Compute the  forward or inverse FFT  of a real signal  using RCPack or    */
/* RCPerm format.                                                            */

NSPAPI(void,nspsRealFftl,(float  *samps, int order, int flags));
NSPAPI(void,nspdRealFftl,(double *samps, int order, int flags));


NSPAPI(void,nspsRealFftlNip,(const float  *inSamps,float  *outSamps,
                                   int     order,  int     flags));

NSPAPI(void,nspdRealFftlNip,(const double *inSamps,double *outSamps,
                                   int     order,  int     flags));

/*---------------------------------------------------------------------------*/
/*        CcsFftl, CcsFftlNip                                                */
/*                                                                           */
/* Compute the  forward or inverse  FFT of a  complex conjugate-symmetric    */
/* (CCS) signal using RCPack or RCPerm format.                               */

NSPAPI(void,nspsCcsFftl,(float  *samps, int order, int flags));
NSPAPI(void,nspdCcsFftl,(double *samps, int order, int flags));

NSPAPI(void,nspsCcsFftlNip,(const float  *inSamps,float  *outSamps,
                                  int     order,  int     flags));

NSPAPI(void,nspdCcsFftlNip,(const double *inSamps,double *outSamps,
                                  int     order,  int     flags));

/*---------------------------------------------------------------------------*/
/*        MpyRCPack2, MpyRCPack3                                             */
/*                                                                           */
/* Multiply two vectors stored in RCPack format.                             */

NSPAPI(void,nspsMpyRCPack2,(const float  *src, float  *dst, int order));
NSPAPI(void,nspdMpyRCPack2,(const double *src, double *dst, int order));

NSPAPI(void,nspsMpyRCPack3,(const float  *srcA,const float  *srcB,float  *dst,
                                  int     order));

NSPAPI(void,nspdMpyRCPack3,(const double *srcA,const double *srcB,double *dst,
                                  int     order));

/*---------------------------------------------------------------------------*/
/*        MpyRCPerm2, MpyRCPerm3                                             */
/*                                                                           */
/* Multiply two vectors stored in RCPerm format.                             */

NSPAPI(void,nspsMpyRCPerm2,(const float  *src, float  *dst, int order));
NSPAPI(void,nspdMpyRCPerm2,(const double *src, double *dst, int order));

NSPAPI(void,nspsMpyRCPerm3,(const float  *srcA,const float  *srcB,float  *dst,
                                  int     order));

NSPAPI(void,nspdMpyRCPerm3,(const double *srcA,const double *srcB,double *dst,
                                  int     order));

/*---------------------------------------------------------------------------*/
/*        RealFft, RealFftNip                                                */
/*                                                                           */
/* Compute the forward or inverse FFT of a real signal.                      */

NSPAPI(void,nspwRealFft,(short  *samps, int order, int flags));
NSPAPI(void,nspsRealFft,(float  *samps, int order, int flags));
NSPAPI(void,nspdRealFft,(double *samps, int order, int flags));

NSPAPI(void,nspwRealFftNip,(const short  *inSamps, WCplx *outSamps,
                                  int     order,   int    flags));

NSPAPI(void,nspsRealFftNip,(const float  *inSamps, SCplx *outSamps,
                                  int     order,   int    flags));

NSPAPI(void,nspdRealFftNip,(const double *inSamps, DCplx *outSamps,
                                  int     order,   int    flags));

/*---------------------------------------------------------------------------*/
/*        CcsFft, CcsFftNip                                                  */
/*                                                                           */
/* Compute the  forward or inverse  FFT of a  complex conjugate-symmetric    */
/* (CCS) signal.                                                             */

NSPAPI(void,nspwCcsFft,(short  *samps, int order, int flags));
NSPAPI(void,nspsCcsFft,(float  *samps, int order, int flags));
NSPAPI(void,nspdCcsFft,(double *samps, int order, int flags));

NSPAPI(void,nspwCcsFftNip,(const WCplx *inSamps, short  *outSamps,
                                 int    order,   int     flags));

NSPAPI(void,nspsCcsFftNip,(const SCplx *inSamps, float  *outSamps,
                                 int    order,   int     flags));

NSPAPI(void,nspdCcsFftNip,(const DCplx *inSamps, double *outSamps,
                                 int    order,   int     flags));

/*---------------------------------------------------------------------------*/
/*        nsp?Real2Fft, nsp?Real2FftNip                                      */
/*                                                                           */
/* Compute the forward or inverse FFT of two real signals.                   */

NSPAPI(void,nspsReal2Fft,(float  *xSamps, float  *ySamps, int order, int flags));
NSPAPI(void,nspdReal2Fft,(double *xSamps, double *ySamps, int order, int flags));

NSPAPI(void,nspsReal2FftNip,(const float *xInSamps,SCplx  *xOutSamps,
                             const float *yInSamps,SCplx  *yOutSamps,int order,
                                                                     int flags));

NSPAPI(void,nspdReal2FftNip,(const double *xInSamps,DCplx *xOutSamps,
                             const double *yInSamps,DCplx *yOutSamps,int order,
                                                                     int flags));

/*---------------------------------------------------------------------------*/
/*        nsp?Ccs2Fft, nsp?Ccs2FftNip                                        */
/*                                                                           */
/* Compute the forward or reverse  FFT of two complex conjugate-symmetric    */
/* (CCS) signals.                                                            */

NSPAPI(void,nspsCcs2Fft,(float  *xSamps, float  *ySamps, int order,int flags));
NSPAPI(void,nspdCcs2Fft,(double *xSamps, double *ySamps, int order,int flags));

NSPAPI(void,nspsCcs2FftNip,(const SCplx *xInSamps,float  *xOutSamps,
                            const SCplx *yInSamps,float  *yOutSamps,int order,
                                                                    int flags));

NSPAPI(void,nspdCcs2FftNip,(const DCplx *xInSamps,double *xOutSamps,
                            const DCplx *yInSamps,double *yOutSamps,int order,
                                                                    int flags));

#endif                                  /* _NSPFFT_H                         */
