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); 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=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"); handler->usrp->set_clock_source("internal");
std::string otw, cpu; std::string otw, cpu;

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

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

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

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

Loading…
Cancel
Save