Merge remote-tracking branch 'origin/develop' into NR_2port_CSIRS
This commit is contained in:
@@ -582,7 +582,6 @@ void *trx_usrp_write_thread(void * arg){
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_USRP_SEND_RETURN, ret );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_THREAD, 0 );
|
||||
|
||||
if(0) break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -645,7 +644,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
rxshift=2;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Shouldn't be here\n");
|
||||
AssertFatal(1==0,"Shouldn't be here\n");
|
||||
}
|
||||
|
||||
samples_received=0;
|
||||
@@ -1259,7 +1258,7 @@ extern "C" {
|
||||
gain - gain_range.stop());
|
||||
gain=gain_range.stop();
|
||||
}
|
||||
|
||||
|
||||
s->usrp->set_rx_gain(gain,i);
|
||||
LOG_I(HW,"RX Gain %d %f (%f) => %f (max %f)\n",i,
|
||||
openair0_cfg[0].rx_gain[i],openair0_cfg[0].rx_gain_offset[i],
|
||||
@@ -1301,12 +1300,12 @@ extern "C" {
|
||||
|
||||
LOG_I(HW,"rx_max_num_samps %zu\n",
|
||||
s->usrp->get_rx_stream(stream_args_rx)->get_max_num_samps());
|
||||
|
||||
|
||||
for (int i = 0; i<openair0_cfg[0].rx_num_channels; i++) {
|
||||
LOG_I(HW,"setting rx channel %d\n",i);
|
||||
stream_args_rx.channels.push_back(i);
|
||||
}
|
||||
|
||||
|
||||
s->rx_stream = s->usrp->get_rx_stream(stream_args_rx);
|
||||
uhd::stream_args_t stream_args_tx("sc16", "sc16");
|
||||
|
||||
|
||||
@@ -618,8 +618,8 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, int nsamps_for_initi
|
||||
}
|
||||
|
||||
static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, void **samplesVoid, int nsamps, int nbAnt) {
|
||||
if (nbAnt != 1) {
|
||||
LOG_W(HW, "rfsimulator: only 1 antenna tested\n");
|
||||
if (nbAnt > 4) {
|
||||
LOG_W(HW, "rfsimulator: only 4 antenna tested\n");
|
||||
}
|
||||
|
||||
rfsimulator_state_t *t = device->priv;
|
||||
@@ -736,14 +736,19 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest
|
||||
CirSize
|
||||
);
|
||||
else { // no channel modeling
|
||||
double H_awgn_mimo[4][4] ={{1.0, 0.5, 0.25, 0.125},//rx 0
|
||||
{0.5, 1.0, 0.5, 0.25}, //rx 1
|
||||
{0.25, 0.5, 1.0, 0.5}, //rx 2
|
||||
{0.125, 0.25, 0.5, 1.0}};//rx 3
|
||||
|
||||
sample_t *out=(sample_t *)samplesVoid[a];
|
||||
int nbAnt_tx = ptr->th.nbAnt;//number of Tx antennas
|
||||
|
||||
//LOG_I(HW, "nbAnt_tx %d\n",nbAnt_tx);
|
||||
for (int i=0; i < nsamps; i++) {//loop over nsamps
|
||||
for (int a_tx=0; a_tx<nbAnt_tx; a_tx++) { //sum up signals from nbAnt_tx antennas
|
||||
out[i].r+=ptr->circularBuf[((t->nextTimestamp+i)*nbAnt_tx+a_tx)%CirSize].r;
|
||||
out[i].i+=ptr->circularBuf[((t->nextTimestamp+i)*nbAnt_tx+a_tx)%CirSize].i;
|
||||
out[i].r += (short)(ptr->circularBuf[((t->nextTimestamp+i)*nbAnt_tx+a_tx)%CirSize].r*H_awgn_mimo[a][a_tx]);
|
||||
out[i].i += (short)(ptr->circularBuf[((t->nextTimestamp+i)*nbAnt_tx+a_tx)%CirSize].i*H_awgn_mimo[a][a_tx]);
|
||||
} // end for a_tx
|
||||
} // end for i (number of samps)
|
||||
} // end of no channel modeling
|
||||
|
||||
Reference in New Issue
Block a user