File: mclms.c

    1   /*
    2    * mclms.c
    3    *
    4    * Code generation for function 'mclms'
    5    *
    6    */
    7   
    8   /* Include files */
    9   #include "rt_nonfinite.h"
   10   #include "gjbf.h"
   11   #include "mclms.h"
   12   #include "gjbf_emxutil.h"
   13   #include "NCAF.h"
   14   #include "optwmc.h"
   15   #include "targmc.h"
   16   #include "all.h"
   17   #include "gjbf_mexutil.h"
   18   #include "gjbf_data.h"
   19   #include "blas.h"
   20   
   21   /* Variable Definitions */
   22   static emlrtRSInfo vd_emlrtRSI = { 66, "mclms",
   23     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   24   
   25   static emlrtRSInfo wd_emlrtRSI = { 64, "mclms",
   26     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   27   
   28   static emlrtRSInfo xd_emlrtRSI = { 59, "mclms",
   29     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   30   
   31   static emlrtRSInfo yd_emlrtRSI = { 40, "mclms",
   32     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   33   
   34   static emlrtRSInfo ae_emlrtRSI = { 37, "mclms",
   35     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   36   
   37   static emlrtRSInfo be_emlrtRSI = { 36, "mclms",
   38     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   39   
   40   static emlrtRSInfo ce_emlrtRSI = { 28, "mclms",
   41     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   42   
   43   static emlrtRSInfo de_emlrtRSI = { 27, "mclms",
   44     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   45   
   46   static emlrtRSInfo ee_emlrtRSI = { 24, "mclms",
   47     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   48   
   49   static emlrtRSInfo fe_emlrtRSI = { 23, "mclms",
   50     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   51   
   52   static emlrtRSInfo ge_emlrtRSI = { 21, "mclms",
   53     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   54   
   55   static emlrtRSInfo he_emlrtRSI = { 18, "mclms",
   56     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   57   
   58   static emlrtRSInfo ie_emlrtRSI = { 14, "mclms",
   59     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   60   
   61   static emlrtRSInfo je_emlrtRSI = { 12, "mclms",
   62     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   63   
   64   static emlrtRSInfo ke_emlrtRSI = { 11, "mclms",
   65     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   66   
   67   static emlrtRSInfo le_emlrtRSI = { 10, "mclms",
   68     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   69   
   70   static emlrtRSInfo me_emlrtRSI = { 9, "mclms",
   71     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   72   
   73   static emlrtRTEInfo d_emlrtRTEI = { 4, 24, "mclms",
   74     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   75   
   76   static emlrtECInfo d_emlrtECI = { -1, 68, 1, "mclms",
   77     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m" };
   78   
   79   static emlrtBCInfo g_emlrtBCI = { -1, -1, 68, 12, "mcWall", "mclms",
   80     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m", 0 };
   81   
   82   static emlrtDCInfo i_emlrtDCI = { 45, 29, "mclms",
   83     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m", 1 };
   84   
   85   static emlrtDCInfo j_emlrtDCI = { 45, 29, "mclms",
   86     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m", 4 };
   87   
   88   static emlrtDCInfo k_emlrtDCI = { 47, 16, "mclms",
   89     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m", 1 };
   90   
   91   static emlrtDCInfo l_emlrtDCI = { 47, 16, "mclms",
   92     "E:\\micro array project\\Microphone Array\\beamform test\\mclms.m", 4 };
   93   
   94   /* Function Definitions */
   95   void mclms(const emlrtStack *sp, const real_T z[14112], const real_T b_data[],
   96              const int32_T b_size[1], real_T mu, real_T order, real_T beta,
   97              emxArray_real_T *zp, const real_T mw1[320], const real_T mcAdapt
   98              [14112], real_T K, real_T y_data[], int32_T y_size[1],
   99              emxArray_real_T *mcWall)
  100   {
  101     boolean_T b3;
  102     boolean_T tmp_data[14112];
  103     int32_T i34;
  104     boolean_T x[16];
  105     boolean_T y;
  106     int32_T k;
  107     boolean_T exitg3;
  108     int32_T loop_ub;
  109     const mxArray *b_y;
  110     char_T u[23];
  111     static const char_T varargin_1[23] = { 'z', ' ', 'm', 'u', 's', 't', ' ', 'b',
  112       'e', ' ', 'a', ' ', 'r', 'e', 'a', 'l', ' ', 'm', 'a', 't', 'r', 'i', 'x' };
  113   
  114     boolean_T b_tmp_data[1764];
  115     const mxArray *m23;
  116     static const int32_T iv38[2] = { 1, 23 };
  117   
  118     boolean_T c_tmp_data[1764];
  119     boolean_T d_tmp_data[1764];
  120     int32_T tmp_size[1];
  121     real_T b_x;
  122     const mxArray *c_y;
  123     char_T b_u[23];
  124     static const char_T b_varargin_1[23] = { 'b', ' ', 'm', 'u', 's', 't', ' ',
  125       'b', 'e', ' ', 'a', ' ', 'r', 'e', 'a', 'l', ' ', 'v', 'e', 'c', 't', 'o',
  126       'r' };
  127   
  128     static const int32_T iv39[2] = { 1, 23 };
  129   
  130     boolean_T guard1 = false;
  131     const mxArray *d_y;
  132     char_T c_u[24];
  133     static const char_T c_varargin_1[24] = { 'm', 'u', ' ', 'm', 'u', 's', 't',
  134       ' ', 'b', 'e', ' ', 'a', ' ', 'r', 'e', 'a', 'l', ' ', 's', 'c', 'a', 'l',
  135       'a', 'r' };
  136   
  137     static const int32_T iv40[2] = { 1, 24 };
  138   
  139     real_T r;
  140     const mxArray *e_y;
  141     char_T d_u[32];
  142     static const char_T d_varargin_1[32] = { 'o', 'r', 'd', 'e', 'r', ' ', 'm',
  143       'u', 's', 't', ' ', 'b', 'e', ' ', 'a', ' ', 'p', 'o', 's', 'i', 't', 'i',
  144       'v', 'e', ' ', 'i', 'n', 't', 'e', 'g', 'e', 'r' };
  145   
  146     static const int32_T iv41[2] = { 1, 32 };
  147   
  148     real_T w[320];
  149     int32_T n;
  150     emxArray_real_T *zWin;
  151     const mxArray *f_y;
  152     char_T e_u[35];
  153     static const char_T e_varargin_1[35] = { 'b', 'e', 't', 'a', ' ', 'm', 'u',
  154       's', 't', ' ', 'b', 'e', ' ', 'a', ' ', 'r', 'e', 'a', 'l', ' ', 's', 'c',
  155       'a', 'l', 'a', 'r', ' ', 'i', 'n', ' ', '[', '0', ',', '1', ']' };
  156   
  157     emxArray_int32_T *r1;
  158     static const int32_T iv42[2] = { 1, 35 };
  159   
  160     boolean_T e_tmp_data[14112];
  161     boolean_T f_tmp_data[14112];
  162     int32_T b_tmp_size[2];
  163     boolean_T exitg2;
  164     boolean_T bv16[320];
  165     const mxArray *g_y;
  166     char_T f_u[24];
  167     static const char_T f_varargin_1[24] = { 'z', 'p', ' ', 'm', 'u', 's', 't',
  168       ' ', 'b', 'e', ' ', 'a', ' ', 'r', 'e', 'a', 'l', ' ', 'm', 'a', 't', 'r',
  169       'i', 'x' };
  170   
  171     static const int32_T iv43[2] = { 1, 24 };
  172   
  173     int32_T iv44[2];
  174     int32_T iv45[2];
  175     boolean_T exitg1;
  176     const mxArray *h_y;
  177     char_T g_u[25];
  178     static const char_T g_varargin_1[25] = { 'm', 'w', '1', ' ', 'm', 'u', 's',
  179       't', ' ', 'b', 'e', ' ', 'a', ' ', 'r', 'e', 'a', 'l', ' ', 'm', 'a', 't',
  180       'r', 'i', 'x' };
  181   
  182     static const int32_T iv46[2] = { 1, 25 };
  183   
  184     const mxArray *i_y;
  185     char_T h_u[29];
  186     static const char_T h_varargin_1[29] = { 'm', 'c', 'A', 'd', 'a', 'p', 't',
  187       ' ', 'm', 'u', 's', 't', ' ', 'b', 'e', ' ', 'a', ' ', 'r', 'e', 'a', 'l',
  188       ' ', 'm', 'a', 't', 'r', 'i', 'x' };
  189   
  190     static const int32_T iv47[2] = { 1, 29 };
  191   
  192     const mxArray *j_y;
  193     char_T i_u[32];
  194     static const char_T i_varargin_1[32] = { 'K', ' ', 'm', 'u', 's', 't', ' ',
  195       'b', 'e', ' ', 'a', ' ', 'r', 'e', 'a', 'l', ' ', 'p', 'o', 's', 'i', 't',
  196       'i', 'v', 'e', ' ', 's', 'c', 'a', 'l', 'a', 'r' };
  197   
  198     static const int32_T iv48[2] = { 1, 32 };
  199   
  200     emlrtStack st;
  201     emlrtStack b_st;
  202     st.prev = sp;
  203     st.tls = sp->tls;
  204     b_st.prev = &st;
  205     b_st.tls = st.tls;
  206     emlrtHeapReferenceStackEnterFcnR2012b(sp);
  207     b3 = false;
  208     covrtLogFcn(&emlrtCoverageInstance, 8U, 0);
  209     covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 0);
  210   
  211     /* % Multiple-Input Canceller LMS Filter */
  212     /* % Function Declaration */
  213     /* % Argument Error Checking */
  214     covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 0, true);
  215     covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 1, false);
  216     for (i34 = 0; i34 < 14112; i34++) {
  217       tmp_data[i34] = ((!muDoubleScalarIsInf(z[i34])) && (!muDoubleScalarIsNaN
  218         (z[i34])));
  219     }
  220   
  221     st.site = &me_emlrtRSI;
  222     all(&st, tmp_data, x);
  223     y = true;
  224     k = 0;
  225     exitg3 = false;
  226     while ((!exitg3) && (k < 16)) {
  227       if (!x[k]) {
  228         y = false;
  229         exitg3 = true;
  230       } else {
  231         k++;
  232       }
  233     }
  234   
  235     if (!covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 2, y)) {
  236       covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 0, true);
  237       covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 0, true);
  238       covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 1);
  239       st.site = &le_emlrtRSI;
  240       for (i34 = 0; i34 < 23; i34++) {
  241         u[i34] = varargin_1[i34];
  242       }
  243   
  244       b_y = NULL;
  245       m23 = emlrtCreateCharArray(2, iv38);
  246       emlrtInitCharArrayR2013a(&st, 23, m23, &u[0]);
  247       emlrtAssign(&b_y, m23);
  248       b_st.site = &af_emlrtRSI;
  249       ab_error(&b_st, b_y, &emlrtMCI);
  250     } else {
  251       covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 0, false);
  252       covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 0, false);
  253       covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 3, true);
  254       covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 4, true);
  255       loop_ub = b_size[0];
  256       for (i34 = 0; i34 < loop_ub; i34++) {
  257         b_tmp_data[i34] = muDoubleScalarIsInf(b_data[i34]);
  258       }
  259   
  260       loop_ub = b_size[0];
  261       for (i34 = 0; i34 < loop_ub; i34++) {
  262         d_tmp_data[i34] = muDoubleScalarIsNaN(b_data[i34]);
  263       }
  264   
  265       tmp_size[0] = b_size[0];
  266       loop_ub = b_size[0];
  267       for (i34 = 0; i34 < loop_ub; i34++) {
  268         c_tmp_data[i34] = ((!b_tmp_data[i34]) && (!d_tmp_data[i34]));
  269       }
  270   
  271       st.site = &ke_emlrtRSI;
  272       if (!covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 5, g_all(&st, c_tmp_data,
  273             tmp_size))) {
  274         covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 1, true);
  275         covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 1, true);
  276         covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 2);
  277         st.site = &je_emlrtRSI;
  278         for (i34 = 0; i34 < 23; i34++) {
  279           b_u[i34] = b_varargin_1[i34];
  280         }
  281   
  282         c_y = NULL;
  283         m23 = emlrtCreateCharArray(2, iv39);
  284         emlrtInitCharArrayR2013a(&st, 23, m23, &b_u[0]);
  285         emlrtAssign(&c_y, m23);
  286         b_st.site = &af_emlrtRSI;
  287         ab_error(&b_st, c_y, &emlrtMCI);
  288       } else {
  289         covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 1, false);
  290         covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 1, false);
  291         covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 6, false);
  292         covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 7, true);
  293         covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 8, true);
  294         if (!covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 9, (!muDoubleScalarIsInf
  295               (mu)) && (!muDoubleScalarIsNaN(mu)))) {
  296           covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 2, true);
  297           covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 2, true);
  298           covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 3);
  299           st.site = &ie_emlrtRSI;
  300           for (i34 = 0; i34 < 24; i34++) {
  301             c_u[i34] = c_varargin_1[i34];
  302           }
  303   
  304           d_y = NULL;
  305           m23 = emlrtCreateCharArray(2, iv40);
  306           emlrtInitCharArrayR2013a(&st, 24, m23, &c_u[0]);
  307           emlrtAssign(&d_y, m23);
  308           b_st.site = &af_emlrtRSI;
  309           ab_error(&b_st, d_y, &emlrtMCI);
  310         } else {
  311           covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 2, false);
  312           covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 2, false);
  313           covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 10, false);
  314           covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 11, true);
  315           covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 12, true);
  316           guard1 = false;
  317           if (!covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 13,
  318                             (!muDoubleScalarIsInf(order)) && (!muDoubleScalarIsNaN
  319                 (order)))) {
  320             guard1 = true;
  321           } else {
  322             covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 14, order < 0.0);
  323             b_x = muDoubleScalarFloor(order);
  324             if (b_x == 0.0) {
  325               r = order;
  326             } else if (b_x == b_x) {
  327               r = order - muDoubleScalarFloor(order / b_x) * b_x;
  328             } else {
  329               r = order / b_x;
  330               if (muDoubleScalarAbs(r - muDoubleScalarRound(r)) <=
  331                   2.2204460492503131E-16 * muDoubleScalarAbs(r)) {
  332                 r = 0.0;
  333               } else {
  334                 r = (r - muDoubleScalarFloor(r)) * b_x;
  335               }
  336             }
  337   
  338             if (covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 15, muDoubleScalarAbs
  339                              (r) > 0.0)) {
  340               guard1 = true;
  341             } else {
  342               covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 3, false);
  343               covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 3, false);
  344               covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 16, false);
  345               covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 17, true);
  346               covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 18, true);
  347               if (!covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 19,
  348                                 (!muDoubleScalarIsInf(beta)) &&
  349                                 (!muDoubleScalarIsNaN(beta)))) {
  350                 covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 4, true);
  351                 covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 4, true);
  352                 covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 5);
  353                 st.site = &ge_emlrtRSI;
  354                 for (i34 = 0; i34 < 35; i34++) {
  355                   e_u[i34] = e_varargin_1[i34];
  356                 }
  357   
  358                 f_y = NULL;
  359                 m23 = emlrtCreateCharArray(2, iv42);
  360                 emlrtInitCharArrayR2013a(&st, 35, m23, &e_u[0]);
  361                 emlrtAssign(&f_y, m23);
  362                 b_st.site = &af_emlrtRSI;
  363                 ab_error(&b_st, f_y, &emlrtMCI);
  364               } else {
  365                 covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 20, beta < 0.0);
  366                 covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 21, beta > 1.0);
  367                 covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 4, false);
  368                 covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 4, false);
  369                 covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 22, false);
  370                 covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 23, true);
  371                 k = zp->size[0];
  372                 loop_ub = zp->size[0] * zp->size[1];
  373                 for (i34 = 0; i34 < loop_ub; i34++) {
  374                   e_tmp_data[i34] = muDoubleScalarIsInf(zp->data[i34]);
  375                 }
  376   
  377                 loop_ub = zp->size[0] * zp->size[1];
  378                 for (i34 = 0; i34 < loop_ub; i34++) {
  379                   f_tmp_data[i34] = muDoubleScalarIsNaN(zp->data[i34]);
  380                 }
  381   
  382                 b_tmp_size[0] = k;
  383                 b_tmp_size[1] = 16;
  384                 loop_ub = k << 4;
  385                 for (i34 = 0; i34 < loop_ub; i34++) {
  386                   tmp_data[i34] = ((!e_tmp_data[i34]) && (!f_tmp_data[i34]));
  387                 }
  388   
  389                 st.site = &fe_emlrtRSI;
  390                 f_all(&st, tmp_data, b_tmp_size, x);
  391                 y = true;
  392                 k = 0;
  393                 exitg2 = false;
  394                 while ((!exitg2) && (k < 16)) {
  395                   if (!x[k]) {
  396                     y = false;
  397                     exitg2 = true;
  398                   } else {
  399                     k++;
  400                   }
  401                 }
  402   
  403                 if (!covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 24, y)) {
  404                   covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 5, true);
  405                   covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 5, true);
  406                   covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 6);
  407                   st.site = &ee_emlrtRSI;
  408                   for (i34 = 0; i34 < 24; i34++) {
  409                     f_u[i34] = f_varargin_1[i34];
  410                   }
  411   
  412                   g_y = NULL;
  413                   m23 = emlrtCreateCharArray(2, iv43);
  414                   emlrtInitCharArrayR2013a(&st, 24, m23, &f_u[0]);
  415                   emlrtAssign(&g_y, m23);
  416                   b_st.site = &af_emlrtRSI;
  417                   ab_error(&b_st, g_y, &emlrtMCI);
  418                 } else {
  419                   covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 5, false);
  420                   covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 5, false);
  421                   covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 25, false);
  422                   covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 26, false);
  423                   covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 27, true);
  424                   for (i34 = 0; i34 < 320; i34++) {
  425                     bv16[i34] = ((!muDoubleScalarIsInf(mw1[i34])) &&
  426                                  (!muDoubleScalarIsNaN(mw1[i34])));
  427                   }
  428   
  429                   st.site = &de_emlrtRSI;
  430                   e_all(&st, bv16, x);
  431                   y = true;
  432                   k = 0;
  433                   exitg1 = false;
  434                   while ((!exitg1) && (k < 16)) {
  435                     if (!x[k]) {
  436                       y = false;
  437                       exitg1 = true;
  438                     } else {
  439                       k++;
  440                     }
  441                   }
  442   
  443                   if (!covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 28, y)) {
  444                     covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 6, true);
  445                     covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 6, true);
  446                     covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 7);
  447                     st.site = &ce_emlrtRSI;
  448                     for (i34 = 0; i34 < 25; i34++) {
  449                       g_u[i34] = g_varargin_1[i34];
  450                     }
  451   
  452                     h_y = NULL;
  453                     m23 = emlrtCreateCharArray(2, iv46);
  454                     emlrtInitCharArrayR2013a(&st, 25, m23, &g_u[0]);
  455                     emlrtAssign(&h_y, m23);
  456                     b_st.site = &af_emlrtRSI;
  457                     ab_error(&b_st, h_y, &emlrtMCI);
  458                   } else {
  459                     covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 6, false);
  460                     covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 6, false);
  461                     covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 29, true);
  462                     covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 7, false);
  463                     covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 7, false);
  464                     covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 35, false);
  465                     covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 36, true);
  466                     for (i34 = 0; i34 < 14112; i34++) {
  467                       tmp_data[i34] = ((!muDoubleScalarIsInf(mcAdapt[i34])) &&
  468                                        (!muDoubleScalarIsNaN(mcAdapt[i34])));
  469                     }
  470   
  471                     st.site = &be_emlrtRSI;
  472                     all(&st, tmp_data, x);
  473                     if (!covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 37, b_all(x)))
  474                     {
  475                       covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 8, true);
  476                       covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 8, true);
  477                       covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 9);
  478                       st.site = &ae_emlrtRSI;
  479                       for (i34 = 0; i34 < 29; i34++) {
  480                         h_u[i34] = h_varargin_1[i34];
  481                       }
  482   
  483                       i_y = NULL;
  484                       m23 = emlrtCreateCharArray(2, iv47);
  485                       emlrtInitCharArrayR2013a(&st, 29, m23, &h_u[0]);
  486                       emlrtAssign(&i_y, m23);
  487                       b_st.site = &af_emlrtRSI;
  488                       ab_error(&b_st, i_y, &emlrtMCI);
  489                     } else {
  490                       covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 8, false);
  491                       covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 8, false);
  492                       covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 38, false);
  493                       covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 39, true);
  494                       covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 40, true);
  495                       if (!covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 41,
  496                                         (!muDoubleScalarIsInf(K)) &&
  497                                         (!muDoubleScalarIsNaN(K)))) {
  498                         covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 9, true);
  499                         covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 9, true);
  500                         covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 10);
  501                         st.site = &yd_emlrtRSI;
  502                         for (i34 = 0; i34 < 32; i34++) {
  503                           i_u[i34] = i_varargin_1[i34];
  504                         }
  505   
  506                         j_y = NULL;
  507                         m23 = emlrtCreateCharArray(2, iv48);
  508                         emlrtInitCharArrayR2013a(&st, 32, m23, &i_u[0]);
  509                         emlrtAssign(&j_y, m23);
  510                         b_st.site = &af_emlrtRSI;
  511                         ab_error(&b_st, j_y, &emlrtMCI);
  512                       } else {
  513                         covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 42, K < 0.0);
  514                         covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 9, false);
  515                         covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 9, false);
  516                       }
  517                     }
  518                   }
  519                 }
  520               }
  521             }
  522           }
  523   
  524           if (guard1) {
  525             covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 3, true);
  526             covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 3, true);
  527             covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 4);
  528             st.site = &he_emlrtRSI;
  529             for (i34 = 0; i34 < 32; i34++) {
  530               d_u[i34] = d_varargin_1[i34];
  531             }
  532   
  533             e_y = NULL;
  534             m23 = emlrtCreateCharArray(2, iv41);
  535             emlrtInitCharArrayR2013a(&st, 32, m23, &d_u[0]);
  536             emlrtAssign(&e_y, m23);
  537             b_st.site = &af_emlrtRSI;
  538             ab_error(&b_st, e_y, &emlrtMCI);
  539           }
  540         }
  541       }
  542     }
  543   
  544     if (covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 10, zp->size[0] == 0)) {
  545       covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 11);
  546       i34 = zp->size[0] * zp->size[1];
  547       if (!(order >= 0.0)) {
  548         emlrtNonNegativeCheckR2012b(order, &j_emlrtDCI, sp);
  549       }
  550   
  551       b_x = order;
  552       if (b_x != (int32_T)muDoubleScalarFloor(b_x)) {
  553         emlrtIntegerCheckR2012b(b_x, &i_emlrtDCI, sp);
  554       }
  555   
  556       zp->size[0] = (int32_T)b_x;
  557       zp->size[1] = 16;
  558       emxEnsureCapacity(sp, (emxArray__common *)zp, i34, (int32_T)sizeof(real_T),
  559                         &d_emlrtRTEI);
  560       if (!(order >= 0.0)) {
  561         emlrtNonNegativeCheckR2012b(order, &j_emlrtDCI, sp);
  562       }
  563   
  564       if (b_x != (int32_T)muDoubleScalarFloor(b_x)) {
  565         emlrtIntegerCheckR2012b(b_x, &i_emlrtDCI, sp);
  566       }
  567   
  568       loop_ub = (int32_T)b_x << 4;
  569       for (i34 = 0; i34 < loop_ub; i34++) {
  570         zp->data[i34] = 0.0;
  571       }
  572     }
  573   
  574     covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 12);
  575     i34 = mcWall->size[0] * mcWall->size[1] * mcWall->size[2];
  576     if (!(order >= 0.0)) {
  577       emlrtNonNegativeCheckR2012b(order, &l_emlrtDCI, sp);
  578     }
  579   
  580     b_x = order;
  581     if (b_x != (int32_T)muDoubleScalarFloor(b_x)) {
  582       emlrtIntegerCheckR2012b(b_x, &k_emlrtDCI, sp);
  583     }
  584   
  585     mcWall->size[0] = (int32_T)b_x;
  586     mcWall->size[1] = 16;
  587     mcWall->size[2] = b_size[0];
  588     emxEnsureCapacity(sp, (emxArray__common *)mcWall, i34, (int32_T)sizeof(real_T),
  589                       &d_emlrtRTEI);
  590     if (!(order >= 0.0)) {
  591       emlrtNonNegativeCheckR2012b(order, &l_emlrtDCI, sp);
  592     }
  593   
  594     if (b_x != (int32_T)muDoubleScalarFloor(b_x)) {
  595       emlrtIntegerCheckR2012b(b_x, &k_emlrtDCI, sp);
  596     }
  597   
  598     loop_ub = ((int32_T)b_x << 4) * b_size[0];
  599     for (i34 = 0; i34 < loop_ub; i34++) {
  600       mcWall->data[i34] = 0.0;
  601     }
  602   
  603     /*  initial targmc */
  604     y_size[0] = (int16_T)b_size[0];
  605     loop_ub = (int16_T)b_size[0];
  606     for (i34 = 0; i34 < loop_ub; i34++) {
  607       y_data[i34] = 0.0;
  608     }
  609   
  610     covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 43, false);
  611     covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 10, true);
  612     covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 11, true);
  613     covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 13);
  614     memcpy(&w[0], &mw1[0], 320U * sizeof(real_T));
  615   
  616     /*  ord--one for each track of BM */
  617     n = 0;
  618     emxInit_real_T(sp, &zWin, 2, &d_emlrtRTEI, true);
  619     emxInit_int32_T(sp, &r1, 1, &d_emlrtRTEI, true);
  620     while (n <= b_size[0] - 1) {
  621       covrtLogFor(&emlrtCoverageInstance, 8U, 0U, 0, 1);
  622       covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 15);
  623   
  624       /*  calculate targmc output and ready to opt */
  625       st.site = &xd_emlrtRSI;
  626       targmc(&st, zp, z, b_data, b_size, 1.0 + (real_T)n, order, w, y_data, y_size,
  627              zWin);
  628   
  629       /*  check mcf */
  630       covrtLogCond(&emlrtCoverageInstance, 8U, 0U, 44, true);
  631       covrtLogMcdc(&emlrtCoverageInstance, 8U, 0U, 11, false);
  632       covrtLogIf(&emlrtCoverageInstance, 8U, 0U, 12, false);
  633       covrtLogBasicBlock(&emlrtCoverageInstance, 8U, 17);
  634   
  635       /*  Tap update. If mcAdapt specified, adapt only requested columns */
  636       st.site = &wd_emlrtRSI;
  637       optwmc(&st, zWin, 1.0 + (real_T)n, w, mcAdapt, mu, order, beta, z);
  638   
  639       /*  NCAF (Norm-Constrained Adaptive Filter) */
  640       st.site = &vd_emlrtRSI;
  641       NCAF(&st, K, w, order, 1.0 + (real_T)n, mcAdapt);
  642   
  643       /*  Save the taps used on this iteration */
  644       loop_ub = mcWall->size[0];
  645       i34 = r1->size[0];
  646       r1->size[0] = loop_ub;
  647       emxEnsureCapacity(sp, (emxArray__common *)r1, i34, (int32_T)sizeof(int32_T),
  648                         &d_emlrtRTEI);
  649       for (i34 = 0; i34 < loop_ub; i34++) {
  650         r1->data[i34] = i34;
  651       }
  652   
  653       i34 = mcWall->size[2];
  654       k = n + 1;
  655       if (!((k >= 1) && (k <= i34))) {
  656         emlrtDynamicBoundsCheckR2012b(k, 1, i34, &g_emlrtBCI, sp);
  657       }
  658   
  659       iv44[0] = r1->size[0];
  660       iv44[1] = 16;
  661       if (!b3) {
  662         for (i34 = 0; i34 < 2; i34++) {
  663           iv45[i34] = 20 + -4 * i34;
  664         }
  665   
  666         b3 = true;
  667       }
  668   
  669       emlrtSubAssignSizeCheckR2012b(iv44, 2, iv45, 2, &d_emlrtECI, sp);
  670       loop_ub = r1->size[0];
  671       for (i34 = 0; i34 < 16; i34++) {
  672         for (k = 0; k < loop_ub; k++) {
  673           mcWall->data[(r1->data[k] + mcWall->size[0] * i34) + mcWall->size[0] *
  674             mcWall->size[1] * n] = w[k + loop_ub * i34];
  675         }
  676       }
  677   
  678       n++;
  679       if (*emlrtBreakCheckR2012bFlagVar != 0) {
  680         emlrtBreakCheckR2012b(sp);
  681       }
  682     }
  683   
  684     emxFree_int32_T(&r1);
  685     emxFree_real_T(&zWin);
  686     covrtLogFor(&emlrtCoverageInstance, 8U, 0U, 0, 0);
  687   
  688     /*  function mclms */
  689     emlrtHeapReferenceStackLeaveFcnR2012b(sp);
  690   }
  691   
  692   /* End of code generation (mclms.c) */
  693