Do a corralation with DSP Library
I have a 32F746GDISCOVERY and would like to test the dsp functionalities with a correlation.
I have the following code:
#include "arm_math.h"
extern void arm_correlate_fast_q31(q31_t * pSrcA, uint32_t srcALen, q31_t * pSrcB, uint32_t srcBLen, q31_t * pDst);
extern void arm_q31_to_float(q31_t * pSrc, float32_t * pDst, uint32_t blockSize);
extern void arm_float_to_q31( float32_t * pSrc, q31_t * pDst, uint32_t blockSize);
q31_t in1[32];
q31_t in2[32];
q31_t out1[64];
float out1_f[64];
for(int i=0; i<32; i++){
in1[i] = 0;
in2[i] = 0;
}
float tempf = 0.00001;
for(int i=12; i<20; i++){
arm_float_to_q31( &tempf, &in1[i], 1);
arm_float_to_q31( &tempf, &in2[i], 1);
}
arm_correlate_fast_q31(in1, 32, in2, 32, out1);
arm_q31_to_float(out1,out1_f,64);I'm putting in two square wave signals and expecting a triangle signal. I look with the debugger, but out1 has only stored zeroes. What am I doing wrong? Do I still have to initialize the DSP core?