您好,
我使用的是:D:\zj\AutomotiveToolbox\mmwave_industrial_toolbox_4_1_0\labs\people_counting\68xx_3D_people_counting
1.我在这个demo的静杂波滤除函数中,他把所有的数据都加和了一遍, 在后续的相减过程中并未除以一帧的chirp数以得到平均数,我认为是需要得到平均数再相减,但是我并未找到相关的操作。
2.还有我看到
ftemp = _rcpsp((float)nChirps); ftemp = ftemp * (2.f - (float)nChirps * ftemp); ftemp = ftemp * (2.f - (float)nChirps * ftemp);这里面的第一行代码似乎取了chirp数的倒数,但是后面并未用到该变量。
我有这两个问题,希望可以得到解答。
void RADARDEMO_aoaEst2DCaponBF_clutterRemoval(
IN int32_t nRxAnt,
IN int32_t nChirps,
IN cplx16_t * inputAntSamples,
OUT cplx16_t * outputAntSamples,
OUT cplxf_t * static_information)
{
#ifdef RADARDEMO_AOARADARCUDE_RNGCHIRPANT
int32_t antIdx, chirpIdx;
cplx16_t * RESTRICT input1;
cplx16_t * RESTRICT input2;
cplx16_t * RESTRICT input3;
cplx16_t * RESTRICT input4;
int64_t * RESTRICT output1;
int64_t * RESTRICT output2;
int64_t * RESTRICT output3;
int64_t * RESTRICT output4;
int64_t llinput1, llinput2;
__float2_t acc1, acc2, acc3, acc4, scale2;//scale2=0
int32_t itemp1,itemp2;
float ftemp;
int64_t mean12, mean34;
int64_t intAcc;
#ifdef _TMS320C6X
_nassert(nRxAnt %4 == 0);
_nassert(nChirps %8 == 0);
#endif
ftemp = _rcpsp((float)nChirps);
ftemp = ftemp * (2.f - (float)nChirps * ftemp);
ftemp = ftemp * (2.f - (float)nChirps * ftemp);
//这几步不知道在干嘛,只知道输出的数是0.01041666左右的数
//这一行不懂,好像是把一个float拼成一个2float
for (antIdx = 0; antIdx < nRxAnt; antIdx += 4)
{
input1 = (cplx16_t *) &inputAntSamples[antIdx];
input2 = (cplx16_t *) &inputAntSamples[antIdx + nRxAnt * (nChirps >> 1)];
input3 = (cplx16_t *) &inputAntSamples[antIdx + 2];
input4 = (cplx16_t *) &inputAntSamples[(antIdx + 2) + nRxAnt * (nChirps >> 1)];
acc1 = _ftof2(0.f, 0.f);
acc2 = _ftof2(0.f, 0.f);
acc3 = _ftof2(0.f, 0.f);
acc4 = _ftof2(0.f, 0.f);
for (chirpIdx = 0; chirpIdx < nRxAnt * (nChirps >> 1); chirpIdx += nRxAnt)//0开始,每次加12,加到564,共计96/2=48次
{
intAcc = _dsadd2(_amem8(&input1[chirpIdx]), _amem8(&input2[chirpIdx]));//amem8取8个byte,也就是32位,dsadd2把有符号位相加,64位
acc1 = _daddsp(acc1, _dinthsp(_loll(intAcc)));//32位
acc2 = _daddsp(acc2, _dinthsp(_hill(intAcc)));//32位
intAcc = _dsadd2(_amem8(&input3[chirpIdx]), _amem8(&input4[chirpIdx]));
acc3 = _daddsp(acc3, _dinthsp(_loll(intAcc)));
acc4 = _daddsp(acc4, _dinthsp(_hill(intAcc)));
}
//保留静态信息
acc1 = _dmpysp(acc1, scale2);
_amem8_f2(static_information++) = acc1;
acc2 = _dmpysp(acc2, scale2);
_amem8_f2(static_information++) = acc2;
acc3 = _dmpysp(acc3, scale2);
_amem8_f2(static_information++) = acc3;
acc4 = _dmpysp(acc4, scale2);
_amem8_f2(static_information++) = acc4;
itemp1 = _dspinth(acc1);
itemp2 = _dspinth(acc2);
mean12 = _itoll(itemp2,itemp1);
itemp1 = _dspinth(acc3);
itemp2 = _dspinth(acc4);
mean34 = _itoll(itemp2,itemp1);
input1 = (cplx16_t *) &inputAntSamples[antIdx];//0,4,8
input2 = (cplx16_t *) &inputAntSamples[antIdx + nRxAnt];//12,16,20
output1 = (int64_t *)&outputAntSamples[antIdx * nChirps];
output2 = (int64_t *)&outputAntSamples[(antIdx + 1) * nChirps];
output3 = (int64_t *)&outputAntSamples[(antIdx + 2) * nChirps];
output4 = (int64_t *)&outputAntSamples[(antIdx + 3) * nChirps];
for (chirpIdx = 0; chirpIdx < nRxAnt * nChirps ; chirpIdx += 2 * nRxAnt)//从0开始,每次加24,一共加48次
{
llinput1 = _dssub2(_amem8(&input1[chirpIdx]), mean12);//减法
llinput2 = _dssub2(_amem8(&input2[chirpIdx]), mean12);
_amem8(output1++) = _itoll(_loll(llinput2), _loll(llinput1));
_amem8(output2++) = _itoll(_hill(llinput2), _hill(llinput1));
llinput1 = _dssub2(_amem8(&input1[chirpIdx+2]), mean34);
llinput2 = _dssub2(_amem8(&input2[chirpIdx+2]), mean34);
_amem8(output3++) = _itoll(_loll(llinput2), _loll(llinput1));
_amem8(output4++) = _itoll(_hill(llinput2), _hill(llinput1));
}
}
#endif
