FIRQ7.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #include "FIRQ7.h"
  2. #include "Error.h"
  3. #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE)
  4. static __ALIGNED(8) q7_t coeffArray[64];
  5. #endif
  6. void FIRQ7::test_fir_q7()
  7. {
  8. arm_fir_q7(&instFir, this->pSrc, this->pDst, this->nbSamples);
  9. }
  10. void FIRQ7::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  11. {
  12. std::vector<Testing::param_t>::iterator it = params.begin();
  13. this->nbTaps = *it++;
  14. this->nbSamples = *it;
  15. samples.reload(FIRQ7::SAMPLES1_Q7_ID,mgr,this->nbSamples);
  16. coefs.reload(FIRQ7::COEFS1_Q7_ID,mgr,this->nbTaps);
  17. state.create(this->nbSamples + this->nbTaps - 1,FIRQ7::STATE_Q7_ID,mgr);
  18. output.create(this->nbSamples,FIRQ7::OUT_SAMPLES_Q7_ID,mgr);
  19. switch(id)
  20. {
  21. case TEST_FIR_Q7_1:
  22. #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE)
  23. /* Copy coefficients and pad to zero
  24. */
  25. memset(coeffArray,0,32*sizeof(q7_t));
  26. q7_t *ptr;
  27. ptr=coefs.ptr();
  28. memcpy(coeffArray,ptr,this->nbTaps*sizeof(q7_t));
  29. this->pCoefs = coeffArray;
  30. #else
  31. this->pCoefs=coefs.ptr();
  32. #endif
  33. arm_fir_init_q7(&instFir,this->nbTaps,coefs.ptr(),state.ptr(),this->nbSamples);
  34. this->pSrc=samples.ptr();
  35. this->pDst=output.ptr();
  36. break;
  37. }
  38. }
  39. void FIRQ7::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  40. {
  41. }