Added SSS disable option to sync

master
ismagom 11 years ago
parent b78c8bde4f
commit e1334ff028

@ -61,6 +61,7 @@ typedef struct {
float cfo;
lte_cp_t cp;
bool detect_cp;
bool sss_en;
}sync_t;
@ -81,6 +82,9 @@ void sync_pss_det_peak_to_avg(sync_t *q);
void sync_force_N_id_2(sync_t *q, int force_N_id_2);
/* Forces the synchronizer to skip CP detection (useful for tracking mode) */
void sync_force_cp(sync_t *q, lte_cp_t cp);
/* Enables/Disables SSS detection (useful for tracking mode) */
void sync_sss_en(sync_t *q, bool enabled);
/* Gets the slot id (0 or 10) */
int sync_get_slot_id(sync_t *q);

@ -94,6 +94,10 @@ void sync_force_cp(sync_t *q, lte_cp_t cp) {
q->detect_cp = false;
}
void sync_sss_en(sync_t *q, bool enabled) {
q->sss_en = enabled;
}
int sync_get_cell_id(sync_t *q) {
if (q->N_id_1 >=0 && q->N_id_2 >= 0) {
return q->N_id_1*3 + q->N_id_2;
@ -179,6 +183,8 @@ int sync_run(sync_t *q, cf_t *input) {
INFO("PSS peak detected N_id_2=%d, pos=%d peak=%.2f par=%.2f th=%.2f cfo=%.4f\n", N_id_2,
peak_pos[N_id_2], peak_value[N_id_2], q->peak_to_avg, q->threshold, q->cfo);
if (q->sss_en) {
/* Make sure we have enough room to find SSS sequence */
sss_idx_n = peak_pos[N_id_2]-2*(128+CP(128,CPNORM_LEN));
sss_idx_e = peak_pos[N_id_2]-2*(128+CP(128,CPEXT_LEN));
@ -233,8 +239,11 @@ int sync_run(sync_t *q, cf_t *input) {
q->N_id_1 = N_id_1_n;
}
q->N_id_2 = N_id_2;
INFO("SSS detected N_id_1=%d, slot_idx=%d, %s CP\n",
q->N_id_1, q->slot_id, CP_ISNORM(q->cp)?"Normal":"Extended");
}
return peak_pos[N_id_2];
} else {

Loading…
Cancel
Save