1 #include "BIQUADF32.h"
2 #include "Error.h"
3 
4 
test_biquad_cascade_df1_f32()5     void BIQUADF32::test_biquad_cascade_df1_f32()
6     {
7        arm_biquad_cascade_df1_f32(&instBiquadDf1, this->pSrc, this->pDst, this->nbSamples);
8     }
9 
test_biquad_cascade_df2T_f32()10     void BIQUADF32::test_biquad_cascade_df2T_f32()
11     {
12        arm_biquad_cascade_df2T_f32(&instBiquadDf2T, this->pSrc, this->pDst, this->nbSamples);
13     }
14 
15 
test_biquad_cascade_stereo_df2T_f32()16     void BIQUADF32::test_biquad_cascade_stereo_df2T_f32()
17     {
18        arm_biquad_cascade_stereo_df2T_f32(&instStereo, this->pSrc, this->pDst, this->nbSamples);
19     }
20 
21 
22 
setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)23     void BIQUADF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
24     {
25 
26 
27 
28        std::vector<Testing::param_t>::iterator it = params.begin();
29        this->numStages = *it++;
30        this->nbSamples = *it;
31 
32 
33 
34 
35        switch(id)
36        {
37            case TEST_BIQUAD_CASCADE_DF1_F32_1:
38                   samples.reload(BIQUADF32::SAMPLES1_F32_ID,mgr,this->nbSamples);
39                   output.create(this->nbSamples,BIQUADF32::OUT_SAMPLES_F32_ID,mgr);
40                   coefs.reload(BIQUADF32::COEFS1_F32_ID,mgr,this->numStages * 5);
41                   state.create(4*this->numStages,BIQUADF32::STATE_F32_ID,mgr);
42 
43                   arm_biquad_cascade_df1_init_f32(&instBiquadDf1,
44                     this->numStages,
45                     coefs.ptr(),
46                     state.ptr());
47 
48            break;
49 
50            case TEST_BIQUAD_CASCADE_DF2T_F32_2:
51                samples.reload(BIQUADF32::SAMPLES1_F32_ID,mgr,this->nbSamples);
52                output.create(this->nbSamples,BIQUADF32::OUT_SAMPLES_F32_ID,mgr);
53                coefs.reload(BIQUADF32::COEFS1_F32_ID,mgr,this->numStages * 5);
54                state.create(2*this->numStages,BIQUADF32::STATE_F32_ID,mgr);
55 
56 
57 #if defined(ARM_MATH_NEON)
58                // For Neon, neonCoefs is the coef array and is bigger
59                neonCoefs.create(8*this->numStages,BIQUADF32::STATE_F32_ID,mgr);
60 
61                arm_biquad_cascade_df2T_init_f32(&instBiquadDf2T,
62                     this->numStages,
63                     neonCoefs.ptr(),
64                     state.ptr());
65 
66                // Those Neon coefs must be computed from original coefs
67                arm_biquad_cascade_df2T_compute_coefs_f32(&instBiquadDf2T,this->numStages,coefs.ptr());
68 #else
69 
70               // For cortex-M, coefs is the coef array
71               arm_biquad_cascade_df2T_init_f32(&instBiquadDf2T,
72                     this->numStages,
73                     coefs.ptr(),
74                     state.ptr());
75 
76 
77 #endif
78            break;
79 
80            case TEST_BIQUAD_CASCADE_STEREO_DF2T_F32_3:
81                   samples.reload(BIQUADF32::SAMPLES1_F32_ID,mgr,2*this->nbSamples);
82                   output.create(2*this->nbSamples,BIQUADF32::OUT_SAMPLES_F32_ID,mgr);
83                   coefs.reload(BIQUADF32::COEFS1_F32_ID,mgr,this->numStages * 5);
84                   state.create(4*this->numStages,BIQUADF32::STATE_F32_ID,mgr);
85 
86                   arm_biquad_cascade_stereo_df2T_init_f32(&instStereo,
87                     this->numStages,
88                     coefs.ptr(),
89                     state.ptr());
90            break;
91        }
92 
93        this->pSrc=samples.ptr();
94        this->pDst=output.ptr();
95 
96     }
97 
tearDown(Testing::testID_t id,Client::PatternMgr * mgr)98     void BIQUADF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
99     {
100     }
101