31 static void four1(
float data[],
unsigned long nn,
int isign)
33 unsigned long n, mmax, m, j, i;
34 double wtemp, wr, wpr, wpi, wi,
50 while (m >= 2 && j > m)
61 unsigned long istep = mmax << 1;
62 theta = isign * (6.28318530717959 /
64 wtemp = sin(0.5 * theta);
65 wpr = -2.0 * wtemp * wtemp;
69 for (m = 1; m < mmax; m += 2)
71 for (i = m; i <=
n; i += istep)
74 tempr = (float)(wr *
data[j] - wi *
data[j + 1]);
75 tempi = (float)(wr *
data[j + 1] + wi *
data[j]);
81 wr = (wtemp = wr) * wpr - wi * wpi +
83 wi = wi * wpr + wtemp * wpi + wi;
102 unsigned long i, i1, i2, i3, i4, np3;
103 float c1 = 0.5, c2, h1r, h1i, h2r, h2i;
104 double wr, wi, wpr, wpi, wtemp,
106 theta = 3.141592653589793 / (double)(
n >> 1);
111 wtemp = sin(0.5 * theta);
112 wpr = -2.0 * wtemp * wtemp;
117 for (i = 2; i <= (n >> 2); i++)
119 i4 = 1 + (i3 = np3 - (i2 = 1 + (i1 = i + i - 1)));
126 (float)(h1r + wr * h2r - wi * h2i);
129 data[i2] = (float)(h1i + wr * h2i + wi * h2r);
130 data[i3] = (float)(h1r - wr * h2r + wi * h2i);
131 data[i4] = (float)(-h1i + wr * h2i + wi * h2r);
132 wr = (wtemp = wr) * wpr - wi * wpi + wr;
133 wi = wi * wpr + wtemp * wpi + wi;
158 int j, j1, j2, j3, k, k1, ks, l, m;
159 FFT_TYPE wk1r, wk1i, wk2r, wk2i, wk3r, wk3i;
160 FFT_TYPE x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
166 for (j = 0; j <= l - 2; j += 2)
172 x0i =
a[j + 1] +
a[j1 + 1];
174 x1i =
a[j + 1] -
a[j1 + 1];
176 x2i =
a[j2 + 1] +
a[j3 + 1];
178 x3i =
a[j2 + 1] -
a[j3 + 1];
180 a[j + 1] = x0i + x2i;
182 a[j2 + 1] = x0i - x2i;
184 a[j1 + 1] = x1i + x3r;
186 a[j3 + 1] = x1i - x3r;
191 for (j = m; j <= l + m - 2; j += 2)
197 x0i =
a[j + 1] +
a[j1 + 1];
199 x1i =
a[j + 1] -
a[j1 + 1];
201 x2i =
a[j2 + 1] +
a[j3 + 1];
203 x3i =
a[j2 + 1] -
a[j3 + 1];
205 a[j + 1] = x0i + x2i;
207 a[j2 + 1] = x0r - x2r;
210 a[j1] = wk1r * (x0r - x0i);
211 a[j1 + 1] = wk1r * (x0r + x0i);
214 a[j3] = wk1r * (x0i - x0r);
215 a[j3 + 1] = wk1r * (x0i + x0r);
219 for (k = (m << 1); k <=
n - m; k += m)
224 wk1i =
w[(k1 << 1) + 1];
227 wk3r = wk1r - 2 * wk2i * wk1i;
228 wk3i = 2 * wk2i * wk1r - wk1i;
229 for (j = k; j <= l + k - 2; j += 2)
235 x0i =
a[j + 1] +
a[j1 + 1];
237 x1i =
a[j + 1] -
a[j1 + 1];
239 x2i =
a[j2 + 1] +
a[j3 + 1];
241 x3i =
a[j2 + 1] -
a[j3 + 1];
243 a[j + 1] = x0i + x2i;
246 a[j2] = wk2r * x0r - wk2i * x0i;
247 a[j2 + 1] = wk2r * x0i + wk2i * x0r;
250 a[j1] = wk1r * x0r - wk1i * x0i;
251 a[j1 + 1] = wk1r * x0i + wk1i * x0r;
254 a[j3] = wk3r * x0r - wk3i * x0i;
255 a[j3 + 1] = wk3r * x0i + wk3i * x0r;
263 for (j = 0; j <= l - 2; j += 2)
267 x0i =
a[j + 1] -
a[j1 + 1];
269 a[j + 1] +=
a[j1 + 1];
278 int j, j1, j2, j3, k, k1, ks, l, m;
279 FFT_TYPE wk1r, wk1i, wk2r, wk2i, wk3r, wk3i;
280 FFT_TYPE x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
286 for (j = 0; j <= l - 2; j += 2)
292 x0i =
a[j + 1] +
a[j1 + 1];
294 x1i =
a[j + 1] -
a[j1 + 1];
296 x2i =
a[j2 + 1] +
a[j3 + 1];
298 x3i =
a[j2 + 1] -
a[j3 + 1];
300 a[j + 1] = x0i + x2i;
302 a[j2 + 1] = x0i - x2i;
304 a[j1 + 1] = x1i - x3r;
306 a[j3 + 1] = x1i + x3r;
311 for (j = m; j <= l + m - 2; j += 2)
317 x0i =
a[j + 1] +
a[j1 + 1];
319 x1i =
a[j + 1] -
a[j1 + 1];
321 x2i =
a[j2 + 1] +
a[j3 + 1];
323 x3i =
a[j2 + 1] -
a[j3 + 1];
325 a[j + 1] = x0i + x2i;
327 a[j2 + 1] = x2r - x0r;
330 a[j1] = wk1r * (x0i + x0r);
331 a[j1 + 1] = wk1r * (x0i - x0r);
334 a[j3] = wk1r * (x0r + x0i);
335 a[j3 + 1] = wk1r * (x0r - x0i);
339 for (k = (m << 1); k <=
n - m; k += m)
344 wk1i =
w[(k1 << 1) + 1];
347 wk3r = wk1r - 2 * wk2i * wk1i;
348 wk3i = 2 * wk2i * wk1r - wk1i;
349 for (j = k; j <= l + k - 2; j += 2)
355 x0i =
a[j + 1] +
a[j1 + 1];
357 x1i =
a[j + 1] -
a[j1 + 1];
359 x2i =
a[j2 + 1] +
a[j3 + 1];
361 x3i =
a[j2 + 1] -
a[j3 + 1];
363 a[j + 1] = x0i + x2i;
366 a[j2] = wk2r * x0r + wk2i * x0i;
367 a[j2 + 1] = wk2r * x0i - wk2i * x0r;
370 a[j1] = wk1r * x0r + wk1i * x0i;
371 a[j1 + 1] = wk1r * x0i - wk1i * x0r;
374 a[j3] = wk3r * x0r + wk3i * x0i;
375 a[j3 + 1] = wk3r * x0i - wk3i * x0r;
383 for (j = 0; j <= l - 2; j += 2)
387 x0i =
a[j + 1] -
a[j1 + 1];
389 a[j + 1] +=
a[j1 + 1];
407 delta = atan(1.0f) / nwh;
410 w[nwh] = cos(delta * nwh);
412 for (j = 2; j <= nwh - 2; j += 2)
439 delta = atan(1.0f) / nch;
441 c[nch] = 0.5f * cos(delta * nch);
442 for (j = 1; j <= nch - 1; j++)
444 c[j] = 0.5f * cos(delta * j);
445 c[nc - j] = 0.5f * sin(delta * j);
457 int j, j1, k, k1, l, m, m2;
466 for (j = 0; j <= m - 1; j++)
468 ip[m + j] = ip[j] + l;
474 for (k = 1; k <= m - 1; k++)
476 for (j = 0; j <= k - 1; j++)
478 j1 = (j << 1) + ip[k];
479 k1 = (k << 1) + ip[j];
483 a[j1 + 1] =
a[k1 + 1];
492 for (k = 1; k <= m - 1; k++)
494 for (j = 0; j <= k - 1; j++)
496 j1 = (j << 1) + ip[k];
497 k1 = (k << 1) + ip[j];
501 a[j1 + 1] =
a[k1 + 1];
509 a[j1 + 1] =
a[k1 + 1];
524 if (
n > (ip[0] << 2))
549 for (k = (
n >> 1) - 2; k >= 2; k -= 2)
556 xi =
a[k + 1] +
a[j + 1];
557 yr = wkr * xr + wki * xi;
558 yi = wkr * xi - wki * xr;
585 a[1] = 0.5f * (
a[0] -
a[1]);
618 for (k = (
n >> 1) - 2; k >= 2; k -= 2)
625 xi =
a[k + 1] +
a[j + 1];
626 yr = wkr * xr - wki * xi;
627 yi = wkr * xi + wki * xr;
737 int n, nw, nc, n1h, i, j, i2;
760 for (i = 1; i <= n1h - 1; i++)
763 xi =
a[i][0] -
a[j][0];
766 xi =
a[j][1] -
a[i][1];
770 for (j = 0; j <= n2 - 2; j += 2)
772 for (i = 0; i <= n1 - 1; i++)
776 t[i2 + 1] =
a[i][j + 1];
778 cdft(n1 << 1, isgn,
t, ip,
w);
779 for (i = 0; i <= n1 - 1; i++)
783 a[i][j + 1] =
t[i2 + 1];
786 for (i = 0; i <= n1 - 1; i++)
788 rdft(n2, isgn,
a[i], ip,
w);
793 for (i = 0; i <= n1 - 1; i++)
795 rdft(n2, isgn,
a[i], ip,
w);
797 for (j = 0; j <= n2 - 2; j += 2)
799 for (i = 0; i <= n1 - 1; i++)
803 t[i2 + 1] =
a[i][j + 1];
805 cdft(n1 << 1, isgn,
t, ip,
w);
806 for (i = 0; i <= n1 - 1; i++)
810 a[i][j + 1] =
t[i2 + 1];
813 for (i = 1; i <= n1h - 1; i++)
816 a[j][0] = 0.5f * (
a[i][0] -
a[j][0]);
818 a[j][1] = 0.5f * (
a[i][1] +
a[j][1]);
898 if (
n > (ip[0] << 2))
902 for (i = 0; i <= n1 - 1; i++)
904 cdft(n2, isgn,
a[i], ip,
w);
906 for (j = 0; j <= n2 - 2; j += 2)
908 for (i = 0; i <= n1 - 1; i++)
912 t[i2 + 1] =
a[i][j + 1];
914 cdft(n1 << 1, isgn,
t, ip,
w);
915 for (i = 0; i <= n1 - 1; i++)
919 a[i][j + 1] =
t[i2 + 1];
932 unsigned long n = (
unsigned long)in_realData.size();
938 memcpy(&auxVect[1], &in_realData[0],
n *
sizeof(auxVect[0]));
942 unsigned int n_2 = 1 + (
n / 2);
944 out_FFT_Re.resize(n_2);
945 out_FFT_Im.resize(n_2);
946 out_FFT_Mag.resize(n_2);
948 for (
unsigned int i = 0; i < n_2; i++)
951 out_FFT_Re[i] = auxVect[2];
953 out_FFT_Re[i] = auxVect[1 + i * 2];
955 if (i == 0 || i == (n_2 - 1))
958 out_FFT_Im[i] = auxVect[1 + i * 2 + 1];
961 std::sqrt(
square(out_FFT_Re[i]) +
square(out_FFT_Im[i]));
976 size_t dim1 = in_data.rows();
977 size_t dim2 = in_data.cols();
988 a =
new float_ptr[dim1];
989 for (i = 0; i < dim1; i++)
992 for (j = 0; j < dim2; j++)
a[i][j] = in_data.get_unsafe(i, j);
996 ip =
new int[(int)ceil(20 + 2 + sqrt((
FFT_TYPE)max(dim1, dim2 / 2)))];
998 w =
new FFT_TYPE[max(dim1 / 2, dim2 / 4) + dim2 / 4 + 20];
1002 rdft2d((
int)dim1, (
int)dim2, 1,
a,
t, ip,
w);
1006 out_real.setSize(dim1, dim2);
1007 out_imag.setSize(dim1, dim2);
1012 for (i = 1; i < dim1; i++)
1013 for (j = 1; j < dim2 / 2; j++)
1015 out_real.set_unsafe(i, j, (
float)
a[i][j * 2]);
1016 out_real.set_unsafe(dim1 - i, dim2 - j, (
float)
a[i][j * 2]);
1017 out_imag.set_unsafe(i, j, (
float)-
a[i][j * 2 + 1]);
1018 out_imag.set_unsafe(dim1 - i, dim2 - j, (
float)
a[i][j * 2 + 1]);
1023 for (j = 1; j < dim2 / 2; j++)
1025 out_real.set_unsafe(0, j, (
float)
a[0][j * 2]);
1026 out_real.set_unsafe(0, dim2 - j, (
float)
a[0][j * 2]);
1027 out_imag.set_unsafe(0, j, (
float)-
a[0][j * 2 + 1]);
1028 out_imag.set_unsafe(0, dim2 - j, (
float)
a[0][j * 2 + 1]);
1036 for (i = 1; i < dim1 / 2; i++)
1038 out_real.set_unsafe(i, 0, (
float)
a[i][0]);
1039 out_real.set_unsafe(dim1 - i, 0, (
float)
a[i][0]);
1040 out_imag.set_unsafe(i, 0, (
float)-
a[i][1]);
1041 out_imag.set_unsafe(dim1 - i, 0, (
float)
a[i][1]);
1042 out_real.set_unsafe(i, dim2 / 2, (
float)
a[dim1 - i][1]);
1043 out_real.set_unsafe(dim1 - i, dim2 / 2, (
float)
a[dim1 - i][1]);
1044 out_imag.set_unsafe(i, dim2 / 2, (
float)
a[dim1 - i][0]);
1045 out_imag.set_unsafe(dim1 - i, dim2 / 2, (
float)-
a[dim1 - i][0]);
1052 out_real.set_unsafe(0, 0, (
float)
a[0][0]);
1053 out_real.set_unsafe(0, dim2 / 2, (
float)
a[0][1]);
1054 out_real.set_unsafe(dim1 / 2, 0, (
float)
a[dim1 / 2][0]);
1055 out_real.set_unsafe(dim1 / 2, dim2 / 2, (
float)
a[dim1 / 2][1]);
1058 for (i = 0; i < dim1; i++)
delete[]
a[i];
1076 ASSERT_(in_real.rows() == in_imag.rows());
1077 ASSERT_(in_real.cols() == in_imag.cols());
1080 size_t dim1 = in_real.rows();
1081 size_t dim2 = in_real.cols();
1095 a =
new float_ptr[dim1];
1096 for (i = 0; i < dim1; i++)
a[i] =
new FFT_TYPE[dim2];
1101 for (i = 1; i < dim1; i++)
1102 for (j = 1; j < dim2 / 2; j++)
1104 a[i][2 * j] = in_real.get_unsafe(i, j);
1105 a[i][2 * j + 1] = -in_imag.get_unsafe(i, j);
1111 for (j = 1; j < dim2 / 2; j++)
1113 a[0][2 * j] = in_real.get_unsafe(0, j);
1114 a[0][2 * j + 1] = -in_imag.get_unsafe(0, j);
1122 for (i = 1; i < dim1 / 2; i++)
1124 a[i][0] = in_real.get_unsafe(i, 0);
1125 a[i][1] = -in_imag.get_unsafe(i, 0);
1126 a[dim1 - i][1] = in_real.get_unsafe(i, dim2 / 2);
1127 a[dim1 - i][0] = in_imag.get_unsafe(i, dim2 / 2);
1134 a[0][0] = in_real.get_unsafe(0, 0);
1135 a[0][1] = in_real.get_unsafe(0, dim2 / 2);
1136 a[dim1 / 2][0] = in_real.get_unsafe(dim1 / 2, 0);
1137 a[dim1 / 2][1] = in_real.get_unsafe(dim1 / 2, dim2 / 2);
1140 ip =
new int[(int)ceil(20 + 2 + sqrt((
FFT_TYPE)max(dim1, dim2 / 2)))];
1142 w =
new FFT_TYPE[max(dim1 / 2, dim2 / 4) + dim2 / 4 + 20];
1146 rdft2d((
int)dim1, (
int)dim2, -1,
a,
t, ip,
w);
1150 out_data.setSize(dim1, dim2);
1154 for (i = 0; i < dim1; i++)
1155 for (j = 0; j < dim2; j++)
1156 out_data.set_unsafe(i, j, (
float)(
a[i][j] *
scale));
1159 for (i = 0; i < dim1; i++)
delete[]
a[i];
1177 ASSERT_(in_real.rows() == in_imag.rows());
1178 ASSERT_(in_real.cols() == in_imag.cols());
1181 size_t dim1 = in_real.rows();
1182 size_t dim2 = in_real.cols();
1184 size_t k1, k2, n1, n2;
1186 float ang1 = (float)(
sign *
M_2PI / dim1);
1187 float ang2 = (float)(
sign *
M_2PI / dim2);
1190 float scale =
sign == 1 ? (1.0f / (dim1 * dim2)) : 1;
1192 out_real.setSize(dim1, dim2);
1193 out_imag.setSize(dim1, dim2);
1195 for (k1 = 0; k1 < dim1; k1++)
1197 for (k2 = 0; k2 < dim2; k2++)
1201 for (n1 = 0; n1 < dim1; n1++)
1203 phase = ang1 * n1 * k1;
1204 for (n2 = 0; n2 < dim2; n2++)
1209 R += w_r * in_real.get_unsafe(n1, n2) -
1210 w_i * in_imag.get_unsafe(n1, n2);
1211 I += w_i * in_real.get_unsafe(n1, n2) +
1212 w_r * in_imag.get_unsafe(n1, n2);
1219 out_real.set_unsafe(k1, k2,
R *
scale);
1220 out_imag.set_unsafe(k1, k2, I *
scale);
1235 ASSERT_(in_real.rows() == in_imag.rows());
1236 ASSERT_(in_real.cols() == in_imag.cols());
1239 size_t dim1 = in_real.rows();
1240 size_t dim2 = in_real.cols();
1247 if (dim1IsPower2 && dim2IsPower2)
1258 static int* ip =
nullptr;
1263 static int alreadyInitSize1 = -1, alreadyInitSize2 = -1;
1265 if (alreadyInitSize1 != (
int)dim1 || alreadyInitSize2 != (int)dim2)
1270 for (i = 0; i < dim1; i++)
delete[]
a[i];
1273 if (ip)
delete[] ip;
1277 alreadyInitSize1 = (int)dim1;
1278 alreadyInitSize2 = (int)dim2;
1280 a =
new float_ptr[dim1];
1281 for (i = 0; i < dim1; i++)
a[i] =
new FFT_TYPE[2 * dim2];
1284 ip =
new int[(int)ceil(
1285 20 + 2 + sqrt((
FFT_TYPE)max(dim1, dim2 / 2)))];
1287 w =
new FFT_TYPE[max(dim1 / 2, dim2 / 4) + dim2 / 4 + 20];
1292 for (i = 0; i < dim1; i++)
1293 for (j = 0; j < dim2; j++)
1295 a[i][2 * j + 0] = in_real.get_unsafe(i, j);
1296 a[i][2 * j + 1] = in_imag.get_unsafe(i, j);
1301 cdft2d((
int)dim1, (
int)(2 * dim2), 1,
a,
t, ip,
w);
1305 out_real.setSize(dim1, dim2);
1306 out_imag.setSize(dim1, dim2);
1311 for (i = 0; i < dim1; i++)
1312 for (j = 0; j < dim2; j++)
1314 out_real.set_unsafe(i, j, (
float)
a[i][j * 2 + 0]);
1315 out_imag.set_unsafe(i, j, (
float)
a[i][j * 2 + 1]);
1324 printf(
"Using general DFT...\n");
1325 myGeneralDFT(-1, in_real, in_imag, out_real, out_imag);
1340 ASSERT_(in_real.rows() == in_imag.rows());
1341 ASSERT_(in_real.cols() == in_imag.cols());
1344 size_t dim1 = in_real.rows();
1345 size_t dim2 = in_real.cols();
1352 if (dim1IsPower2 && dim2IsPower2)
1363 static int* ip =
nullptr;
1371 static int alreadyInitSize1 = -1, alreadyInitSize2 = -1;
1373 if (alreadyInitSize1 != (
int)dim1 || alreadyInitSize2 != (int)dim2)
1378 for (i = 0; i < dim1; i++)
delete[]
a[i];
1381 if (ip)
delete[] ip;
1385 alreadyInitSize1 = (int)dim1;
1386 alreadyInitSize2 = (int)dim2;
1388 a =
new float_ptr[dim1];
1389 for (i = 0; i < dim1; i++)
a[i] =
new FFT_TYPE[2 * dim2];
1391 ip =
new int[(int)ceil(
1392 20 + 2 + sqrt((
FFT_TYPE)max(dim1, dim2 / 2)))];
1394 w =
new FFT_TYPE[max(dim1 / 2, dim2 / 4) + dim2 / 4 + 20];
1399 for (i = 0; i < dim1; i++)
1400 for (j = 0; j < dim2; j++)
1402 a[i][2 * j + 0] = in_real.get_unsafe(i, j);
1403 a[i][2 * j + 1] = in_imag.get_unsafe(i, j);
1408 cdft2d((
int)dim1, (
int)(2 * dim2), -1,
a,
t, ip,
w);
1412 out_real.setSize(dim1, dim2);
1413 out_imag.setSize(dim1, dim2);
1420 for (i = 0; i < dim1; i++)
1421 for (j = 0; j < dim2; j++)
1425 out_real.set_unsafe(i, j, (
float)(
a[i][j * 2 + 0]));
1426 out_imag.set_unsafe(i, j, (
float)(
a[i][j * 2 + 1]));
1433 out_imag.set_unsafe(0, 0, 0);
1441 printf(
"Using general DFT...\n");
1453 ASSERT_(A.cols() == B.cols() && A.rows() == B.rows());
1460 const size_t lx = A.cols();
1461 const size_t ly = A.rows();
1472 for (
y = 0;
y < ly;
y++)
1473 for (
x = 0;
x < lx;
x++)
1475 float r1 = I1_R.get_unsafe(
y,
x);
1476 float r2 = I2_R.get_unsafe(
y,
x);
1478 float ii1 = I1_I.get_unsafe(
y,
x);
1479 float ii2 = I2_I.get_unsafe(
y,
x);
1482 I2_R.set_unsafe(
y,
x, (r1 * r2 + ii1 * ii2) / den);
1483 I2_I.set_unsafe(
y,
x, (ii2 * r1 - r2 * ii1) / den);
1490 out_corr.setSize(ly, lx);
1491 for (
y = 0;
y < ly;
y++)
1492 for (
x = 0;
x < lx;
x++)
static void four1(float data[], unsigned long nn, int isign)
#define THROW_EXCEPTION(msg)
GLenum GLenum GLenum GLenum GLenum scale
void dft2_real(const CMatrixFloat &in_data, CMatrixFloat &out_real, CMatrixFloat &out_imag)
Compute the 2D Discrete Fourier Transform (DFT) of a real matrix, returning the real and imaginary pa...
void fft_real(CVectorFloat &in_realData, CVectorFloat &out_FFT_Re, CVectorFloat &out_FFT_Im, CVectorFloat &out_FFT_Mag)
Computes the FFT of a 2^N-size vector of real numbers, and returns the Re+Im+Magnitude parts...
static void rftfsub(int n, FFT_TYPE *a, int nc, FFT_TYPE *c)
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
static void myGeneralDFT(int sign, const CMatrixFloat &in_real, const CMatrixFloat &in_imag, CMatrixFloat &out_real, CMatrixFloat &out_imag)
GLubyte GLubyte GLubyte GLubyte w
T square(const T x)
Inline function for the square of a number.
#define ASSERT_(f)
Defines an assertion mechanism.
static void cdft2d(int n1, int n2, int isgn, FFT_TYPE **a, FFT_TYPE *t, int *ip, FFT_TYPE *w)
Copyright(C) 1997 Takuya OOURA (email: ooura@mmm.t.u-tokyo.ac.jp).
static void rftbsub(int n, FFT_TYPE *a, int nc, FFT_TYPE *c)
This base provides a set of functions for maths stuff.
static void cftbsub(int n, FFT_TYPE *a, FFT_TYPE *w)
void cross_correlation_FFT(const CMatrixFloat &A, const CMatrixFloat &B, CMatrixFloat &out_corr)
Correlation of two matrixes using 2D FFT.
T round2up(T val)
Round up to the nearest power of two of a given number.
static void cftfsub(int n, FFT_TYPE *a, FFT_TYPE *w)
static void bitrv2(int n, int *ip, FFT_TYPE *a)
Copyright(C) 1997 Takuya OOURA (email: ooura@mmm.t.u-tokyo.ac.jp).
float FFT_TYPE
Copyright(C) 1997 Takuya OOURA (email: ooura@mmm.t.u-tokyo.ac.jp).
void idft2_complex(const CMatrixFloat &in_real, const CMatrixFloat &in_imag, CMatrixFloat &out_real, CMatrixFloat &out_imag)
Compute the 2D inverse Discrete Fourier Transform (DFT).
static void rdft(int n, int isgn, FFT_TYPE *a, int *ip, FFT_TYPE *w)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void idft2_real(const CMatrixFloat &in_real, const CMatrixFloat &in_imag, CMatrixFloat &out_data)
Compute the 2D inverse Discrete Fourier Transform (DFT)
static void makewt(int nw, int *ip, FFT_TYPE *w)
static void rdft2d(int n1, int n2, int isgn, FFT_TYPE **a, FFT_TYPE *t, int *ip, FFT_TYPE *w)
Copyright(C) 1997 Takuya OOURA (email: ooura@mmm.t.u-tokyo.ac.jp).
static void realft(float data[], unsigned long n)
A matrix of dynamic size.
int sign(T x)
Returns the sign of X as "1" or "-1".
static void makect(int nc, int *ip, FFT_TYPE *c)
Copyright(C) 1997 Takuya OOURA (email: ooura@mmm.t.u-tokyo.ac.jp).
void dft2_complex(const CMatrixFloat &in_real, const CMatrixFloat &in_imag, CMatrixFloat &out_real, CMatrixFloat &out_imag)
Compute the 2D Discrete Fourier Transform (DFT) of a complex matrix, returning the real and imaginary...
GLsizei GLsizei GLenum GLenum const GLvoid * data
GLubyte GLubyte GLubyte a
static void cdft(int n, int isgn, FFT_TYPE *a, int *ip, FFT_TYPE *w)
Copyright(C) 1997 Takuya OOURA (email: ooura@mmm.t.u-tokyo.ac.jp).
void memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) noexcept
An OS and compiler independent version of "memcpy".