MISCQ7.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #include "MISCQ7.h"
  2. #include "Error.h"
  3. #define MAX(A,B) (A) > (B) ? (A) : (B)
  4. void MISCQ7::test_conv_q7()
  5. {
  6. const q7_t *inp1=input1.ptr();
  7. const q7_t *inp2=input2.ptr();
  8. q7_t *outp=output.ptr();
  9. arm_conv_q7(inp1, this->nba,inp2, this->nbb, outp);
  10. }
  11. void MISCQ7::test_correlate_q7()
  12. {
  13. const q7_t *inp1=input1.ptr();
  14. const q7_t *inp2=input2.ptr();
  15. q7_t *outp=output.ptr();
  16. arm_correlate_q7(inp1, this->nba,inp2, this->nbb, outp);
  17. }
  18. void MISCQ7::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  19. {
  20. std::vector<Testing::param_t>::iterator it = params.begin();
  21. this->nba = *it++;
  22. this->nbb = *it;
  23. input1.reload(MISCQ7::INPUTSA1_Q7_ID,mgr,this->nba);
  24. input2.reload(MISCQ7::INPUTSB1_Q7_ID,mgr,this->nbb);
  25. switch(id)
  26. {
  27. case TEST_CONV_Q7_1:
  28. output.create(this->nba + this->nbb - 1 ,MISCQ7::OUT_SAMPLES_Q7_ID,mgr);
  29. break;
  30. case TEST_CORRELATE_Q7_2:
  31. output.create(2*MAX(this->nba , this->nbb) - 1 ,MISCQ7::OUT_SAMPLES_Q7_ID,mgr);
  32. break;
  33. }
  34. }
  35. void MISCQ7::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  36. {
  37. }