This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IWR1642: Zoom FFT

Part Number: IWR1642

Hi,

I am trying to understand below code from RADARDEMO_highAccuRangeProc_priv.c, line 267. Below lines of code is finding fine peak. At present zoom FFT size is 512*512. I wanted to modify zoom FFT size (e.g 512*32 or 1024*64 etc), but unable to understand below logic. Can anyone help in understanding below logic.

for( i = zoomStartInd; i < zoomEndInd; i++)
{
for( j = 0; j < (int32_t)highAccuRangeHandle->fft1DSize; j ++)
{
tempFineSearchIdx = j;
sigAcc = _ftof2(0.f, 0.f);
tempCoarseSearchIdx = 0;
#ifdef _TMS320C6X
#pragma UNROLL(2);
#endif
for( k = 0; k < (int32_t)highAccuRangeHandle->nSamplesPerChirp; k ++)
{
#if 0
tempIndFine1 = tempFineSearchIdx & indMask;
tempIndFine2 = tempFineSearchIdx >> shift;
tempFineSearchIdx += j;
tempIndCoarse = tempCoarseSearchIdx & indMask;
tempCoarseSearchIdx += i;

f2input = _amem8_f2(&inputPtr[k]);
wncoarse = _amem8_f2(&wncPtr[tempIndCoarse]);
wnfine1 = _amem8_f2(&wnfPtr[tempIndFine1]);
wnfine2 = _amem8_f2(&wncPtr[tempIndFine2]);

f2temp = _complex_mpysp(f2input, wnfine1);
f2temp = _complex_mpysp(f2temp, wnfine2);
f2temp = _complex_mpysp(f2temp, wncoarse);
sigAcc = _daddsp(sigAcc, f2temp);
#else
tempIndFine1 = tempFineSearchIdx & indMask; // 0 & 511 0
tempIndFine2 = tempFineSearchIdx >> shift; // 0 >> 8 0
tempFineSearchIdx += j; // 0
tempIndCoarse = (tempCoarseSearchIdx + tempIndFine2) & indMask; // (0+0) & 511
tempCoarseSearchIdx += i; // 18

f2input = _amem8_f2(&inputPtr[k]);
wncoarse = _amem8_f2(&wncPtr[tempIndCoarse]);
wnfine1 = _amem8_f2(&wnfPtr[tempIndFine1]);

f2temp = _complex_mpysp(f2input, wnfine1);
f2temp = _complex_mpysp(f2temp, wncoarse);
sigAcc = _daddsp(sigAcc, f2temp);
#endif
}
prevP = currP;
f2temp = _dmpysp(sigAcc,sigAcc);
ftemp = _hif2(f2temp) + _lof2(f2temp);
currP = ftemp;
if( max < ftemp)
{
max = ftemp;
fineRangeInd = itemp;
maxPrevP = prevP;
}
if(itemp == fineRangeInd + 1)
maxNextP = currP;
itemp++;
}
}

Thanks,

Akshay