1 #include "DECIMF32.h" 2 #include "Error.h" 3 4 test_fir_decimate_f32()5 void DECIMF32::test_fir_decimate_f32() 6 { 7 arm_fir_decimate_f32(&instDecim,this->pSrc,this->pDst,this->nbSamples); 8 } 9 10 11 12 test_fir_interpolate_f32()13 void DECIMF32::test_fir_interpolate_f32() 14 { 15 arm_fir_interpolate_f32(&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 DECIMF32::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(DECIMF32::SAMPLES1_F32_ID,mgr,this->nbSamples); 28 coefs.reload(DECIMF32::COEFS1_F32_ID,mgr,this->nbTaps); 29 30 output.create(this->nbSamples,DECIMF32::OUT_SAMPLES_F32_ID,mgr); 31 32 switch(id) 33 { 34 case TEST_FIR_DECIMATE_F32_1: 35 this->decimationFactor = *it; 36 37 state.create(this->nbSamples + this->nbTaps - 1,DECIMF32::STATE_F32_ID,mgr); 38 39 arm_fir_decimate_init_f32(&instDecim, 40 this->nbTaps, 41 this->decimationFactor, 42 coefs.ptr(), 43 state.ptr(), 44 this->nbSamples); 45 break; 46 47 48 case TEST_FIR_INTERPOLATE_F32_2: 49 { 50 this->interpolationFactor = *it; 51 int phase = this->nbTaps / this->interpolationFactor; 52 53 state.create(this->nbSamples + phase - 1,DECIMF32::STATE_F32_ID,mgr); 54 55 arm_fir_interpolate_init_f32(&instInterpol, 56 this->interpolationFactor, 57 this->nbTaps, 58 coefs.ptr(), 59 state.ptr(), 60 this->nbSamples); 61 } 62 break; 63 64 65 } 66 67 this->pSrc=samples.ptr(); 68 this->pDst=output.ptr(); 69 70 } 71 tearDown(Testing::testID_t id,Client::PatternMgr * mgr)72 void DECIMF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) 73 { 74 } 75