Adjusted PSS find thresholds for loaded cells

master
ismagom 11 years ago
parent 67977f7974
commit ad004c58d8

@ -112,6 +112,7 @@ int cuhd_open(char *args, void **h)
std::string _args = std::string(args);
handler->usrp = uhd::usrp::multi_usrp::make(_args + ", master_clock_rate=30720000" + ", num_recv_frames=512");
// handler->usrp = uhd::usrp::multi_usrp::make(_args + ", master_clock_rate=50000000" + ", num_recv_frames=512");
handler->usrp->set_clock_source("internal");
std::string otw, cpu;

@ -52,7 +52,7 @@ uint32_t mcs_idx = 12;
int nof_frames = -1;
char *uhd_args = "";
float uhd_amp = 0.25, uhd_gain = 10.0, uhd_freq = 2400000000;
float uhd_amp = 0.01, uhd_gain = 10.0, uhd_freq = 2400000000;
filesink_t fsink;
lte_fft_t ifft;
@ -70,6 +70,7 @@ void usage(char *prog) {
printf("Usage: %s [agmfoncvp]\n", prog);
#ifndef DISABLE_UHD
printf("\t-a UHD args [Default %s]\n", uhd_args);
printf("\t-l UHD amplitude [Default %.2f]\n", uhd_amp);
printf("\t-g UHD TX gain [Default %.2f dB]\n", uhd_gain);
printf("\t-f UHD TX frequency [Default %.1f MHz]\n", uhd_freq / 1000000);
#else
@ -85,7 +86,7 @@ void usage(char *prog) {
void parse_args(int argc, char **argv) {
int opt;
while ((opt = getopt(argc, argv, "agfmoncpv")) != -1) {
while ((opt = getopt(argc, argv, "aglfmoncpv")) != -1) {
switch (opt) {
case 'a':
uhd_args = argv[optind];
@ -93,6 +94,9 @@ void parse_args(int argc, char **argv) {
case 'g':
uhd_gain = atof(argv[optind]);
break;
case 'l':
uhd_amp = atof(argv[optind]);
break;
case 'f':
uhd_freq = atof(argv[optind]);
break;

@ -99,7 +99,7 @@ void usage(prog_args_t *args, char *prog) {
void parse_args(prog_args_t *args, int argc, char **argv) {
int opt;
args_default(args);
while ((opt = getopt(argc, argv, "icagfndvtbp")) != -1) {
while ((opt = getopt(argc, argv, "icagfndvtbpr")) != -1) {
switch (opt) {
case 'i':
args->io_config.input_file_name = argv[optind];
@ -125,6 +125,9 @@ void parse_args(prog_args_t *args, int argc, char **argv) {
case 'n':
args->nof_subframes = atoi(argv[optind]);
break;
case 'r':
args->rnti= atoi(argv[optind]);
break;
case 'd':
args->disable_plots = true;
break;
@ -201,8 +204,9 @@ int main(int argc, char **argv) {
/* iodev_receive returns 1 if successfully read 1 aligned subframe */
if (ret == 0) {
printf("Finding PSS... Peak: %8.1f, Output level: %+.2f dB\r",
sync_get_peak_value(&iodev.sframe.s), 10*log10f(agc_get_gain(&iodev.sframe.agc)));
printf("Finding PSS... Peak: %8.1f, Output level: %+.2f dB FrameCnt: %d, State: %d\r",
sync_get_peak_value(&iodev.sframe.s), 20*log10f(agc_get_output_level(&iodev.sframe.agc)),
iodev.sframe.frame_total_cnt, iodev.sframe.state);
} else if (ret == 1) {
if (!ue_dl_initiated) {
if (iodev_isUSRP(&iodev)) {

@ -43,7 +43,7 @@
#include "liblte/phy/phch/dci.h"
#include "liblte/phy/phch/regs.h"
#define TDEC_ITERATIONS 6
#define TDEC_ITERATIONS 3
typedef _Complex float cf_t;

@ -60,19 +60,19 @@ static void update_threshold(ue_sync_t *q) {
if (symbol_sz > 0) {
switch (symbol_sz) {
case 128:
sync_set_threshold(&q->s, 20000, 2000);
sync_set_threshold(&q->s, 10000, 1000);
break;
case 256:
sync_set_threshold(&q->s, 25000, 2500);
sync_set_threshold(&q->s, 20000, 2000);
break;
case 512:
sync_set_threshold(&q->s, 38000, 3800);
sync_set_threshold(&q->s, 30000, 3000);
break;
case 1024:
sync_set_threshold(&q->s, 50000, 5000);
sync_set_threshold(&q->s, 40000, 4000);
break;
case 2048:
sync_set_threshold(&q->s, 80000, 4000);
sync_set_threshold(&q->s, 50000, 5000);
}
}
}
@ -318,13 +318,16 @@ static int mib_decoder_run(ue_sync_t *q) {
if (pbch_decode(&q->pbch, q->sf_symbols, q->ce, &q->mib) == 1) {
q->frame_number = q->mib.sfn;
q->cell.nof_ports = q->mib.nof_ports;
q->cell.nof_prb = q->mib.nof_prb;
if (!q->pbch_decoded) {
printf("\n\nMIB decoded:\n");
pbch_mib_fprint(stdout, &q->mib, q->cell.id);
if (q->change_srate) {
ret = update_srate(q);
if (q->cell.nof_prb != q->mib.nof_prb) {
q->cell.nof_prb = q->mib.nof_prb;
if (q->change_srate) {
ret = update_srate(q);
}
}
} else {
INFO("MIB decoded #%d SFN: %d\n", q->pbch_decoded, q->mib.sfn);

Loading…
Cancel
Save