DECIMQ31.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #include "DECIMQ31.h"
  2. #include "Error.h"
  3. void DECIMQ31::test_fir_decimate_q31()
  4. {
  5. arm_fir_decimate_q31(&instDecim,this->pSrc,this->pDst,this->nbSamples);
  6. }
  7. void DECIMQ31::test_fir_interpolate_q31()
  8. {
  9. arm_fir_interpolate_q31(&instInterpol,this->pSrc,this->pDst,this->nbSamples);
  10. }
  11. void DECIMQ31::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(DECIMQ31::SAMPLES1_Q31_ID,mgr,this->nbSamples);
  17. coefs.reload(DECIMQ31::COEFS1_Q31_ID,mgr,this->nbTaps);
  18. state.create(this->nbSamples + this->nbTaps - 1,DECIMQ31::STATE_Q31_ID,mgr);
  19. output.create(this->nbSamples,DECIMQ31::OUT_SAMPLES_Q31_ID,mgr);
  20. switch(id)
  21. {
  22. case TEST_FIR_DECIMATE_Q31_1:
  23. this->decimationFactor = *it;
  24. arm_fir_decimate_init_q31(&instDecim,
  25. this->nbTaps,
  26. this->decimationFactor,
  27. coefs.ptr(),
  28. state.ptr(),
  29. this->nbSamples);
  30. break;
  31. case TEST_FIR_INTERPOLATE_Q31_2:
  32. this->interpolationFactor = *it;
  33. arm_fir_interpolate_init_q31(&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 DECIMQ31::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  45. {
  46. }