// // File: fun8_2_FFTImplementationCallback.cpp // // MATLAB Coder version : 5.2 // C/C++ source code generated on : 10-Mar-2023 11:08:29 // // Include Files #include "fun8_2_FFTImplementationCallback.h" #include "rt_nonfinite.h" #include "coder_array.h" // Function Definitions // // Arguments : const ::coder::array &x // int unsigned_nRows // const ::coder::array &costab // const ::coder::array &sintab // ::coder::array &y // Return Type : void // namespace coder { namespace internal { namespace fft { void fun8_2_FFTImplementationCallback::r2br_r2dit_trig_impl( const ::coder::array &x, int unsigned_nRows, const ::coder::array &costab, const ::coder::array &sintab, ::coder::array &y) { double temp_im; double temp_re; double twid_im; double twid_re; int i; int iDelta2; int iheight; int iy; int ju; int k; int nRowsD2; y.set_size(unsigned_nRows); if (unsigned_nRows > x.size(0)) { y.set_size(unsigned_nRows); for (iy = 0; iy < unsigned_nRows; iy++) { y[iy].re = 0.0; y[iy].im = 0.0; } } iDelta2 = x.size(0); if (iDelta2 >= unsigned_nRows) { iDelta2 = unsigned_nRows; } iheight = unsigned_nRows - 2; nRowsD2 = unsigned_nRows / 2; k = nRowsD2 / 2; iy = 0; ju = 0; for (i = 0; i <= iDelta2 - 2; i++) { boolean_T tst; y[iy] = x[i]; iy = unsigned_nRows; tst = true; while (tst) { iy >>= 1; ju ^= iy; tst = ((ju & iy) == 0); } iy = ju; } y[iy] = x[iDelta2 - 1]; if (unsigned_nRows > 1) { for (i = 0; i <= iheight; i += 2) { temp_re = y[i + 1].re; temp_im = y[i + 1].im; twid_re = y[i].re; twid_im = y[i].im; y[i + 1].re = y[i].re - y[i + 1].re; y[i + 1].im = y[i].im - y[i + 1].im; twid_re += temp_re; twid_im += temp_im; y[i].re = twid_re; y[i].im = twid_im; } } iy = 2; iDelta2 = 4; iheight = ((k - 1) << 2) + 1; while (k > 0) { int temp_re_tmp; for (i = 0; i < iheight; i += iDelta2) { temp_re_tmp = i + iy; temp_re = y[temp_re_tmp].re; temp_im = y[temp_re_tmp].im; y[temp_re_tmp].re = y[i].re - temp_re; y[temp_re_tmp].im = y[i].im - temp_im; y[i].re = y[i].re + temp_re; y[i].im = y[i].im + temp_im; } ju = 1; for (int j{k}; j < nRowsD2; j += k) { int ihi; twid_re = costab[j]; twid_im = sintab[j]; i = ju; ihi = ju + iheight; while (i < ihi) { temp_re_tmp = i + iy; temp_re = twid_re * y[temp_re_tmp].re - twid_im * y[temp_re_tmp].im; temp_im = twid_re * y[temp_re_tmp].im + twid_im * y[temp_re_tmp].re; y[temp_re_tmp].re = y[i].re - temp_re; y[temp_re_tmp].im = y[i].im - temp_im; y[i].re = y[i].re + temp_re; y[i].im = y[i].im + temp_im; i += iDelta2; } ju++; } k /= 2; iy = iDelta2; iDelta2 += iDelta2; iheight -= iy; } } } // namespace fft } // namespace internal } // namespace coder // // File trailer for fun8_2_FFTImplementationCallback.cpp // // [EOF] //