Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

FEAPIExamplePluginZeroCrossings/zplVecLib.h

Go to the documentation of this file.
00001 
00002 //     /*! \file zplVecLib.h: \brief interface of the zplVecLib . */
00003 //
00004 //        Copyright (c) 2004-2007  
00005 //        zplane.development
00006 //        Flohrer Lerch Schwerdtfeger GbR
00007 //        All rights reserved.
00008 //
00009 //        Redistribution and use in source and binary forms, with or without 
00010 //        modification, are permitted provided that the following conditions 
00011 //        are met:
00012 //
00013 //        *   Redistributions of source code must retain the above copyright 
00014 //            notice, this list of conditions and the following disclaimer. 
00015 //        *   Redistributions in binary form must reproduce the above 
00016 //            copyright notice, this list of conditions and the following 
00017 //            disclaimer in the documentation and/or other materials 
00018 //            provided with the distribution. 
00019 //        *   Neither the name of the FEAPI development team nor the names 
00020 //            of its contributors may be used to endorse or promote products 
00021 //            derived from this software without specific prior written 
00022 //            permission. 
00023 //
00024 //        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00025 //        "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
00026 //        LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
00027 //        FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
00028 //        COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
00029 //        INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
00030 //        BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
00031 //        LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
00032 //        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
00033 //        LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
00034 //        ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
00035 //        POSSIBILITY OF SUCH DAMAGE.
00036 //
00038 
00039 #if !defined(__libzplVecLib_HEADER_INCLUDED__)
00040 #define __libzplVecLib_HEADER_INCLUDED__
00041 
00042 
00043 
00044 #ifdef WIN32
00045 typedef float zCOMPLEX;
00046 #define ZCDECL __cdecl
00047 #elif defined(_MACH)
00048 typedef float zCOMPLEX;
00049 #define ZCDECL
00050 #else
00051 #error  "undefined system"
00052 #endif
00053 #if defined (NDEBUG) || (GP_DEBUG == 0)
00054     #define ZASSERT(exp)    ((void)0)
00055 #else
00056     #include <assert.h>
00057     #define ZASSERT(exp)    assert(!(exp))
00058 #endif
00059 
00060 #include "RingBuffer.h"
00061 
00062 
00063 
00071 void zplVecLibDispatcher ();
00072 
00073 
00081 extern float*   (ZCDECL *zplfMalloc)      (int       iNumOfFloats);
00082 
00090 extern void       (ZCDECL *zplfFree)        (float   *&ppfBuffer);
00091 
00100 extern void       (ZCDECL *zplfSetZero)     (float   *pfBuffer, int iLengthAsPowOf4);
00101 
00102 
00113 extern void       (ZCDECL *zplfRealFindMax)   (float    *pfSrc, float    *pfMax, int    *piIdx, int    iLengthAsPowOf4);
00114 
00124 extern void       (ZCDECL *zplfRealAdd_I)   (float   *pfSrcDest, float    *pfSrc, int    iLengthAsPowOf4);
00125 
00135 extern void       (ZCDECL *zplfRealAddC_I)   (float   *pfSrcDest, float    fValue, int    iLengthAsPowOf4);
00136 
00146 extern void       (ZCDECL *zplfRealSub_I)   (float   *pfSrcDest, float    *pfSrc, int    iLengthAsPowOf4);
00147 
00157 extern void       (ZCDECL *zplfRealMul_I)   (float   *pfSrcDest, float    *pfSrc, int    iLengthAsPowOf4);
00158 
00168 extern void       (ZCDECL *zplfRealMulC_I)  (float   *pfSrcDest, float    fScaleFactor, int    iLengthAsPowOf4);
00169 
00179 extern void       (ZCDECL *zplfRealDiv_I)   (float   *pfNomSrcDest, float    *pfDenomSrc, int    iLengthAsPowOf4);
00180 
00191 extern void       (ZCDECL *zplfRealMac_I)   (float   *pfSrcDest, float    *pfSrc1, float   *pfSrc2, int   iLengthAsPowOf4);
00192 
00201 extern void       (ZCDECL *zplfRealAbs_I)   (float   *pfSrcDest, int iLengthAsPowOf4);
00202 
00211 extern float    (ZCDECL *zplfRealSum)   (float   *pfSrc, int iLengthAsPowOf4);
00212 
00213 
00223 extern void       (ZCDECL *zplfCompAdd_I)   (zCOMPLEX   *pfSrcDest, zCOMPLEX    *pfSrc,  int iRealLengthAsPowOf4);
00224 
00234 extern void       (ZCDECL *zplfCompMul_I)   (zCOMPLEX   *pfSrcDest, zCOMPLEX    *pfSrc,  int iRealLengthAsPowOf4);
00235 
00245 extern void       (ZCDECL *zplfCompDiv_I)   (zCOMPLEX   *pfNomSrcDest, zCOMPLEX    *pfDenomSrc, int    iRealLengthAsPowOf4);
00246 
00257 extern void       (ZCDECL *zplfCompMac_I)   (zCOMPLEX   *pfSrcDest, zCOMPLEX    *pfSrc1, float   *pfSrc2, int   iRealLengthAsPowOf4);
00258 
00268 extern void       (ZCDECL *zplfCompAbs)     (float   *pfDest,    zCOMPLEX    *pfSrc1, int iRealLengthAsPowOf4);
00269 
00270 
00271 class CzplfFFT_If
00272 {
00273 public:
00274 
00275     
00277     enum _Fft_Windows_
00278     {
00279         _RECT,      
00280         _HANNING,   
00281         _HAMMING,   
00282         _BLACKMAN,  
00283         _BARTLETT,  
00284         _WELCH      
00285     };
00286 
00287 
00288 
00297     virtual void           zplfFFT         (zCOMPLEX *pfDest, float *pfSrc) = 0;
00298 
00307     virtual void           zplfIFFT        (float *pfDest, zCOMPLEX *pfSrc) = 0;
00308 
00309 
00317     int zplfGetWindow                      (float *pfWindow);
00318 
00319 protected:
00320     int      m_eLastError;
00321 
00322     void       CalculateWindow (_Fft_Windows_ eWindowType);
00323     unsigned int     Log2 (int iValueAsPowOf2);
00324     virtual int      BuildFFTTables () = 0;
00325     virtual void       FreeFFTTables () = 0;
00326 
00327     int        m_iFFTLength,
00328                 m_iBlockLength;
00329 
00330     float    *m_pfWindow;
00331 };
00332 
00333 
00344 extern int       (ZCDECL *zplfFFTCreateInstance)  (CzplfFFT_If*& pCFFT, int iBlockLength, int iZeroPadFactor, CzplfFFT_If::_Fft_Windows_ eWindowType);
00345 
00353 extern int       (ZCDECL *zplfFFTDestroyInstance) (CzplfFFT_If*& pCFFT);
00354 
00355 
00356 extern int        (ZCDECL *zplfZeroCrossings)     (float   *pfSrc, int        iRealLengthAsPowOf4);
00357 
00358 
00359 #endif // #if !defined(__libzplVecLib_HEADER_INCLUDED__)
00360 
00361 
00362 

Generated on Fri Mar 23 10:28:54 2007 for FEAPI Plugin Documentation by  doxygen 1.3.9.1