MISCQ31.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include "MISCQ31.h"
  2. #include "Error.h"
  3. #define MAX(A,B) (A) > (B) ? (A) : (B)
  4. void MISCQ31::test_conv_q31()
  5. {
  6. arm_conv_q31(this->inp1, this->nba,this->inp2, this->nbb, this->outp);
  7. }
  8. void MISCQ31::test_correlate_q31()
  9. {
  10. arm_correlate_q31(this->inp1, this->nba,this->inp2, this->nbb, this->outp);
  11. }
  12. void MISCQ31::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  13. {
  14. std::vector<Testing::param_t>::iterator it = params.begin();
  15. this->nba = *it++;
  16. this->nbb = *it;
  17. input1.reload(MISCQ31::INPUTSA1_Q31_ID,mgr,this->nba);
  18. input2.reload(MISCQ31::INPUTSB1_Q31_ID,mgr,this->nbb);
  19. switch(id)
  20. {
  21. case TEST_CONV_Q31_1:
  22. output.create(this->nba + this->nbb - 1 ,MISCQ31::OUT_SAMPLES_Q31_ID,mgr);
  23. break;
  24. case TEST_CORRELATE_Q31_2:
  25. output.create(2*MAX(this->nba , this->nbb) - 1 ,MISCQ31::OUT_SAMPLES_Q31_ID,mgr);
  26. break;
  27. }
  28. this->inp1=input1.ptr();
  29. this->inp2=input2.ptr();
  30. this->outp=output.ptr();
  31. }
  32. void MISCQ31::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  33. {
  34. }