home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / CMCD1104.ISO / Software / Complet / ZynAddFX / Setup_ZynAddSubFX-2.1.1.exe / FFTwrapper.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-03-05  |  1.8 KB  |  60 lines

  1. /*
  2.   ZynAddSubFX - a software synthesizer
  3.  
  4.   FFTwrapper.h  -  A wrapper for Fast Fourier Transforms
  5.   Copyright (C) 2002-2004 Nasca Octavian Paul
  6.   Author: Nasca Octavian Paul
  7.  
  8.   This program is free software; you can redistribute it and/or modify
  9.   it under the terms of version 2 of the GNU General Public License 
  10.   as published by the Free Software Foundation.
  11.  
  12.   This program is distributed in the hope that it will be useful,
  13.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.   GNU General Public License (version 2) for more details.
  16.  
  17.   You should have received a copy of the GNU General Public License (version 2)
  18.   along with this program; if not, write to the Free Software Foundation,
  19.   Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  20.  
  21. */
  22.  
  23. #ifndef FFT_WRAPPER_H
  24. #define FFT_WRAPPER_H
  25.  
  26. #include "../globals.h"
  27.  
  28. #ifdef FFTW_VERSION_2
  29.  
  30. #include <fftw.h>
  31.  
  32. /* If you got error messages about rfftw.h, replace the next include  line with "#include <srfftw.h>"
  33. or with "#include <drfftw.h> (if one doesn't work try the other). It may be necessary to replace
  34. the <fftw.h> with <dfftw.h> or <sfftw.h>. If the neither one doesn't work, 
  35. please install latest version of fftw(recomanded from the sources) from www.fftw.org.
  36. If you'll install fftw3 you need to change the Makefile.inc
  37. Hope all goes right." */
  38. #include <rfftw.h>
  39.  
  40. #else
  41.  
  42. #include <fftw3.h>
  43. #define fftw_real double
  44. #define rfftw_plan fftw_plan
  45. #endif
  46.  
  47. class FFTwrapper{
  48.     public:
  49.     FFTwrapper(int fftsize_);
  50.     ~FFTwrapper();
  51.     void smps2freqs(REALTYPE *smps,REALTYPE *freqs);
  52.     void freqs2smps(REALTYPE *freqs,REALTYPE *smps);
  53.     private:
  54.     int fftsize;
  55.     fftw_real *tmpfftdata1,*tmpfftdata2;
  56.     rfftw_plan planfftw,planfftw_inv;
  57. };
  58. #endif
  59.  
  60.