BALL
1.4.79
|
#include <BALL/MATHS/FFT1D.h>
Public Types | |
typedef std::complex< typename ComplexTraits::ComplexPrecision > | Complex |
typedef TRegularData1D < std::complex< typename ComplexTraits::ComplexPrecision > > | ComplexVector |
Public Types inherited from BALL::TRegularData1D< std::complex< ComplexTraits::ComplexPrecision > > | |
typedef std::complex < ComplexTraits::ComplexPrecision > | value_type |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::iterator | iterator |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::const_iterator | const_iterator |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::reference | reference |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::const_reference | const_reference |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::pointer | pointer |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::difference_type | difference_type |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::size_type | size_type |
typedef Position | IndexType |
The IndexType. More... | |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > > | VectorType |
The type containing an STL vector of the corresponding ValueType. More... | |
typedef double | CoordinateType |
The coordinate type. More... | |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::iterator | Iterator |
A mutable iterator. More... | |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::const_iterator | ConstIterator |
A constant iterator. More... | |
Public Member Functions | |
void | doFFT () |
void | doiFFT () |
bool | translate (double trans_origin) |
bool | setPhysStepWidth (double new_width) |
double | getPhysStepWidth () const |
double | getFourierStepWidth () const |
double | getPhysSpaceMin () const |
double | getPhysSpaceMax () const |
double | getFourierSpaceMin () const |
double | getFourierSpaceMax () const |
Size | getMaxIndex () const |
Size | getNumberOfInverseTransforms () const |
double | getGridCoordinates (Position position) const |
Complex | getData (const double pos) const |
Complex | getInterpolatedValue (const double pos) const |
void | setData (double pos, Complex val) |
Complex & | operator[] (const double pos) |
const Complex & | operator[] (const double pos) const |
Complex & | operator[] (const Position &pos) |
const Complex & | operator[] (const Position &pos) const |
void | setNumberOfFFTTransforms (Size num) |
void | setNumberOfiFFTTransforms (Size num) |
bool | isInFourierSpace () const |
Complex | phase (const double pos) const |
Constructors and Destructors | |
TFFT1D () | |
Default constructor. More... | |
TFFT1D (const TFFT1D &data) | |
Copy constructor. More... | |
TFFT1D (Size ldn, double stepPhys=1., double origin=0., bool inFourierSpace=false) | |
virtual | ~TFFT1D () |
Destructor. More... | |
Assignment | |
const TFFT1D & | operator= (const TFFT1D &fft1d) |
Assignment operator. More... | |
virtual void | clear () |
virtual void | destroy () |
Predicates | |
bool | operator== (const TFFT1D &fft1d) const |
Public Member Functions inherited from BALL::TRegularData1D< std::complex< ComplexTraits::ComplexPrecision > > | |
TRegularData1D () | |
Default constructor. More... | |
TRegularData1D (const TRegularData1D &data) | |
TRegularData1D (const CoordinateType &origin, const CoordinateType &dimension, const CoordinateType &spacing) | |
TRegularData1D (const IndexType &size) | |
TRegularData1D (const VectorType &data, const CoordinateType &origin=0.0, const CoordinateType &dimension=1.0) | |
virtual | ~TRegularData1D () |
Destructor. More... | |
TRegularData1D & | operator= (const TRegularData1D< std::complex< ComplexTraits::ComplexPrecision > > &data) |
TRegularData1D & | operator= (const VectorType &data) |
bool | operator== (const TRegularData1D &data) const |
Equality operator. More... | |
BALL_INLINE bool | operator!= (const TRegularData1D &data) const |
Inequality operator. More... | |
BALL_INLINE bool | empty () const |
Empty predicate. More... | |
bool | isInside (const CoordinateType &x) const |
Test whether a point is inside the grid. More... | |
BALL_INLINE ConstIterator | begin () const |
BALL_INLINE Iterator | begin () |
BALL_INLINE ConstIterator | end () const |
BALL_INLINE Iterator | end () |
BALL_INLINE size_type | size () const |
BALL_INLINE size_type | max_size () const |
BALL_INLINE void | swap (TRegularData1D< std::complex< ComplexTraits::ComplexPrecision > > &data) |
const std::complex < ComplexTraits::ComplexPrecision > & | getData (const IndexType &index) const |
std::complex < ComplexTraits::ComplexPrecision > & | getData (const IndexType &index) |
const std::complex < ComplexTraits::ComplexPrecision > & | operator[] (const IndexType &index) const |
std::complex < ComplexTraits::ComplexPrecision > & | operator[] (const IndexType &index) |
std::complex < ComplexTraits::ComplexPrecision > | operator() (const CoordinateType &x) const |
std::complex < ComplexTraits::ComplexPrecision > | getInterpolatedValue (const CoordinateType &x) const |
void | getEnclosingIndices (const CoordinateType &x, Position &lower, Position &upper) const |
void | getEnclosingValues (const CoordinateType &x, std::complex< ComplexTraits::ComplexPrecision > &lower, std::complex< ComplexTraits::ComplexPrecision > &upper) const |
CoordinateType | getCoordinates (const IndexType &index) const |
IndexType | getClosestIndex (const CoordinateType &x) const |
IndexType | getLowerIndex (const CoordinateType &x) const |
const std::complex < ComplexTraits::ComplexPrecision > & | getClosestValue (const CoordinateType &x) const |
std::complex < ComplexTraits::ComplexPrecision > & | getClosestValue (const CoordinateType &x) |
BALL_INLINE IndexType | getSize () const |
Return the number of points in the data set. More... | |
BALL_INLINE const CoordinateType & | getOrigin () const |
BALL_INLINE const CoordinateType & | getSpacing () const |
BALL_INLINE void | setOrigin (const CoordinateType &origin) |
BALL_INLINE const CoordinateType & | getDimension () const |
BALL_INLINE void | setDimension (const CoordinateType &dimension) |
void | resize (const IndexType &size) |
void | rescale (const IndexType &new_size) |
std::complex < ComplexTraits::ComplexPrecision > | calculateMean () const |
std::complex < ComplexTraits::ComplexPrecision > | calculateSD () const |
void | binaryWrite (const String &filename) const |
void | binaryRead (const String &filename) |
Protected Attributes | |
Size | length_ |
bool | inFourierSpace_ |
Size | numPhysToFourier_ |
Size | numFourierToPhys_ |
double | origin_ |
double | stepPhys_ |
double | stepFourier_ |
double | minPhys_ |
double | maxPhys_ |
double | minFourier_ |
double | maxFourier_ |
ComplexTraits::FftwPlan | planForward_ |
ComplexTraits::FftwPlan | planBackward_ |
Complex * | dataAdress_ |
bool | planCalculated_ |
Protected Attributes inherited from BALL::TRegularData1D< std::complex< ComplexTraits::ComplexPrecision > > | |
CoordinateType | origin_ |
The origin of the data set. More... | |
CoordinateType | dimension_ |
The dimension (length) More... | |
CoordinateType | spacing_ |
The spacing. More... | |
VectorType | data_ |
The data. More... | |
A class to perform Fast Fourier Transforms and inverse Fast Fourier Transforms on regularly spaced one dimensional data.
typedef std::complex<typename ComplexTraits::ComplexPrecision> BALL::TFFT1D< ComplexTraits >::Complex |
typedef TRegularData1D<std::complex<typename ComplexTraits::ComplexPrecision> > BALL::TFFT1D< ComplexTraits >::ComplexVector |
BALL::TFFT1D< ComplexTraits >::TFFT1D | ( | ) |
Default constructor.
Global assignment operator from FFT2D to TRegularData2D<Complex>Global assignment operator from FFT3D to TRegularData3D<float>. This operator assigns the real part of the complex FFT2D-data to the TRegularData2D<float> to.
BALL::TFFT1D< ComplexTraits >::TFFT1D | ( | const TFFT1D< ComplexTraits > & | data | ) |
Copy constructor.
BALL::TFFT1D< ComplexTraits >::TFFT1D | ( | Size | ldn, |
double | stepPhys = 1. , |
||
double | origin = 0. , |
||
bool | inFourierSpace = false |
||
) |
Detailed constructor.
ldn | The binary logarithm of the number of grid points (we use the logarithm to ensure that the number of points is a power of two, which is important for the FFT) |
stepPhys | The step width in physical space |
origin | The origin of the coordinate system |
inFourierSpace | Flag to decide whether the data is assumed to be in physical or fourier space |
|
virtual |
Destructor.
|
virtual |
Clear the contents.
Reimplemented from BALL::TRegularData1D< std::complex< ComplexTraits::ComplexPrecision > >.
|
virtual |
Clear the contents and reset all attributes.
void BALL::TFFT1D< ComplexTraits >::doFFT | ( | ) |
Perform a single fast fourier transform on the data.
void BALL::TFFT1D< ComplexTraits >::doiFFT | ( | ) |
Perform a single inverse fourier transform on the data.
TFFT1D< ComplexTraits >::Complex BALL::TFFT1D< ComplexTraits >::getData | ( | const double | pos | ) | const |
Returns the data at the grid position closest to pos , and automatically includes the correct phase factor and normalization.
Exception::OutOfGrid | if pos is outside the grid boundaries |
double BALL::TFFT1D< ComplexTraits >::getFourierSpaceMax | ( | ) | const |
double BALL::TFFT1D< ComplexTraits >::getFourierSpaceMin | ( | ) | const |
double BALL::TFFT1D< ComplexTraits >::getFourierStepWidth | ( | ) | const |
double BALL::TFFT1D< ComplexTraits >::getGridCoordinates | ( | Position | position | ) | const |
TFFT1D< ComplexTraits >::Complex BALL::TFFT1D< ComplexTraits >::getInterpolatedValue | ( | const double | pos | ) | const |
Returns the data at point pos. If pos is not a point on the grid, the data is linearly interpolated. This method automatically includes the correct phase factor and normalization.
Exception::OutOfGrid | if pos is outside the grid boundaries |
Size BALL::TFFT1D< ComplexTraits >::getMaxIndex | ( | ) | const |
Size BALL::TFFT1D< ComplexTraits >::getNumberOfInverseTransforms | ( | ) | const |
double BALL::TFFT1D< ComplexTraits >::getPhysSpaceMax | ( | ) | const |
double BALL::TFFT1D< ComplexTraits >::getPhysSpaceMin | ( | ) | const |
double BALL::TFFT1D< ComplexTraits >::getPhysStepWidth | ( | ) | const |
bool BALL::TFFT1D< ComplexTraits >::isInFourierSpace | ( | ) | const |
const TFFT1D& BALL::TFFT1D< ComplexTraits >::operator= | ( | const TFFT1D< ComplexTraits > & | fft1d | ) |
Assignment operator.
bool BALL::TFFT1D< ComplexTraits >::operator== | ( | const TFFT1D< ComplexTraits > & | fft1d | ) | const |
TFFT1D< ComplexTraits >::Complex & BALL::TFFT1D< ComplexTraits >::operator[] | ( | const double | pos | ) |
Access the data at the grid position closest to pos . This function returns the "raw" data at that position.
Exception::OutOfGrid | if pos is outside the grid boundaries |
const TFFT1D< ComplexTraits >::Complex & BALL::TFFT1D< ComplexTraits >::operator[] | ( | const double | pos | ) | const |
Access the data at the grid position closest to pos . This function returns the "raw" data at that position.
Exception::OutOfGrid | if pos is outside the grid boundaries |
|
inline |
Access the (raw) data at Position pos
Exception::OutOfGrid | if pos is outside the grid boundaries |
|
inline |
Access the (raw) data at Position pos. Const method.
Exception::OutOfGrid | if pos is outside the grid boundaries |
TFFT1D< ComplexTraits >::Complex BALL::TFFT1D< ComplexTraits >::phase | ( | const double | pos | ) | const |
void BALL::TFFT1D< ComplexTraits >::setData | ( | double | pos, |
Complex | val | ||
) |
Sets the data point at the grid position closest to pos to the value val , and – if called in fourier space – automatically includes the correct phase factor and normalization.
Exception::OutOfGrid | if pos is outside the grid boundaries |
|
inline |
|
inline |
bool BALL::TFFT1D< ComplexTraits >::setPhysStepWidth | ( | double | new_width | ) |
bool BALL::TFFT1D< ComplexTraits >::translate | ( | double | trans_origin | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |