Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Transform8.hh

Go to the documentation of this file.
00001 /*
00002 
00003     DFT, DCT and DST routines
00004     Copyright (C) 1996-1999 Takuya OOURA
00005     Copyright (C) 1999-2003 Jussi Laako
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 
00021     Version 1.0 : Converted T.OOURA's functions to C++ class
00022     Version 1.1 : Updated to match T.OOURA's Oct/99 code and all versions
00023     Version 1.2 : Some conversion and precision updates
00024 
00025 */
00026 
00027 
00028 /* This is decimation-in-frequency radix-2/4/8 transform */
00029 
00030 
00031 #ifndef TRANSFORM8_HH
00032     #define TRANSFORM8_HH
00033 
00034     #ifdef TRANSFORM_INLINE
00035         #define T8_INLINE           inline
00036     #else
00037         #define T8_INLINE
00038     #endif
00039 
00040     #if (defined(_GNU_SOURCE) && (!defined(ALPHA)))
00041         #ifndef TRANSFORM_EXT_PREC
00042             #define TRANSFORM_EXT_PREC
00043         #endif
00044     #endif
00045 
00046     #if (defined(__BORLANDC__) || defined(SOLARIS) || defined(OSX))
00047         #define sinf(x)             sin(x)
00048         #define cosf(x)             cos(x)
00049         #define atanf(x)            atan(x)
00050     #endif
00051 
00052     // #define TRANSFORM_EXT_PREC for extended precision for table calculation
00053     // for single precision transforms
00054 
00055 
00064     class clTransform8
00065     {
00066             void makewt(long, long *, float *);
00067             void makewt(long, long *, double *);
00068             void makect(long, long *, float *);
00069             void makect(long, long *, double *);
00070             void bitrv2(long, long *, float *);
00071             void bitrv2(long, long *, double *);
00072             void bitrv2conj(long, long *, float *);
00073             void bitrv2conj(long, long *, double *);
00074             void cftfsub(long, float *, float *);
00075             void cftfsub(long, double *, double *);
00076             void cftbsub(long, float *, float *);
00077             void cftbsub(long, double *, double *);
00078             void cft1st(long, float *, float *);
00079             void cft1st(long, double *, double *);
00080             void cftmdl(long, long, float *, float *);
00081             void cftmdl(long, long, double *, double *);
00082             void rftfsub(long, float *, long, float *);
00083             void rftfsub(long, double *, long, double *);
00084             void rftbsub(long, float *, long, float *);
00085             void rftbsub(long, double *, long, double *);
00086             void dctsub(long, float *, long, float *);
00087             void dctsub(long, double *, long, double *);
00088             void dstsub(long, float *, long, float *);
00089             void dstsub(long, double *, long, double *);
00090         public:
00091             // Complex DFT
00092             // (2 * size, <1|-1>, input/output, work area [0] = 0 init,
00093             // cos/sin table)
00094             void cdft(long, long, float *, long *, float *);
00095             void cdft(long, long, double *, long *, double *);
00096             // Real DFT
00097             // (size, <1|-1>, input/output, work area, cos/sin table)
00098             void rdft(long, long, float *, long *, float *);
00099             void rdft(long, long, double *, long *, double *);
00100             // DCT
00101             void ddct(long, long, float *, long *, float *);
00102             void ddct(long, long, double *, long *, double *);
00103             // DST
00104             void ddst(long, long, float *, long *, float *);
00105             void ddst(long, long, double *, long *, double *);
00106             // CT of RDFT
00107             void dfct(long, float *, float *, long *, float *);
00108             void dfct(long, double *, double *, long *, double *);
00109             // ST of RDFT
00110             void dfst(long, float *, float *, long *, float *);
00111             void dfst(long, double *, double *, long *, double *);
00112     };
00113 
00114 #endif
00115 

Generated on Tue Mar 2 19:46:45 2004 for libDSP by doxygen 1.3.6