DECIMF32.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #include "DECIMF32.h"
  2. #include "Error.h"
  3. void DECIMF32::test_fir_decimate_f32()
  4. {
  5. const float32_t *pSrc=samples.ptr();
  6. float32_t *pDst=output.ptr();
  7. arm_fir_decimate_f32(&instDecim,pSrc,pDst,this->nbSamples);
  8. }
  9. void DECIMF32::test_fir_interpolate_f32()
  10. {
  11. const float32_t *pSrc=samples.ptr();
  12. float32_t *pDst=output.ptr();
  13. arm_fir_interpolate_f32(&instInterpol,pSrc,pDst,this->nbSamples);
  14. }
  15. void DECIMF32::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(DECIMF32::SAMPLES1_F32_ID,mgr,this->nbSamples);
  21. coefs.reload(DECIMF32::COEFS1_F32_ID,mgr,this->nbTaps);
  22. state.create(this->nbSamples + this->nbTaps - 1,DECIMF32::STATE_F32_ID,mgr);
  23. output.create(this->nbSamples,DECIMF32::OUT_SAMPLES_F32_ID,mgr);
  24. switch(id)
  25. {
  26. case TEST_FIR_DECIMATE_F32_1:
  27. this->decimationFactor = *it;
  28. arm_fir_decimate_init_f32(&instDecim,
  29. this->nbTaps,
  30. this->decimationFactor,
  31. coefs.ptr(),
  32. state.ptr(),
  33. this->nbSamples);
  34. break;
  35. case TEST_FIR_INTERPOLATE_F32_2:
  36. this->interpolationFactor = *it;
  37. arm_fir_interpolate_init_f32(&instInterpol,
  38. this->interpolationFactor,
  39. this->nbTaps,
  40. coefs.ptr(),
  41. state.ptr(),
  42. this->nbSamples);
  43. break;
  44. }
  45. }
  46. void DECIMF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  47. {
  48. }