MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / irdft_1d_step

Function irdft_1d_step

tests/validation/reference/DFT.cpp:116–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 */
115template <typename T>
116void irdft_1d_step(const T *src_ptr, size_t K, T *dst_ptr, size_t N)
117{
118 const bool is_odd = N % 2;
119 const unsigned int Nleft = N - K;
120 const int tail_start = is_odd ? K - 1 : K - 2;
121#if defined(_OPENMP)
122#pragma omp parallel for
123#endif /* _OPENMP */
124 for (unsigned int n = 0; n < N; ++n)
125 {
126 float xr = 0;
127 for (unsigned int k = 0; k < K; ++k)
128 {
129 const float alpha = (2 * M_PI * k * n) / N;
130 xr += src_ptr[2 * k] * cos(alpha) - src_ptr[2 * k + 1] * sin(alpha);
131 }
132
133 unsigned int j = tail_start;
134 for (unsigned int k = 0; k < Nleft; ++k)
135 {
136 const float alpha = (2 * M_PI * (k + K) * n) / N;
137 xr += src_ptr[2 * j] * cos(alpha) + src_ptr[2 * j + 1] * sin(alpha);
138 --j;
139 }
140
141 dst_ptr[n] = xr;
142 }
143}
144
145/** Performs an one dimensional inverse DFT on a given complex sequence.
146 *

Callers 1

rdft_1d_coreFunction · 0.85

Calls 2

cosFunction · 0.85
sinFunction · 0.85

Tested by

no test coverage detected