Ejemplo n.º 1
0
/**@ingroup gen_modulator
 *
 * \param modulation Choose between 0: BPŜK, 1: QPSK, 2: QAM16 or 3: QAM64. Default is BPSK.
 */
int initialize() {

	modulation_id = param_id("modulation");
	if (!modulation_id) {
		modinfo("Parameter modulation not configured. Setting to BPSK\n");
		modulation = BPSK;
	}

	set_BPSKtable();
	set_QPSKtable();
	set_16QAMtable();
	set_64QAMtable();

	return 0;
}
Ejemplo n.º 2
0
int srslte_modem_table_lte(srslte_modem_table_t* q, srslte_mod_t modulation) {
  srslte_modem_table_init(q);
  switch(modulation) {
  case SRSLTE_MOD_LAST:
  case SRSLTE_MOD_BPSK:
    q->nbits_x_symbol = 1;
    q->nsymbols = 2;
    if (table_create(q)) {
      return SRSLTE_ERROR;
    }
    set_BPSKtable(q->symbol_table);
    break;
  case SRSLTE_MOD_QPSK:
    q->nbits_x_symbol = 2;
    q->nsymbols = 4;
    if (table_create(q)) {
      return SRSLTE_ERROR;
    }
    set_QPSKtable(q->symbol_table);
    break;
  case SRSLTE_MOD_16QAM:
    q->nbits_x_symbol = 4;
    q->nsymbols = 16;
    if (table_create(q)) {
      return SRSLTE_ERROR;
    }
    set_16QAMtable(q->symbol_table);
    break;
  case SRSLTE_MOD_64QAM:
    q->nbits_x_symbol = 6;
    q->nsymbols = 64;
    if (table_create(q)) {
      return SRSLTE_ERROR;
    }
    set_64QAMtable(q->symbol_table);
    break;
  }
  return SRSLTE_SUCCESS;
}
Ejemplo n.º 3
0
int modem_table_std(modem_table_t* q, enum modem_std  std, bool compute_soft_demod) {
	switch(std) {
	case LTE_BPSK:
		q->nbits_x_symbol = 1;
		q->nsymbols = 2;
		if (table_create(q)) {
			return -1;
		}
		set_BPSKtable(q->symbol_table, &q->soft_table, compute_soft_demod);
		break;
	case LTE_QPSK:
		q->nbits_x_symbol = 2;
		q->nsymbols = 4;
		if (table_create(q)) {
			return -1;
		}
		set_QPSKtable(q->symbol_table, &q->soft_table, compute_soft_demod);
		break;
	case LTE_QAM16:
		q->nbits_x_symbol = 4;
		q->nsymbols = 16;
		if (table_create(q)) {
			return -1;
		}
		set_16QAMtable(q->symbol_table, &q->soft_table, compute_soft_demod);
		break;
	case LTE_QAM64:
		q->nbits_x_symbol = 6;
		q->nsymbols = 64;
		if (table_create(q)) {
			return -1;
		}
		set_64QAMtable(q->symbol_table, &q->soft_table, compute_soft_demod);
		break;
	}
	return 0;
}
Ejemplo n.º 4
0
int srslte_modem_table_lte(srslte_modem_table_t* q, srslte_mod_t modulation, bool compute_soft_demod) {
  switch(modulation) {
  case SRSLTE_MOD_BPSK:
    q->nbits_x_symbol = 1;
    q->nsymbols = 2;
    if (table_create(q)) {
      return SRSLTE_ERROR;
    }
    set_BPSKtable(q->symbol_table, &q->soft_table, compute_soft_demod);
    break;
  case SRSLTE_MOD_QPSK:
    q->nbits_x_symbol = 2;
    q->nsymbols = 4;
    if (table_create(q)) {
      return SRSLTE_ERROR;
    }
    set_QPSKtable(q->symbol_table, &q->soft_table, compute_soft_demod);
    break;
  case SRSLTE_MOD_16QAM:
    q->nbits_x_symbol = 4;
    q->nsymbols = 16;
    if (table_create(q)) {
      return SRSLTE_ERROR;
    }
    set_16QAMtable(q->symbol_table, &q->soft_table, compute_soft_demod);
    break;
  case SRSLTE_MOD_64QAM:
    q->nbits_x_symbol = 6;
    q->nsymbols = 64;
    if (table_create(q)) {
      return SRSLTE_ERROR;
    }
    set_64QAMtable(q->symbol_table, &q->soft_table, compute_soft_demod);
    break;
  }
  return SRSLTE_SUCCESS;
}