DECIMQ15.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #include "DECIMQ15.h"
  2. #include "Error.h"
  3. void DECIMQ15::test_fir_decimate_q15()
  4. {
  5. const q15_t *pSrc=samples.ptr();
  6. q15_t *pDst=output.ptr();
  7. arm_fir_decimate_q15(&instDecim,pSrc,pDst,this->nbSamples);
  8. }
  9. void DECIMQ15::test_fir_interpolate_q15()
  10. {
  11. const q15_t *pSrc=samples.ptr();
  12. q15_t *pDst=output.ptr();
  13. arm_fir_interpolate_q15(&instInterpol,pSrc,pDst,this->nbSamples);
  14. }
  15. void DECIMQ15::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  16. {
  17. std::vector<Testing::param_t>::iterator it = params.begin();
  18. this->nbTaps = *it++;
  19. this->nbSamples = *it++;
  20. samples.reload(DECIMQ15::SAMPLES1_Q15_ID,mgr,this->nbSamples);
  21. coefs.reload(DECIMQ15::COEFS1_Q15_ID,mgr,this->nbTaps);
  22. state.create(this->nbSamples + this->nbTaps - 1,DECIMQ15::STATE_Q15_ID,mgr);
  23. output.create(this->nbSamples,DECIMQ15::OUT_SAMPLES_Q15_ID,mgr);
  24. switch(id)
  25. {
  26. case TEST_FIR_DECIMATE_Q15_1:
  27. this->decimationFactor = *it;
  28. arm_fir_decimate_init_q15(&instDecim,
  29. this->nbTaps,
  30. this->decimationFactor,
  31. coefs.ptr(),
  32. state.ptr(),
  33. this->nbSamples);
  34. break;
  35. case TEST_FIR_INTERPOLATE_Q15_2:
  36. this->interpolationFactor = *it;
  37. arm_fir_interpolate_init_q15(&instInterpol,
  38. this->interpolationFactor,
  39. this->nbTaps,
  40. coefs.ptr(),
  41. state.ptr(),
  42. this->nbSamples);
  43. break;
  44. }
  45. }
  46. void DECIMQ15::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  47. {
  48. }