summaryrefslogtreecommitdiff
path: root/muse_qt4_evolution/synti/zynaddsubfx/DSP/FFTwrapper.h
blob: df8cad7ae539227d88623329d2a0c30c895b17e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
  ZynAddSubFX - a software synthesizer
 
  FFTwrapper.h  -  A wrapper for Fast Fourier Transforms
  Copyright (C) 2002-2005 Nasca Octavian Paul
  Author: Nasca Octavian Paul

  This program is free software; you can redistribute it and/or modify
  it under the terms of version 2 of the GNU General Public License 
  as published by the Free Software Foundation.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License (version 2) for more details.

  You should have received a copy of the GNU General Public License (version 2)
  along with this program; if not, write to the Free Software Foundation,
  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA

*/

#ifndef FFT_WRAPPER_H
#define FFT_WRAPPER_H

#include "../globals.h"

#ifdef FFTW_VERSION_2

#include <fftw.h>

/* If you got error messages about rfftw.h, replace the next include  line with "#include <srfftw.h>"
or with "#include <drfftw.h> (if one doesn't work try the other). It may be necessary to replace
the <fftw.h> with <dfftw.h> or <sfftw.h>. If the neither one doesn't work, 
please install latest version of fftw(recomanded from the sources) from www.fftw.org.
If you'll install fftw3 you need to change the Makefile.inc
Hope all goes right." */
#include <rfftw.h>

#else

#include <fftw3.h>
#define fftw_real double
#define rfftw_plan fftw_plan
#endif

class FFTwrapper{
    public:
	FFTwrapper(int fftsize_);
	~FFTwrapper();
	void smps2freqs(REALTYPE *smps,FFTFREQS freqs);
	void freqs2smps(FFTFREQS freqs,REALTYPE *smps);
    private:
	int fftsize;
	fftw_real *tmpfftdata1,*tmpfftdata2;
	rfftw_plan planfftw,planfftw_inv;
};
#endif