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.

AWR1843: The deviation of DFT results by HWA

Part Number: AWR1843

HI,

  there is my configuration of HWA MULTIPLICATION DFT MODE:

  I create 512 adcsamples array,every element of the array is 1.it is like that [1+1j,1+1j,...1+1j ].there are 512*4bytes.My question is:for the first iteration,the sum is the same between HWA and PYTHON,but for the second or the third and so on,the sum is defferent.So,How can I do to make it the same at any iterations.

  DFT.docx

  

    hwaParamCfg[arrayIdx].triggerMode = HWA_TRIG_MODE_SOFTWARE;
    hwaParamCfg[arrayIdx].accelMode = HWA_ACCELMODE_FFT; //do FFT
    hwaParamCfg[arrayIdx].source.srcAddr = hwaMemAdcBufOffset;  /* 使用FFT数据的源地址,相对于MEM0的地址偏移 */
    hwaParamCfg[arrayIdx].source.srcAcnt = numAdcSamples-1;   /* 根据注释,这个值要填(采样点数 - 1),numAdcSamples = 512 */
    hwaParamCfg[arrayIdx].source.srcAIdx = sizeof(uint32_t);    /* 采样点的长度,使用复采样,固定为 4 bytes */
    hwaParamCfg[arrayIdx].source.srcBcnt = numAdcSamples - 1; /* 迭代次数,DFE公式中的K值 */
    hwaParamCfg[arrayIdx].source.srcBIdx = 0;            /*每次迭代从sample0开始*/
    hwaParamCfg[arrayIdx].source.srcShift = 0;
    hwaParamCfg[arrayIdx].source.srcCircShiftWrap = 0;
    hwaParamCfg[arrayIdx].source.srcRealComplex = HWA_SAMPLES_FORMAT_COMPLEX; /* ADC使用复采样,这里也将配置为复采样,ADC输入为一个32bit的数据,低地址/LSB为虚部(Q),高地址/MSB为实部(I) */
    hwaParamCfg[arrayIdx].source.srcWidth = HWA_SAMPLES_WIDTH_16BIT;          /* 复采样数据为 16-bit */
    hwaParamCfg[arrayIdx].source.srcSign = HWA_SAMPLES_SIGNED;                /* 复采样数据为有符号数 */
    hwaParamCfg[arrayIdx].source.srcConjugate = 0;                            /* non conjugate */
    hwaParamCfg[arrayIdx].source.srcScale = 8;                                /* 对于16bit输入,在MSB添加srcScale bit的0,在LSB添加(8-srcScale)个0,组成一个24bit的数据 */
    hwaParamCfg[arrayIdx].source.bpmEnable = 0;                               // TI内置的BPM不适用,因此在这里失能
    hwaParamCfg[arrayIdx].source.bpmPhase = 0;                                // TI内置的BPM不适用,因此在这里失能
    hwaParamCfg[arrayIdx].dest.dstAddr = hwaMemDestPingOffset;                /* MMW_HWA_1D_OUT_PING, 作为HWA的1D-FFT输出地址 */
    hwaParamCfg[arrayIdx].dest.dstAcnt = 4095;                      /* 实际使用的range_fft长度 - 1 */
    hwaParamCfg[arrayIdx].dest.dstRealComplex = HWA_SAMPLES_FORMAT_COMPLEX;   /* 使用复采样 */
    hwaParamCfg[arrayIdx].dest.dstWidth = HWA_SAMPLES_WIDTH_32BIT;            /* 输入信号宽度-16bit */
    hwaParamCfg[arrayIdx].dest.dstSign = HWA_SAMPLES_SIGNED;                  /* FFT输出为有符号数 */
    hwaParamCfg[arrayIdx].dest.dstConjugate = 0;                              /* no conjugate */
    hwaParamCfg[arrayIdx].dest.dstScale = 8;                                  /* 对于16bit输出,删除LSB方向的srcScale位,同时删除MSB方向的(8-srcScale)位,组成一个16bit的数据 */

    hwaParamCfg[arrayIdx].dest.dstSkipInit = 0;
    hwaParamCfg[arrayIdx].dest.dstAIdx = 8;                /*实部虚部一共占据8个字节*/;
    hwaParamCfg[arrayIdx].dest.dstBIdx = 8;                    /* dstBIdx设置参考radarCube */

    hwaParamCfg[arrayIdx].accelModeArgs.fftMode.fftEn = 0;

    hwaParamCfg[arrayIdx].accelModeArgs.fftMode.fftSize = 0;


    hwaParamCfg[arrayIdx].accelModeArgs.fftMode.butterflyScaling = 0x3ff;   //LSB fftSize bits are relevant - revisit this for all FFT size and data size

    hwaParamCfg[arrayIdx].accelModeArgs.fftMode.interfZeroOutEn = 0;        //disabled
    hwaParamCfg[arrayIdx].accelModeArgs.fftMode.windowEn = 0;               //disabled
