1 #include "FIRQ7.h" 2 #include "Error.h" 3 4 #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) 5 static __ALIGNED(8) q7_t coeffArray[64]; 6 #endif 7 test_fir_q7()8 void FIRQ7::test_fir_q7() 9 { 10 arm_fir_q7(&instFir, this->pSrc, this->pDst, this->nbSamples); 11 } 12 13 14 15 setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)16 void FIRQ7::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr) 17 { 18 19 20 std::vector<Testing::param_t>::iterator it = params.begin(); 21 this->nbTaps = *it++; 22 this->nbSamples = *it; 23 24 samples.reload(FIRQ7::SAMPLES1_Q7_ID,mgr,this->nbSamples); 25 coefs.reload(FIRQ7::COEFS1_Q7_ID,mgr,this->nbTaps); 26 27 state.create(this->nbSamples + this->nbTaps - 1,FIRQ7::STATE_Q7_ID,mgr); 28 output.create(this->nbSamples,FIRQ7::OUT_SAMPLES_Q7_ID,mgr); 29 30 switch(id) 31 { 32 case TEST_FIR_Q7_1: 33 #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) 34 /* Copy coefficients and pad to zero 35 */ 36 memset(coeffArray,0,32*sizeof(q7_t)); 37 q7_t *ptr; 38 39 ptr=coefs.ptr(); 40 memcpy(coeffArray,ptr,this->nbTaps*sizeof(q7_t)); 41 this->pCoefs = coeffArray; 42 #else 43 this->pCoefs=coefs.ptr(); 44 #endif 45 arm_fir_init_q7(&instFir,this->nbTaps,coefs.ptr(),state.ptr(),this->nbSamples); 46 47 this->pSrc=samples.ptr(); 48 this->pDst=output.ptr(); 49 break; 50 51 52 53 54 } 55 56 } 57 tearDown(Testing::testID_t id,Client::PatternMgr * mgr)58 void FIRQ7::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) 59 { 60 } 61