gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
Real2DFFT.H
Go to the documentation of this file.
1 /* Copyright 2000-2018 Matt Flax <flatmax@flatmax.org>
2  This file is part of GTK+ IOStream class set
3 
4  GTK+ IOStream is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  GTK+ IOStream is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You have received a copy of the GNU General Public License
15  along with GTK+ IOStream
16 */
17 #ifndef REAL2DFFT_H_
18 #define REAL2DFFT_H_
19 
20 #include "fft/FFTCommon.H"
21 #include "fft/Real2DFFTData.H"
22 
24 class Real2DFFT {
26  fftw_plan fwdPlan, invPlan;
27 protected:
30 public:
33  //std::cout <<"RealFFT init:"<<this<<std::endl;
34  data=d;
35  // std::cout <<data->getXSize() << '\t'<<data->getYSize()<<std::endl;
36  fwdPlan = fftw_plan_dft_r2c_2d(data->getXSize(), data->getYSize(), data->in, data->out, PLANTYPE);
37  invPlan = fftw_plan_dft_c2r_2d(data->getXSize(), data->getYSize(), data->out, data->in, PLANTYPE);
38 }
39 
41  virtual ~Real2DFFT(){
42  // std::cout <<"RealFFT DeInit:"<<this<<std::endl;
43  fftw_destroy_plan(fwdPlan);
44  fftw_destroy_plan(invPlan);
45  std::cout <<"RealFFT DeInit done"<<std::endl;
46 }
47 
48 
50  void fwdTransform(){
51  if (!data)
52  std::cerr<<"Real2DFFT::fwdTransform : data not present"<<std::endl;
53  else
54  fftw_execute(fwdPlan);
55 }
56 
58  void invTransform(){
59  if (!data)
60  std::cerr<<"Real2DFFT::invTransform : data not present"<<std::endl;
61  else
62  fftw_execute(invPlan);
63 }
64 
65 };
69 #endif // REAL2DFFT_H_
void invTransform()
Inverse transform the data (out to in)
Definition: Real2DFFT.H:58
class Real2DFFTData controls and manipulates real 2D fft data
Definition: Real2DFFTData.H:24
Real2DFFTData * data
The pointer to the relevant data.
Definition: Real2DFFT.H:29
virtual ~Real2DFFT()
fft deconstructor
Definition: Real2DFFT.H:41
fftw_complex * out
The output data.
Definition: Real2DFFTData.H:35
#define PLANTYPE
Definition: FFTCommon.H:20
class Real2DFFT controls fftw plans and executes fwd/inv transforms
Definition: Real2DFFT.H:24
fftw_plan fwdPlan
The forward and inverse plans.
Definition: Real2DFFT.H:26
int getYSize()
The column count.
Definition: Real2DFFTData.H:58
void fwdTransform()
Forward transform the data (in to out)
Definition: Real2DFFT.H:50
Real2DFFT(Real2DFFTData *d)
fft init ... data pointed to by &#39;d&#39;
Definition: Real2DFFT.H:32
fftw_real * in
The input data and power spectrum.
Definition: Real2DFFTData.H:33
fftw_plan invPlan
Definition: Real2DFFT.H:26
int getXSize()
The row count.
Definition: Real2DFFTData.H:56
gtkIOStream: /tmp/gtkiostream/include/fft/Real2DFFT.H Source File
GTK+ IOStream  Beta