//    hwaParamCfg[arrayIdx].accelModeArgs.fftMode.windowStart = 0; //start of window RAM
//    hwaParamCfg[arrayIdx].accelModeArgs.fftMode.winSymm = HWA_FFT_WINDOW_SYMMETRIC;                //non-symmetric - in demo do we make this symmetric
//    hwaParamCfg[arrayIdx].accelModeArgs.fftMode.winInterpolateMode = 0;     //fftsize is less than 1K
    hwaParamCfg[arrayIdx].accelModeArgs.fftMode.magLogEn = HWA_FFT_MODE_MAGNITUDE_LOG2_DISABLED; //disabled
    hwaParamCfg[arrayIdx].accelModeArgs.fftMode.fftOutMode = HWA_FFT_MODE_OUTPUT_SUM_STATS;// output FFT samples

    hwaParamCfg[arrayIdx].complexMultiply.mode = HWA_COMPLEX_MULTIPLY_MODE_SLOW_DFT;
    hwaParamCfg[arrayIdx].complexMultiply.cmpMulArgs.dft.startFreq = 0;/*demo中该值可以设置为0或者其他值*/
    hwaParamCfg[arrayIdx].complexMultiply.cmpMulArgs.dft.freqIncrement = log2Approx(numAdcSamples);/**/
  • Hello,

    Extremely Sorry for the delay.

    Our expert will look into your concern and get back before the end of this week.

    Regards,

    Ishita

  • Hi,

    Your configurations seem alright to me. What I can see is that your input data is only spread in bin 0. Could you use input data with a different frequency to check if the peak that you currently observe at bin 0 moves?

    Regards,

    Aayush

  • HI,

     With my configuration , could  you please verify it use the input data that you give.Ant check if the result sum is correct?T tried different input data,the result was incorrect.

     Thanks!

  • just some deviation between hwa result and python calulate result.like that::k = 0 python result:3729-809j hwa dft result:3729-809j;k = 1, python result,2088.447596-2392.01j hwa dft result:2093-2370j;k=2, python result:3057+1749j hwa dft result:3077+1778j;k = 3, python result:2267+1569j,hwa dft result:2272+1591j;...k=511, python result,-298+140j hwa dft result:-295+159j;The input data:1049+17j,779+679j,37+1119j.....

    dft_input_test.txt
            17,
            1049,
            679,
            779,
            1119,
            37,
            651,
            -604,
            187,
            -999,
            -563,
            -882,
            -974,
            -161,
            -907,
            536,
            -273,
            944,
            415,
            999,
            885,
            438,
            1084,
            -262,
            568,
            -765,
            -126,
            -1032,
            -861,
            -664,
            -1015,
            -54,
            -698,
            727,
            24,
            1008,
            597,
            789,
            1001,
            154,
            795,
            -568,
            344,
            -1010,
            -439,
            -810,
            -894,
            -315,
            -948,
            411,
            -236,
            980,
            262,
            1015,
            848,
            634,
            902,
            -234,
            740,
            -866,
            -2,
            -1110,
            -842,
            -630,
            -1001,
            4,
            -765,
            643,
            -91,
            929,
            678,
            702,
            1045,
            30,
            859,
            -564,
            297,
            -1047,
            -560,
            -835,
            -950,
            -333,
            -932,
            515,
            -283,
            900,
            314,
            1001,
            1035,
            368,
            912,
            -151,
            559,
            -877,
            -82,
            -1041,
            -682,
            -659,
            -1072,
            117,
            -598,
            744,
            -113,
            1084,
            507,
            818,
            942,
            89,
            855,
            -534,
            190,
            -902,
            -469,
            -967,
            -859,
            -275,
            -1021,
            392,
            -509,
            829,
            316,
            937,
            862,
            693,
            1025,
            -283,
            616,
            -812,
            -43,
            -928,
            -876,
            -648,
            -1052,
            143,
            -847,
            649,
            -90,
            1017,
            625,
            829,
            973,
            221,
            994,
            -566,
            263,
            -938,
            -409,
            -885,
            -1053,
            -385,
            -909,
            309,
            -359,
            892,
            322,
            901,
            924,
            582,
            968,
            -174,
            553,
            -853,
            68,
            -1041,
            -700,
            -755,
            -849,
            -29,
            -769,
            607,
            -103,
            897,
            575,
            789,
            979,
            223,
            807,
            -552,
            205,
            -1052,
            -455,
            -790,
            -898,
            -425,
            -938,
            344,
            -511,
            1033,
            187,
            982,
            624,
            552,
            1062,
            -139,
            570,
            -819,
            75,
            -891,
            -783,
            -722,
            -1039,
            -139,
            -875,
            638,
            -71,
            981,
            559,
            782,
            1038,
            231,
            842,
            -456,
            262,
            -803,
            -330,
            -905,
            -1055,
            -389,
            -923,
            506,
            -571,
            819,
            175,
            989,
            907,
            722,
            1009,
            -179,
            725,
            -579,
            -62,
            -934,
            -680,
            -696,
            -957,
            -102,
            -853,
            529,
            -238,
            1109,
            512,
            870,
            942,
            291,
            1041,
            -351,
            355,
            -923,
            -260,
            -896,
            -921,
            -600,
            -986,
            398,
            -565,
            925,
            292,
            969,
            837,
            655,
            1110,
            7,
            743,
            -763,
            23,
            -1016,
            -664,
            -712,
            -1061,
            -235,
            -896,
            632,
            -189,
            1030,
            518,
            807,
            1049,
            192,
            930,
            -376,
            412,
            -994,
            -390,
            -983,
            -979,
            -458,
            -1042,
            311,
            -484,
            918,
            289,
            888,
            747,
            594,
            1034,
            -115,
            624,
            -601,
            -80,
            -1022,
            -703,
            -739,
            -1094,
            -114,
            -768,
            600,
            -178,
            1025,
            507,
            906,
            1092,
            258,
            894,
            -546,
            457,
            -856,
            -333,
            -783,
            -853,
            -341,
            -1041,
            149,
            -694,
            848,
            305,
            916,
            739,
            785,
            987,
            44,
            655,
            -621,
            86,
            -939,
            -679,
            -873,
            -954,
            -268,
            -1031,
            643,
            -230,
            1030,
            445,
            902,
            880,
            248,
            966,
            -525,
            423,
            -942,
            -357,
            -902,
            -849,
            -551,
            -1134,
            242,
            -660,
            903,
            91,
            993,
            690,
            821,
            1053,
            10,
            884,
            -634,
            57,
            -997,
            -529,
            -787,
            -986,
            -271,
            -733,
            682,
            -278,
            985,
            447,
            914,
            978,
            420,
            774,
            -358,
            434,
            -940,
            -272,
            -1001,
            -768,
            -749,
            -924,
            150,
            -570,
            789,
            60,
            1033,
            743,
            594,
            1003,
            -41,
            727,
            -648,
            20,
            -1037,
            -571,
            -897,
            -909,
            -130,
            -819,
            493,
            -359,
            1150,
            405,
            809,
            1017,
            378,
            1106,
            -270,
            425,
            -1014,
            -262,
            -854,
            -752,
            -463,
            -978,
            106,
            -571,
            837,
            92,
            1123,
            788,
            695,
            994,
            -19,
            677,
            -467,
            110,
            -898,
            -540,
            -745,
            -924,
            -212,
            -892,
            406,
            -207,
            1003,
            575,
            982,
            936,
            507,
            823,
            -272,
            530,
            -833,
            -142,
            -1122,
            -823,
            -556,
            -1259,
            19,
            -604,
            765,
            156,
            1222,
            702,
            569,
            1043,
            148,
            717,
            -553,
            87,
            -1025,
            -611,
            -884,
            -1061,
            -332,
            -842,
            470,
            -473,
            998,
            336,
            898,
            900,
            376,
            900,
            -254,
            522,
            -919,
            -321,
            -1001,
            -760,
            -607,
            -1050,
            39,
            -724,
            876,
            141,
            1104,
            771,
            710,
            928,
            179,
            917,
            -655,
            212,
            -933,
            -646,
            -732,
            -914,
            -295,
            -851,
            558,
            -328,
            891,
            376,
            1068,
            1052,
            461,
            958,
            -307,
            555,
            -725,
            -193,
            -997,
            -808,
            -690,
            -984,
            75,
            -788,
            772,
            -106,
            974,
            528,
            679,
            990,
            184,
            743,
            -521,
            105,
            -1021,
            -490,
            -885,
            -914,
            -304,
            -996,
            454,
            -335,
            1022,
            387,
            893,
            841,
            518,
            1161,
            -201,
            518,
            -941,
            -151,
            -1068,
            -906,
            -600,
            -971,
            134,
            -740,
            715,
            67,
            917,
            574,
            739,
            1025,
            -71,
            886,
            -677,
            313,
            -1041,
            -461,
            -960,
            -984,
            -357,
            -941,
            505,
            -407,
            851,
            406,
            1000,
            976,
            584,
            1106,
            -270,
            583,
            -901,
            -116,
            -1029,
            -704,
            -545,
            -1017,
            58,
            -887,
            734,
            -106,
            1029,
            686,
            760,
            957,
            140,
            916,
            -533,
            161,
            -1035,
            -483,
            -919,
            -780,
            -266,
            -933,
            455,
            -522,
            965,
            200,
            1059,
            861,
            535,
            1064,
            -244,
            700,
            -745,
            -198,
            -936,
            -636,
            -674,
            -888,
            -10,
            -877,
            683,
            -96,
            1172,
            536,
            854,
            1005,
            83,
            773,
            -524,
            221,
            -1066,
            -392,
            -926,
            -837,
            -351,
            -918,
            420,
            -533,
            945,
            228,
            1081,
            839,
            444,
            994,
            -160,
            605,
            -863,
            93,
            -1097,
            -741,
            -829,
            -1062,
            53,
            -791,
            531,
            -139,
            929,
            600,
            796,
            1089,
            301,
            860,
            -545,
            341,
            -1004,
            -456,
            -939,
            -890,
            -349,
            -926,
            285,
            -506,
            852,
            267,
            1032,
            937,
            602,
            955,
            -157,
            607,
            -723,
            -141,
            -935,
            -700,
            -800,
            -968,
            -66,
            -714,
            734,
            -73,
            963,
            567,
            889,
            1189,
            327,
            896,
            -510,
            343,
            -1061,
            -384,
            -1118,
            -1059,
            -436,
            -1002,
            241,
            -488,
            1070,
            91,
            958,
            863,
            609,
            878,
            -235,
            752,
            -747,
            -139,
            -1020,
            -740,
            -713,
            -939,
            -81,
            -786,
            624,
            -191,
            914,
            596,
            905,
            906,
            237,
            920,
            -598,
            364,
            -946,
            -427,
            -951,
            -862,
            -347,
            -987,
            347,
            -607,
            676,
            338,
            937,
            727,
            632,
            1029,
            -198,
            685,
            -823,
            37,
            -1005,
            -667,
            -752,
            -937,
            -166,
            -863,
            823,
            -241,
            1034,
            645,
            863,
            998,
            331,
            832,
            -377,
            333,
            -984,
            -365,
            -928,
            -726,
            -360,
            -1012,
            266,
            -501,
            866,
            315,
            1109,
            733,
            638,
            950,
            -55,
            741,
            -633,
            87,
            -1029,
            -734,
            -735,
            -1000,
            0,
            -929,
            508,
            -349,
            994,
            538,
            857,
            966,
            295,
            784,
            -483,
            408,
            -974,
            -196,
            -950,
            -883,
            -492,
            -1127,
            428,
            -494,
            831,
            56,
            945,
            761,
            753,
            977,
            -94,
            676,
            -650,
            26,
            -879,
            -651,
            -893,
            -937,
            -206,
            -955,
            610,
            -131,
            924,
            499,
            1127,
            1021,
            298,
            781,
            -428,
            447,
            -1015,
            -373,
            -939,
            -1058,
            -624,
            -1004,
            305,
            -756,
            863,
            235,
            1045,
            803,
            676,
            1116,
            -49,
            726,
            -755,
            -3,
            -1154,
            -662,
            -783,
            -992,
            -193,
            -911,
            513,
            -205,
            972,
            379,
            868,
            924,
            370,
            950,
            -249,
            477,
            -932,
            -271,
            -888,
            -833,
            -492,
            -1098,
            253,
            -654,
            811,
            174,
            1083,
            711,
            790,
            1051,
            -84,
            800,
            -673,
            150,
            -1049,
            -544,
            -914,
            -967,
            -408,
            -921,
            461,
            -264,
            903,
            375,
            843,
            827,
            453,
            811,
            -348,
            465,
            -862,
            -270,
            -957,
            -886,
            -449,
            -1086,
            109,
            -582,
            872,
            -25,
            1072,
            699,
            790,
            1059,
            -29,
            684,
            -755,
            165,
            -1015,
            -695,
            -868,
            -1107,
            -116,
            -987,
            650,
            -200,
            990,
            478,
            930,
            909,
            376,
            981,
            -254,
            303,
            -895,
            -287,
            -969,
            -880,
            -561,
            -1105,
            160,
            -598,
            765,
            -47,
            1242,
            691,
            780,
            908,
            30,
            690,
            -636,
            269,
            -1120,
            -606,
            -967,
            -1125,
            -252,
            -963,
            427,
            -402,
            864,
            344,
            1015,
            762,
            537,
            948,
            -526,
            551,
            -782,
            -333,
            -1045,
            -820,
            -534,
            -971,
            126,
            -690,
            855,
            -29,
            1040,
            775,
            714,
            1186,
            9,
            771,
            -705,
            176,
            -1044,
            -584,
            -808,
            -907,
            -395,
            -792,
            515,
            -392,
            1063,
            423,
            970,
            978,
            351,
            853,
            -291,
            519,
            -819,
            -285,
            -908,
            -795,
            -554,
            -856,
            88,
            -732,
            772,
            67,
            1042
    ;

  • Hi,

    I see. Could you have a look at the code documentation for freqIncrement? It seems that the actual increment value is 2^(14-freqIncrement), this might be the issue in your configuration.

    Regards,

    Aayush

  • hwaParamCfg[arrayIdx].complexMultiply.cmpMulArgs.dft.freqIncrement = 14-log2Approx(numAdcSamples);/**/

    I tried,and the result was totally wrong.But In my configuration before I thought LUT caused the deviation?Is that right?So how to create the LUT(SIN&COS) in hwa in which DFT will use LUT.

  • in C:\ti\mmwave_sdk_03_05_00_04\packages\ti\alg\mmwavelib\test\lib_dftsinglebin_test,I have used test_dftsinglebin() to verify the result.The two reaults were the same with what python calculate.But differen with HWA DFT's RESULT,there were some errors.

  • Hi,

    If the configuration wasn't the issue, and since you are seeing results in the right ballpark, it's likely that the LUT for sin, cos is the cause of the error. There isn't a way to change the LUT used by HWA for this.

    Regards,

    Aayush