DECIMF32.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #include "DECIMF32.h"
  2. #include "Error.h"
  3. void DECIMF32::test_fir_decimate_f32()
  4. {
  5. arm_fir_decimate_f32(&instDecim,this->pSrc,this->pDst,this->nbSamples);
  6. }
  7. void DECIMF32::test_fir_interpolate_f32()
  8. {
  9. arm_fir_interpolate_f32(&instInterpol,this->pSrc,this->pDst,this->nbSamples);
  10. }
  11. void DECIMF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  12. {
  13. std::vector<Testing::param_t>::iterator it = params.begin();
  14. this->nbTaps = *it++;
  15. this->nbSamples = *it++;
  16. samples.reload(DECIMF32::SAMPLES1_F32_ID,mgr,this->nbSamples);
  17. coefs.reload(DECIMF32::COEFS1_F32_ID,mgr,this->nbTaps);
  18. state.create(this->nbSamples + this->nbTaps - 1,DECIMF32::STATE_F32_ID,mgr);
  19. output.create(this->nbSamples,DECIMF32::OUT_SAMPLES_F32_ID,mgr);
  20. switch(id)
  21. {
  22. case TEST_FIR_DECIMATE_F32_1:
  23. this->decimationFactor = *it;
  24. arm_fir_decimate_init_f32(&instDecim,
  25. this->nbTaps,
  26. this->decimationFactor,
  27. coefs.ptr(),
  28. state.ptr(),
  29. this->nbSamples);
  30. break;
  31. case TEST_FIR_INTERPOLATE_F32_2:
  32. this->interpolationFactor = *it;
  33. arm_fir_interpolate_init_f32(&instInterpol,
  34. this->interpolationFactor,
  35. this->nbTaps,
  36. coefs.ptr(),
  37. state.ptr(),
  38. this->nbSamples);
  39. break;
  40. }
  41. this->pSrc=samples.ptr();
  42. this->pDst=output.ptr();
  43. }
  44. void DECIMF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  45. {
  46. }