Exemple #1
0
static void eml_warning(void)
{
  const mxArray *y;
  static const int32_T iv3[2] = { 1, 27 };

  const mxArray *m2;
  char_T cv4[27];
  int32_T i;
  static const char_T cv5[27] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T',
    'L', 'A', 'B', ':', 's', 'i', 'n', 'g', 'u', 'l', 'a', 'r', 'M', 'a', 't',
    'r', 'i', 'x' };

  emlrtPushRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal);
  emlrt_synchGlobalsToML();
  y = NULL;
  m2 = mxCreateCharArray(2, iv3);
  for (i = 0; i < 27; i++) {
    cv4[i] = cv5[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 27, m2, cv4);
  emlrtAssign(&y, m2);
  warning(b_message(y, &d_emlrtMCI), &e_emlrtMCI);
  emlrt_synchGlobalsFromML();
  emlrtPopRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal);
}
Exemple #2
0
static void check_forloop_overflow_error(void)
{
  const mxArray *y;
  static const int32_T iv8[2] = { 1, 34 };

  const mxArray *m1;
  char_T cv9[34];
  int32_T i;
  static const char_T cv10[34] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o',
    'l', 'b', 'o', 'x', ':', 'i', 'n', 't', '_', 'f', 'o', 'r', 'l', 'o', 'o',
    'p', '_', 'o', 'v', 'e', 'r', 'f', 'l', 'o', 'w' };

  const mxArray *b_y;
  static const int32_T iv9[2] = { 1, 23 };

  char_T cv11[23];
  static const char_T cv12[23] = { 'c', 'o', 'd', 'e', 'r', '.', 'i', 'n', 't',
    'e', 'r', 'n', 'a', 'l', '.', 'i', 'n', 'd', 'e', 'x', 'I', 'n', 't' };

  emlrtPushRtStackR2012b(&s_emlrtRSI, emlrtRootTLSGlobal);
  y = NULL;
  m1 = mxCreateCharArray(2, iv8);
  for (i = 0; i < 34; i++) {
    cv9[i] = cv10[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 34, m1, cv9);
  emlrtAssign(&y, m1);
  b_y = NULL;
  m1 = mxCreateCharArray(2, iv9);
  for (i = 0; i < 23; i++) {
    cv11[i] = cv12[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 23, m1, cv11);
  emlrtAssign(&b_y, m1);
  error(b_message(y, b_y, &f_emlrtMCI), &g_emlrtMCI);
  emlrtPopRtStackR2012b(&s_emlrtRSI, emlrtRootTLSGlobal);
}
/* Function Definitions */
void generateOFDMSignal(const emlrtStack *sp, OFDMDemodulator_1 *iobj_0,
  OFDMDemodulator_1 *iobj_1, OFDMDemodulator_1 **hPreambleDemod,
  OFDMDemodulator_1 **hDataDemod, creal_T r[25600], d_struct_T *tx)
{
  OFDMModulator_1 hDataMod;
  OFDMModulator hPreambleMod;
  creal_T shortPreambleOFDM[64];
  int32_T i;
  creal_T completeShortPreambleOFDM[160];
  creal_T longPreambleOFDM[64];
  creal_T completeLongPreambleOFDM[160];
  real_T originalData[560];
  real_T x[560];
  int32_T ib;
  real_T b_originalData[560];
  commcodegen_CRCGenerator_6 hGen;
  real_T dataWithCRC[563];
  commcodegen_BPSKModulator_1 hMod;
  creal_T modData[563];
  real_T varargin_1[13];
  int32_T k;
  commcodegen_BPSKModulator_1 *obj;
  const mxArray *y;
  static const int32_T iv54[2] = { 1, 45 };

  const mxArray *m10;
  char_T cv58[45];
  static const char_T cv59[45] = { 'M', 'A', 'T', 'L', 'A', 'B', ':', 's', 'y',
    's', 't', 'e', 'm', ':', 'm', 'e', 't', 'h', 'o', 'd', 'C', 'a', 'l', 'l',
    'e', 'd', 'W', 'h', 'e', 'n', 'R', 'e', 'l', 'e', 'a', 's', 'e', 'd', 'C',
    'o', 'd', 'e', 'g', 'e', 'n' };

  const mxArray *b_y;
  static const int32_T iv55[2] = { 1, 4 };

  char_T cv60[4];
  static const char_T cv61[4] = { 's', 't', 'e', 'p' };

  const mxArray *c_y;
  static const int32_T iv56[2] = { 1, 51 };

  char_T cv62[51];
  static const char_T cv63[51] = { 'M', 'A', 'T', 'L', 'A', 'B', ':', 's', 'y',
    's', 't', 'e', 'm', ':', 'm', 'e', 't', 'h', 'o', 'd', 'C', 'a', 'l', 'l',
    'e', 'd', 'W', 'h', 'e', 'n', 'L', 'o', 'c', 'k', 'e', 'd', 'R', 'e', 'l',
    'e', 'a', 's', 'e', 'd', 'C', 'o', 'd', 'e', 'g', 'e', 'n' };

  const mxArray *d_y;
  static const int32_T iv57[2] = { 1, 5 };

  char_T cv64[5];
  static const char_T cv65[5] = { 's', 'e', 't', 'u', 'p' };

  static const int8_T value[8] = { 13, 1, 1, 1, 1, 1, 1, 1 };

  boolean_T anyInputSizeChanged;
  boolean_T exitg2;
  static const int8_T iv58[8] = { 13, 1, 1, 1, 1, 1, 1, 1 };

  creal_T varargout_1[13];
  creal_T b_modData[576];
  creal_T ofdmData[576];
  comm_PNSequence_5 hPN;
  comm_PNSequence_5 *b_obj;
  static const int8_T iv59[8] = { 1, 0, 0, 0, 1, 0, 0, 1 };

  static const int8_T iv60[7] = { 0, 0, 0, 0, 0, 0, 1 };

  int8_T pilot[12];
  uint8_T tmp;
  uint8_T tmp2;
  int8_T pilots[48];
  int32_T ia;
  real_T b_pilots[48];
  creal_T b_r[960];
  creal_T preambles[320];
  creal_T c_r[1280];
  OFDMDemodulator_1 *object;
  int8_T b_data[4];
  int32_T exitg1;
  int32_T exponent;
  boolean_T b2;
  int32_T i12;
  const mxArray *e_y;
  static const int32_T iv61[2] = { 1, 13 };

  char_T cv66[13];
  static const char_T cv67[13] = { 'c', 'o', 'm', 'm', ':', 'O', 'F', 'D', 'M',
    ':', 'x', 'x', 'x' };

  static const creal_T dcv3[53] = { { 0.0, 0.0 }, { 0.0, 0.0 }, { 1.0, 1.0 }, {
      0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { -1.0, -1.0 }, { 0.0, 0.0 }, {
      0.0, 0.0 }, { 0.0, 0.0 }, { 1.0, 1.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0,
      0.0 }, { -1.0, -1.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { -1.0,
      -1.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 1.0, 1.0 }, { 0.0, 0.0
    }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, {
      0.0, 0.0 }, { -1.0, -1.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { -
      1.0, -1.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 1.0, 1.0 }, { 0.0,
      0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 1.0, 1.0 }, { 0.0, 0.0 }, { 0.0, 0.0
    }, { 0.0, 0.0 }, { 1.0, 1.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, {
      1.0, 1.0 }, { 0.0, 0.0 }, { 0.0, 0.0 } };

  static const int8_T iv62[53] = { 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1,
    1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 0, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1,
    -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1 };

  static const int8_T iv63[48] = { 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14,
    15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 35, 36,
    37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53 };

  emlrtStack st;
  emlrtStack b_st;
  emlrtStack c_st;
  emlrtStack d_st;
  emlrtStack e_st;
  emlrtStack f_st;
  emlrtStack g_st;
  st.prev = sp;
  st.tls = sp->tls;
  b_st.prev = &st;
  b_st.tls = st.tls;
  c_st.prev = &b_st;
  c_st.tls = b_st.tls;
  d_st.prev = &c_st;
  d_st.tls = c_st.tls;
  e_st.prev = &d_st;
  e_st.tls = d_st.tls;
  f_st.prev = &e_st;
  f_st.tls = e_st.tls;
  g_st.prev = &f_st;
  g_st.tls = f_st.tls;
  emlrtHeapReferenceStackEnterFcnR2012b(sp);
  emxInitStruct_OFDMModulator_1(sp, &hDataMod, &s_emlrtRTEI, TRUE);
  emxInitStruct_OFDMModulator(sp, &hPreambleMod, &t_emlrtRTEI, TRUE);

  /*  generateOFDMSignal: Generate OFDM signal based on the 802.11a standard. */
  /*  This function returns the time domain signal and a structure containing */
  /*  details about the signal itself.  This information is required by the */
  /*  receiver to operate correctly. */
  /* % System Parameters */
  /*  OFDM modulator FFT size */
  /*  Enable moving averages for estimates */
  /* 1e3 */
  /*  Message to transmit */
  /*  String holder */
  /* coder.varsize('payloadMessage', [1, 80], [0 1]); */
  /* payloadMessage = ''; */
  /* % Create Short Preamble */
  /*  % [-27:-17] */
  /*  % [-16:-1] */
  /*  % [0:15] */
  /*  [16:27] */
  /*  % Create modulator */
  /*  hPreambleMod = OFDMModulator(... */
  /*      'NumGuardBandCarriers', [6; 5],... */
  /*      'CyclicPrefixLength',   0,... */
  /*      'FFTLength' ,           FFTLength,... */
  /*      'NumSymbols',           1);     */
  /*  Create modulator */
  st.site = &lk_emlrtRSI;
  OFDMModulator_OFDMModulator(&hPreambleMod);

  /*  Modulate and scale */
  st.site = &mk_emlrtRSI;
  SystemCore_step(&st, &hPreambleMod, shortPreambleOFDM);
  st.site = &mk_emlrtRSI;
  for (i = 0; i < 64; i++) {
    shortPreambleOFDM[i].re *= 1.4719601443879744;
    shortPreambleOFDM[i].im *= 1.4719601443879744;
  }

  /*  Form 10 Short Preambles */
  memcpy(&completeShortPreambleOFDM[0], &shortPreambleOFDM[0], sizeof(creal_T) <<
         6);
  memcpy(&completeShortPreambleOFDM[64], &shortPreambleOFDM[0], sizeof(creal_T) <<
         6);
  memcpy(&completeShortPreambleOFDM[128], &shortPreambleOFDM[0], sizeof(creal_T)
         << 5);

  /* % Create Long Preamble */
  /*  Modulate */
  st.site = &nk_emlrtRSI;
  b_SystemCore_step(&st, &hPreambleMod, longPreambleOFDM);

  /*  Form 2 Long Preambles */
  memcpy(&completeLongPreambleOFDM[0], &longPreambleOFDM[32], sizeof(creal_T) <<
         5);
  memcpy(&completeLongPreambleOFDM[32], &longPreambleOFDM[0], sizeof(creal_T) <<
         6);
  memcpy(&completeLongPreambleOFDM[96], &longPreambleOFDM[0], sizeof(creal_T) <<
         6);

  /* % Generate Data */
  /*  Use string as message */
  st.site = &ok_emlrtRSI;
  b_OFDMletters2bits(&st, originalData);
  st.site = &pk_emlrtRSI;
  for (i = 0; i < 80; i++) {
    for (ib = 0; ib < 7; ib++) {
      x[ib + 7 * i] = originalData[i + 80 * ib];
    }
  }

  memcpy(&b_originalData[0], &x[0], 560U * sizeof(real_T));

  /*  Generate CRC */
  st.site = &qk_emlrtRSI;
  b_CRCGenerator_CRCGenerator(&hGen);
  st.site = &rk_emlrtRSI;
  e_SystemCore_step(&st, &hGen, b_originalData, dataWithCRC);

  /*  Add CRC */
  /*  Construct modulator for each subcarrier */
  st.site = &sk_emlrtRSI;
  BPSKModulator_BPSKModulator(&hMod);

  /*  BPSK */
  /*  Apply modulator for each subcarrier */
  st.site = &tk_emlrtRSI;
  f_SystemCore_step(&st, &hMod, dataWithCRC, modData);

  /*  Pad IFFT */
  st.site = &uk_emlrtRSI;
  b_st.site = &u_emlrtRSI;
  emlrtRandu(varargin_1, 13);
  for (k = 0; k < 13; k++) {
    b_st.site = &v_emlrtRSI;
    b_st.site = &v_emlrtRSI;
    c_st.site = &p_emlrtRSI;
    varargin_1[k] = muDoubleScalarFloor(varargin_1[k] * 2.0);
  }

  st.site = &uk_emlrtRSI;
  obj = &hMod;
  if (!obj->isReleased) {
  } else {
    y = NULL;
    m10 = mxCreateCharArray(2, iv54);
    for (i = 0; i < 45; i++) {
      cv58[i] = cv59[i];
    }

    emlrtInitCharArrayR2013a(&st, 45, m10, cv58);
    emlrtAssign(&y, m10);
    b_y = NULL;
    m10 = mxCreateCharArray(2, iv55);
    for (i = 0; i < 4; i++) {
      cv60[i] = cv61[i];
    }

    emlrtInitCharArrayR2013a(&st, 4, m10, cv60);
    emlrtAssign(&b_y, m10);
    b_st.site = &cb_emlrtRSI;
    c_error(&b_st, message(&b_st, y, b_y, &emlrtMCI), &emlrtMCI);
  }

  if (!obj->isInitialized) {
    b_st.site = &cb_emlrtRSI;
    if (!obj->isInitialized) {
    } else {
      c_y = NULL;
      m10 = mxCreateCharArray(2, iv56);
      for (i = 0; i < 51; i++) {
        cv62[i] = cv63[i];
      }

      emlrtInitCharArrayR2013a(&b_st, 51, m10, cv62);
      emlrtAssign(&c_y, m10);
      d_y = NULL;
      m10 = mxCreateCharArray(2, iv57);
      for (i = 0; i < 5; i++) {
        cv64[i] = cv65[i];
      }

      emlrtInitCharArrayR2013a(&b_st, 5, m10, cv64);
      emlrtAssign(&d_y, m10);
      c_st.site = &cb_emlrtRSI;
      c_error(&c_st, message(&c_st, c_y, d_y, &emlrtMCI), &emlrtMCI);
    }

    c_st.site = &cb_emlrtRSI;
    obj->isInitialized = TRUE;
    d_st.site = &db_emlrtRSI;
    c_st.site = &cb_emlrtRSI;
    d_st.site = &cb_emlrtRSI;
    e_st.site = &db_emlrtRSI;
    d_st.site = &cb_emlrtRSI;
    e_st.site = &db_emlrtRSI;
    c_st.site = &cb_emlrtRSI;
    d_st.site = &cb_emlrtRSI;
    d_st.site = &cb_emlrtRSI;
    d_st.site = &cb_emlrtRSI;
    e_st.site = &db_emlrtRSI;
    c_st.site = &cb_emlrtRSI;
    d_st.site = &cb_emlrtRSI;
    for (i = 0; i < 8; i++) {
      obj->inputVarSize1[i] = (uint32_T)value[i];
    }

    e_st.site = &db_emlrtRSI;
    c_st.site = &cb_emlrtRSI;
    d_st.site = &cb_emlrtRSI;
    c_st.site = &cb_emlrtRSI;
    d_st.site = &cb_emlrtRSI;
    e_st.site = &cb_emlrtRSI;
    e_st.site = &cb_emlrtRSI;
    f_st.site = &gg_emlrtRSI;
    c_st.site = &cb_emlrtRSI;
    d_st.site = &cb_emlrtRSI;
    d_st.site = &cb_emlrtRSI;
    e_st.site = &gg_emlrtRSI;
    c_st.site = &cb_emlrtRSI;
    c_st.site = &cb_emlrtRSI;
    c_st.site = &cb_emlrtRSI;
    c_st.site = &cb_emlrtRSI;
    d_st.site = &gg_emlrtRSI;
    d_st.site = &gg_emlrtRSI;
    e_st.site = &db_emlrtRSI;
    c_st.site = &cb_emlrtRSI;
    d_st.site = &gg_emlrtRSI;
    e_st.site = NULL;
  }

  b_st.site = &cb_emlrtRSI;
  b_st.site = &cb_emlrtRSI;
  b_st.site = &cb_emlrtRSI;
  c_st.site = &cb_emlrtRSI;
  c_st.site = &cb_emlrtRSI;
  d_st.site = &gg_emlrtRSI;
  b_st.site = &cb_emlrtRSI;
  b_st.site = &cb_emlrtRSI;
  anyInputSizeChanged = FALSE;
  k = 0;
  exitg2 = FALSE;
  while ((exitg2 == FALSE) && (k < 8)) {
    if (obj->inputVarSize1[k] != (uint32_T)iv58[k]) {
      anyInputSizeChanged = TRUE;
      c_st.site = &cb_emlrtRSI;
      for (i = 0; i < 8; i++) {
        obj->inputVarSize1[i] = (uint32_T)value[i];
      }

      d_st.site = &db_emlrtRSI;
      exitg2 = TRUE;
    } else {
      k++;
    }
  }

  if (anyInputSizeChanged) {
    b_st.site = &cb_emlrtRSI;
    b_st.site = &cb_emlrtRSI;
  }

  b_st.site = &cb_emlrtRSI;
  c_st.site = &cb_emlrtRSI;
  c_st.site = &cb_emlrtRSI;
  d_st.site = &gg_emlrtRSI;
  b_st.site = &cb_emlrtRSI;
  b_st.site = &cb_emlrtRSI;
  b_st.site = &cb_emlrtRSI;
  d_Nondirect_stepImpl(obj, varargin_1, varargout_1);
  memcpy(&b_modData[0], &modData[0], 563U * sizeof(creal_T));
  memcpy(&b_modData[563], &varargout_1[0], 13U * sizeof(creal_T));

  /*  Calculate required data sizes for correct receiver operation */
  /*  Save desired message size */
  /*  Save number of transmitted frames */
  /*  Convert data into subcarrier streams */
  st.site = &vk_emlrtRSI;
  memcpy(&ofdmData[0], &b_modData[0], 576U * sizeof(creal_T));

  /*  Create Pilots */
  st.site = &wk_emlrtRSI;
  b_obj = &hPN;

  /* System object Constructor function: comm.PNSequence */
  b_obj->S0_isInitialized = FALSE;
  b_obj->S1_isReleased = FALSE;
  for (i = 0; i < 8; i++) {
    b_obj->P0_Polynomial[i] = (uint8_T)iv59[i];
  }

  for (i = 0; i < 7; i++) {
    b_obj->P1_IniState[i] = 1;
    b_obj->P2_Mask[i] = (uint8_T)iv60[i];
  }

  st.site = &xk_emlrtRSI;
  b_obj = &hPN;
  if (!b_obj->S0_isInitialized) {
    b_obj->S0_isInitialized = TRUE;
    if (b_obj->S1_isReleased) {
      emlrtErrorWithMessageIdR2012b(&st, &bc_emlrtRTEI,
        "MATLAB:system:runtimeMethodCalledWhenReleasedCodegen", 0);
    }

    b_st.site = NULL;
    b_st.site = NULL;

    /* System object Initialization function: comm.PNSequence */
    for (ib = 0; ib < 7; ib++) {
      b_obj->W0_shiftReg[ib] = b_obj->P1_IniState[ib];
      emlrtBreakCheckFastR2012b(emlrtBreakCheckR2012bFlagVar, &b_st);
    }
  }

  b_st.site = NULL;

  /* System object Outputs function: comm.PNSequence */
  for (ib = 0; ib < 12; ib++) {
    tmp = 0;
    for (i = 0; i < 7; i++) {
      tmp = (uint8_T)((uint32_T)tmp + (uint8_T)((uint32_T)b_obj->P0_Polynomial[i
        + 1] * b_obj->W0_shiftReg[i]));
    }

    tmp &= 1;
    tmp2 = 0;
    for (i = 0; i < 7; i++) {
      tmp2 = (uint8_T)((uint32_T)tmp2 + (uint8_T)((uint32_T)b_obj->W0_shiftReg[i]
        * b_obj->P2_Mask[i]));
    }

    pilot[ib] = (int8_T)(tmp2 & 1);
    for (i = 5; i > -1; i += -1) {
      b_obj->W0_shiftReg[i + 1] = b_obj->W0_shiftReg[i];
    }

    b_obj->W0_shiftReg[0U] = tmp;
  }

  /*  Create pilot */
  st.site = &yk_emlrtRSI;
  ib = 0;
  for (i = 0; i < 4; i++) {
    ia = 0;
    for (k = 0; k < 12; k++) {
      pilots[ib] = pilot[ia];
      b_st.site = &ng_emlrtRSI;
      ia++;
      b_st.site = &og_emlrtRSI;
      ib++;
    }
  }

  /*  Expand to all pilot tones */
  st.site = &al_emlrtRSI;
  for (i = 0; i < 12; i++) {
    for (ib = 0; ib < 4; ib++) {
      b_pilots[ib + (i << 2)] = 2.0 * (real_T)(pilots[i + 12 * ib] < 1) - 1.0;
    }
  }

  /*  Bipolar to unipolar */
  st.site = &bl_emlrtRSI;
  for (i = 0; i < 12; i++) {
    b_pilots[3 + (i << 2)] = -b_pilots[3 + (i << 2)];
  }

  /*  Invert last pilot */
  /*  Construct Modulator */
  st.site = &cl_emlrtRSI;
  b_OFDMModulator_OFDMModulator(&st, &hDataMod);

  /*  Modulate */
  st.site = &dl_emlrtRSI;
  d_SystemCore_step(&st, &hDataMod, ofdmData, b_pilots, b_r);

  /*  Add preambles to data */
  memcpy(&preambles[0], &completeShortPreambleOFDM[0], 160U * sizeof(creal_T));
  memcpy(&preambles[160], &completeLongPreambleOFDM[0], 160U * sizeof(creal_T));
  memcpy(&c_r[0], &preambles[0], 320U * sizeof(creal_T));
  memcpy(&c_r[320], &b_r[0], 960U * sizeof(creal_T));

  /*  Repeat frame */
  st.site = &el_emlrtRSI;
  ib = 0;
  for (i = 0; i < 20; i++) {
    ia = 0;
    for (k = 0; k < 1280; k++) {
      r[ib] = c_r[ia];
      b_st.site = &ng_emlrtRSI;
      ia++;
      b_st.site = &og_emlrtRSI;
      ib++;
    }
  }

  /*  Save Demodulator object data for receiver */
  /* hDataDemod = get(OFDMDemodulator(hDataMod)); */
  /* hPreambleDemod = get(OFDMDemodulator(hPreambleMod)); */
  st.site = &fl_emlrtRSI;
  object = iobj_0;
  *hDataDemod = object;
  b_st.site = &jj_emlrtRSI;
  object = *hDataDemod;
  c_st.site = &y_emlrtRSI;
  d_st.site = &bb_emlrtRSI;
  d_st.site = &bb_emlrtRSI;
  object->isInitialized = FALSE;
  object->isReleased = FALSE;
  e_st.site = &cb_emlrtRSI;
  f_st.site = &db_emlrtRSI;
  e_st.site = &cb_emlrtRSI;
  f_st.site = &db_emlrtRSI;
  c_st.site = &y_emlrtRSI;
  c_st.site = &ab_emlrtRSI;
  b_st.site = &kj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &lj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &mj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &nj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &oj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &pj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &qj_emlrtRSI;
  c_st.site = &db_emlrtRSI;

  /* OFDMBase Base object for OFDMModulator and OFDMDemodulator System objects */
  /*  Copyright 2013 The MathWorks, Inc. */
  /* FFTLength FFT length */
  /*  Specify the IFFT length. This property can be set to an integer */
  /*  scalar. The value must be a power of two. The default value of */
  /*  this property is 64. */
  /* CyclicPrefixLength Cyclic prefix length */
  /*  Specify the cyclic prefix length. This property can be set to a */
  /*  non-negative interher scalar. The default value of this property is 16. */
  /* NumGuardBandCarriers Number of guard bands */
  /*  Specify the lower and upper guard bands in frequency domain.This */
  /*  property can be set to a non-nagative two-element vector.  */
  /*  The default setting of this property is [6 5]. */
  /* NumSymbols Number of OFDM symbols */
  /*  Specify the number of OFDM symbols at the output. The default value  */
  /*  of this property is 1. */
  /* PilotCarrierIndices Pilot subcarrier indices */
  /*  Specify the locations where pilots are to be inserted. You can */
  /*  set this property to a numeric scalar, column vector, matrix, or */
  /*  3-D array. The defalut value of the property is [-21; -7; 7; 21]. */
  /*  Nontunable ideally */
  /*  Constructor */
  /*      validateattributes(fftLen, {'numeric'}, ... */
  /*          {'real','scalar','integer','finite','>=',8}, ... */
  /*          [class(obj) '.' propName], propName);   */
  /*      validateattributes(CPLen, {'numeric'}, ... */
  /*          {'real','row','integer','nonnegative','finite'}, ... */
  /*          [class(obj) '.' propName], propName);   */
  /*      validateattributes(guardBands, {'numeric'}, ... */
  /*          {'real','integer','nonnegative','finite','size', [2, 1]}, ... */
  /*          [class(obj) '.' propName], propName);   */
  /*      validateattributes(numSym, {'numeric'}, ... */
  /*          {'real','scalar','integer','positive','finite'}, ... */
  /*          [class(obj) '.' propName], propName);   */
  /*      validateattributes(pilotIdx, {'numeric'}, ... */
  /*          {'real','integer','positive','finite','3d'}, ... */
  /*          [class(obj) '.' propName], propName);   */
  /*  Check the 3rd dimension for numTx */
  d_st.site = &uh_emlrtRSI;
  e_st.site = &vh_emlrtRSI;
  for (k = 0; k < 4; k++) {
    b_data[k] = (int8_T)(12 + 14 * k);
  }

  f_st.site = &mi_emlrtRSI;
  i = 0;
  f_st.site = &ki_emlrtRSI;
  f_st.site = &ji_emlrtRSI;
  k = 1;
  while (k <= 4) {
    ib = b_data[k - 1];
    do {
      exitg1 = 0;
      f_st.site = &ii_emlrtRSI;
      k++;
      if (k > 4) {
        exitg1 = 1;
      } else {
        f_st.site = &hi_emlrtRSI;
        frexp((real_T)ib / 2.0, &exponent);
        if (muDoubleScalarAbs(ib - b_data[k - 1]) < ldexp(1.0, exponent - 53)) {
          anyInputSizeChanged = TRUE;
        } else {
          anyInputSizeChanged = FALSE;
        }

        if (!anyInputSizeChanged) {
          exitg1 = 1;
        }
      }
    } while (exitg1 == 0);

    f_st.site = &gi_emlrtRSI;
    i++;
    b_data[i - 1] = (int8_T)ib;
    f_st.site = &fi_emlrtRSI;
    f_st.site = &fi_emlrtRSI;
  }

  f_st.site = &bi_emlrtRSI;
  f_st.site = &ai_emlrtRSI;
  f_st.site = &wh_emlrtRSI;
  if (1 > i) {
    b2 = FALSE;
  } else {
    b2 = (i > 2147483646);
  }

  if (b2) {
    g_st.site = &bg_emlrtRSI;
    check_forloop_overflow_error(&g_st);
  }

  d_st.site = &uh_emlrtRSI;
  d_st.site = &uh_emlrtRSI;
  if (1 > i) {
    i12 = 0;
  } else {
    i12 = i;
  }

  if (!(4 != i12)) {
  } else {
    e_y = NULL;
    m10 = mxCreateCharArray(2, iv61);
    for (i = 0; i < 13; i++) {
      cv66[i] = cv67[i];
    }

    emlrtInitCharArrayR2013a(&d_st, 13, m10, cv66);
    emlrtAssign(&e_y, m10);
    e_st.site = &mv_emlrtRSI;
    c_error(&e_st, b_message(&e_st, e_y, &g_emlrtMCI), &g_emlrtMCI);
  }

  /*  Error message:  */
  /*  If pilot index is 2-D, the indices per symbol must be unique; */
  /*  If pilot index is 3-D, the indices across transmit antennas per symbol must be unique. */
  c_st.site = &db_emlrtRSI;
  st.site = &gl_emlrtRSI;
  object = iobj_1;
  *hPreambleDemod = object;
  b_st.site = &jj_emlrtRSI;
  object = *hPreambleDemod;
  c_st.site = &y_emlrtRSI;
  d_st.site = &bb_emlrtRSI;
  d_st.site = &bb_emlrtRSI;
  object->isInitialized = FALSE;
  object->isReleased = FALSE;
  e_st.site = &cb_emlrtRSI;
  f_st.site = &db_emlrtRSI;
  e_st.site = &cb_emlrtRSI;
  f_st.site = &db_emlrtRSI;
  c_st.site = &y_emlrtRSI;
  c_st.site = &ab_emlrtRSI;
  b_st.site = &kj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &lj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &mj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &nj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &oj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &pj_emlrtRSI;
  c_st.site = &db_emlrtRSI;

  /*  Calcuate OFDM frequency bin size */
  /*  Calculate locations of pilots without guardbands */
  /*  Calculate locations of subcarrier datastreams without guardbands */
  /* Remove guardband offsets */
  /* Remove index offsets for pilots and guardbands */
  /* dataSubcarrierIndexies([pilotLocationsWithoutGuardbands;DCNullLocation]) = [];%Remove pilot and DCNull locations */
  /*  Create return structure */
  for (i = 0; i < 560; i++) {
    tx->originalData[i] = b_originalData[i];
  }

  for (i = 0; i < 64; i++) {
    tx->shortPreambleOFDM[i] = shortPreambleOFDM[i];
  }

  for (i = 0; i < 160; i++) {
    tx->completeShortPreambleOFDM[i] = completeShortPreambleOFDM[i];
  }

  for (i = 0; i < 53; i++) {
    tx->shortPreamble[i] = dcv3[i];
  }

  for (i = 0; i < 53; i++) {
    tx->longPreamble[i] = iv62[i];
  }

  for (i = 0; i < 64; i++) {
    tx->longPreambleOFDM[i] = longPreambleOFDM[i];
  }

  for (i = 0; i < 160; i++) {
    tx->completeLongPreambleOFDM[i] = completeLongPreambleOFDM[i];
  }

  for (i = 0; i < 48; i++) {
    tx->pilots[i] = b_pilots[i];
  }

  for (i = 0; i < 320; i++) {
    tx->preambles[i] = preambles[i];
  }

  for (i = 0; i < 4; i++) {
    tx->pilotLocationsWithoutGuardbands[i] = 6.0 + 14.0 * (real_T)i;
  }

  tx->dataSubcarrierIndexies.size[0] = 1;
  tx->dataSubcarrierIndexies.size[1] = 48;
  for (i = 0; i < 48; i++) {
    tx->dataSubcarrierIndexies.data[i] = iv63[i];
  }

  tx->samplingFreq = 5.0E+6;
  tx->FFTLength = 64.0;
  tx->enableMA = TRUE;
  tx->numCarriers = 48.0;
  tx->padBits = 13.0;
  tx->numSamples = 576.0;
  tx->messageCharacters = 80.0;
  tx->numFrames = 20.0;
  tx->frameLength = 1280.0;
  tx->freqBin = 78125.0;
  tx->DecimationFactor = 0.0;
  tx->receiveBufferLength = 0.0;

  /*                              padBits: 13 */
  /*                           numSamples: 576 */
  /*                    messageCharacters: 80 */
  /*                            numFrames: 1000 */
  /*                          frameLength: 1280 */
  /*                              freqBin: 312500 */
  /*                           hDataDemod: [1x1 struct] */
  /*                       hPreambleDemod: [1x1 struct] */
  st.site = NULL;
  b_Destructor(&hPN);
  emxFreeStruct_OFDMModulator(&hPreambleMod);
  emxFreeStruct_OFDMModulator_1(&hDataMod);
  emlrtHeapReferenceStackLeaveFcnR2012b(sp);
}
Exemple #4
0
/* Function Definitions */
void OFDMbits2letters(const emlrtStack *sp, const boolean_T bits_data[560],
                      const int32_T bits_size[2], real_T Letters_data[80],
                      int32_T Letters_size[1])
{
  real_T a;
  int32_T i32;
  int32_T i33;
  boolean_T p;
  const mxArray *y;
  static const int32_T iv237[2] = { 1, 28 };

  const mxArray *m43;
  char_T cv284[28];
  int32_T i;
  static const char_T cv285[28] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T',
    'L', 'A', 'B', ':', 'N', 'o', 'n', 'I', 'n', 't', 'e', 'g', 'e', 'r', 'I',
    'n', 'p', 'u', 't' };

  const mxArray *b_y;
  const mxArray *c_y;
  int32_T maxdimlen;
  boolean_T y_data[560];
  const mxArray *d_y;
  static const int32_T iv238[2] = { 1, 40 };

  char_T cv286[40];
  static const char_T cv287[40] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T',
    'L', 'A', 'B', ':', 'g', 'e', 't', 'R', 'e', 's', 'h', 'a', 'p', 'e', 'D',
    'i', 'm', 's', '_', 'n', 'o', 't', 'S', 'a', 'm', 'e', 'N', 'u', 'm', 'e',
    'l' };

  boolean_T b_bits_data[560];
  char_T s[7];
  int32_T exitg1;
  const mxArray *e_y;
  static const int32_T iv239[2] = { 1, 34 };

  char_T cv288[34];
  static const char_T cv289[34] = { 'M', 'A', 'T', 'L', 'A', 'B', ':', 'b', 'i',
    'n', '2', 'd', 'e', 'c', ':', 'I', 'l', 'l', 'e', 'g', 'a', 'l', 'B', 'i',
    'n', 'a', 'r', 'y', 'S', 't', 'r', 'i', 'n', 'g' };

  real_T varargin_1;
  real_T p2;
  emlrtStack st;
  emlrtStack b_st;
  emlrtStack c_st;
  emlrtStack d_st;
  emlrtStack e_st;
  st.prev = sp;
  st.tls = sp->tls;
  b_st.prev = &st;
  b_st.tls = st.tls;
  c_st.prev = &b_st;
  c_st.tls = b_st.tls;
  d_st.prev = &b_st;
  d_st.tls = b_st.tls;
  e_st.prev = &st;
  e_st.tls = st.tls;

  /*  OFDMbits2letters: Convert input bits from a double array to ascii */
  /*  integers, which can be converted to letters by the char() function */
  /*  Make input into column */
  /* Trim extra bits */
  st.site = &qab_emlrtRSI;
  st.site = &qab_emlrtRSI;
  b_st.site = &m_emlrtRSI;
  c_st.site = &n_emlrtRSI;
  a = (real_T)(bits_size[0] * bits_size[1]) / 7.0;
  st.site = &qab_emlrtRSI;
  b_floor(&a);
  st.site = &qab_emlrtRSI;
  a *= 7.0;
  if (1.0 > a) {
    i32 = 0;
  } else {
    i32 = bits_size[0] * bits_size[1];
    emlrtDynamicBoundsCheckFastR2012b(1, 1, i32, &rb_emlrtBCI, sp);
    i32 = bits_size[0] * bits_size[1];
    i33 = (int32_T)a;
    i32 = emlrtDynamicBoundsCheckFastR2012b(i33, 1, i32, &rb_emlrtBCI, sp);
  }

  emlrtVectorVectorIndexCheckR2012b(bits_size[0] * bits_size[1], 1, 1, i32,
    &x_emlrtECI, sp);

  /* Shape into letters */
  st.site = &rab_emlrtRSI;
  st.site = &rab_emlrtRSI;
  b_st.site = &m_emlrtRSI;
  c_st.site = &n_emlrtRSI;
  a = (real_T)i32 / 7.0;
  st.site = &rab_emlrtRSI;
  b_st.site = &tab_emlrtRSI;
  c_st.site = &uab_emlrtRSI;
  if (a != muDoubleScalarFloor(a)) {
    p = FALSE;
  } else {
    p = TRUE;
  }

  if (p) {
    c_st.site = &uab_emlrtRSI;
    p = TRUE;
  } else {
    p = FALSE;
  }

  if (p) {
  } else {
    y = NULL;
    m43 = mxCreateCharArray(2, iv237);
    for (i = 0; i < 28; i++) {
      cv284[i] = cv285[i];
    }

    emlrtInitCharArrayR2013a(&b_st, 28, m43, cv284);
    emlrtAssign(&y, m43);
    b_y = NULL;
    m43 = mxCreateNumericMatrix(1, 1, mxINT32_CLASS, mxREAL);
    *(int32_T *)mxGetData(m43) = MIN_int32_T;
    emlrtAssign(&b_y, m43);
    c_y = NULL;
    m43 = mxCreateNumericMatrix(1, 1, mxINT32_CLASS, mxREAL);
    *(int32_T *)mxGetData(m43) = MAX_int32_T;
    emlrtAssign(&c_y, m43);
    c_st.site = &uab_emlrtRSI;
    d_st.site = &bcb_emlrtRSI;
    c_error(&c_st, c_message(&d_st, y, b_y, c_y, &ac_emlrtMCI), &bc_emlrtMCI);
  }

  c_st.site = &ny_emlrtRSI;
  c_st.site = &ny_emlrtRSI;
  b_st.site = &ky_emlrtRSI;
  c_st.site = &af_emlrtRSI;
  maxdimlen = i32;
  if (1 > i32) {
    maxdimlen = 1;
  }

  b_st.site = &ky_emlrtRSI;
  c_st.site = &af_emlrtRSI;
  if (i32 < maxdimlen) {
  } else {
    maxdimlen = i32;
  }

  if (7 > maxdimlen) {
    b_st.site = &jy_emlrtRSI;
    c_eml_error(&b_st);
  }

  if ((int8_T)(int32_T)a > maxdimlen) {
    b_st.site = &jy_emlrtRSI;
    c_eml_error(&b_st);
  }

  b_st.site = &iy_emlrtRSI;
  c_st.site = &v_emlrtRSI;
  if (i32 == 7 * (int32_T)a) {
  } else {
    d_y = NULL;
    m43 = mxCreateCharArray(2, iv238);
    for (i = 0; i < 40; i++) {
      cv286[i] = cv287[i];
    }

    emlrtInitCharArrayR2013a(&st, 40, m43, cv286);
    emlrtAssign(&d_y, m43);
    b_st.site = &iy_emlrtRSI;
    e_st.site = &rbb_emlrtRSI;
    c_error(&b_st, b_message(&e_st, d_y, &tb_emlrtMCI), &ub_emlrtMCI);
  }

  b_st.site = &hy_emlrtRSI;
  c_st.site = &dg_emlrtRSI;
  for (maxdimlen = 0; maxdimlen + 1 <= i32; maxdimlen++) {
    y_data[maxdimlen] = bits_data[maxdimlen];
  }

  for (i32 = 0; i32 < 7; i32++) {
    maxdimlen = (int32_T)a;
    for (i33 = 0; i33 < maxdimlen; i33++) {
      b_bits_data[i33 + (int32_T)a * i32] = y_data[i32 + 7 * i33];
    }
  }

  /* Convert bits to letters */
  Letters_size[0] = (int32_T)a;
  maxdimlen = (int32_T)a;
  for (i32 = 0; i32 < maxdimlen; i32++) {
    Letters_data[i32] = 0.0;
  }

  i = 0;
  while (i <= (int32_T)a - 1) {
    st.site = &sab_emlrtRSI;
    i32 = (int32_T)a;
    i33 = 1 + i;
    emlrtDynamicBoundsCheckFastR2012b(i33, 1, i32, &qb_emlrtBCI, &st);
    b_st.site = &of_emlrtRSI;
    b_st.site = &vab_emlrtRSI;
    for (maxdimlen = 0; maxdimlen < 7; maxdimlen++) {
      s[maxdimlen] = '0';
      if (b_bits_data[i + (int32_T)a * maxdimlen]) {
        s[maxdimlen] = '1';
      }
    }

    st.site = &sab_emlrtRSI;
    b_st.site = &wab_emlrtRSI;
    maxdimlen = 0;
    do {
      exitg1 = 0;
      if (maxdimlen < 7) {
        if ((s[maxdimlen] != '0') && (s[maxdimlen] != '1')) {
          p = FALSE;
          exitg1 = 1;
        } else {
          maxdimlen++;
        }
      } else {
        p = TRUE;
        exitg1 = 1;
      }
    } while (exitg1 == 0);

    if (p) {
    } else {
      e_y = NULL;
      m43 = mxCreateCharArray(2, iv239);
      for (maxdimlen = 0; maxdimlen < 34; maxdimlen++) {
        cv288[maxdimlen] = cv289[maxdimlen];
      }

      emlrtInitCharArrayR2013a(&st, 34, m43, cv288);
      emlrtAssign(&e_y, m43);
      b_st.site = &wab_emlrtRSI;
      e_st.site = &qbb_emlrtRSI;
      c_error(&b_st, b_message(&e_st, e_y, &cc_emlrtMCI), &dc_emlrtMCI);
    }

    b_st.site = &xab_emlrtRSI;
    varargin_1 = 0.0;
    p2 = 1.0;
    for (maxdimlen = 0; maxdimlen < 7; maxdimlen++) {
      if (s[6 - maxdimlen] == '1') {
        varargin_1 += p2;
      }

      p2 += p2;
    }

    st.site = &sab_emlrtRSI;
    i32 = (int32_T)varargin_1;
    emlrtDynamicBoundsCheckFastR2012b(i32, 0, 255, &emlrtBCI, &st);
    i32 = (int32_T)a;
    i33 = 1 + i;
    Letters_data[emlrtDynamicBoundsCheckFastR2012b(i33, 1, i32, &sb_emlrtBCI, sp)
      - 1] = (int8_T)varargin_1;
    i++;
    emlrtBreakCheckFastR2012b(emlrtBreakCheckR2012bFlagVar, sp);
  }
}
static void cgxe_mdl_outputs(InstanceStruct_UXvEHHrxIcmXaLthmwvduD
  *moduleInstance)
{
  real_T varargin_6[6250];
  int32_T k;
  dsp_SampleRateConverter_2 *obj;
  dspcodegen_FIRDecimator *iobj_0;
  dspcodegen_FIRRateConverter *iobj_1;
  static char_T cv14[45] = { 'M', 'A', 'T', 'L', 'A', 'B', ':', 's', 'y', 's',
    't', 'e', 'm', ':', 'm', 'e', 't', 'h', 'o', 'd', 'C', 'a', 'l', 'l', 'e',
    'd', 'W', 'h', 'e', 'n', 'R', 'e', 'l', 'e', 'a', 's', 'e', 'd', 'C', 'o',
    'd', 'e', 'g', 'e', 'n' };

  char_T u[45];
  const mxArray *y;
  static const int32_T iv21[2] = { 1, 45 };

  const mxArray *m4;
  static char_T cv15[4] = { 's', 't', 'e', 'p' };

  char_T b_u[4];
  const mxArray *b_y;
  static const int32_T iv22[2] = { 1, 4 };

  static char_T cv16[51] = { 'M', 'A', 'T', 'L', 'A', 'B', ':', 's', 'y', 's',
    't', 'e', 'm', ':', 'm', 'e', 't', 'h', 'o', 'd', 'C', 'a', 'l', 'l', 'e',
    'd', 'W', 'h', 'e', 'n', 'L', 'o', 'c', 'k', 'e', 'd', 'R', 'e', 'l', 'e',
    'a', 's', 'e', 'd', 'C', 'o', 'd', 'e', 'g', 'e', 'n' };

  char_T c_u[51];
  const mxArray *c_y;
  static const int32_T iv23[2] = { 1, 51 };

  static char_T cv17[5] = { 's', 'e', 't', 'u', 'p' };

  char_T d_u[5];
  const mxArray *d_y;
  static const int32_T iv24[2] = { 1, 5 };

  static int16_T inputSize[8] = { 6250, 1, 1, 1, 1, 1, 1, 1 };

  static char_T cv18[29] = { 'd', 's', 'p', ':', 's', 'y', 's', 't', 'e', 'm',
    ':', 'S', 'h', 'a', 'r', 'e', 'd', ':', 'n', 'u', 'm', 'C', 'h', 'a', 'n',
    'n', 'e', 'l', 's' };

  char_T e_u[29];
  const mxArray *e_y;
  static const int32_T iv25[2] = { 1, 29 };

  static real_T dv2[65] = { -0.00042490390801053907, 0.001829921716933601,
    -0.0053922845058157441, 0.013158346550611766, -0.0306391449331187,
    0.097992165418816057, 0.1494061316020634, -0.036811645611123822,
    0.015554560498179271, -0.0065160634201840671, 0.002322039466476993,
    -0.00059679513327257766, 7.912220199299E-5, -0.00018023922410876497,
    0.00087868330763207075, -0.0027374434497387575, 0.0068640356860943941,
    -0.015898279697317719, 0.044393549657968379, 0.18648984591811768,
    -0.027710944293488637, 0.011353373510521791, -0.004835216511247617,
    0.0017985509582130208, -0.0005034779575003312, 7.1006774722819944E-5, 0.0,
    0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
    7.1006774722819944E-5, -0.0005034779575003312, 0.0017985509582130208,
    -0.004835216511247617, 0.011353373510521791, -0.027710944293488637,
    0.18648984591811768, 0.044393549657968379, -0.015898279697317719,
    0.0068640356860943941, -0.0027374434497387575, 0.00087868330763207075,
    -0.00018023922410876497, 7.912220199299E-5, -0.00059679513327257766,
    0.002322039466476993, -0.0065160634201840671, 0.015554560498179271,
    -0.036811645611123822, 0.1494061316020634, 0.097992165418816057,
    -0.0306391449331187, 0.013158346550611766, -0.0053922845058157441,
    0.001829921716933601, -0.00042490390801053907 };

  static real_T dv3[120] = { -2.7394100013652473E-5, 0.0, 0.00037894068534068619,
    -0.0013708823152694639, 0.00268257205568729, -0.0029618195399131889, 0.0,
    0.0078609652501006478, -0.019453248977701877, 0.028984307962212054,
    -0.026341800053436379, 0.0, 0.059586630047975528, -0.16398784004285519,
    0.39970920445885333, 0.74757835469466261, 0.0, -0.076109876780524763,
    0.077352679334485558, -0.051701756420330057, 0.021737647121907556, 0.0,
    -0.009760644763162624, 0.010147444378648696, -0.0062395788347920046,
    0.00223736435719863, 0.0, -0.000578393604977232, 0.00038049397375299542,
    -0.00011122314331323368, -7.3471653020902532E-5, 0.0001803558498977357, 0.0,
    -0.0010125268340104962, 0.00312437313653832, -0.0054788551201990889,
    0.0055792244712591183, 0.0, -0.013309431044135926, 0.031938446310848335,
    -0.04692872867557716, 0.043075982682944734, 0.0, -0.11993407734560091,
    0.60283398545426792, 0.60283398545426792, -0.11993407734560091, 0.0,
    0.043075982682944734, -0.04692872867557716, 0.031938446310848335,
    -0.013309431044135926, 0.0, 0.0055792244712591183, -0.0054788551201990889,
    0.00312437313653832, -0.0010125268340104962, 0.0, 0.0001803558498977357,
    -7.3471653020902532E-5, -0.00011122314331323368, 0.00038049397375299542,
    -0.000578393604977232, 0.0, 0.00223736435719863, -0.0062395788347920046,
    0.010147444378648696, -0.009760644763162624, 0.0, 0.021737647121907556,
    -0.051701756420330057, 0.077352679334485558, -0.076109876780524763, 0.0,
    0.74757835469466261, 0.39970920445885333, -0.16398784004285519,
    0.059586630047975528, 0.0, -0.026341800053436379, 0.028984307962212054,
    -0.019453248977701877, 0.0078609652501006478, 0.0, -0.0029618195399131889,
    0.00268257205568729, -0.0013708823152694639, 0.00037894068534068619, 0.0,
    -2.7394100013652473E-5, -9.8313238270332086E-5, 0.000486827925108784,
    -0.0011378244855056148, 0.001415513014019786, 0.0, -0.0043758948985123938,
    0.011375305454062892, -0.017543845054337627, 0.01624272325576193, 0.0,
    -0.035239058026866117, 0.086157558252096214, -0.14115130237644263,
    0.18386872695653758, 0.8, 0.18386872695653758, -0.14115130237644263,
    0.086157558252096214, -0.035239058026866117, 0.0, 0.01624272325576193,
    -0.017543845054337627, 0.011375305454062892, -0.0043758948985123938, 0.0,
    0.001415513014019786, -0.0011378244855056148, 0.000486827925108784,
    -9.8313238270332086E-5, 0.0 };

  static int8_T iv26[5] = { 1, 2, 3, 4, 4 };

  char_T f_u[45];
  const mxArray *f_y;
  static const int32_T iv27[2] = { 1, 45 };

  static char_T cv19[5] = { 'r', 'e', 's', 'e', 't' };

  char_T g_u[5];
  const mxArray *g_y;
  static const int32_T iv28[2] = { 1, 5 };

  char_T h_u[45];
  const mxArray *h_y;
  static const int32_T iv29[2] = { 1, 45 };

  char_T i_u[5];
  const mxArray *i_y;
  static const int32_T iv30[2] = { 1, 5 };

  boolean_T anyInputSizeChanged;
  boolean_T exitg1;
  char_T j_u[29];
  const mxArray *j_y;
  static const int32_T iv31[2] = { 1, 29 };

  real_T varargout_1[1000];
  for (k = 0; k < 6250; k++) {
    varargin_6[k] = (*moduleInstance->u0)[k];
  }

  if (!moduleInstance->sysobj_not_empty) {
    obj = &moduleInstance->sysobj;
    moduleInstance->sysobj.filt1 = NULL;
    moduleInstance->sysobj.filt2 = NULL;
    obj->isInitialized = 0;
    obj->NumChannels = -1.0;
    moduleInstance->sysobj_not_empty = true;
  }

  obj = &moduleInstance->sysobj;
  iobj_0 = &moduleInstance->gobj_1;
  iobj_1 = &moduleInstance->gobj_3;
  if (moduleInstance->sysobj.isInitialized == 2) {
    for (k = 0; k < 45; k++) {
      u[k] = cv14[k];
    }

    y = NULL;
    m4 = emlrtCreateCharArray(2, iv21);
    emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 45, m4, &u[0]);
    emlrtAssign(&y, m4);
    for (k = 0; k < 4; k++) {
      b_u[k] = cv15[k];
    }

    b_y = NULL;
    m4 = emlrtCreateCharArray(2, iv22);
    emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 4, m4, &b_u[0]);
    emlrtAssign(&b_y, m4);
    error(moduleInstance, message(moduleInstance, y, b_y, &c_emlrtMCI),
          &c_emlrtMCI);
  }

  if (obj->isInitialized != 1) {
    if (obj->isInitialized != 0) {
      for (k = 0; k < 51; k++) {
        c_u[k] = cv16[k];
      }

      c_y = NULL;
      m4 = emlrtCreateCharArray(2, iv23);
      emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 51, m4, &c_u
        [0]);
      emlrtAssign(&c_y, m4);
      for (k = 0; k < 5; k++) {
        d_u[k] = cv17[k];
      }

      d_y = NULL;
      m4 = emlrtCreateCharArray(2, iv24);
      emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 5, m4, &d_u[0]);
      emlrtAssign(&d_y, m4);
      error(moduleInstance, message(moduleInstance, c_y, d_y, &c_emlrtMCI),
            &c_emlrtMCI);
    }

    obj->isInitialized = 1;
    for (k = 0; k < 8; k++) {
      obj->inputVarSize1[k] = (uint32_T)inputSize[k];
    }

    if ((obj->NumChannels != -1.0) && (1.0 != obj->NumChannels)) {
      for (k = 0; k < 29; k++) {
        e_u[k] = cv18[k];
      }

      e_y = NULL;
      m4 = emlrtCreateCharArray(2, iv25);
      emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 29, m4, &e_u
        [0]);
      emlrtAssign(&e_y, m4);
      error(moduleInstance, b_message(moduleInstance, e_y, &d_emlrtMCI),
            &d_emlrtMCI);
    }

    if (!(obj->filt1 == NULL)) {
      emlrtErrorWithMessageIdR2012b(moduleInstance->emlrtRootTLSGlobal,
        &b_emlrtRTEI, "EMLRT:runTime:NontunableHandleProp", 0);
    }

    iobj_0->isInitialized = 0;

    /* System object Constructor function: dsp.FIRDecimator */
    iobj_0->cSFunObject.P0_IC = 0.0;
    for (k = 0; k < 65; k++) {
      iobj_0->cSFunObject.P1_FILT[k] = dv2[k];
    }

    obj->filt1 = iobj_0;
    if (!(obj->filt2 == NULL)) {
      emlrtErrorWithMessageIdR2012b(moduleInstance->emlrtRootTLSGlobal,
        &emlrtRTEI, "EMLRT:runTime:NontunableHandleProp", 0);
    }

    iobj_1->isInitialized = 0;

    /* System object Constructor function: dsp.FIRRateConverter */
    for (k = 0; k < 120; k++) {
      iobj_1->cSFunObject.P0_FILTER[k] = dv3[k];
    }

    for (k = 0; k < 4; k++) {
      iobj_1->cSFunObject.P1_PolyphaseSelector[k] = k;
    }

    for (k = 0; k < 5; k++) {
      iobj_1->cSFunObject.P2_StartIdx[k] = k;
    }

    for (k = 0; k < 5; k++) {
      iobj_1->cSFunObject.P3_StopIdx[k] = iv26[k];
    }

    obj->filt2 = iobj_1;
    obj->NumChannels = 1.0;
    iobj_0 = obj->filt1;
    if (iobj_0->isInitialized == 2) {
      for (k = 0; k < 45; k++) {
        f_u[k] = cv14[k];
      }

      f_y = NULL;
      m4 = emlrtCreateCharArray(2, iv27);
      emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 45, m4, &f_u
        [0]);
      emlrtAssign(&f_y, m4);
      for (k = 0; k < 5; k++) {
        g_u[k] = cv19[k];
      }

      g_y = NULL;
      m4 = emlrtCreateCharArray(2, iv28);
      emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 5, m4, &g_u[0]);
      emlrtAssign(&g_y, m4);
      error(moduleInstance, message(moduleInstance, f_y, g_y, &c_emlrtMCI),
            &c_emlrtMCI);
    }

    if (iobj_0->isInitialized == 1) {
      /* System object Initialization function: dsp.FIRDecimator */
      iobj_0->cSFunObject.W2_CoeffIdx = 52;
      iobj_0->cSFunObject.W0_PhaseIdx = 4;
      iobj_0->cSFunObject.W4_TapDelayIndex = 48;
      iobj_0->cSFunObject.W1_Sums = 0.0;
      for (k = 0; k < 60; k++) {
        iobj_0->cSFunObject.W3_StatesBuff[k] = 0.0;
      }
    }

    iobj_1 = obj->filt2;
    if (iobj_1->isInitialized == 2) {
      for (k = 0; k < 45; k++) {
        h_u[k] = cv14[k];
      }

      h_y = NULL;
      m4 = emlrtCreateCharArray(2, iv29);
      emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 45, m4, &h_u
        [0]);
      emlrtAssign(&h_y, m4);
      for (k = 0; k < 5; k++) {
        i_u[k] = cv19[k];
      }

      i_y = NULL;
      m4 = emlrtCreateCharArray(2, iv30);
      emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 5, m4, &i_u[0]);
      emlrtAssign(&i_y, m4);
      error(moduleInstance, message(moduleInstance, h_y, i_y, &c_emlrtMCI),
            &c_emlrtMCI);
    }

    if (iobj_1->isInitialized == 1) {
      /* System object Initialization function: dsp.FIRRateConverter */
      iobj_1->cSFunObject.W1_InBufIdx = 0;
      for (k = 0; k < 30; k++) {
        iobj_1->cSFunObject.W0_InBuf[k] = 0.0;
      }
    }
  }

  anyInputSizeChanged = false;
  k = 0;
  exitg1 = false;
  while ((exitg1 == false) && (k < 8)) {
    if (obj->inputVarSize1[k] != (uint32_T)inputSize[k]) {
      anyInputSizeChanged = true;
      for (k = 0; k < 8; k++) {
        obj->inputVarSize1[k] = (uint32_T)inputSize[k];
      }

      exitg1 = true;
    } else {
      k++;
    }
  }

  if (anyInputSizeChanged && (obj->NumChannels != -1.0) && (1.0 !=
       obj->NumChannels)) {
    for (k = 0; k < 29; k++) {
      j_u[k] = cv18[k];
    }

    j_y = NULL;
    m4 = emlrtCreateCharArray(2, iv31);
    emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 29, m4, &j_u[0]);
    emlrtAssign(&j_y, m4);
    error(moduleInstance, b_message(moduleInstance, j_y, &d_emlrtMCI),
          &d_emlrtMCI);
  }

  SampleRateConverter_stepImpl(moduleInstance, obj, varargin_6, varargout_1);
  for (k = 0; k < 1000; k++) {
    (*moduleInstance->b_y0)[k] = varargout_1[k];
  }
}
static void cgxe_mdl_start(InstanceStruct_UXvEHHrxIcmXaLthmwvduD *moduleInstance)
{
  dsp_SampleRateConverter_2 *obj;
  dspcodegen_FIRDecimator *iobj_0;
  dspcodegen_FIRRateConverter *iobj_1;
  int32_T i0;
  static char_T cv8[51] = { 'M', 'A', 'T', 'L', 'A', 'B', ':', 's', 'y', 's',
    't', 'e', 'm', ':', 'm', 'e', 't', 'h', 'o', 'd', 'C', 'a', 'l', 'l', 'e',
    'd', 'W', 'h', 'e', 'n', 'L', 'o', 'c', 'k', 'e', 'd', 'R', 'e', 'l', 'e',
    'a', 's', 'e', 'd', 'C', 'o', 'd', 'e', 'g', 'e', 'n' };

  char_T u[51];
  const mxArray *y;
  static const int32_T iv8[2] = { 1, 51 };

  const mxArray *m2;
  static char_T cv9[5] = { 's', 'e', 't', 'u', 'p' };

  char_T b_u[5];
  const mxArray *b_y;
  static const int32_T iv9[2] = { 1, 5 };

  static int16_T iv10[8] = { 6250, 1, 1, 1, 1, 1, 1, 1 };

  static char_T cv10[29] = { 'd', 's', 'p', ':', 's', 'y', 's', 't', 'e', 'm',
    ':', 'S', 'h', 'a', 'r', 'e', 'd', ':', 'n', 'u', 'm', 'C', 'h', 'a', 'n',
    'n', 'e', 'l', 's' };

  char_T c_u[29];
  const mxArray *c_y;
  static const int32_T iv11[2] = { 1, 29 };

  static real_T dv0[65] = { -0.00042490390801053907, 0.001829921716933601,
    -0.0053922845058157441, 0.013158346550611766, -0.0306391449331187,
    0.097992165418816057, 0.1494061316020634, -0.036811645611123822,
    0.015554560498179271, -0.0065160634201840671, 0.002322039466476993,
    -0.00059679513327257766, 7.912220199299E-5, -0.00018023922410876497,
    0.00087868330763207075, -0.0027374434497387575, 0.0068640356860943941,
    -0.015898279697317719, 0.044393549657968379, 0.18648984591811768,
    -0.027710944293488637, 0.011353373510521791, -0.004835216511247617,
    0.0017985509582130208, -0.0005034779575003312, 7.1006774722819944E-5, 0.0,
    0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
    7.1006774722819944E-5, -0.0005034779575003312, 0.0017985509582130208,
    -0.004835216511247617, 0.011353373510521791, -0.027710944293488637,
    0.18648984591811768, 0.044393549657968379, -0.015898279697317719,
    0.0068640356860943941, -0.0027374434497387575, 0.00087868330763207075,
    -0.00018023922410876497, 7.912220199299E-5, -0.00059679513327257766,
    0.002322039466476993, -0.0065160634201840671, 0.015554560498179271,
    -0.036811645611123822, 0.1494061316020634, 0.097992165418816057,
    -0.0306391449331187, 0.013158346550611766, -0.0053922845058157441,
    0.001829921716933601, -0.00042490390801053907 };

  static real_T dv1[120] = { -2.7394100013652473E-5, 0.0, 0.00037894068534068619,
    -0.0013708823152694639, 0.00268257205568729, -0.0029618195399131889, 0.0,
    0.0078609652501006478, -0.019453248977701877, 0.028984307962212054,
    -0.026341800053436379, 0.0, 0.059586630047975528, -0.16398784004285519,
    0.39970920445885333, 0.74757835469466261, 0.0, -0.076109876780524763,
    0.077352679334485558, -0.051701756420330057, 0.021737647121907556, 0.0,
    -0.009760644763162624, 0.010147444378648696, -0.0062395788347920046,
    0.00223736435719863, 0.0, -0.000578393604977232, 0.00038049397375299542,
    -0.00011122314331323368, -7.3471653020902532E-5, 0.0001803558498977357, 0.0,
    -0.0010125268340104962, 0.00312437313653832, -0.0054788551201990889,
    0.0055792244712591183, 0.0, -0.013309431044135926, 0.031938446310848335,
    -0.04692872867557716, 0.043075982682944734, 0.0, -0.11993407734560091,
    0.60283398545426792, 0.60283398545426792, -0.11993407734560091, 0.0,
    0.043075982682944734, -0.04692872867557716, 0.031938446310848335,
    -0.013309431044135926, 0.0, 0.0055792244712591183, -0.0054788551201990889,
    0.00312437313653832, -0.0010125268340104962, 0.0, 0.0001803558498977357,
    -7.3471653020902532E-5, -0.00011122314331323368, 0.00038049397375299542,
    -0.000578393604977232, 0.0, 0.00223736435719863, -0.0062395788347920046,
    0.010147444378648696, -0.009760644763162624, 0.0, 0.021737647121907556,
    -0.051701756420330057, 0.077352679334485558, -0.076109876780524763, 0.0,
    0.74757835469466261, 0.39970920445885333, -0.16398784004285519,
    0.059586630047975528, 0.0, -0.026341800053436379, 0.028984307962212054,
    -0.019453248977701877, 0.0078609652501006478, 0.0, -0.0029618195399131889,
    0.00268257205568729, -0.0013708823152694639, 0.00037894068534068619, 0.0,
    -2.7394100013652473E-5, -9.8313238270332086E-5, 0.000486827925108784,
    -0.0011378244855056148, 0.001415513014019786, 0.0, -0.0043758948985123938,
    0.011375305454062892, -0.017543845054337627, 0.01624272325576193, 0.0,
    -0.035239058026866117, 0.086157558252096214, -0.14115130237644263,
    0.18386872695653758, 0.8, 0.18386872695653758, -0.14115130237644263,
    0.086157558252096214, -0.035239058026866117, 0.0, 0.01624272325576193,
    -0.017543845054337627, 0.011375305454062892, -0.0043758948985123938, 0.0,
    0.001415513014019786, -0.0011378244855056148, 0.000486827925108784,
    -9.8313238270332086E-5, 0.0 };

  static int8_T iv12[5] = { 1, 2, 3, 4, 4 };

  init_simulink_io_address(moduleInstance);
  if (!moduleInstance->sysobj_not_empty) {
    obj = &moduleInstance->sysobj;
    moduleInstance->sysobj.filt1 = NULL;
    moduleInstance->sysobj.filt2 = NULL;
    obj->isInitialized = 0;
    obj->NumChannels = -1.0;
    moduleInstance->sysobj_not_empty = true;
  }

  obj = &moduleInstance->sysobj;
  iobj_0 = &moduleInstance->gobj_0;
  iobj_1 = &moduleInstance->gobj_2;
  if (moduleInstance->sysobj.isInitialized != 0) {
    for (i0 = 0; i0 < 51; i0++) {
      u[i0] = cv8[i0];
    }

    y = NULL;
    m2 = emlrtCreateCharArray(2, iv8);
    emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 51, m2, &u[0]);
    emlrtAssign(&y, m2);
    for (i0 = 0; i0 < 5; i0++) {
      b_u[i0] = cv9[i0];
    }

    b_y = NULL;
    m2 = emlrtCreateCharArray(2, iv9);
    emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 5, m2, &b_u[0]);
    emlrtAssign(&b_y, m2);
    error(moduleInstance, message(moduleInstance, y, b_y, &c_emlrtMCI),
          &c_emlrtMCI);
  }

  obj->isInitialized = 1;
  for (i0 = 0; i0 < 8; i0++) {
    obj->inputVarSize1[i0] = (uint32_T)iv10[i0];
  }

  if ((obj->NumChannels != -1.0) && (1.0 != obj->NumChannels)) {
    for (i0 = 0; i0 < 29; i0++) {
      c_u[i0] = cv10[i0];
    }

    c_y = NULL;
    m2 = emlrtCreateCharArray(2, iv11);
    emlrtInitCharArrayR2013a(moduleInstance->emlrtRootTLSGlobal, 29, m2, &c_u[0]);
    emlrtAssign(&c_y, m2);
    error(moduleInstance, b_message(moduleInstance, c_y, &d_emlrtMCI),
          &d_emlrtMCI);
  }

  if (!(obj->filt1 == NULL)) {
    emlrtErrorWithMessageIdR2012b(moduleInstance->emlrtRootTLSGlobal,
      &b_emlrtRTEI, "EMLRT:runTime:NontunableHandleProp", 0);
  }

  iobj_0->isInitialized = 0;

  /* System object Constructor function: dsp.FIRDecimator */
  iobj_0->cSFunObject.P0_IC = 0.0;
  for (i0 = 0; i0 < 65; i0++) {
    iobj_0->cSFunObject.P1_FILT[i0] = dv0[i0];
  }

  obj->filt1 = iobj_0;
  if (!(obj->filt2 == NULL)) {
    emlrtErrorWithMessageIdR2012b(moduleInstance->emlrtRootTLSGlobal, &emlrtRTEI,
      "EMLRT:runTime:NontunableHandleProp", 0);
  }

  iobj_1->isInitialized = 0;

  /* System object Constructor function: dsp.FIRRateConverter */
  for (i0 = 0; i0 < 120; i0++) {
    iobj_1->cSFunObject.P0_FILTER[i0] = dv1[i0];
  }

  for (i0 = 0; i0 < 4; i0++) {
    iobj_1->cSFunObject.P1_PolyphaseSelector[i0] = i0;
  }

  for (i0 = 0; i0 < 5; i0++) {
    iobj_1->cSFunObject.P2_StartIdx[i0] = i0;
  }

  for (i0 = 0; i0 < 5; i0++) {
    iobj_1->cSFunObject.P3_StopIdx[i0] = iv12[i0];
  }

  obj->filt2 = iobj_1;
  obj->NumChannels = 1.0;
}
void reportSDRuStatus(const emlrtStack *sp, UsrpErrorCapiEnumT errStatus, const
                      char_T errMsg_data[], const int32_T errMsg_size[2])
{
  const mxArray *y;
  static const int32_T iv16[2] = { 1, 35 };

  const mxArray *m7;
  char_T cv31[35];
  int32_T i;
  static const char_T cv32[35] = { 's', 'd', 'r', 'u', ':', 'r', 'e', 'p', 'o',
    'r', 't', 'S', 'D', 'R', 'u', 'S', 't', 'a', 't', 'u', 's', ':', 'N', 'o',
    't', 'C', 'o', 'm', 'p', 'a', 't', 'i', 'b', 'l', 'e' };

  const mxArray *b_y;
  static const int32_T iv17[2] = { 1, 12 };

  char_T cv33[12];
  static const char_T cv34[12] = { '1', '9', '2', '.', '1', '6', '8', '.', '1',
    '0', '.', '2' };

  const mxArray *c_y;
  static const int32_T iv18[2] = { 1, 43 };

  char_T cv35[43];
  static const char_T cv36[43] = { 'r', 'e', 't', 'u', 'r', 'n', 'e', 'd', ' ',
    'b', 'y', ' ', '\'', 'g', 'e', 't', 'S', 'D', 'R', 'u', 'D', 'r', 'i', 'v',
    'e', 'r', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\'', ' ', 'f', 'u', 'n', 'c',
    't', 'i', 'o', 'n' };

  const mxArray *d_y;
  static const int32_T iv19[2] = { 1, 35 };

  static const char_T cv37[35] = { 's', 'd', 'r', 'u', ':', 'r', 'e', 'p', 'o',
    'r', 't', 'S', 'D', 'R', 'u', 'S', 't', 'a', 't', 'u', 's', ':', 'N', 'o',
    't', 'R', 'e', 's', 'p', 'o', 'n', 'd', 'i', 'n', 'g' };

  const mxArray *e_y;
  static const int32_T iv20[2] = { 1, 12 };

  const mxArray *f_y;
  static const int32_T iv21[2] = { 1, 28 };

  char_T cv38[28];
  static const char_T cv39[28] = { 's', 'd', 'r', 'u', ':', 'r', 'e', 'p', 'o',
    'r', 't', 'S', 'D', 'R', 'u', 'S', 't', 'a', 't', 'u', 's', ':', 'R', 'x',
    'B', 'u', 's', 'y' };

  const mxArray *g_y;
  static const int32_T iv22[2] = { 1, 12 };

  const mxArray *h_y;
  static const int32_T iv23[2] = { 1, 28 };

  static const char_T cv40[28] = { 's', 'd', 'r', 'u', ':', 'r', 'e', 'p', 'o',
    'r', 't', 'S', 'D', 'R', 'u', 'S', 't', 'a', 't', 'u', 's', ':', 'T', 'x',
    'B', 'u', 's', 'y' };

  const mxArray *i_y;
  static const int32_T iv24[2] = { 1, 12 };

  const mxArray *j_y;
  static const int32_T iv25[2] = { 1, 26 };

  char_T cv41[26];
  static const char_T cv42[26] = { 's', 'd', 'r', 'u', ':', 'r', 'e', 'p', 'o',
    'r', 't', 'S', 'D', 'R', 'u', 'S', 't', 'a', 't', 'u', 's', ':', 'B', 'u',
    's', 'y' };

  const mxArray *k_y;
  static const int32_T iv26[2] = { 1, 12 };

  const mxArray *l_y;
  static const int32_T iv27[2] = { 1, 35 };

  static const char_T cv43[35] = { 's', 'd', 'r', 'u', ':', 'r', 'e', 'p', 'o',
    'r', 't', 'S', 'D', 'R', 'u', 'S', 't', 'a', 't', 'u', 's', ':', 'U', 'n',
    'k', 'n', 'o', 'w', 'n', 'S', 't', 'a', 't', 'u', 's' };

  int32_T u_size[2];
  int32_T i10;
  char_T u_data[1024];
  const mxArray *m_y;
  emlrtStack st;
  emlrtStack b_st;
  st.prev = sp;
  st.tls = sp->tls;
  b_st.prev = &st;
  b_st.tls = st.tls;

  /* reportSDRuStatus SDRu status reporter */
  /*    reportSDRuStatus(STATUS,MSG,IP,METHOD) reports the SDRu status based on */
  /*    the STATUS input. STATUS is a UsrpErrorCapiEnumT type. IP is the IP */
  /*    address of the USRP(R) radio. METHOD is a UsrpReportMethodEnumT type and */
  /*    can be Warning, Error , or None. */
  /*  */
  /*    USRP(R) is a trademark of National Instruments Corp. */
  /*    Copyright 2012-2014 The MathWorks, Inc. */
  switch (errStatus) {
   case UsrpDriverNotCompatible:
    st.site = &ib_emlrtRSI;
    if (!(errStatus == UsrpDriverNotCompatible)) {
    } else {
      y = NULL;
      m7 = emlrtCreateCharArray(2, iv16);
      for (i = 0; i < 35; i++) {
        cv31[i] = cv32[i];
      }

      emlrtInitCharArrayR2013a(&st, 35, m7, cv31);
      emlrtAssign(&y, m7);
      b_y = NULL;
      m7 = emlrtCreateCharArray(2, iv17);
      for (i = 0; i < 12; i++) {
        cv33[i] = cv34[i];
      }

      emlrtInitCharArrayR2013a(&st, 12, m7, cv33);
      emlrtAssign(&b_y, m7);
      c_y = NULL;
      m7 = emlrtCreateCharArray(2, iv18);
      for (i = 0; i < 43; i++) {
        cv35[i] = cv36[i];
      }

      emlrtInitCharArrayR2013a(&st, 43, m7, cv35);
      emlrtAssign(&c_y, m7);
      b_st.site = &pb_emlrtRSI;
      c_error(&b_st, b_message(&b_st, y, b_y, c_y, &c_emlrtMCI), &c_emlrtMCI);
    }
    break;

   case UsrpDriverNotResponding:
    st.site = &hb_emlrtRSI;
    if (!(errStatus == UsrpDriverNotResponding)) {
    } else {
      d_y = NULL;
      m7 = emlrtCreateCharArray(2, iv19);
      for (i = 0; i < 35; i++) {
        cv31[i] = cv37[i];
      }

      emlrtInitCharArrayR2013a(&st, 35, m7, cv31);
      emlrtAssign(&d_y, m7);
      e_y = NULL;
      m7 = emlrtCreateCharArray(2, iv20);
      for (i = 0; i < 12; i++) {
        cv33[i] = cv34[i];
      }

      emlrtInitCharArrayR2013a(&st, 12, m7, cv33);
      emlrtAssign(&e_y, m7);
      b_st.site = &pb_emlrtRSI;
      c_error(&b_st, message(&b_st, d_y, e_y, &c_emlrtMCI), &c_emlrtMCI);
    }
    break;

   case UsrpDriverRxBusy:
    st.site = &gb_emlrtRSI;
    if (!(errStatus == UsrpDriverRxBusy)) {
    } else {
      f_y = NULL;
      m7 = emlrtCreateCharArray(2, iv21);
      for (i = 0; i < 28; i++) {
        cv38[i] = cv39[i];
      }

      emlrtInitCharArrayR2013a(&st, 28, m7, cv38);
      emlrtAssign(&f_y, m7);
      g_y = NULL;
      m7 = emlrtCreateCharArray(2, iv22);
      for (i = 0; i < 12; i++) {
        cv33[i] = cv34[i];
      }

      emlrtInitCharArrayR2013a(&st, 12, m7, cv33);
      emlrtAssign(&g_y, m7);
      b_st.site = &pb_emlrtRSI;
      c_error(&b_st, message(&b_st, f_y, g_y, &c_emlrtMCI), &c_emlrtMCI);
    }
    break;

   case UsrpDriverTxBusy:
    st.site = &fb_emlrtRSI;
    if (!(errStatus == UsrpDriverTxBusy)) {
    } else {
      h_y = NULL;
      m7 = emlrtCreateCharArray(2, iv23);
      for (i = 0; i < 28; i++) {
        cv38[i] = cv40[i];
      }

      emlrtInitCharArrayR2013a(&st, 28, m7, cv38);
      emlrtAssign(&h_y, m7);
      i_y = NULL;
      m7 = emlrtCreateCharArray(2, iv24);
      for (i = 0; i < 12; i++) {
        cv33[i] = cv34[i];
      }

      emlrtInitCharArrayR2013a(&st, 12, m7, cv33);
      emlrtAssign(&i_y, m7);
      b_st.site = &pb_emlrtRSI;
      c_error(&b_st, message(&b_st, h_y, i_y, &c_emlrtMCI), &c_emlrtMCI);
    }
    break;

   case UsrpDriverBusy:
    st.site = &eb_emlrtRSI;
    if (!(errStatus == UsrpDriverBusy)) {
    } else {
      j_y = NULL;
      m7 = emlrtCreateCharArray(2, iv25);
      for (i = 0; i < 26; i++) {
        cv41[i] = cv42[i];
      }

      emlrtInitCharArrayR2013a(&st, 26, m7, cv41);
      emlrtAssign(&j_y, m7);
      k_y = NULL;
      m7 = emlrtCreateCharArray(2, iv26);
      for (i = 0; i < 12; i++) {
        cv33[i] = cv34[i];
      }

      emlrtInitCharArrayR2013a(&st, 12, m7, cv33);
      emlrtAssign(&k_y, m7);
      b_st.site = &pb_emlrtRSI;
      c_error(&b_st, message(&b_st, j_y, k_y, &c_emlrtMCI), &c_emlrtMCI);
    }
    break;

   case UsrpDriverError:
    st.site = &db_emlrtRSI;
    if (!(errStatus == UsrpDriverError)) {
    } else {
      l_y = NULL;
      m7 = emlrtCreateCharArray(2, iv27);
      for (i = 0; i < 35; i++) {
        cv31[i] = cv43[i];
      }

      emlrtInitCharArrayR2013a(&st, 35, m7, cv31);
      emlrtAssign(&l_y, m7);
      u_size[0] = 1;
      u_size[1] = errMsg_size[1];
      i = errMsg_size[0] * errMsg_size[1];
      for (i10 = 0; i10 < i; i10++) {
        u_data[i10] = errMsg_data[i10];
      }

      m_y = NULL;
      m7 = emlrtCreateCharArray(2, u_size);
      emlrtInitCharArrayR2013a(&st, u_size[1], m7, (char_T *)u_data);
      emlrtAssign(&m_y, m7);
      b_st.site = &pb_emlrtRSI;
      c_error(&b_st, message(&b_st, l_y, m_y, &c_emlrtMCI), &c_emlrtMCI);
    }
    break;
  }
}