MFFM FFTw Wrapper
realFFT.H
1/* Copyright 2001,2002 Matt Flax <flatmax@ieee.org>
2 This file is part of the MFFM FFTw Wrapper library.
3
4 MFFM MFFM FFTw Wrapper library is free software; you can
5 redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 MFFM FFTw Wrapper library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You have received a copy of the GNU General Public License
16 along with the MFFM FFTw Wrapper library
17*/
18#ifndef REALFFT_H_
19#define REALFFT_H_
20
21#include "realFFTData.H"
22#include <fftw3.h>
23
24#include <iostream>
25using namespace std;
26
27class realFFTData;
28
29#define PLANTYPE FFTW_ESTIMATE
30
31///class realFFT controls fftw plans and executes fwd/inv transforms
32class realFFT {
33 /// The fwd/inv plans
34 fftw_plan fwdPlan, invPlan;
35
36 /// Method to create the plans
37 void createPlan(void);
38 /// Method to destroy the plans
39 void destroyPlan(void);
40protected:
41 /// The pointer to the relevant data
43public:
44 /// fft init ... don't forget to associate data using switchData
45 realFFT(void);
46 /// fft init ... data pointed to by 'd'
48 /// fft deconstructor
49 ~realFFT(void);
50
51 /// Use this to change associated fft data (for fft'ing)
53
54 /// Forward transform the data (in to out)
55 void fwdTransform(); // Forward fft
56 /// Inverse transform the data (out to in)
57 void invTransform(); // Inverse fft
58};
59/** \example realFFTExample.cc
60 * This is an example of how to use the class.
61 * It transforms a sine tone stored in the .dat file and saves the
62 * in, out, and power_spectrum results of using the class
63 */
64#endif // REALFFT_H_
class realFFTData controls and manipulates fft data
Definition: realFFTData.H:32
class realFFT controls fftw plans and executes fwd/inv transforms
Definition: realFFT.H:32
void invTransform()
Inverse transform the data (out to in)
realFFT(void)
fft init ... don't forget to associate data using switchData
realFFTData * data
The pointer to the relevant data.
Definition: realFFT.H:42
realFFT(realFFTData *d)
fft init ... data pointed to by 'd'
void fwdTransform()
Forward transform the data (in to out)
~realFFT(void)
fft deconstructor
void switchData(realFFTData *d)
Use this to change associated fft data (for fft'ing)