BIQUADF32.cpp 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #include "BIQUADF32.h"
  2. #include "Error.h"
  3. void BIQUADF32::test_biquad_cascade_df1_f32()
  4. {
  5. arm_biquad_cascade_df1_f32(&instBiquadDf1, this->pSrc, this->pDst, this->nbSamples);
  6. }
  7. void BIQUADF32::test_biquad_cascade_df2T_f32()
  8. {
  9. arm_biquad_cascade_df2T_f32(&instBiquadDf2T, this->pSrc, this->pDst, this->nbSamples);
  10. }
  11. void BIQUADF32::test_biquad_cascade_stereo_df2T_f32()
  12. {
  13. arm_biquad_cascade_stereo_df2T_f32(&instStereo, this->pSrc, this->pDst, this->nbSamples);
  14. }
  15. void BIQUADF32::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->numStages = *it++;
  19. this->nbSamples = *it;
  20. switch(id)
  21. {
  22. case TEST_BIQUAD_CASCADE_DF1_F32_1:
  23. samples.reload(BIQUADF32::SAMPLES1_F32_ID,mgr,this->nbSamples);
  24. output.create(this->nbSamples,BIQUADF32::OUT_SAMPLES_F32_ID,mgr);
  25. coefs.reload(BIQUADF32::COEFS1_F32_ID,mgr,this->numStages * 5);
  26. state.create(4*this->numStages,BIQUADF32::STATE_F32_ID,mgr);
  27. arm_biquad_cascade_df1_init_f32(&instBiquadDf1,
  28. this->numStages,
  29. coefs.ptr(),
  30. state.ptr());
  31. break;
  32. case TEST_BIQUAD_CASCADE_DF2T_F32_2:
  33. samples.reload(BIQUADF32::SAMPLES1_F32_ID,mgr,this->nbSamples);
  34. output.create(this->nbSamples,BIQUADF32::OUT_SAMPLES_F32_ID,mgr);
  35. coefs.reload(BIQUADF32::COEFS1_F32_ID,mgr,this->numStages * 5);
  36. state.create(2*this->numStages,BIQUADF32::STATE_F32_ID,mgr);
  37. arm_biquad_cascade_df2T_init_f32(&instBiquadDf2T,
  38. this->numStages,
  39. coefs.ptr(),
  40. state.ptr());
  41. break;
  42. case TEST_BIQUAD_CASCADE_STEREO_DF2T_F32_3:
  43. samples.reload(BIQUADF32::SAMPLES1_F32_ID,mgr,2*this->nbSamples);
  44. output.create(2*this->nbSamples,BIQUADF32::OUT_SAMPLES_F32_ID,mgr);
  45. coefs.reload(BIQUADF32::COEFS1_F32_ID,mgr,this->numStages * 5);
  46. state.create(4*this->numStages,BIQUADF32::STATE_F32_ID,mgr);
  47. arm_biquad_cascade_stereo_df2T_init_f32(&instStereo,
  48. this->numStages,
  49. coefs.ptr(),
  50. state.ptr());
  51. break;
  52. }
  53. this->pSrc=samples.ptr();
  54. this->pDst=output.ptr();
  55. }
  56. void BIQUADF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  57. {
  58. }