Skip to content
Snippets Groups Projects
arm_math.h 243 KiB
Newer Older
  • Learn to ignore specific revisions
  • 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717
    
    
      /**
       * @param[in,out] *S           points to an instance of the high precision Q31 Biquad cascade filter structure.
       * @param[in]     numStages    number of 2nd order stages in the filter.
       * @param[in]     *pCoeffs     points to the filter coefficients.
       * @param[in]     *pState      points to the state buffer.
       * @param[in]     postShift    shift to be applied to the output. Varies according to the coefficients format
       * @return        none
       */
    
      void arm_biquad_cas_df1_32x64_init_q31(
      arm_biquad_cas_df1_32x64_ins_q31 * S,
      uint8_t numStages,
      q31_t * pCoeffs,
      q63_t * pState,
      uint8_t postShift);
    
    
    
      /**
       * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
       */
    
      typedef struct
      {
        uint8_t numStages;         /**< number of 2nd order stages in the filter.  Overall order is 2*numStages. */
        float32_t *pState;         /**< points to the array of state coefficients.  The array is of length 2*numStages. */
        float32_t *pCoeffs;        /**< points to the array of coefficients.  The array is of length 5*numStages. */
      } arm_biquad_cascade_df2T_instance_f32;
    
    
      /**
       * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter.
       * @param[in]  *S        points to an instance of the filter data structure.
       * @param[in]  *pSrc     points to the block of input data.
       * @param[out] *pDst     points to the block of output data
       * @param[in]  blockSize number of samples to process.
       * @return none.
       */
    
      void arm_biquad_cascade_df2T_f32(
      const arm_biquad_cascade_df2T_instance_f32 * S,
      float32_t * pSrc,
      float32_t * pDst,
      uint32_t blockSize);
    
    
      /**
       * @brief  Initialization function for the floating-point transposed direct form II Biquad cascade filter.
       * @param[in,out] *S           points to an instance of the filter data structure.
       * @param[in]     numStages    number of 2nd order stages in the filter.
       * @param[in]     *pCoeffs     points to the filter coefficients.
       * @param[in]     *pState      points to the state buffer.
       * @return        none
       */
    
      void arm_biquad_cascade_df2T_init_f32(
      arm_biquad_cascade_df2T_instance_f32 * S,
      uint8_t numStages,
      float32_t * pCoeffs,
      float32_t * pState);
    
    
    
      /**
       * @brief Instance structure for the Q15 FIR lattice filter.
       */
    
      typedef struct
      {
        uint16_t numStages;                          /**< number of filter stages. */
        q15_t *pState;                               /**< points to the state variable array. The array is of length numStages. */
        q15_t *pCoeffs;                              /**< points to the coefficient array. The array is of length numStages. */
      } arm_fir_lattice_instance_q15;
    
      /**
       * @brief Instance structure for the Q31 FIR lattice filter.
       */
    
      typedef struct
      {
        uint16_t numStages;                          /**< number of filter stages. */
        q31_t *pState;                               /**< points to the state variable array. The array is of length numStages. */
        q31_t *pCoeffs;                              /**< points to the coefficient array. The array is of length numStages. */
      } arm_fir_lattice_instance_q31;
    
      /**
       * @brief Instance structure for the floating-point FIR lattice filter.
       */
    
      typedef struct
      {
        uint16_t numStages;                  /**< number of filter stages. */
        float32_t *pState;                   /**< points to the state variable array. The array is of length numStages. */
        float32_t *pCoeffs;                  /**< points to the coefficient array. The array is of length numStages. */
      } arm_fir_lattice_instance_f32;
    
      /**
       * @brief Initialization function for the Q15 FIR lattice filter.
       * @param[in] *S points to an instance of the Q15 FIR lattice structure.
       * @param[in] numStages  number of filter stages.
       * @param[in] *pCoeffs points to the coefficient buffer.  The array is of length numStages. 
       * @param[in] *pState points to the state buffer.  The array is of length numStages. 
       * @return none.
       */
    
      void arm_fir_lattice_init_q15(
      arm_fir_lattice_instance_q15 * S,
      uint16_t numStages,
      q15_t * pCoeffs,
      q15_t * pState);
    
    
      /**
       * @brief Processing function for the Q15 FIR lattice filter.
       * @param[in] *S points to an instance of the Q15 FIR lattice structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
      void arm_fir_lattice_q15(
      const arm_fir_lattice_instance_q15 * S,
      q15_t * pSrc,
      q15_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief Initialization function for the Q31 FIR lattice filter.
       * @param[in] *S points to an instance of the Q31 FIR lattice structure.
       * @param[in] numStages  number of filter stages.
       * @param[in] *pCoeffs points to the coefficient buffer.  The array is of length numStages.
       * @param[in] *pState points to the state buffer.   The array is of length numStages.
       * @return none.
       */
    
      void arm_fir_lattice_init_q31(
      arm_fir_lattice_instance_q31 * S,
      uint16_t numStages,
      q31_t * pCoeffs,
      q31_t * pState);
    
    
      /**
       * @brief Processing function for the Q31 FIR lattice filter.
       * @param[in]  *S        points to an instance of the Q31 FIR lattice structure.
       * @param[in]  *pSrc     points to the block of input data.
       * @param[out] *pDst     points to the block of output data
       * @param[in]  blockSize number of samples to process.
       * @return none.
       */
    
      void arm_fir_lattice_q31(
      const arm_fir_lattice_instance_q31 * S,
      q31_t * pSrc,
      q31_t * pDst,
      uint32_t blockSize);
    
    /**
     * @brief Initialization function for the floating-point FIR lattice filter.
     * @param[in] *S points to an instance of the floating-point FIR lattice structure.
     * @param[in] numStages  number of filter stages.
     * @param[in] *pCoeffs points to the coefficient buffer.  The array is of length numStages.
     * @param[in] *pState points to the state buffer.  The array is of length numStages.
     * @return none.
     */
    
      void arm_fir_lattice_init_f32(
      arm_fir_lattice_instance_f32 * S,
      uint16_t numStages,
      float32_t * pCoeffs,
      float32_t * pState);
    
      /**
       * @brief Processing function for the floating-point FIR lattice filter.
       * @param[in]  *S        points to an instance of the floating-point FIR lattice structure.
       * @param[in]  *pSrc     points to the block of input data.
       * @param[out] *pDst     points to the block of output data
       * @param[in]  blockSize number of samples to process.
       * @return none.
       */
    
      void arm_fir_lattice_f32(
      const arm_fir_lattice_instance_f32 * S,
      float32_t * pSrc,
      float32_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief Instance structure for the Q15 IIR lattice filter.
       */
      typedef struct
      {
        uint16_t numStages;                         /**< number of stages in the filter. */
        q15_t *pState;                              /**< points to the state variable array. The array is of length numStages+blockSize. */
        q15_t *pkCoeffs;                            /**< points to the reflection coefficient array. The array is of length numStages. */
        q15_t *pvCoeffs;                            /**< points to the ladder coefficient array. The array is of length numStages+1. */
      } arm_iir_lattice_instance_q15;
    
      /**
       * @brief Instance structure for the Q31 IIR lattice filter.
       */
      typedef struct
      {
        uint16_t numStages;                         /**< number of stages in the filter. */
        q31_t *pState;                              /**< points to the state variable array. The array is of length numStages+blockSize. */
        q31_t *pkCoeffs;                            /**< points to the reflection coefficient array. The array is of length numStages. */
        q31_t *pvCoeffs;                            /**< points to the ladder coefficient array. The array is of length numStages+1. */
      } arm_iir_lattice_instance_q31;
    
      /**
       * @brief Instance structure for the floating-point IIR lattice filter.
       */
      typedef struct
      {
        uint16_t numStages;                         /**< number of stages in the filter. */
        float32_t *pState;                          /**< points to the state variable array. The array is of length numStages+blockSize. */
        float32_t *pkCoeffs;                        /**< points to the reflection coefficient array. The array is of length numStages. */
        float32_t *pvCoeffs;                        /**< points to the ladder coefficient array. The array is of length numStages+1. */
      } arm_iir_lattice_instance_f32;
    
      /**
       * @brief Processing function for the floating-point IIR lattice filter.
       * @param[in] *S points to an instance of the floating-point IIR lattice structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
    
      void arm_iir_lattice_f32(
      const arm_iir_lattice_instance_f32 * S,
      float32_t * pSrc,
      float32_t * pDst,
      uint32_t blockSize);
    
      /**
       * @brief Initialization function for the floating-point IIR lattice filter.
       * @param[in] *S points to an instance of the floating-point IIR lattice structure.
       * @param[in] numStages number of stages in the filter.
       * @param[in] *pkCoeffs points to the reflection coefficient buffer.  The array is of length numStages.
       * @param[in] *pvCoeffs points to the ladder coefficient buffer.  The array is of length numStages+1.
       * @param[in] *pState points to the state buffer.  The array is of length numStages+blockSize-1.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
    
      void arm_iir_lattice_init_f32(
      arm_iir_lattice_instance_f32 * S,
      uint16_t numStages,
      float32_t * pkCoeffs,
      float32_t * pvCoeffs,
      float32_t * pState,
      uint32_t blockSize);
    
    
      /**
       * @brief Processing function for the Q31 IIR lattice filter.
       * @param[in] *S points to an instance of the Q31 IIR lattice structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
    
      void arm_iir_lattice_q31(
      const arm_iir_lattice_instance_q31 * S,
      q31_t * pSrc,
      q31_t * pDst,
      uint32_t blockSize);
    
    
      /**
       * @brief Initialization function for the Q31 IIR lattice filter.
       * @param[in] *S points to an instance of the Q31 IIR lattice structure.
       * @param[in] numStages number of stages in the filter.
       * @param[in] *pkCoeffs points to the reflection coefficient buffer.  The array is of length numStages.
       * @param[in] *pvCoeffs points to the ladder coefficient buffer.  The array is of length numStages+1.
       * @param[in] *pState points to the state buffer.  The array is of length numStages+blockSize.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
    
      void arm_iir_lattice_init_q31(
      arm_iir_lattice_instance_q31 * S,
      uint16_t numStages,
      q31_t * pkCoeffs,
      q31_t * pvCoeffs,
      q31_t * pState,
      uint32_t blockSize);
    
    
      /**
       * @brief Processing function for the Q15 IIR lattice filter.
       * @param[in] *S points to an instance of the Q15 IIR lattice structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[out] *pDst points to the block of output data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
    
      void arm_iir_lattice_q15(
      const arm_iir_lattice_instance_q15 * S,
      q15_t * pSrc,
      q15_t * pDst,
      uint32_t blockSize);
    
    
    /**
     * @brief Initialization function for the Q15 IIR lattice filter.
     * @param[in] *S points to an instance of the fixed-point Q15 IIR lattice structure.
     * @param[in] numStages  number of stages in the filter.
     * @param[in] *pkCoeffs points to reflection coefficient buffer.  The array is of length numStages.
     * @param[in] *pvCoeffs points to ladder coefficient buffer.  The array is of length numStages+1.
     * @param[in] *pState points to state buffer.  The array is of length numStages+blockSize.
     * @param[in] blockSize number of samples to process per call.
     * @return none.
     */
    
      void arm_iir_lattice_init_q15(
      arm_iir_lattice_instance_q15 * S,
      uint16_t numStages,
      q15_t * pkCoeffs,
      q15_t * pvCoeffs,
      q15_t * pState,
      uint32_t blockSize);
    
      /**
       * @brief Instance structure for the floating-point LMS filter.
       */
    
      typedef struct
      {
        uint16_t numTaps;    /**< number of coefficients in the filter. */
        float32_t *pState;   /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
        float32_t *pCoeffs;  /**< points to the coefficient array. The array is of length numTaps. */
        float32_t mu;        /**< step size that controls filter coefficient updates. */
      } arm_lms_instance_f32;
    
      /**
       * @brief Processing function for floating-point LMS filter.
       * @param[in]  *S points to an instance of the floating-point LMS filter structure.
       * @param[in]  *pSrc points to the block of input data.
       * @param[in]  *pRef points to the block of reference data.
       * @param[out] *pOut points to the block of output data.
       * @param[out] *pErr points to the block of error data.
       * @param[in]  blockSize number of samples to process.
       * @return     none.
       */
    
      void arm_lms_f32(
      const arm_lms_instance_f32 * S,
      float32_t * pSrc,
      float32_t * pRef,
      float32_t * pOut,
      float32_t * pErr,
      uint32_t blockSize);
    
      /**
       * @brief Initialization function for floating-point LMS filter.
       * @param[in] *S points to an instance of the floating-point LMS filter structure.
       * @param[in] numTaps  number of filter coefficients.
       * @param[in] *pCoeffs points to the coefficient buffer.
       * @param[in] *pState points to state buffer.
       * @param[in] mu step size that controls filter coefficient updates.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
    
      void arm_lms_init_f32(
      arm_lms_instance_f32 * S,
      uint16_t numTaps,
      float32_t * pCoeffs,
      float32_t * pState,
      float32_t mu,
      uint32_t blockSize);
    
      /**
       * @brief Instance structure for the Q15 LMS filter.
       */
    
      typedef struct
      {
        uint16_t numTaps;    /**< number of coefficients in the filter. */
        q15_t *pState;       /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
        q15_t *pCoeffs;      /**< points to the coefficient array. The array is of length numTaps. */
        q15_t mu;            /**< step size that controls filter coefficient updates. */
        uint32_t postShift;  /**< bit shift applied to coefficients. */
      } arm_lms_instance_q15;
    
    
      /**
       * @brief Initialization function for the Q15 LMS filter.
       * @param[in] *S points to an instance of the Q15 LMS filter structure.
       * @param[in] numTaps  number of filter coefficients.
       * @param[in] *pCoeffs points to the coefficient buffer.
       * @param[in] *pState points to the state buffer.
       * @param[in] mu step size that controls filter coefficient updates.
       * @param[in] blockSize number of samples to process.
       * @param[in] postShift bit shift applied to coefficients.
       * @return    none.
       */
    
      void arm_lms_init_q15(
      arm_lms_instance_q15 * S,
      uint16_t numTaps,
      q15_t * pCoeffs,
      q15_t * pState,
      q15_t mu,
      uint32_t blockSize,
      uint32_t postShift);
    
      /**
       * @brief Processing function for Q15 LMS filter.
       * @param[in] *S points to an instance of the Q15 LMS filter structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[in] *pRef points to the block of reference data.
       * @param[out] *pOut points to the block of output data.
       * @param[out] *pErr points to the block of error data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
    
      void arm_lms_q15(
      const arm_lms_instance_q15 * S,
      q15_t * pSrc,
      q15_t * pRef,
      q15_t * pOut,
      q15_t * pErr,
      uint32_t blockSize);
    
    
      /**
       * @brief Instance structure for the Q31 LMS filter.
       */
    
      typedef struct
      {
        uint16_t numTaps;    /**< number of coefficients in the filter. */
        q31_t *pState;       /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
        q31_t *pCoeffs;      /**< points to the coefficient array. The array is of length numTaps. */
        q31_t mu;            /**< step size that controls filter coefficient updates. */
        uint32_t postShift;  /**< bit shift applied to coefficients. */
    
      } arm_lms_instance_q31;
    
      /**
       * @brief Processing function for Q31 LMS filter.
       * @param[in]  *S points to an instance of the Q15 LMS filter structure.
       * @param[in]  *pSrc points to the block of input data.
       * @param[in]  *pRef points to the block of reference data.
       * @param[out] *pOut points to the block of output data.
       * @param[out] *pErr points to the block of error data.
       * @param[in]  blockSize number of samples to process.
       * @return     none.
       */
    
      void arm_lms_q31(
      const arm_lms_instance_q31 * S,
      q31_t * pSrc,
      q31_t * pRef,
      q31_t * pOut,
      q31_t * pErr,
      uint32_t blockSize);
    
      /**
       * @brief Initialization function for Q31 LMS filter.
       * @param[in] *S points to an instance of the Q31 LMS filter structure.
       * @param[in] numTaps  number of filter coefficients.
       * @param[in] *pCoeffs points to coefficient buffer.
       * @param[in] *pState points to state buffer.
       * @param[in] mu step size that controls filter coefficient updates.
       * @param[in] blockSize number of samples to process.
       * @param[in] postShift bit shift applied to coefficients.
       * @return none.
       */
    
      void arm_lms_init_q31(
      arm_lms_instance_q31 * S,
      uint16_t numTaps,
      q31_t * pCoeffs,
      q31_t * pState,
      q31_t mu,
      uint32_t blockSize,
      uint32_t postShift);
    
      /**
       * @brief Instance structure for the floating-point normalized LMS filter.
       */
    
      typedef struct
      {
        uint16_t numTaps;     /**< number of coefficients in the filter. */
        float32_t *pState;    /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
        float32_t *pCoeffs;   /**< points to the coefficient array. The array is of length numTaps. */
        float32_t mu;        /**< step size that control filter coefficient updates. */
        float32_t energy;    /**< saves previous frame energy. */
        float32_t x0;        /**< saves previous input sample. */
      } arm_lms_norm_instance_f32;
    
      /**
       * @brief Processing function for floating-point normalized LMS filter.
       * @param[in] *S points to an instance of the floating-point normalized LMS filter structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[in] *pRef points to the block of reference data.
       * @param[out] *pOut points to the block of output data.
       * @param[out] *pErr points to the block of error data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
    
      void arm_lms_norm_f32(
      arm_lms_norm_instance_f32 * S,
      float32_t * pSrc,
      float32_t * pRef,
      float32_t * pOut,
      float32_t * pErr,
      uint32_t blockSize);
    
      /**
       * @brief Initialization function for floating-point normalized LMS filter.
       * @param[in] *S points to an instance of the floating-point LMS filter structure.
       * @param[in] numTaps  number of filter coefficients.
       * @param[in] *pCoeffs points to coefficient buffer.
       * @param[in] *pState points to state buffer.
       * @param[in] mu step size that controls filter coefficient updates.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
    
      void arm_lms_norm_init_f32(
      arm_lms_norm_instance_f32 * S,
      uint16_t numTaps,
      float32_t * pCoeffs,
      float32_t * pState,
      float32_t mu,
      uint32_t blockSize);
    
    
      /**
       * @brief Instance structure for the Q31 normalized LMS filter.
       */
      typedef struct
      {
        uint16_t numTaps;     /**< number of coefficients in the filter. */
        q31_t *pState;        /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
        q31_t *pCoeffs;       /**< points to the coefficient array. The array is of length numTaps. */
        q31_t mu;             /**< step size that controls filter coefficient updates. */
        uint8_t postShift;    /**< bit shift applied to coefficients. */
        q31_t *recipTable;    /**< points to the reciprocal initial value table. */
        q31_t energy;         /**< saves previous frame energy. */
        q31_t x0;             /**< saves previous input sample. */
      } arm_lms_norm_instance_q31;
    
      /**
       * @brief Processing function for Q31 normalized LMS filter.
       * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[in] *pRef points to the block of reference data.
       * @param[out] *pOut points to the block of output data.
       * @param[out] *pErr points to the block of error data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
    
      void arm_lms_norm_q31(
      arm_lms_norm_instance_q31 * S,
      q31_t * pSrc,
      q31_t * pRef,
      q31_t * pOut,
      q31_t * pErr,
      uint32_t blockSize);
    
      /**
       * @brief Initialization function for Q31 normalized LMS filter.
       * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
       * @param[in] numTaps  number of filter coefficients.
       * @param[in] *pCoeffs points to coefficient buffer.
       * @param[in] *pState points to state buffer.
       * @param[in] mu step size that controls filter coefficient updates.
       * @param[in] blockSize number of samples to process.
       * @param[in] postShift bit shift applied to coefficients.
       * @return none.
       */
    
      void arm_lms_norm_init_q31(
      arm_lms_norm_instance_q31 * S,
      uint16_t numTaps,
      q31_t * pCoeffs,
      q31_t * pState,
      q31_t mu,
      uint32_t blockSize,
      uint8_t postShift);
    
      /**
       * @brief Instance structure for the Q15 normalized LMS filter.
       */
    
      typedef struct
      {
        uint16_t numTaps;    /**< Number of coefficients in the filter. */
        q15_t *pState;        /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
        q15_t *pCoeffs;       /**< points to the coefficient array. The array is of length numTaps. */
        q15_t mu;            /**< step size that controls filter coefficient updates. */
        uint8_t postShift;   /**< bit shift applied to coefficients. */
        q15_t *recipTable;   /**< Points to the reciprocal initial value table. */
        q15_t energy;        /**< saves previous frame energy. */
        q15_t x0;            /**< saves previous input sample. */
      } arm_lms_norm_instance_q15;
    
      /**
       * @brief Processing function for Q15 normalized LMS filter.
       * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
       * @param[in] *pSrc points to the block of input data.
       * @param[in] *pRef points to the block of reference data.
       * @param[out] *pOut points to the block of output data.
       * @param[out] *pErr points to the block of error data.
       * @param[in] blockSize number of samples to process.
       * @return none.
       */
    
      void arm_lms_norm_q15(
      arm_lms_norm_instance_q15 * S,
      q15_t * pSrc,
      q15_t * pRef,
      q15_t * pOut,
      q15_t * pErr,
      uint32_t blockSize);
    
    
      /**
       * @brief Initialization function for Q15 normalized LMS filter.
       * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
       * @param[in] numTaps  number of filter coefficients.
       * @param[in] *pCoeffs points to coefficient buffer.
       * @param[in] *pState points to state buffer.
       * @param[in] mu step size that controls filter coefficient updates.
       * @param[in] blockSize number of samples to process.
       * @param[in] postShift bit shift applied to coefficients.
       * @return none.
       */
    
      void arm_lms_norm_init_q15(
      arm_lms_norm_instance_q15 * S,
      uint16_t numTaps,
      q15_t * pCoeffs,
      q15_t * pState,
      q15_t mu,
      uint32_t blockSize,
      uint8_t postShift);
    
      /**
       * @brief Correlation of floating-point sequences.
       * @param[in] *pSrcA points to the first input sequence.
       * @param[in] srcALen length of the first input sequence.
       * @param[in] *pSrcB points to the second input sequence.
       * @param[in] srcBLen length of the second input sequence.
       * @param[out] *pDst points to the block of output data  Length 2 * max(srcALen, srcBLen) - 1.
       * @return none.
       */
    
      void arm_correlate_f32(
      float32_t * pSrcA,
      uint32_t srcALen,
      float32_t * pSrcB,
      uint32_t srcBLen,
      float32_t * pDst);
    
    
       /**   
       * @brief Correlation of Q15 sequences   
       * @param[in] *pSrcA points to the first input sequence.   
       * @param[in] srcALen length of the first input sequence.   
       * @param[in] *pSrcB points to the second input sequence.   
       * @param[in] srcBLen length of the second input sequence.   
       * @param[out] *pDst points to the block of output data  Length 2 * max(srcALen, srcBLen) - 1.   
       * @param[in]  *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.   
       * @return none.   
       */
      void arm_correlate_opt_q15(
      q15_t * pSrcA,
      uint32_t srcALen,
      q15_t * pSrcB,
      uint32_t srcBLen,
      q15_t * pDst,
      q15_t * pScratch);
    
    
      /**
       * @brief Correlation of Q15 sequences.
       * @param[in] *pSrcA points to the first input sequence.
       * @param[in] srcALen length of the first input sequence.
       * @param[in] *pSrcB points to the second input sequence.
       * @param[in] srcBLen length of the second input sequence.
       * @param[out] *pDst points to the block of output data  Length 2 * max(srcALen, srcBLen) - 1.
       * @return none.
       */
    
      void arm_correlate_q15(
      q15_t * pSrcA,
      uint32_t srcALen,
      q15_t * pSrcB,
      uint32_t srcBLen,
      q15_t * pDst);
    
      /**
       * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
       * @param[in] *pSrcA points to the first input sequence.
       * @param[in] srcALen length of the first input sequence.
       * @param[in] *pSrcB points to the second input sequence.
       * @param[in] srcBLen length of the second input sequence.
       * @param[out] *pDst points to the block of output data  Length 2 * max(srcALen, srcBLen) - 1.
       * @return none.
       */
    
      void arm_correlate_fast_q15(
    
                 q15_t * pSrcA,
                uint32_t srcALen,
                 q15_t * pSrcB,
                uint32_t srcBLen,
                q15_t * pDst);
    
    
    
    
      /**
       * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
       * @param[in] *pSrcA points to the first input sequence.
       * @param[in] srcALen length of the first input sequence.
       * @param[in] *pSrcB points to the second input sequence.
       * @param[in] srcBLen length of the second input sequence.
       * @param[out] *pDst points to the block of output data  Length 2 * max(srcALen, srcBLen) - 1.
       * @param[in]  *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.   
       * @return none.
       */
    
      void arm_correlate_fast_opt_q15(
      q15_t * pSrcA,
      uint32_t srcALen,
      q15_t * pSrcB,
      uint32_t srcBLen,
      q15_t * pDst,
      q15_t * pScratch);
    
      /**
       * @brief Correlation of Q31 sequences.
       * @param[in] *pSrcA points to the first input sequence.
       * @param[in] srcALen length of the first input sequence.
       * @param[in] *pSrcB points to the second input sequence.
       * @param[in] srcBLen length of the second input sequence.
       * @param[out] *pDst points to the block of output data  Length 2 * max(srcALen, srcBLen) - 1.
       * @return none.
       */
    
      void arm_correlate_q31(
      q31_t * pSrcA,
      uint32_t srcALen,
      q31_t * pSrcB,
      uint32_t srcBLen,
      q31_t * pDst);
    
      /**
       * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4
       * @param[in] *pSrcA points to the first input sequence.
       * @param[in] srcALen length of the first input sequence.
       * @param[in] *pSrcB points to the second input sequence.
       * @param[in] srcBLen length of the second input sequence.
       * @param[out] *pDst points to the block of output data  Length 2 * max(srcALen, srcBLen) - 1.
       * @return none.
       */
    
      void arm_correlate_fast_q31(
      q31_t * pSrcA,
      uint32_t srcALen,
      q31_t * pSrcB,
      uint32_t srcBLen,
      q31_t * pDst);
    
    
    
     /**   
       * @brief Correlation of Q7 sequences.   
       * @param[in] *pSrcA points to the first input sequence.   
       * @param[in] srcALen length of the first input sequence.   
       * @param[in] *pSrcB points to the second input sequence.   
       * @param[in] srcBLen length of the second input sequence.   
       * @param[out] *pDst points to the block of output data  Length 2 * max(srcALen, srcBLen) - 1.   
       * @param[in]  *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.   
       * @param[in]  *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).   
       * @return none.   
       */
    
      void arm_correlate_opt_q7(
      q7_t * pSrcA,
      uint32_t srcALen,
      q7_t * pSrcB,
      uint32_t srcBLen,
      q7_t * pDst,
      q15_t * pScratch1,
      q15_t * pScratch2);
    
    
      /**
       * @brief Correlation of Q7 sequences.
       * @param[in] *pSrcA points to the first input sequence.
       * @param[in] srcALen length of the first input sequence.
       * @param[in] *pSrcB points to the second input sequence.
       * @param[in] srcBLen length of the second input sequence.
       * @param[out] *pDst points to the block of output data  Length 2 * max(srcALen, srcBLen) - 1.
       * @return none.
       */
    
      void arm_correlate_q7(
      q7_t * pSrcA,
      uint32_t srcALen,
      q7_t * pSrcB,
      uint32_t srcBLen,
      q7_t * pDst);
    
    
      /**
       * @brief Instance structure for the floating-point sparse FIR filter.
       */
      typedef struct
      {
        uint16_t numTaps;             /**< number of coefficients in the filter. */
        uint16_t stateIndex;          /**< state buffer index.  Points to the oldest sample in the state buffer. */
        float32_t *pState;            /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
        float32_t *pCoeffs;           /**< points to the coefficient array. The array is of length numTaps.*/
        uint16_t maxDelay;            /**< maximum offset specified by the pTapDelay array. */
        int32_t *pTapDelay;           /**< points to the array of delay values.  The array is of length numTaps. */
      } arm_fir_sparse_instance_f32;
    
      /**
       * @brief Instance structure for the Q31 sparse FIR filter.
       */
    
      typedef struct
      {
        uint16_t numTaps;             /**< number of coefficients in the filter. */
        uint16_t stateIndex;          /**< state buffer index.  Points to the oldest sample in the state buffer. */
        q31_t *pState;                /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
        q31_t *pCoeffs;               /**< points to the coefficient array. The array is of length numTaps.*/
        uint16_t maxDelay;            /**< maximum offset specified by the pTapDelay array. */
        int32_t *pTapDelay;           /**< points to the array of delay values.  The array is of length numTaps. */
      } arm_fir_sparse_instance_q31;
    
      /**
       * @brief Instance structure for the Q15 sparse FIR filter.
       */
    
      typedef struct
      {
        uint16_t numTaps;             /**< number of coefficients in the filter. */
        uint16_t stateIndex;          /**< state buffer index.  Points to the oldest sample in the state buffer. */
        q15_t *pState;                /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
        q15_t *pCoeffs;               /**< points to the coefficient array. The array is of length numTaps.*/
        uint16_t maxDelay;            /**< maximum offset specified by the pTapDelay array. */
        int32_t *pTapDelay;           /**< points to the array of delay values.  The array is of length numTaps. */
      } arm_fir_sparse_instance_q15;
    
      /**
       * @brief Instance structure for the Q7 sparse FIR filter.
       */
    
      typedef struct
      {
        uint16_t numTaps;             /**< number of coefficients in the filter. */
        uint16_t stateIndex;          /**< state buffer index.  Points to the oldest sample in the state buffer. */
        q7_t *pState;                 /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
        q7_t *pCoeffs;                /**< points to the coefficient array. The array is of length numTaps.*/
        uint16_t maxDelay;            /**< maximum offset specified by the pTapDelay array. */
        int32_t *pTapDelay;           /**< points to the array of delay values.  The array is of length numTaps. */
      } arm_fir_sparse_instance_q7;
    
      /**
       * @brief Processing function for the floating-point sparse FIR filter.
       * @param[in]  *S          points to an instance of the floating-point sparse FIR structure.
       * @param[in]  *pSrc       points to the block of input data.
       * @param[out] *pDst       points to the block of output data
       * @param[in]  *pScratchIn points to a temporary buffer of size blockSize.
       * @param[in]  blockSize   number of input samples to process per call.
       * @return none.
       */
    
      void arm_fir_sparse_f32(
      arm_fir_sparse_instance_f32 * S,
      float32_t * pSrc,
      float32_t * pDst,
      float32_t * pScratchIn,
      uint32_t blockSize);
    
      /**
       * @brief  Initialization function for the floating-point sparse FIR filter.
       * @param[in,out] *S         points to an instance of the floating-point sparse FIR structure.
       * @param[in]     numTaps    number of nonzero coefficients in the filter.
       * @param[in]     *pCoeffs   points to the array of filter coefficients.
       * @param[in]     *pState    points to the state buffer.
       * @param[in]     *pTapDelay points to the array of offset times.
       * @param[in]     maxDelay   maximum offset time supported.
       * @param[in]     blockSize  number of samples that will be processed per block.
       * @return none
       */
    
      void arm_fir_sparse_init_f32(
      arm_fir_sparse_instance_f32 * S,
      uint16_t numTaps,
      float32_t * pCoeffs,
      float32_t * pState,
      int32_t * pTapDelay,
      uint16_t maxDelay,
      uint32_t blockSize);
    
      /**
       * @brief Processing function for the Q31 sparse FIR filter.
       * @param[in]  *S          points to an instance of the Q31 sparse FIR structure.
       * @param[in]  *pSrc       points to the block of input data.
       * @param[out] *pDst       points to the block of output data
       * @param[in]  *pScratchIn points to a temporary buffer of size blockSize.
       * @param[in]  blockSize   number of input samples to process per call.
       * @return none.
       */
    
      void arm_fir_sparse_q31(
      arm_fir_sparse_instance_q31 * S,
      q31_t * pSrc,
      q31_t * pDst,
      q31_t * pScratchIn,
      uint32_t blockSize);
    
      /**
       * @brief  Initialization function for the Q31 sparse FIR filter.
       * @param[in,out] *S         points to an instance of the Q31 sparse FIR structure.
       * @param[in]     numTaps    number of nonzero coefficients in the filter.
       * @param[in]     *pCoeffs   points to the array of filter coefficients.
       * @param[in]     *pState    points to the state buffer.
       * @param[in]     *pTapDelay points to the array of offset times.
       * @param[in]     maxDelay   maximum offset time supported.
       * @param[in]     blockSize  number of samples that will be processed per block.
       * @return none
       */
    
      void arm_fir_sparse_init_q31(
      arm_fir_sparse_instance_q31 * S,
      uint16_t numTaps,
      q31_t * pCoeffs,
      q31_t * pState,
      int32_t * pTapDelay,
      uint16_t maxDelay,
      uint32_t blockSize);
    
      /**
       * @brief Processing function for the Q15 sparse FIR filter.
       * @param[in]  *S           points to an instance of the Q15 sparse FIR structure.
       * @param[in]  *pSrc        points to the block of input data.
       * @param[out] *pDst        points to the block of output data
       * @param[in]  *pScratchIn  points to a temporary buffer of size blockSize.
       * @param[in]  *pScratchOut points to a temporary buffer of size blockSize.
       * @param[in]  blockSize    number of input samples to process per call.
       * @return none.
       */
    
      void arm_fir_sparse_q15(
      arm_fir_sparse_instance_q15 * S,
      q15_t * pSrc,
      q15_t * pDst,
      q15_t * pScratchIn,
      q31_t * pScratchOut,
      uint32_t blockSize);
    
    
      /**
       * @brief  Initialization function for the Q15 sparse FIR filter.
       * @param[in,out] *S         points to an instance of the Q15 sparse FIR structure.
       * @param[in]     numTaps    number of nonzero coefficients in the filter.
       * @param[in]     *pCoeffs   points to the array of filter coefficients.
       * @param[in]     *pState    points to the state buffer.
       * @param[in]     *pTapDelay points to the array of offset times.
       * @param[in]     maxDelay   maximum offset time supported.
       * @param[in]     blockSize  number of samples that will be processed per block.
       * @return none
       */
    
      void arm_fir_sparse_init_q15(
      arm_fir_sparse_instance_q15 * S,
      uint16_t numTaps,
      q15_t * pCoeffs,
      q15_t * pState,
      int32_t * pTapDelay,
      uint16_t maxDelay,
      uint32_t blockSize);
    
      /**
       * @brief Processing function for the Q7 sparse FIR filter.
       * @param[in]  *S           points to an instance of the Q7 sparse FIR structure.
       * @param[in]  *pSrc        points to the block of input data.
       * @param[out] *pDst        points to the block of output data
       * @param[in]  *pScratchIn  points to a temporary buffer of size blockSize.
       * @param[in]  *pScratchOut points to a temporary buffer of size blockSize.
       * @param[in]  blockSize    number of input samples to process per call.