Fixed bug in channel estimation test

master
ismagom 10 years ago
parent 2b291be6b0
commit 561a2abd53

@ -104,6 +104,7 @@ int chest_ce_ref(chest_t *q, cf_t *input, uint32_t nslot, uint32_t port_id, uint
if (nref < q->refsignal[port_id][nslot].nof_refs) { if (nref < q->refsignal[port_id][nslot].nof_refs) {
fidx = q->refsignal[port_id][nslot].refs[nref].freq_idx; // reference frequency index fidx = q->refsignal[port_id][nslot].refs[nref].freq_idx; // reference frequency index
tidx = q->refsignal[port_id][nslot].refs[nref].time_idx; // reference time index tidx = q->refsignal[port_id][nslot].refs[nref].time_idx; // reference time index
known_ref = q->refsignal[port_id][nslot].refs[nref].simbol; known_ref = q->refsignal[port_id][nslot].refs[nref].simbol;
channel_ref = input[tidx * q->nof_re + fidx]; channel_ref = input[tidx * q->nof_re + fidx];
q->refsignal[port_id][nslot].refs[nref].recv_simbol = channel_ref; q->refsignal[port_id][nslot].refs[nref].recv_simbol = channel_ref;
@ -129,7 +130,7 @@ int chest_ce_ref(chest_t *q, cf_t *input, uint32_t nslot, uint32_t port_id, uint
* Saves the nof_prb * 12 * nof_symbols channel estimates in the array ce * Saves the nof_prb * 12 * nof_symbols channel estimates in the array ce
*/ */
int chest_ce_slot_port(chest_t *q, cf_t *input, cf_t *ce, uint32_t nslot, uint32_t port_id) { int chest_ce_slot_port(chest_t *q, cf_t *input, cf_t *ce, uint32_t nslot, uint32_t port_id) {
int i, j; uint32_t i, j;
cf_t x[2], y[MAX_NSYMB]; cf_t x[2], y[MAX_NSYMB];
int ret = LIBLTE_ERROR_INVALID_INPUTS; int ret = LIBLTE_ERROR_INVALID_INPUTS;
@ -228,7 +229,7 @@ int chest_init(chest_t *q, chest_interp_t interp, uint32_t nof_re, uint32_t nof_
int ret = LIBLTE_ERROR_INVALID_INPUTS; int ret = LIBLTE_ERROR_INVALID_INPUTS;
if (q != NULL && if (q != NULL &&
nof_ports < MAX_PORTS) nof_ports <= MAX_PORTS)
{ {
bzero(q, sizeof(chest_t)); bzero(q, sizeof(chest_t));

@ -123,9 +123,7 @@ int main(int argc, char **argv) {
int max_cid; int max_cid;
FILE *fmatlab = NULL; FILE *fmatlab = NULL;
float mse_mag, mse_phase; float mse_mag, mse_phase;
lte_cell_t cell;
cell.nof_ports = 1;
parse_args(argc,argv); parse_args(argc,argv);
if (output_matlab) { if (output_matlab) {
@ -172,6 +170,11 @@ int main(int argc, char **argv) {
for (n_slot=0;n_slot<NSLOTS_X_FRAME;n_slot++) { for (n_slot=0;n_slot<NSLOTS_X_FRAME;n_slot++) {
for (n_port=0;n_port<cell.nof_ports;n_port++) { for (n_port=0;n_port<cell.nof_ports;n_port++) {
if (refsignal_init_LTEDL(&refs, n_port, n_slot, cell)) {
fprintf(stderr, "Error initiating CRS slot=%d\n", i);
return -1;
}
bzero(input, sizeof(cf_t) * num_re); bzero(input, sizeof(cf_t) * num_re);
for (i=0;i<num_re;i++) { for (i=0;i<num_re;i++) {
input[i] = 0.5-rand()/RAND_MAX+I*(0.5-rand()/RAND_MAX); input[i] = 0.5-rand()/RAND_MAX+I*(0.5-rand()/RAND_MAX);

Loading…
Cancel
Save