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.
Dear team,
I am debugging vital_signs_68xx_dss project.
in dss_data_path.c file, the following line shows totally different fft calculated result from python numpy fft function.
#1 Question: ti dsp_fft function seems to be different from numpy python fft function. totally different values.
How can I go further with this?
step1. imag values are set to all 0's.
obj->pVitalSignsBuffer_Cplx[loopIndexBuffer].real = (int32_t) (obj->scale_heartWfm) * obj->pVitalSigns_Heart_CircularBuffer[loopIndexBuffer];
obj->pVitalSignsBuffer_Cplx[loopIndexBuffer].imag = 0;
step2. I had confirmed (int32_t *) obj->pVitalSignsBuffer_Cplx all same as I had calculated by python.
// FFT of the Cardiac Waveform
DSP_fft32x32((int32_t *) obj->pVitalSignsSpectrumTwiddle32x32, obj->heartWfm_Spectrum_FftSize, (int32_t *) obj->pVitalSignsBuffer_Cplx, (int32_t *) obj->pVitalSigns_SpectrumCplx);
MmwDemo_magnitudeSquared(obj->pVitalSigns_SpectrumCplx, obj->pVitalSigns_Heart_AbsSpectrum, obj->heartWfm_Spectrum_FftSize);
I had dumped all 512 input values: (int32_t *) obj->pVitalSignsBuffer_Cplx ------------------------> all the same in my python calculation
I had dumped first 32 output values: (int32_t *) obj->pVitalSigns_SpectrumCplx -------------------> totally different values came out in spectrum field.
For your reference, This is the input values into fft function
array([ 0.00000000e+00, 1.71193462e-02, 9.47497338e-02, 2.17662990e-01, 2.38536492e-01, 2.93045342e-02, -2.97317386e-01, -4.60439980e-01, -3.37144256e-01, -9.49533880e-02, 4.29746807e-02, 5.10333627e-02, 6.46144748e-02, 1.58542752e-01, 2.41463423e-01, 1.85950220e-01, 1.28235668e-04, -1.80839002e-01, -2.37061575e-01, -1.60851955e-01, -3.87325436e-02, 5.16239703e-02, 1.17849886e-01, 1.98659629e-01, 2.88610220e-01, 3.51717621e-01, 3.37890297e-01, 1.99002773e-01, -3.74684632e-02, -2.50544935e-01, -3.41124773e-01, -3.25585216e-01, -2.91912585e-01, -2.92809397e-01, -2.62338281e-01, -7.46954381e-02, 2.51514494e-01, 5.06420970e-01, 5.07740736e-01, 2.73624599e-01, -3.46136987e-02, -2.62861669e-01, -3.54739934e-01, -3.49145770e-01, -2.95440733e-01, -1.82500228e-01, -7.06136227e-04, 1.77182615e-01, 2.55670846e-01, 2.29241922e-01, 2.00155795e-01, 2.59323120e-01, 3.27725112e-01, 2.06863225e-01, -1.40588075e-01, -4.79888141e-01, -5.61730027e-01, -3.93544674e-01, -1.73319072e-01, -2.31499374e-02, 1.00221306e-01, 2.51916558e-01, 3.91951412e-01, 4.60602611e-01, 4.42569435e-01, 3.03408802e-01, -1.31600499e-02, -4.25330460e-01, -6.80284083e-01, -5.98827779e-01, -2.50446826e-01, 1.44905508e-01, 3.64293367e-01, 2.88486272e-01, 2.07208320e-02, -1.56679645e-01, -6.07864484e-02, 1.92311093e-01, 3.28083873e-01, 2.14652061e-01, -4.26778495e-02, -2.68042684e-01, -3.66197169e-01, -3.19442213e-01, -1.56287417e-01, 5.04296422e-02, 2.12527081e-01, 2.83326924e-01, 2.93201864e-01, 2.97030181e-01, 2.73936331e-01, 1.54659271e-01, -4.56279814e-02, -2.17784673e-01, -2.79157162e-01, -2.33415231e-01, -1.36372164e-01, -4.44997251e-02, 1.68269444e-02, 4.32759449e-02, 4.27750163e-02, 4.22480404e-02, 4.49363068e-02, 4.72322106e-03, -1.01256900e-01, -2.19874322e-01, -2.75856465e-01, -2.27660492e-01, -7.44192302e-02, 1.22409225e-01, 2.54315525e-01, 2.66622722e-01, 2.10637361e-01, 1.76572651e-01, 1.98441535e-01, 2.16273338e-01, 1.40504211e-01, -3.16857398e-02, -2.02760369e-01, -2.96110868e-01, -3.30520570e-01, -3.39655876e-01, -2.93325841e-01, -1.49365485e-01, 5.99683225e-02, 2.29341343e-01, 2.87505358e-01, 2.75364608e-01, 2.56238908e-01, 2.06672087e-01, 8.07232559e-02, -8.32992494e-02, -2.03795850e-01, -2.52721190e-01, -2.47152567e-01, -1.90971091e-01, -7.47314543e-02, 8.14142078e-02, 2.08659396e-01, 2.53231108e-01, 2.41560161e-01, 2.11708322e-01, 1.31741047e-01, -2.85801291e-02, -2.00112820e-01, -2.80547619e-01, -2.66888499e-01, -2.29289412e-01, -1.84099853e-01, -7.85494745e-02, 1.08934730e-01, 2.98413008e-01, 3.75646502e-01, 3.19636315e-01, 1.97928727e-01, 5.74094057e-02, -9.70194638e-02, -2.27632314e-01, -2.61478156e-01, -2.02733964e-01, -1.57932863e-01, -2.01175958e-01, -2.80320644e-01, -2.63971150e-01, -7.71502554e-02, 2.07500428e-01, 4.46566254e-01, 5.33672810e-01, 4.12731886e-01, 1.17535681e-01, -1.85146928e-01, -3.18131417e-01, -2.66316831e-01, -1.50576934e-01, -6.37040734e-02, 6.39751554e-04, 8.25707242e-02, 1.70017242e-01, 2.12249041e-01, 2.05396533e-01, 1.84965134e-01, 1.51031405e-01, 8.48074853e-02, -5.10129333e-03, -1.15203023e-01, -2.57800102e-01, -3.95151347e-01, -4.36013758e-01, -3.10858369e-01, -5.35905659e-02, 1.63429886e-01, 2.36345142e-01, 3.02936316e-01, 4.39167053e-01, 4.45687741e-01, 1.71959430e-01, -2.30022132e-01, -4.96019959e-01, -5.20657539e-01, -3.89732212e-01, -2.34987617e-01, -8.76411200e-02, 1.09393716e-01, 3.41601074e-01, 4.89197493e-01, 4.68966961e-01, 2.95606136e-01, 4.77841794e-02, -1.52965918e-01, -2.21643776e-01, -1.98030934e-01, -1.88468978e-01, -2.32103050e-01, -2.62742877e-01, -1.88321143e-01, 1.48477852e-02, 2.68823028e-01, 4.27288413e-01, 3.76619279e-01, 1.50913507e-01, -6.74867034e-02, -1.13020271e-01, -2.74150819e-02, -2.41253078e-02, -1.94029927e-01, -3.38521510e-01, -2.23582283e-01, 8.11488032e-02, 2.65665948e-01, 1.79356545e-01, 1.13773085e-02, -1.99097171e-02, 3.97755951e-02, 2.51671150e-02, -9.98694599e-02, -2.35185862e-01, -2.86321878e-01, -2.41126448e-01, -1.06702924e-01, 9.35537815e-02, 2.27813199e-01, 2.34356701e-01, 2.81996012e-01, 4.21089381e-01, 4.29431289e-01, 1.99945122e-01, -1.28538430e-01, -4.11291271e-01, -5.75149775e-01, -5.39366841e-01, -2.77952492e-01, 5.00505567e-02, 2.32182458e-01, 3.02622080e-01, 4.97394264e-01, 8.34153593e-01, 9.24545884e-01, 4.12180841e-01, -4.60099459e-01, -1.03538346e+00, -1.00919080e+00, -6.87835217e-01, -4.32646066e-01, -2.44570851e-01, -6.91326261e-02, 4.15581465e-03, 2.73785591e-02, 1.65577650e-01, 3.60685080e-01, 4.75997210e-01, 5.98289490e-01, 7.81081021e-01, 7.87070334e-01, 4.19021547e-01, -1.18298411e-01, -4.33234870e-01, -4.26656067e-01, -3.17493439e-01, -2.95933574e-01, -3.81358355e-01, -5.02167344e-01, -5.78348041e-01, -5.51054120e-01, -3.79931867e-01, -1.01464391e-01, 1.53179526e-01, 3.14596474e-01, 4.38274145e-01, 5.34469843e-01, 5.26611388e-01, 4.11706746e-01, 3.04472268e-01, 3.27590406e-01, 4.86532420e-01, 5.91363132e-01, 3.46452057e-01, -2.94986010e-01, -9.31978464e-01, -1.11551130e+00, -7.89596438e-01, -2.54036605e-01, 1.00363851e-01, 1.45818323e-01, 1.49634451e-01, 3.30219716e-01, 4.71677125e-01, 2.96535820e-01, -3.94317359e-02, -1.98896945e-01, -1.59815833e-01, -1.64965361e-01, -3.56410146e-01, -5.68115592e-01, -4.66740906e-01, 2.03645825e-02, 5.30721784e-01, 6.46665633e-01, 3.40647936e-01, -3.48252691e-02, -1.48406029e-01, -8.29292368e-03, 1.49592966e-01, 1.89768165e-01, 1.47188097e-01, 1.05736509e-01, 1.57532707e-01, 2.96156138e-01, 2.99266398e-01, -3.54116559e-02, -4.74721462e-01, -5.39904058e-01, -2.30930820e-01, -3.35915014e-02, -1.54053152e-01, -3.04819196e-01, -2.44088307e-01, -7.29582310e-02, 6.24288917e-02, 1.93149835e-01, 3.34690601e-01, 3.70043933e-01, 2.27639377e-01, 1.22269988e-02, -1.30736798e-01, -2.06188530e-01, -2.97928691e-01, -3.47322762e-01, -1.83666959e-01, 1.82258576e-01, 4.77932781e-01, 4.85449016e-01, 2.83987135e-01, 8.26127231e-02, -3.87864709e-02, -1.22958377e-01, -2.04505205e-01, -2.79729486e-01, -3.16211641e-01, -2.56734371e-01, -8.69357586e-02, 1.06264025e-01, 2.13691503e-01, 2.26098061e-01, 2.10977614e-01, 1.88913375e-01, 1.13151640e-01, -2.51262486e-02, -1.51646137e-01, -2.07242399e-01, -2.21849084e-01, -2.32209027e-01, -1.94291174e-01, -5.61847389e-02, 1.29832268e-01, 2.55863309e-01, 3.01301777e-01, 3.29360902e-01, 3.39212596e-01, 2.40339190e-01, 1.02179646e-02, -2.31877714e-01, -3.79327267e-01, -4.46707547e-01, -4.46129858e-01, -3.26447725e-01, -9.94144976e-02, 1.15863830e-01, 2.13251024e-01, 2.05081776e-01, 1.63378805e-01, 1.05323121e-01, 2.74453387e-02, -1.87010542e-02, 3.63583490e-03, 4.20346409e-02, 3.97403166e-02, 2.59626284e-02, 6.15700185e-02, 1.36931181e-01, 1.62362650e-01, 9.74600911e-02, 3.64641100e-02, 6.05816394e-02, 1.04223996e-01, 6.53073192e-02, -6.69840574e-02, -2.42407918e-01, -3.94243509e-01, -4.24354792e-01, -2.54553020e-01, 4.91686165e-02, 2.74873078e-01, 2.72823602e-01, 1.41223818e-01, 8.33341852e-02, 1.06228650e-01, 6.60890341e-02, -5.97347170e-02, -1.92732573e-01, -2.87710994e-01, -2.78633475e-01, -1.10115871e-01, 1.21601656e-01, 2.44039506e-01, 2.21360639e-01, 1.82367295e-01, 2.25782841e-01, 2.67692775e-01, 1.61300272e-01, -7.84649253e-02, -2.96328157e-01, -3.93061191e-01, -3.75838667e-01, -2.80538857e-01, -1.40312999e-01, 6.99433684e-03, 1.24678046e-01, 2.06868485e-01, 2.78072327e-01, 3.20270717e-01, 2.63734609e-01, 9.71241444e-02, -9.42124277e-02, -2.25997820e-01, -2.77524054e-01, -2.50298500e-01, -1.39261022e-01, 2.79027522e-02, 1.70868397e-01, 2.28215635e-01, 2.23128498e-01, 1.97269738e-01, 1.29613832e-01, 2.00320780e-03, -1.22952923e-01, -1.83749735e-01, -2.05704242e-01, -2.23629922e-01, -1.98570669e-01, -6.29838109e-02, 1.76141307e-01, 3.75195324e-01, 3.47825229e-01, 6.44537807e-02, -2.80738384e-01, -4.31027949e-01, -3.09160322e-01, -7.57541358e-02, 6.28974736e-02, 7.28428662e-02, 9.39192921e-02, 1.95040017e-01, 2.31418923e-01, 7.83440471e-02, -1.25998020e-01, -1.40592650e-01, 5.38415313e-02, 2.35970825e-01, 2.24994421e-01, 5.52640855e-02, -1.29403234e-01, -2.38786176e-01, -2.54240930e-01, -1.71763808e-01, -7.92878866e-03, 1.68620661e-01, 2.82755136e-01, 3.17795932e-01, 2.86063462e-01, 1.79867595e-01, 1.14597380e-02, -1.56081825e-01, -2.79027730e-01, -3.75885665e-01, -4.47941840e-01, -4.22422677e-01, -2.27463037e-01, 9.57469940e-02, 3.79455984e-01, 4.71422970e-01, 3.76861513e-01, 2.04415202e-01, 3.74541879e-02, -9.39426124e-02, -2.00117588e-01, -3.02354813e-01, -3.55265111e-01, -2.65845597e-01, -3.59264910e-02, 2.04340219e-01, 3.20942640e-01, 3.00293833e-01])
Finally, dsp fft returns different values and different peaks in the following.
numPeaks_heartSpectrum = find_Peaks(obj->pVitalSigns_Heart_AbsSpectrum, uint32_type, obj->pPeakIndex, obj->pPeakValues, obj->heart_startFreq_Index_1p6Hz, obj->heart_endFreq_Index_4Hz);
#question 2.
Are there any way to dump all values of (int32_t *) obj->pVitalSigns_SpectrumCplx ?
for your reference, We would like to put values into debugging reserved field such as obj->VitalSigns_Output.reserved8
#question 3. I had tried to compile the following codes and it was successfully compiled(built) but I have no idea how to run it. ( it seems to need target file while I don't have target to run on this example code)
\ti\dsplib_c64Px_3_4_0_0\examples\fft_ex\fft_example.c
I just want to the fft32x32 result values with my inputs.
BR
kisub