1 #include "DECIMQ15.h" 2 #include "Error.h" 3 4 test_fir_decimate_q15()5 void DECIMQ15::test_fir_decimate_q15() 6 { 7 arm_fir_decimate_q15(&instDecim,this->pSrc,this->pDst,this->nbSamples); 8 } 9 10 11 12 test_fir_interpolate_q15()13 void DECIMQ15::test_fir_interpolate_q15() 14 { 15 arm_fir_interpolate_q15(&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 DECIMQ15::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(DECIMQ15::SAMPLES1_Q15_ID,mgr,this->nbSamples); 28 coefs.reload(DECIMQ15::COEFS1_Q15_ID,mgr,this->nbTaps); 29 30 state.create(this->nbSamples + this->nbTaps - 1,DECIMQ15::STATE_Q15_ID,mgr); 31 output.create(this->nbSamples,DECIMQ15::OUT_SAMPLES_Q15_ID,mgr); 32 33 switch(id) 34 { 35 case TEST_FIR_DECIMATE_Q15_1: 36 this->decimationFactor = *it; 37 arm_fir_decimate_init_q15(&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_Q15_2: 47 this->interpolationFactor = *it; 48 arm_fir_interpolate_init_q15(&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 DECIMQ15::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) 65 { 66 } 67