Commit 9efe4187 authored by rmagueta's avatar rmagueta

Fix preamble sequence

parent 27f0414e
......@@ -681,7 +681,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
preamble_shift -= NCS;
if (preamble_shift < 0)
preamble_shift+=N_ZC;
preamble_shift+=((N_ZC/NCS)*NCS);
}
} else { // This is the high-speed case
new_dft = 0;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -127,6 +127,8 @@ void compute_nr_prach_seq(uint8_t short_sequence,
LOG_D( PHY, "compute_prach_seq: done init prach_tables\n" );
int16_t *x_u_time = calloc(1, sizeof(int32_t)*N_ZC);
for (i=0; i<num_sequences; i++) {
int index = (rootSequenceIndex+i) % (N_ZC-1);
......@@ -147,11 +149,32 @@ void compute_nr_prach_seq(uint8_t short_sequence,
// for the unrestricted case X_u[0] is the first root indicated by the rootSequenceIndex
for (k=0; k<N_ZC; k++) {
// multiply by inverse of 2 (required since ru is exp[j 2\pi n])
X_u[i][k] = ((uint32_t*)nr_ru)[(((k*(1+(inv_u*k)))%N_ZC)*nr_ZC_inv[2])%N_ZC];
int nr_ru_index = N_ZC*((u*k*(k+1)+(N_ZC<<1)-1)/(N_ZC<<1))-((u*k*(k+1))>>1);
x_u_time[k<<1] = (int16_t)nr_ru[nr_ru_index<<1];
x_u_time[1+(k<<1)] = (int16_t)nr_ru[1+(nr_ru_index<<1)];
}
int16_t *x_u_freq = (int16_t*)X_u[i];
bzero(x_u_freq,sizeof(int32_t)*N_ZC);
for (int line=0; line<N_ZC; line++) {
for (int col=0; col<N_ZC; col++) {
int32_t re = x_u_time[col<<1]*prach_fft139_re[col][line] - x_u_time[1+(col<<1)]*prach_fft139_im[col][line];
int32_t im = x_u_time[col<<1]*prach_fft139_im[col][line] + x_u_time[1+(col<<1)]*prach_fft139_re[col][line];
x_u_freq[line<<1] = x_u_freq[line<<1] + (re>>19);
x_u_freq[1+(line<<1)] = x_u_freq[1+(line<<1)] + (im>>19);
}
}
#ifdef PRACH_DEBUG
for (k=0; k<N_ZC; k++) {
LOG_I(NR_PHY," x_u_time[%i][%i] = (%i) + (%i)i\n", i,k, x_u_time[k<<1],x_u_time[1+(k<<1)]);
}
for (k=0; k<N_ZC; k++) {
LOG_I(NR_PHY," x_u_freq[%i][%i] = (%i) + (%i)i\n", i,k, (int16_t)X_u[i][k],(int16_t)(X_u[i][k]>>16));
}
#endif
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_COMPUTE_PRACH, VCD_FUNCTION_OUT);
}
......
......@@ -523,9 +523,9 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
} else {
LOG_I(NR_MAC,"[RAPROC] RA-Msg3 received\n");
LOG_I(NR_MAC,"[RAPROC] Received Msg3:\n");
LOG_D(NR_MAC,"[RAPROC] Received Msg3:\n");
for (int k = 0; k < sdu_lenP; k++) {
LOG_I(NR_MAC,"(%i): 0x%x\n",k,sduP[k]);
LOG_D(NR_MAC,"(%i): 0x%x\n",k,sduP[k]);
}
// UE Contention Resolution Identity
......
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