DGtal 1.4.0
|
#include <DGtal/math/RealFFT.h>
Public Types | |
using | Space = TSpace |
Space type. | |
using | Real = T |
Real value type. | |
using | Domain = HyperRectDomain<Space> |
Domain type. | |
using | Point = typename Space::Point |
Point type. | |
using | RealPoint = PointVector<Space::dimension, Real> |
Real point type. | |
using | Dimension = typename Space::Dimension |
Space dimension type. | |
using | Complex = std::complex<Real> |
Complex value type. | |
using | Self = RealFFT< Domain, T > |
Self type. | |
using | SpatialImage = ArrayImageAdapter< Real*, Domain > |
Mutable spatial image type. | |
using | ConstSpatialImage = ArrayImageAdapter< const Real*, Domain > |
Constant spatial image type. | |
using | FreqImage = ArrayImageAdapter< Complex*, Domain > |
Mutable frequency image type. | |
using | ConstFreqImage = ArrayImageAdapter< const Complex*, Domain > |
Constant frequency image type. | |
Public Member Functions | |
RealFFT (Domain const &aDomain) | |
RealFFT (Domain const &aDomain, RealPoint const &aLowerBound, RealPoint const &anExtent) | |
RealFFT (Self const &)=delete | |
Copy constructor. Deleted. | |
RealFFT (Self &&)=delete | |
Move constructor. Deleted. | |
Self & | operator= (Self const &)=delete |
Copy assignment operator. Deleted. | |
Self & | operator= (Self &&)=delete |
Move assignment operator. Deleted. | |
~RealFFT () | |
Destructor. | |
Spatial domain services. | |
std::size_t | getPadding () const noexcept |
Real * | getSpatialStorage () noexcept |
const Real * | getSpatialStorage () const noexcept |
SpatialImage | getSpatialImage () noexcept |
ConstSpatialImage | getSpatialImage () const noexcept |
Domain const & | getSpatialDomain () const noexcept |
Point const & | getSpatialExtent () const noexcept |
Gets the spatial domain extent. | |
Frequency domain services. | |
Complex * | getFreqStorage () noexcept |
const Complex * | getFreqStorage () const noexcept |
FreqImage | getFreqImage () noexcept |
ConstFreqImage | getFreqImage () const noexcept |
Domain const & | getFreqDomain () const noexcept |
Point const & | getFreqExtent () const noexcept |
Fast Fourier Transformations. | |
void | createPlan (unsigned flags, int way) |
void | doFFT (unsigned flags=FFTW_ESTIMATE, int way=FFTW_FORWARD, bool normalized=false) |
void | forwardFFT (unsigned flags=FFTW_ESTIMATE) |
void | backwardFFT (unsigned flags=FFTW_ESTIMATE, bool normalized=true) |
Spatial scaling definitions. | |
RealPoint | getScaledSpatialExtent () const noexcept |
void | setScaledSpatialExtent (RealPoint const &anExtent) noexcept |
RealPoint | getScaledSpatialLowerBound () const noexcept |
void | setScaledSpatialLowerBound (RealPoint const &aPoint) noexcept |
Scaling calculators. | |
RealPoint | calcScaledSpatialCoords (Point const &aPoint) const noexcept |
RealPoint | calcScaledFreqCoords (Point const &aPoint) const noexcept |
Complex | calcScaledFreqValue (RealPoint const &aScaledPoint, Complex const &aValue) const noexcept |
Point | calcNativeSpatialCoords (RealPoint const &aScaledPoint) const noexcept |
Point | calcNativeFreqCoords (RealPoint const &aScaledPoint, bool &applyConj) const noexcept |
Complex | calcNativeFreqValue (RealPoint const &aScaledPoint, Complex const &aScaledValue) const noexcept |
Scaled accessors. | |
Real | getScaledSpatialValue (RealPoint const &aScaledPoint) const noexcept |
void | setScaledSpatialValue (RealPoint const &aScaledPoint, Real aValue) noexcept |
Complex | getScaledFreqValue (RealPoint const &aScaledPoint) const noexcept |
void | setScaledFreqValue (RealPoint const &aScaledPoint, Complex aScaledValue) noexcept |
DGtal services. | |
bool | isValid () const noexcept |
void | selfDisplay (std::ostream &out) const |
Data Fields | |
const Real | pi = boost::math::constants::pi<Real>() |
Pi. | |
Static Public Attributes | |
static const constexpr Dimension | dimension = Domain::dimension |
Space dimension. | |
Private Types | |
using | FFTW = detail::FFTWWrapper<T> |
Private Attributes | |
const Domain | mySpatialDomain |
Spatial domain (real). | |
const Point | mySpatialExtent |
Extent of the spatial domain. | |
const Point | myFreqExtent |
Extent of the frequential domain. | |
const Domain | myFreqDomain |
Frequential domain (complex). | |
const Domain | myFullSpatialDomain |
Full spatial domain (real) including the padding. | |
void * | myStorage |
Storage. | |
RealPoint | myScaledSpatialExtent |
Extent of the scaled spatial domain. | |
RealPoint | myScaledSpatialLowerBound |
Lower bound of the scaled spatial domain. | |
Real | myScaledFreqMag |
Magnitude ratio for the scaled frequency values. | |
Real-complex backward and forward Fast Fourier Transform over HyperRectDomain.
TSpace | Type of the space. |
T | Values type. |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Complex = std::complex<Real> |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::ConstFreqImage = ArrayImageAdapter< const Complex*, Domain > |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::ConstSpatialImage = ArrayImageAdapter< const Real*, Domain > |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Dimension = typename Space::Dimension |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Domain = HyperRectDomain<Space> |
|
private |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::FreqImage = ArrayImageAdapter< Complex*, Domain > |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Point = typename Space::Point |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Real = T |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::RealPoint = PointVector<Space::dimension, Real> |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Self = RealFFT< Domain, T > |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Space = TSpace |
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::SpatialImage = ArrayImageAdapter< Real*, Domain > |
DGtal::RealFFT< HyperRectDomain< TSpace >, T >::RealFFT | ( | Domain const & | aDomain | ) |
Constructor from the spatial domain.
aDomain | The domain over which the transform will be performed. |
The scaled lower bound and extent is initialized from the given domain.
DGtal::RealFFT< HyperRectDomain< TSpace >, T >::RealFFT | ( | Domain const & | aDomain, |
RealPoint const & | aLowerBound, | ||
RealPoint const & | anExtent ) |
Constructor from the spatial domain and scaled lower bound and extent.
aDomain | The domain over which the transform will be performed. |
aLowerBound | The lower bound of the scaled spatial domain. |
anExtent | The extent of the scaled spatial domain. |
|
delete |
Copy constructor. Deleted.
|
delete |
Move constructor. Deleted.
DGtal::RealFFT< HyperRectDomain< TSpace >, T >::~RealFFT | ( | ) |
Destructor.
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::backwardFFT | ( | unsigned | flags = FFTW_ESTIMATE, |
bool | normalized = true ) |
In-place backward FFT transformation (frequential -> spatial)
The transformation is done as if the lower bound of the spatial domain is the origin but with the same extent as the domain given at construction. See the scaling services provided by this class in order to take into account a different lower bound or extent.
flags | Planner flags. |
normalized | When applying the backward transformation, if normalized is true, then the transformation is normalized (all values are divided by the size of the domain). Otherwise, applying a forward transformation followed by a backward transformation will multiply the input by the size of the spatial domain (see http://www.fftw.org/fftw3_doc/The-1d-Real_002ddata-DFT.html#The-1d-Real_002ddata-DFT). |
|
noexcept |
From the scaled frequency coordinates, calculates the nearest corresponding coordinates in the native frequency image.
Since the frequency image's domain is half the size of the spatial domain due to the hermitian symmetry, if the given point lies into the stripped part, then the given parameter applyConj is set to true to indicate that the frequency image value at the returned coordinates must be conjugate.
aScaledPoint | Coordinates in the scaled domain of the frequency image. | |
[out] | applyConj | Set to true if you must take the conjugate of the frequency image value at the returned coordinates. |
|
noexcept |
From a complex value of the scaled frequency image, calculates the corresponding value (undoing scaling and rotation) in the native frequency image.
aScaledPoint | Coordinates in the scaled domain of the frequency image. |
aScaledValue | Complex value from the scaled frequency image. |
|
noexcept |
From the scaled spatial coordinates, calculates the nearest corresponding coordinates in the native spatial image.
aScaledPoint | Coordinates in the scaled domain of the spatial image. |
|
noexcept |
Scales coordinates from the frequency image taking into account the extent and lower bound of the scaled spatial domain.
Along each dimension, the first half of the space is composed of positive frequencies and the second half maps to the negative frequencies.
aPoint | Coordinates in the domain of the frequency image. |
|
noexcept |
Scales and rotates a complex value from the frequency image taking into account the extent and lower bound of the scaled spatial domain.
aScaledPoint | Coordinates in the scaled domain of the frequency image. |
aValue | Complex value from the frequency image. |
|
noexcept |
Scales coordinates from the spatial image taking into account the extent and lower bound of the scaled spatial domain.
aPoint | Coordinates in the domain of the spatial image. |
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::createPlan | ( | unsigned | flags, |
int | way ) |
Creates a transformation plan for the specified transformation direction.
flags | Planner flags (see http://www.fftw.org/fftw3_doc/Planner-Flags.html#Planner-Flags). |
way | The direction of the transformation: FFTW_FORWARD for real->complex, FFTW_BACKWARD for complex->real. |
The created plan is immediately destroyed but the associated wisdom is keeped by FFTW3, so that future creation of similar plan (same image dimension, size and precision, same number of process, same flags and way) will be costless.
It is only usefull when using a plan flag other than FFTW_ESTIMATE, when the allocation of a temporary image is not wanted and when the spatial or frequency image has not been already initialized. Otherwise, consider using doFFT(), forwardFFT() or backwardFFT() directly.
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::doFFT | ( | unsigned | flags = FFTW_ESTIMATE, |
int | way = FFTW_FORWARD, | ||
bool | normalized = false ) |
In-place Fast Fourier Transformation.
The transformation is done as if the lower bound of the spatial domain is the origin but with the same extent as the domain given at construction. See the scaling services provided by this class in order to take into account a different lower bound or extent.
flags | Planner flags (see http://www.fftw.org/fftw3_doc/Planner-Flags.html#Planner-Flags). |
way | The direction of the transformation: FFTW_FORWARD for real->complex,FFTW_BACKWARD for complex->real. |
normalized | When applying the backward transformation, if normalized is true, then the transformation is normalized (all values are divided by the size of the domain). Otherwise, applying a forward transformation followed by a backward transformation will multiply the input by the size of the spatial domain (see http://www.fftw.org/fftw3_doc/The-1d-Real_002ddata-DFT.html#The-1d-Real_002ddata-DFT). |
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::forwardFFT | ( | unsigned | flags = FFTW_ESTIMATE | ) |
In-place forward FFT transformation (spatial -> frequential)
The transformation is done as if the lower bound of the spatial domain is the origin but with the same extent as the domain given at construction. See the scaling services provided by this class in order to take into account a different lower bound or extent.
flags | Planner flags. |
|
noexcept |
Gets the frequency domain.
|
noexcept |
Gets the frequency domain extent.
|
noexcept |
Gets frequential image.
|
noexcept |
Gets frequential image.
|
noexcept |
Gets frequential raw storage.
|
noexcept |
Gets frequential raw storage.
|
noexcept |
Padding used with real datas.
|
inlinenoexcept |
Reads a scaled frequency value at the nearest native coordinates corresponding to the given scaled frequency coordinates.
aScaledPoint | Coordinates in the scaled domain of the frequency image. |
Definition at line 634 of file RealFFT.h.
|
noexcept |
Gets the extent of the scaled spatial domain.
|
noexcept |
Gets the lower bound of the scaled spatial domain.
|
inlinenoexcept |
Reads a spatial value at the nearest native coordinates corresponding to the given scaled spatial coordinates.
aScaledPoint | Coordinates in the scaled domain of the spatial image. |
|
noexcept |
Gets the spatial domain.
|
noexcept |
Gets the spatial domain extent.
|
noexcept |
Gets the spatial image.
|
noexcept |
Gets the spatial image.
|
noexcept |
Gets spatial raw storage.
|
noexcept |
Gets spatial raw storage.
|
noexcept |
Checks if storage is valid.
|
delete |
Move assignment operator. Deleted.
|
delete |
Copy assignment operator. Deleted.
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
|
inlinenoexcept |
Writes a scaled frequency value at the nearest native coordinates corresponding to the given scaled frequency coordinates.
aScaledPoint | Coordinates in the scaled domain of the frequency image. |
aScaledValue | Scaled value to set in the native frequency image at the nearest corresponding coordinates. |
Definition at line 650 of file RealFFT.h.
|
noexcept |
Sets the extent of the scaled spatial domain.
anExtent | The extent. |
|
noexcept |
Sets the lower bound of the scaled spatial domain.
aPoint | The lower bound. |
|
inlinenoexcept |
Writes a spatial value at the nearest native coordinates corresponding to the given scaled spatial coordinates.
aScaledPoint | Coordinates in the scaled domain of the spatial image. |
aValue | Value to set in the native spatial image at the nearest corresponding coordinates. |
|
staticconstexpr |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
const Real DGtal::RealFFT< HyperRectDomain< TSpace >, T >::pi = boost::math::constants::pi<Real>() |