63 const auto m = static_cast<double>(&resultElement - result.data());
64 const auto minusTwoPiKOverN = constants::twoPi * m / static_cast<double>(n);
65 resultElement = std::complex<double>{ 0., 0. };
66 for (
auto k = 0u; k < std::min(
n, x.size()); ++k)
91 template<
typename dtype>
101 return detail::ifft_internal(data, inN);
108 const auto dataColSlice = data.
cSlice();
109 const auto resultColSlice = result.cSlice();
111 for (
uint32 row = 0; row < data.numRows(); ++row)
113 const auto rowData = data(row, dataColSlice);
114 const auto rowResult = detail::ifft_internal(rowData, inN);
115 result.put(row, resultColSlice, rowResult);
122 return ifft(inArray.
transpose(), inN, Axis::COL).transpose();
143 template<
typename dtype>
152 return ifft(inArray, inArray.
size(), inAxis);
182 template<
typename dtype>
193 return detail::ifft_internal(data, inN);
198 const auto&
shape = inArray.shape();
200 const auto dataColSlice = data.
cSlice();
201 const auto resultColSlice = result.cSlice();
203 for (
uint32 row = 0; row < data.numRows(); ++row)
205 const auto rowData = data(row, dataColSlice);
206 const auto rowResult = detail::ifft_internal(rowData, inN);
207 result.put(row, resultColSlice, rowResult);
214 return ifft(inArray.transpose(), inN, Axis::COL).transpose();
235 template<
typename dtype>
244 return ifft(inArray, inArray.size(), inAxis);
248 return ifft(inArray, inArray.numCols(), inAxis);
252 return ifft(inArray, inArray.numRows(), inAxis);
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition StaticAsserts.hpp:39
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
size_type size() const noexcept
Definition NdArrayCore.hpp:4600
self_type transpose() const
Definition NdArrayCore.hpp:4959
size_type numCols() const noexcept
Definition NdArrayCore.hpp:3541
const Shape & shape() const noexcept
Definition NdArrayCore.hpp:4587
size_type numRows() const noexcept
Definition NdArrayCore.hpp:3553
Slice cSlice(index_type inStartIdx=0, size_type inStepSize=1) const
Definition NdArrayCore.hpp:1008
uint32 rows
Definition Core/shape.hpp:44
NdArray< std::complex< double > > ifft_internal(const NdArray< std::complex< double > > &x, uint32 n)
Definition ifft.hpp:50
Definition FFT/FFT.hpp:40
NdArray< std::complex< double > > ifft(const NdArray< dtype > &inArray, uint32 inN, Axis inAxis=Axis::NONE)
Definition ifft.hpp:92
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition StlAlgorithms.hpp:225
Axis
Enum To describe an axis.
Definition Enums.hpp:36
auto angle(const std::complex< dtype > &inValue)
Definition angle.hpp:48
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
Shape shape(const NdArray< dtype > &inArray) noexcept
Definition Functions/shape.hpp:42
std::uint32_t uint32
Definition Types.hpp:40