Commit de263d4a authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/fft_size_fix_3072' into integration_2024_w15

parents a22eccc0 47d1f8bb
......@@ -934,38 +934,8 @@ void freq2time(uint16_t ofdm_symbol_size,
int16_t *freq_signal,
int16_t *time_signal)
{
switch (ofdm_symbol_size) {
case 128:
idft(IDFT_128, freq_signal, time_signal, 1);
break;
case 256:
idft(IDFT_256, freq_signal, time_signal, 1);
break;
case 512:
idft(IDFT_512, freq_signal, time_signal, 1);
break;
case 1024:
idft(IDFT_1024, freq_signal, time_signal, 1);
break;
case 1536:
idft(IDFT_1536, freq_signal, time_signal, 1);
break;
case 2048:
idft(IDFT_2048, freq_signal, time_signal, 1);
break;
case 4096:
idft(IDFT_4096, freq_signal, time_signal, 1);
break;
case 6144:
idft(IDFT_6144, freq_signal, time_signal, 1);
break;
case 8192:
idft(IDFT_8192, freq_signal, time_signal, 1);
break;
default:
AssertFatal (1 == 0, "Invalid ofdm_symbol_size %i\n", ofdm_symbol_size);
break;
}
const idft_size_idx_t idft_size = get_idft(ofdm_symbol_size);
idft(idft_size, freq_signal, time_signal, 1);
}
void nr_est_delay(int ofdm_symbol_size, const c16_t *ls_est, c16_t *ch_estimates_time, delay_t *delay)
......
......@@ -139,61 +139,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
volatile int *output_ptr=(int*)0;
int *temp_ptr=(int*)0;
idft_size_idx_t idftsize;
switch (fftsize) {
case 128:
idftsize = IDFT_128;
break;
case 256:
idftsize = IDFT_256;
break;
case 512:
idftsize = IDFT_512;
break;
case 768:
idftsize = IDFT_768;
break;
case 1024:
idftsize = IDFT_1024;
break;
case 1536:
idftsize = IDFT_1536;
break;
case 2048:
idftsize = IDFT_2048;
break;
case 3072:
idftsize = IDFT_3072;
break;
case 4096:
idftsize = IDFT_4096;
break;
case 6144:
idftsize= IDFT_6144;
break;
case 12288:
idftsize= IDFT_12288;
break;
case 24576:
idftsize= IDFT_24576;
break;
default:
idftsize = IDFT_512;
break;
}
idft_size_idx_t idft_size = get_idft(fftsize);
#ifdef DEBUG_OFDM_MOD
printf("[PHY] OFDM mod (size %d,prefix %d) Symbols %d, input %p, output %p\n",
......@@ -209,9 +155,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
#endif
// on AVX2 need 256-bit alignment
idft(idftsize,(int16_t *)&input[i*fftsize],
(int16_t *)temp,
1);
idft(idft_size, (int16_t *)&input[i * fftsize], (int16_t *)temp, 1);
// Copy to frame buffer with Cyclic Extension
// Note: will have to adjust for synchronization offset!
......
......@@ -479,86 +479,10 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
if(second_half > 0)
memcpy((int16_t *)&chF_interpol[rxAnt][0], &ch_tmp[first_half << 1], second_half * sizeof(int32_t));
// Time domain IMPULSE response
idft_size_idx_t idftsizeidx;
switch (NR_PRS_IDFT_OVERSAMP_FACTOR*frame_params->ofdm_symbol_size) {
case 128:
idftsizeidx = IDFT_128;
break;
case 256:
idftsizeidx = IDFT_256;
break;
case 512:
idftsizeidx = IDFT_512;
break;
case 768:
idftsizeidx = IDFT_768;
break;
case 1024:
idftsizeidx = IDFT_1024;
break;
case 1536:
idftsizeidx = IDFT_1536;
break;
case 2048:
idftsizeidx = IDFT_2048;
break;
case 3072:
idftsizeidx = IDFT_3072;
break;
case 4096:
idftsizeidx = IDFT_4096;
break;
case 6144:
idftsizeidx = IDFT_6144;
break;
// 16x IDFT oversampling
case 8192:
idftsizeidx = IDFT_8192;
break;
case 12288:
idftsizeidx = IDFT_12288;
break;
case 16384:
idftsizeidx = IDFT_16384;
break;
case 24576:
idftsizeidx = IDFT_24576;
break;
case 32768:
idftsizeidx = IDFT_32768;
break;
case 49152:
idftsizeidx = IDFT_49152;
break;
case 65536:
idftsizeidx = IDFT_65536;
break;
default:
LOG_I(PHY, "%s: unsupported ofdm symbol size \n", __FUNCTION__);
assert(0);
}
idft(idftsizeidx,
// Convert to time domain
freq2time(NR_PRS_IDFT_OVERSAMP_FACTOR * frame_params->ofdm_symbol_size,
(int16_t *)&chF_interpol[rxAnt][0],
(int16_t *)&chT_interpol[rxAnt][0],1);
(int16_t *)&chT_interpol[rxAnt][0]);
// peak estimator
mean_val = squaredMod(((c16_t *)ch_tmp)[(prs_cfg->NumRB * 12) >> 1]);
......@@ -785,53 +709,6 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
break;
}
idft_size_idx_t idftsizeidx;
switch (ue->frame_parms.ofdm_symbol_size) {
case 128:
idftsizeidx = IDFT_128;
break;
case 256:
idftsizeidx = IDFT_256;
break;
case 512:
idftsizeidx = IDFT_512;
break;
case 768:
idftsizeidx = IDFT_768;
break;
case 1024:
idftsizeidx = IDFT_1024;
break;
case 1536:
idftsizeidx = IDFT_1536;
break;
case 2048:
idftsizeidx = IDFT_2048;
break;
case 3072:
idftsizeidx = IDFT_3072;
break;
case 4096:
idftsizeidx = IDFT_4096;
break;
case 6144:
idftsizeidx = IDFT_6144;
break;
default:
printf("unsupported ofdm symbol size \n");
assert(0);
}
// generate pilot
// Note: pilot returned by the following function is already the complex conjugate of the transmitted DMRS
......@@ -926,10 +803,9 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
{
// do ifft of channel estimate
LOG_D(PHY,"Channel Impulse Computation Slot %d Symbol %d ch_offset %d\n", Ns, symbol, ch_offset);
idft(idftsizeidx,
(int16_t*) &dl_ch_estimates[aarx][ch_offset],
(int16_t*) dl_ch_estimates_time[aarx],
1);
freq2time(ue->frame_parms.ofdm_symbol_size,
(int16_t *)&dl_ch_estimates[aarx][ch_offset],
(int16_t *)&dl_ch_estimates_time[aarx]);
}
}
......
......@@ -679,14 +679,20 @@ idft_size_idx_t get_idft(int ofdm_symbol_size)
return IDFT_9216;
case 12288:
return IDFT_12288;
case 16384:
return IDFT_16384;
case 18432:
return IDFT_18432;
case 24576:
return IDFT_24576;
case 32768:
return IDFT_32768;
case 36864:
return IDFT_36864;
case 49152:
return IDFT_49152;
case 65536:
return IDFT_65536;
case 73728:
return IDFT_73728;
case 98304:
......
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