1 #include "DECIMQ31.h" 2 #include "Error.h" 3 4 test_fir_decimate_q31()5 void DECIMQ31::test_fir_decimate_q31() 6 { 7 arm_fir_decimate_q31(&instDecim,this->pSrc,this->pDst,this->nbSamples); 8 } 9 10 11 12 test_fir_interpolate_q31()13 void DECIMQ31::test_fir_interpolate_q31() 14 { 15 arm_fir_interpolate_q31(&instInterpol,this->pSrc,this->pDst,this->nbSamples); 16 } 17 setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)18 void DECIMQ31::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr) 19 { 20 21 22 std::vector<Testing::param_t>::iterator it = params.begin(); 23 this->nbTaps = *it++; 24 this->nbSamples = *it++; 25 26 27 samples.reload(DECIMQ31::SAMPLES1_Q31_ID,mgr,this->nbSamples); 28 coefs.reload(DECIMQ31::COEFS1_Q31_ID,mgr,this->nbTaps); 29 30 state.create(this->nbSamples + this->nbTaps - 1,DECIMQ31::STATE_Q31_ID,mgr); 31 output.create(this->nbSamples,DECIMQ31::OUT_SAMPLES_Q31_ID,mgr); 32 33 switch(id) 34 { 35 case TEST_FIR_DECIMATE_Q31_1: 36 this->decimationFactor = *it; 37 arm_fir_decimate_init_q31(&instDecim, 38 this->nbTaps, 39 this->decimationFactor, 40 coefs.ptr(), 41 state.ptr(), 42 this->nbSamples); 43 break; 44 45 46 case TEST_FIR_INTERPOLATE_Q31_2: 47 this->interpolationFactor = *it; 48 arm_fir_interpolate_init_q31(&instInterpol, 49 this->interpolationFactor, 50 this->nbTaps, 51 coefs.ptr(), 52 state.ptr(), 53 this->nbSamples); 54 break; 55 56 57 } 58 59 this->pSrc=samples.ptr(); 60 this->pDst=output.ptr(); 61 62 } 63 tearDown(Testing::testID_t id,Client::PatternMgr * mgr)64 void DECIMQ31::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) 65 { 66 } 67