1 #ifndef MHO_MultidimensionalFastFourierTransform_HH__
2 #define MHO_MultidimensionalFastFourierTransform_HH__
32 template<
typename XArgType >
38 "Array element type must be a complex floating point type.");
64 #ifdef HOPS_ENABLE_DEBUG_MSG
65 msg_debug(
"operators",
"initialized a native FFT plan." << eom);
66 for(std::size_t i = 0; i < XArgType::rank::value; i++)
86 if(in ==
nullptr || out ==
nullptr)
90 if(!HaveSameDimensions(in, out))
92 out->Resize(in->GetDimensions());
97 #ifdef HOPS_ENABLE_DEBUG_MSG
98 msg_debug(
"operators",
"initialized a native FFT plan." << eom);
99 for(std::size_t i = 0; i < XArgType::rank::value; i++)
101 msg_debug(
"operators",
"fft plan dimension: " << i <<
" has size: " << this->
fDimensionSize[i] <<
", enabled? "
119 size_t total_size = 1;
120 for(
size_t i = 0; i < XArgType::rank::value; i++)
125 size_t index[XArgType::rank::value];
126 size_t non_active_dimension_size[XArgType::rank::value - 1];
127 size_t non_active_dimension_value[XArgType::rank::value - 1];
128 size_t non_active_dimension_index[XArgType::rank::value - 1];
131 for(
size_t d = 0; d < XArgType::rank::value; d++)
139 for(
size_t i = 0; i < XArgType::rank::value; i++)
144 non_active_dimension_index[count] = i;
151 for(
size_t n = 0; n < n_fft; n++)
155 non_active_dimension_value);
158 for(
size_t i = 0; i < XArgType::rank::value - 1; i++)
160 index[non_active_dimension_index[i]] = non_active_dimension_value[i];
163 size_t data_location;
167 MHO_NDArrayMath::OffsetFromRowMajorIndex< XArgType::rank::value >(this->
fDimensionSize, index);
168 data = &((in->GetData())[data_location]);
171 unsigned int stride =
172 MHO_NDArrayMath::StrideFromRowMajorIndex< XArgType::rank::value >(d, this->
fDimensionSize);
192 msg_error(
"math",
"FFT input/output array dimensions are not valid or intialization failed. Aborting transform."
209 if(in && out && in != out)
220 void AllocateWorkspace()
222 for(
size_t i = 0; i < XArgType::rank::value; i++)
#define msg_debug(xKEY, xCONTENT)
Definition: MHO_Message.hh:297
#define msg_error(xKEY, xCONTENT)
Definition: MHO_Message.hh:244
static void RowMajorIndexFromOffset(std::size_t offset, const std::size_t *DimSize, std::size_t *Index)
Function RowMajorIndexFromOffset.
Definition: MHO_NDArrayMath.hh:121
Class MHO_UnaryOperator.
Definition: MHO_UnaryOperator.hh:24
Definition: MHO_ChannelLabeler.hh:17
void FFTBluestein(std::complex< XFloatType > *data, MHO_FastFourierTransformWorkspace< XFloatType > &work, bool isForward, unsigned int stride=1)
Performs Bluestein's FFT algorithm on complex data using a workspace for arbitrary N....
Definition: MHO_FastFourierTransformCalls.hh:68
void FFTRadix2(std::complex< XFloatType > *data, MHO_FastFourierTransformWorkspace< XFloatType > &work, bool isForward, unsigned int stride=1)
Performs a Radix-2 Decimation-in-time (DIT) FFT algorithm on complex data using a workspace for arbit...
Definition: MHO_FastFourierTransformCalls.hh:37
Definition: MHO_Meta.hh:341