npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
FourierImage.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_FOURIERIMAGE_HH_
2 #define NPSTAT_FOURIERIMAGE_HH_
3 
4 /*!
5 // \file FourierImage.hh
6 //
7 // \brief Memory manager for Fourier transforms produced by FFTW
8 //
9 // Author: I. Volobouev
10 //
11 // December 2011
12 */
13 
14 #include <complex>
15 #include "fftw3.h"
16 
17 namespace npstat {
18  /**
19  // Wrapper class for memory blocks allocated by FFTW function
20  // fftw_malloc and deallocated by fftw_free. Intended for storing
21  // results of Fourier transforms.
22  */
24  {
25  public:
26  FourierImage(const std::complex<double>* image, unsigned long imLen);
27  FourierImage(const fftw_complex* image, unsigned long imageLen);
28  FourierImage(const FourierImage&);
29  FourierImage& operator=(const FourierImage&);
30 
31  ~FourierImage();
32 
33  inline const fftw_complex* image() const {return filterImage_;}
34  inline unsigned long size() const {return imageLen_;}
35 
36  private:
37  FourierImage();
38  fftw_complex* filterImage_;
39  unsigned long imageLen_;
40  };
41 
42  /** Multiply two arrays of FFTW complex numbers */
43  void multiplyTransforms(const fftw_complex* l, const fftw_complex* r,
44  fftw_complex* result, const unsigned long len);
45 
46  /** Divide two arrays of FFTW complex numbers */
47  void divideTransforms(const fftw_complex* numer, const fftw_complex* denom,
48  fftw_complex* result, const unsigned long len);
49 
50  /** Multiply by a scalar. "l" and "result" can be the same. */
51  void scaleTransform(const fftw_complex* l, double scale,
52  fftw_complex* result, const unsigned long len);
53 }
54 
55 #endif // NPSTAT_FOURIERIMAGE_HH_
Definition: FourierImage.hh:24
Definition: AbsArrayProjector.hh:14
void divideTransforms(const fftw_complex *numer, const fftw_complex *denom, fftw_complex *result, const unsigned long len)
void scaleTransform(const fftw_complex *l, double scale, fftw_complex *result, const unsigned long len)
void multiplyTransforms(const fftw_complex *l, const fftw_complex *r, fftw_complex *result, const unsigned long len)