Commit 63280328 authored by knopp's avatar knopp
Browse files

fixed initialization of rotation for symbol 0

parent b58ea809
......@@ -411,8 +411,11 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq) {
double tl=0,poff,exp_re,exp_im;
double Ncp,Ncpm1=Ncp0;
fp->symbol_rotation[0] = 32767;
fp->symbol_rotation[1] = 0;
poff = 2*M_PI*((Ncp0*Tc))*f0;
exp_re = cos(poff);
exp_im = sin(-poff);
fp->symbol_rotation[0]=(int16_t)floor(exp_re*32767);
fp->symbol_rotation[1]=(int16_t)floor(exp_im*32767);
LOG_I(PHY,"Doing symbol rotation calculation for gNB TX/RX, f0 %f Hz, Nsymb %d\n",f0,nsymb);
LOG_I(PHY,"Symbol rotation %d/%d => (%d,%d)\n",0,nsymb,fp->symbol_rotation[0],fp->symbol_rotation[1]);
for (int l=1;l<nsymb;l++) {
......
......@@ -488,9 +488,9 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
rxdataF[symbol * frame_parms->ofdm_symbol_size] = 0;
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation)[symbol+symb_offset];
uint32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation)[symbol+symb_offset];
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1];
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symbol_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]);
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",Ns,symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]);
rotate_cpx_vector((int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
(int16_t*)&rot2,
(int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
......
......@@ -926,13 +926,16 @@ int main(int argc, char **argv)
start_meas(&gNB->phy_proc_rx);
phy_procedures_gNB_common_RX(gNB, frame, slot);
phy_procedures_gNB_uespec_RX(gNB, frame, slot);
if (n_trials==1 && round==0) {
LOG_M("rxsig0.m","rx0",&gNB->common_vars.rxdata[0][slot_offset],slot_length,1,1);
LOG_M("rxsigF0.m","rxsF0",gNB->common_vars.rxdataF[0]+start_symbol*frame_parms->ofdm_symbol_size,nb_symb_sch*frame_parms->ofdm_symbol_size,1,1);
}
phy_procedures_gNB_uespec_RX(gNB, frame, slot);
if (n_trials == 1 && round==0) {
#ifdef __AVX2__
int off = ((nb_rb&1) == 1)? 4:0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment