Decreased ue_sync tracking threshold

master
ismagom 10 years ago
parent 204fa85144
commit f6e4aa18c8

@ -45,6 +45,7 @@ typedef struct LIBLTE_API{
float gain_quant; float gain_quant;
uint32_t poly[3]; uint32_t poly[3];
int (*decode) (void*, uint8_t*, uint8_t*, uint32_t); int (*decode) (void*, uint8_t*, uint8_t*, uint32_t);
int (*decode_f) (void*, float*, uint8_t*, uint32_t);
void (*free) (void*); void (*free) (void*);
uint8_t *tmp; uint8_t *tmp;
uint8_t *symbols_uc; uint8_t *symbols_uc;

@ -96,6 +96,7 @@ int decode39(void *o, uint8_t *symbols, uint8_t *data, uint32_t frame_length) {
return q->framebits; return q->framebits;
} }
void free37(void *o) { void free37(void *o) {
viterbi_t *q = o; viterbi_t *q = o;
if (q->symbols_uc) { if (q->symbols_uc) {
@ -123,6 +124,7 @@ int init37(viterbi_t *q, uint32_t poly[3], uint32_t framebits, bool tail_biting)
q->tail_biting = tail_biting; q->tail_biting = tail_biting;
q->decode = decode37; q->decode = decode37;
q->free = free37; q->free = free37;
q->decode_f = NULL;
q->symbols_uc = malloc(3 * (q->framebits + q->K - 1) * sizeof(uint8_t)); q->symbols_uc = malloc(3 * (q->framebits + q->K - 1) * sizeof(uint8_t));
if (!q->symbols_uc) { if (!q->symbols_uc) {
perror("malloc"); perror("malloc");
@ -156,6 +158,7 @@ int init39(viterbi_t *q, uint32_t poly[3], uint32_t framebits, bool tail_biting)
q->gain_quant = 32; q->gain_quant = 32;
q->decode = decode39; q->decode = decode39;
q->free = free39; q->free = free39;
q->decode_f = NULL;
if (q->tail_biting) { if (q->tail_biting) {
fprintf(stderr, fprintf(stderr,
"Error: Tailbitting not supported in 1/3 K=9 decoder\n"); "Error: Tailbitting not supported in 1/3 K=9 decoder\n");
@ -175,6 +178,8 @@ int init39(viterbi_t *q, uint32_t poly[3], uint32_t framebits, bool tail_biting)
} }
} }
void viterbi_set_gain_quant(viterbi_t *q, float gain_quant) { void viterbi_set_gain_quant(viterbi_t *q, float gain_quant) {
q->gain_quant = gain_quant; q->gain_quant = gain_quant;
} }
@ -212,8 +217,14 @@ int viterbi_decode_f(viterbi_t *q, float *symbols, uint8_t *data, uint32_t frame
} else { } else {
len = 3 * (frame_length + q->K - 1); len = 3 * (frame_length + q->K - 1);
} }
if (!q->decode_f) {
vec_quant_fuc(symbols, q->symbols_uc, q->gain_quant, 127.5, 255, len); vec_quant_fuc(symbols, q->symbols_uc, q->gain_quant, 127.5, 255, len);
return q->decode(q, q->symbols_uc, data, frame_length); return q->decode(q, q->symbols_uc, data, frame_length);
} else {
return q->decode_f(q, symbols, data, frame_length);
}
} }
int viterbi_decode_uc(viterbi_t *q, uint8_t *symbols, uint8_t *data, int viterbi_decode_uc(viterbi_t *q, uint8_t *symbols, uint8_t *data,

@ -119,7 +119,7 @@ int ue_sync_init(ue_sync_t *q,
sync_set_em_alpha(&q->sfind, 1); sync_set_em_alpha(&q->sfind, 1);
q->nof_avg_find_frames = 1; q->nof_avg_find_frames = 1;
sync_set_threshold(&q->sfind, 2.0); sync_set_threshold(&q->sfind, 2.0);
sync_set_threshold(&q->strack, 6.0); sync_set_threshold(&q->strack, 1.4);
/* Correct CFO in the find state but not in the track state, since is called only /* Correct CFO in the find state but not in the track state, since is called only
* 1 every 5 subframes. Will do it in the ue_sync_get_buffer() function. * 1 every 5 subframes. Will do it in the ue_sync_get_buffer() function.

Loading…
Cancel
Save