STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
arm_math.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------
2 * Copyright (C) 2010-2015 ARM Limited. All rights reserved.
3 *
4 * $Date: 20. October 2015
5 * $Revision: V1.4.5 b
6 *
7 * Project: CMSIS DSP Library
8 * Title: arm_math.h
9 *
10 * Description: Public header file for CMSIS DSP Library
11 *
12 * Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * - Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * - Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in
21 * the documentation and/or other materials provided with the
22 * distribution.
23 * - Neither the name of ARM LIMITED nor the names of its contributors
24 * may be used to endorse or promote products derived from this
25 * software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
34 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 * POSSIBILITY OF SUCH DAMAGE.
39  * -------------------------------------------------------------------- */
40 
288 #ifndef _ARM_MATH_H
289 #define _ARM_MATH_H
290 
291 /* ignore some GCC warnings */
292 #if defined ( __GNUC__ )
293 #pragma GCC diagnostic push
294 #pragma GCC diagnostic ignored "-Wsign-conversion"
295 #pragma GCC diagnostic ignored "-Wconversion"
296 #pragma GCC diagnostic ignored "-Wunused-parameter"
297 #endif
298 
299 #define __CMSIS_GENERIC /* disable NVIC and Systick functions */
300 
301 #if defined(ARM_MATH_CM7)
302  #include "core_cm7.h"
303 #elif defined (ARM_MATH_CM4)
304  #include "core_cm4.h"
305 #elif defined (ARM_MATH_CM3)
306  #include "core_cm3.h"
307 #elif defined (ARM_MATH_CM0)
308  #include "core_cm0.h"
309  #define ARM_MATH_CM0_FAMILY
310 #elif defined (ARM_MATH_CM0PLUS)
311  #include "core_cm0plus.h"
312  #define ARM_MATH_CM0_FAMILY
313 #else
314  #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0"
315 #endif
316 
317 #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */
318 #include "string.h"
319 #include "math.h"
320 #ifdef __cplusplus
321 extern "C"
322 {
323 #endif
324 
325 
330 #define DELTA_Q31 (0x100)
331 #define DELTA_Q15 0x5
332 #define INDEX_MASK 0x0000003F
333 #ifndef PI
334 #define PI 3.14159265358979f
335 #endif
336 
341 #define FAST_MATH_TABLE_SIZE 512
342 #define FAST_MATH_Q31_SHIFT (32 - 10)
343 #define FAST_MATH_Q15_SHIFT (16 - 10)
344 #define CONTROLLER_Q31_SHIFT (32 - 9)
345 #define TABLE_SIZE 256
346 #define TABLE_SPACING_Q31 0x400000
347 #define TABLE_SPACING_Q15 0x80
348 
352  /* 1.31(q31) Fixed value of 2/360 */
353  /* -1 to +1 is divided into 360 values so total spacing is (2/360) */
354 #define INPUT_SPACING 0xB60B61
355 
359 #ifndef UNALIGNED_SUPPORT_DISABLE
360  #define ALIGN4
361 #else
362  #if defined (__GNUC__)
363  #define ALIGN4 __attribute__((aligned(4)))
364  #else
365  #define ALIGN4 __align(4)
366  #endif
367 #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
368 
373  typedef enum
374  {
382  } arm_status;
383 
387  typedef int8_t q7_t;
388 
392  typedef int16_t q15_t;
393 
397  typedef int32_t q31_t;
398 
402  typedef int64_t q63_t;
403 
407  typedef float float32_t;
408 
412  typedef double float64_t;
413 
417 #if defined __CC_ARM
418  #define __SIMD32_TYPE int32_t __packed
419  #define CMSIS_UNUSED __attribute__((unused))
420 
421 #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
422  #define __SIMD32_TYPE int32_t
423  #define CMSIS_UNUSED __attribute__((unused))
424 
425 #elif defined __GNUC__
426  #define __SIMD32_TYPE int32_t
427  #define CMSIS_UNUSED __attribute__((unused))
428 
429 #elif defined __ICCARM__
430  #define __SIMD32_TYPE int32_t __packed
431  #define CMSIS_UNUSED
432 
433 #elif defined __CSMC__
434  #define __SIMD32_TYPE int32_t
435  #define CMSIS_UNUSED
436 
437 #elif defined __TASKING__
438  #define __SIMD32_TYPE __unaligned int32_t
439  #define CMSIS_UNUSED
440 
441 #else
442  #error Unknown compiler
443 #endif
444 
445 #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr))
446 #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr))
447 #define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr))
448 #define __SIMD64(addr) (*(int64_t **) & (addr))
449 
450 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
451 
454 #define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \
455  (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) )
456 #define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \
457  (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) )
458 
459 #endif
460 
461 
465 #ifndef ARM_MATH_BIG_ENDIAN
466 
467 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \
468  (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \
469  (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \
470  (((int32_t)(v3) << 24) & (int32_t)0xFF000000) )
471 #else
472 
473 #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \
474  (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \
475  (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \
476  (((int32_t)(v0) << 24) & (int32_t)0xFF000000) )
477 
478 #endif
479 
480 
484  static __INLINE q31_t clip_q63_to_q31(
485  q63_t x)
486  {
487  return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
488  ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x;
489  }
490 
494  static __INLINE q15_t clip_q63_to_q15(
495  q63_t x)
496  {
497  return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ?
498  ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15);
499  }
500 
504  static __INLINE q7_t clip_q31_to_q7(
505  q31_t x)
506  {
507  return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ?
508  ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x;
509  }
510 
514  static __INLINE q15_t clip_q31_to_q15(
515  q31_t x)
516  {
517  return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ?
518  ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x;
519  }
520 
525  static __INLINE q63_t mult32x64(
526  q63_t x,
527  q31_t y)
528  {
529  return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) +
530  (((q63_t) (x >> 32) * y)));
531  }
532 
533 /*
534  #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM )
535  #define __CLZ __clz
536  #endif
537  */
538 /* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */
539 #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) )
540  static __INLINE uint32_t __CLZ(
541  q31_t data);
542 
543  static __INLINE uint32_t __CLZ(
544  q31_t data)
545  {
546  uint32_t count = 0;
547  uint32_t mask = 0x80000000;
548 
549  while((data & mask) == 0)
550  {
551  count += 1u;
552  mask = mask >> 1u;
553  }
554 
555  return (count);
556  }
557 #endif
558 
563  static __INLINE uint32_t arm_recip_q31(
564  q31_t in,
565  q31_t * dst,
566  q31_t * pRecipTable)
567  {
568  q31_t out;
569  uint32_t tempVal;
570  uint32_t index, i;
571  uint32_t signBits;
572 
573  if(in > 0)
574  {
575  signBits = ((uint32_t) (__CLZ( in) - 1));
576  }
577  else
578  {
579  signBits = ((uint32_t) (__CLZ(-in) - 1));
580  }
581 
582  /* Convert input sample to 1.31 format */
583  in = (in << signBits);
584 
585  /* calculation of index for initial approximated Val */
586  index = (uint32_t)(in >> 24);
587  index = (index & INDEX_MASK);
588 
589  /* 1.31 with exp 1 */
590  out = pRecipTable[index];
591 
592  /* calculation of reciprocal value */
593  /* running approximation for two iterations */
594  for (i = 0u; i < 2u; i++)
595  {
596  tempVal = (uint32_t) (((q63_t) in * out) >> 31);
597  tempVal = 0x7FFFFFFFu - tempVal;
598  /* 1.31 with exp 1 */
599  /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */
600  out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30);
601  }
602 
603  /* write output */
604  *dst = out;
605 
606  /* return num of signbits of out = 1/in value */
607  return (signBits + 1u);
608  }
609 
610 
614  static __INLINE uint32_t arm_recip_q15(
615  q15_t in,
616  q15_t * dst,
617  q15_t * pRecipTable)
618  {
619  q15_t out = 0;
620  uint32_t tempVal = 0;
621  uint32_t index = 0, i = 0;
622  uint32_t signBits = 0;
623 
624  if(in > 0)
625  {
626  signBits = ((uint32_t)(__CLZ( in) - 17));
627  }
628  else
629  {
630  signBits = ((uint32_t)(__CLZ(-in) - 17));
631  }
632 
633  /* Convert input sample to 1.15 format */
634  in = (in << signBits);
635 
636  /* calculation of index for initial approximated Val */
637  index = (uint32_t)(in >> 8);
638  index = (index & INDEX_MASK);
639 
640  /* 1.15 with exp 1 */
641  out = pRecipTable[index];
642 
643  /* calculation of reciprocal value */
644  /* running approximation for two iterations */
645  for (i = 0u; i < 2u; i++)
646  {
647  tempVal = (uint32_t) (((q31_t) in * out) >> 15);
648  tempVal = 0x7FFFu - tempVal;
649  /* 1.15 with exp 1 */
650  out = (q15_t) (((q31_t) out * tempVal) >> 14);
651  /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */
652  }
653 
654  /* write output */
655  *dst = out;
656 
657  /* return num of signbits of out = 1/in value */
658  return (signBits + 1);
659  }
660 
661 
662  /*
663  * @brief C custom defined intrinisic function for only M0 processors
664  */
665 #if defined(ARM_MATH_CM0_FAMILY)
666  static __INLINE q31_t __SSAT(
667  q31_t x,
668  uint32_t y)
669  {
670  int32_t posMax, negMin;
671  uint32_t i;
672 
673  posMax = 1;
674  for (i = 0; i < (y - 1); i++)
675  {
676  posMax = posMax * 2;
677  }
678 
679  if(x > 0)
680  {
681  posMax = (posMax - 1);
682 
683  if(x > posMax)
684  {
685  x = posMax;
686  }
687  }
688  else
689  {
690  negMin = -posMax;
691 
692  if(x < negMin)
693  {
694  x = negMin;
695  }
696  }
697  return (x);
698  }
699 #endif /* end of ARM_MATH_CM0_FAMILY */
700 
701 
702  /*
703  * @brief C custom defined intrinsic function for M3 and M0 processors
704  */
705 #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY)
706 
707  /*
708  * @brief C custom defined QADD8 for M3 and M0 processors
709  */
710  static __INLINE uint32_t __QADD8(
711  uint32_t x,
712  uint32_t y)
713  {
714  q31_t r, s, t, u;
715 
716  r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF;
717  s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF;
718  t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF;
719  u = __SSAT(((((q31_t)x ) >> 24) + (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF;
720 
721  return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r )));
722  }
723 
724 
725  /*
726  * @brief C custom defined QSUB8 for M3 and M0 processors
727  */
728  static __INLINE uint32_t __QSUB8(
729  uint32_t x,
730  uint32_t y)
731  {
732  q31_t r, s, t, u;
733 
734  r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF;
735  s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF;
736  t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF;
737  u = __SSAT(((((q31_t)x ) >> 24) - (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF;
738 
739  return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r )));
740  }
741 
742 
743  /*
744  * @brief C custom defined QADD16 for M3 and M0 processors
745  */
746  static __INLINE uint32_t __QADD16(
747  uint32_t x,
748  uint32_t y)
749  {
750 /* q31_t r, s; without initialisation 'arm_offset_q15 test' fails but 'intrinsic' tests pass! for armCC */
751  q31_t r = 0, s = 0;
752 
753  r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
754  s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
755 
756  return ((uint32_t)((s << 16) | (r )));
757  }
758 
759 
760  /*
761  * @brief C custom defined SHADD16 for M3 and M0 processors
762  */
763  static __INLINE uint32_t __SHADD16(
764  uint32_t x,
765  uint32_t y)
766  {
767  q31_t r, s;
768 
769  r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
770  s = (((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
771 
772  return ((uint32_t)((s << 16) | (r )));
773  }
774 
775 
776  /*
777  * @brief C custom defined QSUB16 for M3 and M0 processors
778  */
779  static __INLINE uint32_t __QSUB16(
780  uint32_t x,
781  uint32_t y)
782  {
783  q31_t r, s;
784 
785  r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
786  s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
787 
788  return ((uint32_t)((s << 16) | (r )));
789  }
790 
791 
792  /*
793  * @brief C custom defined SHSUB16 for M3 and M0 processors
794  */
795  static __INLINE uint32_t __SHSUB16(
796  uint32_t x,
797  uint32_t y)
798  {
799  q31_t r, s;
800 
801  r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
802  s = (((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
803 
804  return ((uint32_t)((s << 16) | (r )));
805  }
806 
807 
808  /*
809  * @brief C custom defined QASX for M3 and M0 processors
810  */
811  static __INLINE uint32_t __QASX(
812  uint32_t x,
813  uint32_t y)
814  {
815  q31_t r, s;
816 
817  r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
818  s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
819 
820  return ((uint32_t)((s << 16) | (r )));
821  }
822 
823 
824  /*
825  * @brief C custom defined SHASX for M3 and M0 processors
826  */
827  static __INLINE uint32_t __SHASX(
828  uint32_t x,
829  uint32_t y)
830  {
831  q31_t r, s;
832 
833  r = (((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
834  s = (((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
835 
836  return ((uint32_t)((s << 16) | (r )));
837  }
838 
839 
840  /*
841  * @brief C custom defined QSAX for M3 and M0 processors
842  */
843  static __INLINE uint32_t __QSAX(
844  uint32_t x,
845  uint32_t y)
846  {
847  q31_t r, s;
848 
849  r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF;
850  s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF;
851 
852  return ((uint32_t)((s << 16) | (r )));
853  }
854 
855 
856  /*
857  * @brief C custom defined SHSAX for M3 and M0 processors
858  */
859  static __INLINE uint32_t __SHSAX(
860  uint32_t x,
861  uint32_t y)
862  {
863  q31_t r, s;
864 
865  r = (((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF;
866  s = (((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF;
867 
868  return ((uint32_t)((s << 16) | (r )));
869  }
870 
871 
872  /*
873  * @brief C custom defined SMUSDX for M3 and M0 processors
874  */
875  static __INLINE uint32_t __SMUSDX(
876  uint32_t x,
877  uint32_t y)
878  {
879  return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) -
880  ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) ));
881  }
882 
883  /*
884  * @brief C custom defined SMUADX for M3 and M0 processors
885  */
886  static __INLINE uint32_t __SMUADX(
887  uint32_t x,
888  uint32_t y)
889  {
890  return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) +
891  ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) ));
892  }
893 
894 
895  /*
896  * @brief C custom defined QADD for M3 and M0 processors
897  */
898  static __INLINE int32_t __QADD(
899  int32_t x,
900  int32_t y)
901  {
902  return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y)));
903  }
904 
905 
906  /*
907  * @brief C custom defined QSUB for M3 and M0 processors
908  */
909  static __INLINE int32_t __QSUB(
910  int32_t x,
911  int32_t y)
912  {
913  return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y)));
914  }
915 
916 
917  /*
918  * @brief C custom defined SMLAD for M3 and M0 processors
919  */
920  static __INLINE uint32_t __SMLAD(
921  uint32_t x,
922  uint32_t y,
923  uint32_t sum)
924  {
925  return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) +
926  ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) +
927  ( ((q31_t)sum ) ) ));
928  }
929 
930 
931  /*
932  * @brief C custom defined SMLADX for M3 and M0 processors
933  */
934  static __INLINE uint32_t __SMLADX(
935  uint32_t x,
936  uint32_t y,
937  uint32_t sum)
938  {
939  return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) +
940  ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) +
941  ( ((q31_t)sum ) ) ));
942  }
943 
944 
945  /*
946  * @brief C custom defined SMLSDX for M3 and M0 processors
947  */
948  static __INLINE uint32_t __SMLSDX(
949  uint32_t x,
950  uint32_t y,
951  uint32_t sum)
952  {
953  return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) -
954  ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) +
955  ( ((q31_t)sum ) ) ));
956  }
957 
958 
959  /*
960  * @brief C custom defined SMLALD for M3 and M0 processors
961  */
962  static __INLINE uint64_t __SMLALD(
963  uint32_t x,
964  uint32_t y,
965  uint64_t sum)
966  {
967 /* return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + ((q15_t) x * (q15_t) y)); */
968  return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) +
969  ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) +
970  ( ((q63_t)sum ) ) ));
971  }
972 
973 
974  /*
975  * @brief C custom defined SMLALDX for M3 and M0 processors
976  */
977  static __INLINE uint64_t __SMLALDX(
978  uint32_t x,
979  uint32_t y,
980  uint64_t sum)
981  {
982 /* return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + ((q15_t) x * (q15_t) (y >> 16)); */
983  return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) +
984  ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) +
985  ( ((q63_t)sum ) ) ));
986  }
987 
988 
989  /*
990  * @brief C custom defined SMUAD for M3 and M0 processors
991  */
992  static __INLINE uint32_t __SMUAD(
993  uint32_t x,
994  uint32_t y)
995  {
996  return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) +
997  ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) ));
998  }
999 
1000 
1001  /*
1002  * @brief C custom defined SMUSD for M3 and M0 processors
1003  */
1004  static __INLINE uint32_t __SMUSD(
1005  uint32_t x,
1006  uint32_t y)
1007  {
1008  return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) -
1009  ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) ));
1010  }
1011 
1012 
1013  /*
1014  * @brief C custom defined SXTB16 for M3 and M0 processors
1015  */
1016  static __INLINE uint32_t __SXTB16(
1017  uint32_t x)
1018  {
1019  return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) |
1020  ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000) ));
1021  }
1022 
1023 #endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */
1024 
1025 
1029  typedef struct
1030  {
1031  uint16_t numTaps;
1032  q7_t *pState;
1033  q7_t *pCoeffs;
1035 
1039  typedef struct
1040  {
1041  uint16_t numTaps;
1042  q15_t *pState;
1043  q15_t *pCoeffs;
1045 
1049  typedef struct
1050  {
1051  uint16_t numTaps;
1052  q31_t *pState;
1053  q31_t *pCoeffs;
1055 
1059  typedef struct
1060  {
1061  uint16_t numTaps;
1062  float32_t *pState;
1063  float32_t *pCoeffs;
1065 
1066 
1074  void arm_fir_q7(
1075  const arm_fir_instance_q7 * S,
1076  q7_t * pSrc,
1077  q7_t * pDst,
1078  uint32_t blockSize);
1079 
1080 
1089  void arm_fir_init_q7(
1090  arm_fir_instance_q7 * S,
1091  uint16_t numTaps,
1092  q7_t * pCoeffs,
1093  q7_t * pState,
1094  uint32_t blockSize);
1095 
1096 
1104  void arm_fir_q15(
1105  const arm_fir_instance_q15 * S,
1106  q15_t * pSrc,
1107  q15_t * pDst,
1108  uint32_t blockSize);
1109 
1110 
1118  void arm_fir_fast_q15(
1119  const arm_fir_instance_q15 * S,
1120  q15_t * pSrc,
1121  q15_t * pDst,
1122  uint32_t blockSize);
1123 
1124 
1137  uint16_t numTaps,
1138  q15_t * pCoeffs,
1139  q15_t * pState,
1140  uint32_t blockSize);
1141 
1142 
1150  void arm_fir_q31(
1151  const arm_fir_instance_q31 * S,
1152  q31_t * pSrc,
1153  q31_t * pDst,
1154  uint32_t blockSize);
1155 
1156 
1164  void arm_fir_fast_q31(
1165  const arm_fir_instance_q31 * S,
1166  q31_t * pSrc,
1167  q31_t * pDst,
1168  uint32_t blockSize);
1169 
1170 
1179  void arm_fir_init_q31(
1181  uint16_t numTaps,
1182  q31_t * pCoeffs,
1183  q31_t * pState,
1184  uint32_t blockSize);
1185 
1186 
1194  void arm_fir_f32(
1195  const arm_fir_instance_f32 * S,
1196  float32_t * pSrc,
1197  float32_t * pDst,
1198  uint32_t blockSize);
1199 
1200 
1209  void arm_fir_init_f32(
1211  uint16_t numTaps,
1212  float32_t * pCoeffs,
1213  float32_t * pState,
1214  uint32_t blockSize);
1215 
1216 
1220  typedef struct
1221  {
1222  int8_t numStages;
1223  q15_t *pState;
1224  q15_t *pCoeffs;
1225  int8_t postShift;
1227 
1231  typedef struct
1232  {
1233  uint32_t numStages;
1234  q31_t *pState;
1235  q31_t *pCoeffs;
1236  uint8_t postShift;
1238 
1242  typedef struct
1243  {
1244  uint32_t numStages;
1245  float32_t *pState;
1246  float32_t *pCoeffs;
1248 
1249 
1258  const arm_biquad_casd_df1_inst_q15 * S,
1259  q15_t * pSrc,
1260  q15_t * pDst,
1261  uint32_t blockSize);
1262 
1263 
1274  uint8_t numStages,
1275  q15_t * pCoeffs,
1276  q15_t * pState,
1277  int8_t postShift);
1278 
1279 
1288  const arm_biquad_casd_df1_inst_q15 * S,
1289  q15_t * pSrc,
1290  q15_t * pDst,
1291  uint32_t blockSize);
1292 
1293 
1302  const arm_biquad_casd_df1_inst_q31 * S,
1303  q31_t * pSrc,
1304  q31_t * pDst,
1305  uint32_t blockSize);
1306 
1307 
1316  const arm_biquad_casd_df1_inst_q31 * S,
1317  q31_t * pSrc,
1318  q31_t * pDst,
1319  uint32_t blockSize);
1320 
1321 
1332  uint8_t numStages,
1333  q31_t * pCoeffs,
1334  q31_t * pState,
1335  int8_t postShift);
1336 
1337 
1346  const arm_biquad_casd_df1_inst_f32 * S,
1347  float32_t * pSrc,
1348  float32_t * pDst,
1349  uint32_t blockSize);
1350 
1351 
1361  uint8_t numStages,
1362  float32_t * pCoeffs,
1363  float32_t * pState);
1364 
1365 
1369  typedef struct
1370  {
1371  uint16_t numRows;
1372  uint16_t numCols;
1373  float32_t *pData;
1375 
1376 
1380  typedef struct
1381  {
1382  uint16_t numRows;
1383  uint16_t numCols;
1384  float64_t *pData;
1386 
1390  typedef struct
1391  {
1392  uint16_t numRows;
1393  uint16_t numCols;
1394  q15_t *pData;
1396 
1400  typedef struct
1401  {
1402  uint16_t numRows;
1403  uint16_t numCols;
1404  q31_t *pData;
1406 
1407 
1417  const arm_matrix_instance_f32 * pSrcA,
1418  const arm_matrix_instance_f32 * pSrcB,
1419  arm_matrix_instance_f32 * pDst);
1420 
1421 
1431  const arm_matrix_instance_q15 * pSrcA,
1432  const arm_matrix_instance_q15 * pSrcB,
1433  arm_matrix_instance_q15 * pDst);
1434 
1435 
1445  const arm_matrix_instance_q31 * pSrcA,
1446  const arm_matrix_instance_q31 * pSrcB,
1447  arm_matrix_instance_q31 * pDst);
1448 
1449 
1459  const arm_matrix_instance_f32 * pSrcA,
1460  const arm_matrix_instance_f32 * pSrcB,
1461  arm_matrix_instance_f32 * pDst);
1462 
1463 
1473  const arm_matrix_instance_q15 * pSrcA,
1474  const arm_matrix_instance_q15 * pSrcB,
1475  arm_matrix_instance_q15 * pDst,
1476  q15_t * pScratch);
1477 
1478 
1488  const arm_matrix_instance_q31 * pSrcA,
1489  const arm_matrix_instance_q31 * pSrcB,
1490  arm_matrix_instance_q31 * pDst);
1491 
1492 
1501  const arm_matrix_instance_f32 * pSrc,
1502  arm_matrix_instance_f32 * pDst);
1503 
1504 
1513  const arm_matrix_instance_q15 * pSrc,
1514  arm_matrix_instance_q15 * pDst);
1515 
1516 
1525  const arm_matrix_instance_q31 * pSrc,
1526  arm_matrix_instance_q31 * pDst);
1527 
1528 
1538  const arm_matrix_instance_f32 * pSrcA,
1539  const arm_matrix_instance_f32 * pSrcB,
1540  arm_matrix_instance_f32 * pDst);
1541 
1542 
1553  const arm_matrix_instance_q15 * pSrcA,
1554  const arm_matrix_instance_q15 * pSrcB,
1555  arm_matrix_instance_q15 * pDst,
1556  q15_t * pState);
1557 
1558 
1569  const arm_matrix_instance_q15 * pSrcA,
1570  const arm_matrix_instance_q15 * pSrcB,
1571  arm_matrix_instance_q15 * pDst,
1572  q15_t * pState);
1573 
1574 
1584  const arm_matrix_instance_q31 * pSrcA,
1585  const arm_matrix_instance_q31 * pSrcB,
1586  arm_matrix_instance_q31 * pDst);
1587 
1588 
1598  const arm_matrix_instance_q31 * pSrcA,
1599  const arm_matrix_instance_q31 * pSrcB,
1600  arm_matrix_instance_q31 * pDst);
1601 
1602 
1612  const arm_matrix_instance_f32 * pSrcA,
1613  const arm_matrix_instance_f32 * pSrcB,
1614  arm_matrix_instance_f32 * pDst);
1615 
1616 
1626  const arm_matrix_instance_q15 * pSrcA,
1627  const arm_matrix_instance_q15 * pSrcB,
1628  arm_matrix_instance_q15 * pDst);
1629 
1630 
1640  const arm_matrix_instance_q31 * pSrcA,
1641  const arm_matrix_instance_q31 * pSrcB,
1642  arm_matrix_instance_q31 * pDst);
1643 
1644 
1654  const arm_matrix_instance_f32 * pSrc,
1655  float32_t scale,
1656  arm_matrix_instance_f32 * pDst);
1657 
1658 
1669  const arm_matrix_instance_q15 * pSrc,
1670  q15_t scaleFract,
1671  int32_t shift,
1672  arm_matrix_instance_q15 * pDst);
1673 
1674 
1685  const arm_matrix_instance_q31 * pSrc,
1686  q31_t scaleFract,
1687  int32_t shift,
1688  arm_matrix_instance_q31 * pDst);
1689 
1690 
1698  void arm_mat_init_q31(
1700  uint16_t nRows,
1701  uint16_t nColumns,
1702  q31_t * pData);
1703 
1704 
1712  void arm_mat_init_q15(
1714  uint16_t nRows,
1715  uint16_t nColumns,
1716  q15_t * pData);
1717 
1718 
1726  void arm_mat_init_f32(
1728  uint16_t nRows,
1729  uint16_t nColumns,
1730  float32_t * pData);
1731 
1732 
1733 
1737  typedef struct
1738  {
1739  q15_t A0;
1740 #ifdef ARM_MATH_CM0_FAMILY
1741  q15_t A1;
1742  q15_t A2;
1743 #else
1744  q31_t A1;
1745 #endif
1746  q15_t state[3];
1747  q15_t Kp;
1748  q15_t Ki;
1749  q15_t Kd;
1751 
1755  typedef struct
1756  {
1757  q31_t A0;
1758  q31_t A1;
1759  q31_t A2;
1760  q31_t state[3];
1761  q31_t Kp;
1762  q31_t Ki;
1763  q31_t Kd;
1765 
1769  typedef struct
1770  {
1771  float32_t A0;
1772  float32_t A1;
1773  float32_t A2;
1774  float32_t state[3];
1775  float32_t Kp;
1776  float32_t Ki;
1777  float32_t Kd;
1779 
1780 
1781 
1787  void arm_pid_init_f32(
1789  int32_t resetStateFlag);
1790 
1791 
1796  void arm_pid_reset_f32(
1797  arm_pid_instance_f32 * S);
1798 
1799 
1805  void arm_pid_init_q31(
1807  int32_t resetStateFlag);
1808 
1809 
1815  void arm_pid_reset_q31(
1816  arm_pid_instance_q31 * S);
1817 
1818 
1824  void arm_pid_init_q15(
1826  int32_t resetStateFlag);
1827 
1828 
1833  void arm_pid_reset_q15(
1834  arm_pid_instance_q15 * S);
1835 
1836 
1840  typedef struct
1841  {
1842  uint32_t nValues;
1843  float32_t x1;
1844  float32_t xSpacing;
1845  float32_t *pYData;
1847 
1851  typedef struct
1852  {
1853  uint16_t numRows;
1854  uint16_t numCols;
1855  float32_t *pData;
1857 
1861  typedef struct
1862  {
1863  uint16_t numRows;
1864  uint16_t numCols;
1865  q31_t *pData;
1867 
1871  typedef struct
1872  {
1873  uint16_t numRows;
1874  uint16_t numCols;
1875  q15_t *pData;
1877 
1881  typedef struct
1882  {
1883  uint16_t numRows;
1884  uint16_t numCols;
1885  q7_t *pData;
1887 
1888 
1896  void arm_mult_q7(
1897  q7_t * pSrcA,
1898  q7_t * pSrcB,
1899  q7_t * pDst,
1900  uint32_t blockSize);
1901 
1902 
1910  void arm_mult_q15(
1911  q15_t * pSrcA,
1912  q15_t * pSrcB,
1913  q15_t * pDst,
1914  uint32_t blockSize);
1915 
1916 
1924  void arm_mult_q31(
1925  q31_t * pSrcA,
1926  q31_t * pSrcB,
1927  q31_t * pDst,
1928  uint32_t blockSize);
1929 
1930 
1938  void arm_mult_f32(
1939  float32_t * pSrcA,
1940  float32_t * pSrcB,
1941  float32_t * pDst,
1942  uint32_t blockSize);
1943 
1944 
1948  typedef struct
1949  {
1950  uint16_t fftLen;
1951  uint8_t ifftFlag;
1952  uint8_t bitReverseFlag;
1953  q15_t *pTwiddle;
1954  uint16_t *pBitRevTable;
1955  uint16_t twidCoefModifier;
1956  uint16_t bitRevFactor;
1958 
1959 /* Deprecated */
1962  uint16_t fftLen,
1963  uint8_t ifftFlag,
1964  uint8_t bitReverseFlag);
1965 
1966 /* Deprecated */
1967  void arm_cfft_radix2_q15(
1968  const arm_cfft_radix2_instance_q15 * S,
1969  q15_t * pSrc);
1970 
1971 
1975  typedef struct
1976  {
1977  uint16_t fftLen;
1978  uint8_t ifftFlag;
1979  uint8_t bitReverseFlag;
1980  q15_t *pTwiddle;
1981  uint16_t *pBitRevTable;
1982  uint16_t twidCoefModifier;
1983  uint16_t bitRevFactor;
1985 
1986 /* Deprecated */
1989  uint16_t fftLen,
1990  uint8_t ifftFlag,
1991  uint8_t bitReverseFlag);
1992 
1993 /* Deprecated */
1994  void arm_cfft_radix4_q15(
1995  const arm_cfft_radix4_instance_q15 * S,
1996  q15_t * pSrc);
1997 
2001  typedef struct
2002  {
2003  uint16_t fftLen;
2004  uint8_t ifftFlag;
2005  uint8_t bitReverseFlag;
2006  q31_t *pTwiddle;
2007  uint16_t *pBitRevTable;
2008  uint16_t twidCoefModifier;
2009  uint16_t bitRevFactor;
2011 
2012 /* Deprecated */
2015  uint16_t fftLen,
2016  uint8_t ifftFlag,
2017  uint8_t bitReverseFlag);
2018 
2019 /* Deprecated */
2020  void arm_cfft_radix2_q31(
2021  const arm_cfft_radix2_instance_q31 * S,
2022  q31_t * pSrc);
2023 
2027  typedef struct
2028  {
2029  uint16_t fftLen;
2030  uint8_t ifftFlag;
2031  uint8_t bitReverseFlag;
2032  q31_t *pTwiddle;
2033  uint16_t *pBitRevTable;
2034  uint16_t twidCoefModifier;
2035  uint16_t bitRevFactor;
2037 
2038 /* Deprecated */
2039  void arm_cfft_radix4_q31(
2040  const arm_cfft_radix4_instance_q31 * S,
2041  q31_t * pSrc);
2042 
2043 /* Deprecated */
2046  uint16_t fftLen,
2047  uint8_t ifftFlag,
2048  uint8_t bitReverseFlag);
2049 
2053  typedef struct
2054  {
2055  uint16_t fftLen;
2056  uint8_t ifftFlag;
2057  uint8_t bitReverseFlag;
2058  float32_t *pTwiddle;
2059  uint16_t *pBitRevTable;
2060  uint16_t twidCoefModifier;
2061  uint16_t bitRevFactor;
2062  float32_t onebyfftLen;
2064 
2065 /* Deprecated */
2068  uint16_t fftLen,
2069  uint8_t ifftFlag,
2070  uint8_t bitReverseFlag);
2071 
2072 /* Deprecated */
2073  void arm_cfft_radix2_f32(
2074  const arm_cfft_radix2_instance_f32 * S,
2075  float32_t * pSrc);
2076 
2080  typedef struct
2081  {
2082  uint16_t fftLen;
2083  uint8_t ifftFlag;
2084  uint8_t bitReverseFlag;
2085  float32_t *pTwiddle;
2086  uint16_t *pBitRevTable;
2087  uint16_t twidCoefModifier;
2088  uint16_t bitRevFactor;
2089  float32_t onebyfftLen;
2091 
2092 /* Deprecated */
2095  uint16_t fftLen,
2096  uint8_t ifftFlag,
2097  uint8_t bitReverseFlag);
2098 
2099 /* Deprecated */
2100  void arm_cfft_radix4_f32(
2101  const arm_cfft_radix4_instance_f32 * S,
2102  float32_t * pSrc);
2103 
2107  typedef struct
2108  {
2109  uint16_t fftLen;
2110  const q15_t *pTwiddle;
2111  const uint16_t *pBitRevTable;
2112  uint16_t bitRevLength;
2114 
2115 void arm_cfft_q15(
2116  const arm_cfft_instance_q15 * S,
2117  q15_t * p1,
2118  uint8_t ifftFlag,
2119  uint8_t bitReverseFlag);
2120 
2124  typedef struct
2125  {
2126  uint16_t fftLen;
2127  const q31_t *pTwiddle;
2128  const uint16_t *pBitRevTable;
2129  uint16_t bitRevLength;
2131 
2132 void arm_cfft_q31(
2133  const arm_cfft_instance_q31 * S,
2134  q31_t * p1,
2135  uint8_t ifftFlag,
2136  uint8_t bitReverseFlag);
2137 
2141  typedef struct
2142  {
2143  uint16_t fftLen;
2144  const float32_t *pTwiddle;
2145  const uint16_t *pBitRevTable;
2146  uint16_t bitRevLength;
2148 
2149  void arm_cfft_f32(
2150  const arm_cfft_instance_f32 * S,
2151  float32_t * p1,
2152  uint8_t ifftFlag,
2153  uint8_t bitReverseFlag);
2154 
2158  typedef struct
2159  {
2160  uint32_t fftLenReal;
2161  uint8_t ifftFlagR;
2164  q15_t *pTwiddleAReal;
2165  q15_t *pTwiddleBReal;
2168 
2171  uint32_t fftLenReal,
2172  uint32_t ifftFlagR,
2173  uint32_t bitReverseFlag);
2174 
2175  void arm_rfft_q15(
2176  const arm_rfft_instance_q15 * S,
2177  q15_t * pSrc,
2178  q15_t * pDst);
2179 
2183  typedef struct
2184  {
2185  uint32_t fftLenReal;
2186  uint8_t ifftFlagR;
2189  q31_t *pTwiddleAReal;
2190  q31_t *pTwiddleBReal;
2193 
2196  uint32_t fftLenReal,
2197  uint32_t ifftFlagR,
2198  uint32_t bitReverseFlag);
2199 
2200  void arm_rfft_q31(
2201  const arm_rfft_instance_q31 * S,
2202  q31_t * pSrc,
2203  q31_t * pDst);
2204 
2208  typedef struct
2209  {
2210  uint32_t fftLenReal;
2211  uint16_t fftLenBy2;
2212  uint8_t ifftFlagR;
2215  float32_t *pTwiddleAReal;
2216  float32_t *pTwiddleBReal;
2219 
2223  uint32_t fftLenReal,
2224  uint32_t ifftFlagR,
2225  uint32_t bitReverseFlag);
2226 
2227  void arm_rfft_f32(
2228  const arm_rfft_instance_f32 * S,
2229  float32_t * pSrc,
2230  float32_t * pDst);
2231 
2235 typedef struct
2236  {
2238  uint16_t fftLenRFFT;
2239  float32_t * pTwiddleRFFT;
2241 
2244  uint16_t fftLen);
2245 
2246 void arm_rfft_fast_f32(
2248  float32_t * p, float32_t * pOut,
2249  uint8_t ifftFlag);
2250 
2254  typedef struct
2255  {
2256  uint16_t N;
2257  uint16_t Nby2;
2258  float32_t normalize;
2259  float32_t *pTwiddle;
2260  float32_t *pCosFactor;
2264 
2265 
2278  arm_rfft_instance_f32 * S_RFFT,
2280  uint16_t N,
2281  uint16_t Nby2,
2282  float32_t normalize);
2283 
2284 
2291  void arm_dct4_f32(
2292  const arm_dct4_instance_f32 * S,
2293  float32_t * pState,
2294  float32_t * pInlineBuffer);
2295 
2296 
2300  typedef struct
2301  {
2302  uint16_t N;
2303  uint16_t Nby2;
2304  q31_t normalize;
2305  q31_t *pTwiddle;
2306  q31_t *pCosFactor;
2310 
2311 
2324  arm_rfft_instance_q31 * S_RFFT,
2326  uint16_t N,
2327  uint16_t Nby2,
2328  q31_t normalize);
2329 
2330 
2337  void arm_dct4_q31(
2338  const arm_dct4_instance_q31 * S,
2339  q31_t * pState,
2340  q31_t * pInlineBuffer);
2341 
2342 
2346  typedef struct
2347  {
2348  uint16_t N;
2349  uint16_t Nby2;
2350  q15_t normalize;
2351  q15_t *pTwiddle;
2352  q15_t *pCosFactor;
2356 
2357 
2370  arm_rfft_instance_q15 * S_RFFT,
2372  uint16_t N,
2373  uint16_t Nby2,
2374  q15_t normalize);
2375 
2376 
2383  void arm_dct4_q15(
2384  const arm_dct4_instance_q15 * S,
2385  q15_t * pState,
2386  q15_t * pInlineBuffer);
2387 
2388 
2396  void arm_add_f32(
2397  float32_t * pSrcA,
2398  float32_t * pSrcB,
2399  float32_t * pDst,
2400  uint32_t blockSize);
2401 
2402 
2410  void arm_add_q7(
2411  q7_t * pSrcA,
2412  q7_t * pSrcB,
2413  q7_t * pDst,
2414  uint32_t blockSize);
2415 
2416 
2424  void arm_add_q15(
2425  q15_t * pSrcA,
2426  q15_t * pSrcB,
2427  q15_t * pDst,
2428  uint32_t blockSize);
2429 
2430 
2438  void arm_add_q31(
2439  q31_t * pSrcA,
2440  q31_t * pSrcB,
2441  q31_t * pDst,
2442  uint32_t blockSize);
2443 
2444 
2452  void arm_sub_f32(
2453  float32_t * pSrcA,
2454  float32_t * pSrcB,
2455  float32_t * pDst,
2456  uint32_t blockSize);
2457 
2458 
2466  void arm_sub_q7(
2467  q7_t * pSrcA,
2468  q7_t * pSrcB,
2469  q7_t * pDst,
2470  uint32_t blockSize);
2471 
2472 
2480  void arm_sub_q15(
2481  q15_t * pSrcA,
2482  q15_t * pSrcB,
2483  q15_t * pDst,
2484  uint32_t blockSize);
2485 
2486 
2494  void arm_sub_q31(
2495  q31_t * pSrcA,
2496  q31_t * pSrcB,
2497  q31_t * pDst,
2498  uint32_t blockSize);
2499 
2500 
2508  void arm_scale_f32(
2509  float32_t * pSrc,
2510  float32_t scale,
2511  float32_t * pDst,
2512  uint32_t blockSize);
2513 
2514 
2523  void arm_scale_q7(
2524  q7_t * pSrc,
2525  q7_t scaleFract,
2526  int8_t shift,
2527  q7_t * pDst,
2528  uint32_t blockSize);
2529 
2530 
2539  void arm_scale_q15(
2540  q15_t * pSrc,
2541  q15_t scaleFract,
2542  int8_t shift,
2543  q15_t * pDst,
2544  uint32_t blockSize);
2545 
2546 
2555  void arm_scale_q31(
2556  q31_t * pSrc,
2557  q31_t scaleFract,
2558  int8_t shift,
2559  q31_t * pDst,
2560  uint32_t blockSize);
2561 
2562 
2569  void arm_abs_q7(
2570  q7_t * pSrc,
2571  q7_t * pDst,
2572  uint32_t blockSize);
2573 
2574 
2581  void arm_abs_f32(
2582  float32_t * pSrc,
2583  float32_t * pDst,
2584  uint32_t blockSize);
2585 
2586 
2593  void arm_abs_q15(
2594  q15_t * pSrc,
2595  q15_t * pDst,
2596  uint32_t blockSize);
2597 
2598 
2605  void arm_abs_q31(
2606  q31_t * pSrc,
2607  q31_t * pDst,
2608  uint32_t blockSize);
2609 
2610 
2618  void arm_dot_prod_f32(
2619  float32_t * pSrcA,
2620  float32_t * pSrcB,
2621  uint32_t blockSize,
2622  float32_t * result);
2623 
2624 
2632  void arm_dot_prod_q7(
2633  q7_t * pSrcA,
2634  q7_t * pSrcB,
2635  uint32_t blockSize,
2636  q31_t * result);
2637 
2638 
2646  void arm_dot_prod_q15(
2647  q15_t * pSrcA,
2648  q15_t * pSrcB,
2649  uint32_t blockSize,
2650  q63_t * result);
2651 
2652 
2660  void arm_dot_prod_q31(
2661  q31_t * pSrcA,
2662  q31_t * pSrcB,
2663  uint32_t blockSize,
2664  q63_t * result);
2665 
2666 
2674  void arm_shift_q7(
2675  q7_t * pSrc,
2676  int8_t shiftBits,
2677  q7_t * pDst,
2678  uint32_t blockSize);
2679 
2680 
2688  void arm_shift_q15(
2689  q15_t * pSrc,
2690  int8_t shiftBits,
2691  q15_t * pDst,
2692  uint32_t blockSize);
2693 
2694 
2702  void arm_shift_q31(
2703  q31_t * pSrc,
2704  int8_t shiftBits,
2705  q31_t * pDst,
2706  uint32_t blockSize);
2707 
2708 
2716  void arm_offset_f32(
2717  float32_t * pSrc,
2718  float32_t offset,
2719  float32_t * pDst,
2720  uint32_t blockSize);
2721 
2722 
2730  void arm_offset_q7(
2731  q7_t * pSrc,
2732  q7_t offset,
2733  q7_t * pDst,
2734  uint32_t blockSize);
2735 
2736 
2744  void arm_offset_q15(
2745  q15_t * pSrc,
2746  q15_t offset,
2747  q15_t * pDst,
2748  uint32_t blockSize);
2749 
2750 
2758  void arm_offset_q31(
2759  q31_t * pSrc,
2760  q31_t offset,
2761  q31_t * pDst,
2762  uint32_t blockSize);
2763 
2764 
2771  void arm_negate_f32(
2772  float32_t * pSrc,
2773  float32_t * pDst,
2774  uint32_t blockSize);
2775 
2776 
2783  void arm_negate_q7(
2784  q7_t * pSrc,
2785  q7_t * pDst,
2786  uint32_t blockSize);
2787 
2788 
2795  void arm_negate_q15(
2796  q15_t * pSrc,
2797  q15_t * pDst,
2798  uint32_t blockSize);
2799 
2800 
2807  void arm_negate_q31(
2808  q31_t * pSrc,
2809  q31_t * pDst,
2810  uint32_t blockSize);
2811 
2812 
2819  void arm_copy_f32(
2820  float32_t * pSrc,
2821  float32_t * pDst,
2822  uint32_t blockSize);
2823 
2824 
2831  void arm_copy_q7(
2832  q7_t * pSrc,
2833  q7_t * pDst,
2834  uint32_t blockSize);
2835 
2836 
2843  void arm_copy_q15(
2844  q15_t * pSrc,
2845  q15_t * pDst,
2846  uint32_t blockSize);
2847 
2848 
2855  void arm_copy_q31(
2856  q31_t * pSrc,
2857  q31_t * pDst,
2858  uint32_t blockSize);
2859 
2860 
2867  void arm_fill_f32(
2868  float32_t value,
2869  float32_t * pDst,
2870  uint32_t blockSize);
2871 
2872 
2879  void arm_fill_q7(
2880  q7_t value,
2881  q7_t * pDst,
2882  uint32_t blockSize);
2883 
2884 
2891  void arm_fill_q15(
2892  q15_t value,
2893  q15_t * pDst,
2894  uint32_t blockSize);
2895 
2896 
2903  void arm_fill_q31(
2904  q31_t value,
2905  q31_t * pDst,
2906  uint32_t blockSize);
2907 
2908 
2917  void arm_conv_f32(
2918  float32_t * pSrcA,
2919  uint32_t srcALen,
2920  float32_t * pSrcB,
2921  uint32_t srcBLen,
2922  float32_t * pDst);
2923 
2924 
2935  void arm_conv_opt_q15(
2936  q15_t * pSrcA,
2937  uint32_t srcALen,
2938  q15_t * pSrcB,
2939  uint32_t srcBLen,
2940  q15_t * pDst,
2941  q15_t * pScratch1,
2942  q15_t * pScratch2);
2943 
2944 
2953  void arm_conv_q15(
2954  q15_t * pSrcA,
2955  uint32_t srcALen,
2956  q15_t * pSrcB,
2957  uint32_t srcBLen,
2958  q15_t * pDst);
2959 
2960 
2969  void arm_conv_fast_q15(
2970  q15_t * pSrcA,
2971  uint32_t srcALen,
2972  q15_t * pSrcB,
2973  uint32_t srcBLen,
2974  q15_t * pDst);
2975 
2976 
2987  void arm_conv_fast_opt_q15(
2988  q15_t * pSrcA,
2989  uint32_t srcALen,
2990  q15_t * pSrcB,
2991  uint32_t srcBLen,
2992  q15_t * pDst,
2993  q15_t * pScratch1,
2994  q15_t * pScratch2);
2995 
2996 
3005  void arm_conv_q31(
3006  q31_t * pSrcA,
3007  uint32_t srcALen,
3008  q31_t * pSrcB,
3009  uint32_t srcBLen,
3010  q31_t * pDst);
3011 
3012 
3021  void arm_conv_fast_q31(
3022  q31_t * pSrcA,
3023  uint32_t srcALen,
3024  q31_t * pSrcB,
3025  uint32_t srcBLen,
3026  q31_t * pDst);
3027 
3028 
3039  void arm_conv_opt_q7(
3040  q7_t * pSrcA,
3041  uint32_t srcALen,
3042  q7_t * pSrcB,
3043  uint32_t srcBLen,
3044  q7_t * pDst,
3045  q15_t * pScratch1,
3046  q15_t * pScratch2);
3047 
3048 
3057  void arm_conv_q7(
3058  q7_t * pSrcA,
3059  uint32_t srcALen,
3060  q7_t * pSrcB,
3061  uint32_t srcBLen,
3062  q7_t * pDst);
3063 
3064 
3077  float32_t * pSrcA,
3078  uint32_t srcALen,
3079  float32_t * pSrcB,
3080  uint32_t srcBLen,
3081  float32_t * pDst,
3082  uint32_t firstIndex,
3083  uint32_t numPoints);
3084 
3085 
3100  q15_t * pSrcA,
3101  uint32_t srcALen,
3102  q15_t * pSrcB,
3103  uint32_t srcBLen,
3104  q15_t * pDst,
3105  uint32_t firstIndex,
3106  uint32_t numPoints,
3107  q15_t * pScratch1,
3108  q15_t * pScratch2);
3109 
3110 
3123  q15_t * pSrcA,
3124  uint32_t srcALen,
3125  q15_t * pSrcB,
3126  uint32_t srcBLen,
3127  q15_t * pDst,
3128  uint32_t firstIndex,
3129  uint32_t numPoints);
3130 
3131 
3144  q15_t * pSrcA,
3145  uint32_t srcALen,
3146  q15_t * pSrcB,
3147  uint32_t srcBLen,
3148  q15_t * pDst,
3149  uint32_t firstIndex,
3150  uint32_t numPoints);
3151 
3152 
3167  q15_t * pSrcA,
3168  uint32_t srcALen,
3169  q15_t * pSrcB,
3170  uint32_t srcBLen,
3171  q15_t * pDst,
3172  uint32_t firstIndex,
3173  uint32_t numPoints,
3174  q15_t * pScratch1,
3175  q15_t * pScratch2);
3176 
3177 
3190  q31_t * pSrcA,
3191  uint32_t srcALen,
3192  q31_t * pSrcB,
3193  uint32_t srcBLen,
3194  q31_t * pDst,
3195  uint32_t firstIndex,
3196  uint32_t numPoints);
3197 
3198 
3211  q31_t * pSrcA,
3212  uint32_t srcALen,
3213  q31_t * pSrcB,
3214  uint32_t srcBLen,
3215  q31_t * pDst,
3216  uint32_t firstIndex,
3217  uint32_t numPoints);
3218 
3219 
3234  q7_t * pSrcA,
3235  uint32_t srcALen,
3236  q7_t * pSrcB,
3237  uint32_t srcBLen,
3238  q7_t * pDst,
3239  uint32_t firstIndex,
3240  uint32_t numPoints,
3241  q15_t * pScratch1,
3242  q15_t * pScratch2);
3243 
3244 
3257  q7_t * pSrcA,
3258  uint32_t srcALen,
3259  q7_t * pSrcB,
3260  uint32_t srcBLen,
3261  q7_t * pDst,
3262  uint32_t firstIndex,
3263  uint32_t numPoints);
3264 
3265 
3269  typedef struct
3270  {
3271  uint8_t M;
3272  uint16_t numTaps;
3273  q15_t *pCoeffs;
3274  q15_t *pState;
3276 
3280  typedef struct
3281  {
3282  uint8_t M;
3283  uint16_t numTaps;
3284  q31_t *pCoeffs;
3285  q31_t *pState;
3287 
3291  typedef struct
3292  {
3293  uint8_t M;
3294  uint16_t numTaps;
3295  float32_t *pCoeffs;
3296  float32_t *pState;
3298 
3299 
3307  void arm_fir_decimate_f32(
3309  float32_t * pSrc,
3310  float32_t * pDst,
3311  uint32_t blockSize);
3312 
3313 
3327  uint16_t numTaps,
3328  uint8_t M,
3329  float32_t * pCoeffs,
3330  float32_t * pState,
3331  uint32_t blockSize);
3332 
3333 
3341  void arm_fir_decimate_q15(
3343  q15_t * pSrc,
3344  q15_t * pDst,
3345  uint32_t blockSize);
3346 
3347 
3357  q15_t * pSrc,
3358  q15_t * pDst,
3359  uint32_t blockSize);
3360 
3361 
3375  uint16_t numTaps,
3376  uint8_t M,
3377  q15_t * pCoeffs,
3378  q15_t * pState,
3379  uint32_t blockSize);
3380 
3381 
3389  void arm_fir_decimate_q31(
3391  q31_t * pSrc,
3392  q31_t * pDst,
3393  uint32_t blockSize);
3394 
3404  q31_t * pSrc,
3405  q31_t * pDst,
3406  uint32_t blockSize);
3407 
3408 
3422  uint16_t numTaps,
3423  uint8_t M,
3424  q31_t * pCoeffs,
3425  q31_t * pState,
3426  uint32_t blockSize);
3427 
3428 
3432  typedef struct
3433  {
3434  uint8_t L;
3435  uint16_t phaseLength;
3436  q15_t *pCoeffs;
3437  q15_t *pState;
3439 
3443  typedef struct
3444  {
3445  uint8_t L;
3446  uint16_t phaseLength;
3447  q31_t *pCoeffs;
3448  q31_t *pState;
3450 
3454  typedef struct
3455  {
3456  uint8_t L;
3457  uint16_t phaseLength;
3458  float32_t *pCoeffs;
3459  float32_t *pState;
3461 
3462 
3472  q15_t * pSrc,
3473  q15_t * pDst,
3474  uint32_t blockSize);
3475 
3476 
3490  uint8_t L,
3491  uint16_t numTaps,
3492  q15_t * pCoeffs,
3493  q15_t * pState,
3494  uint32_t blockSize);
3495 
3496 
3506  q31_t * pSrc,
3507  q31_t * pDst,
3508  uint32_t blockSize);
3509 
3510 
3524  uint8_t L,
3525  uint16_t numTaps,
3526  q31_t * pCoeffs,
3527  q31_t * pState,
3528  uint32_t blockSize);
3529 
3530 
3540  float32_t * pSrc,
3541  float32_t * pDst,
3542  uint32_t blockSize);
3543 
3544 
3558  uint8_t L,
3559  uint16_t numTaps,
3560  float32_t * pCoeffs,
3561  float32_t * pState,
3562  uint32_t blockSize);
3563 
3564 
3568  typedef struct
3569  {
3570  uint8_t numStages;
3571  q63_t *pState;
3572  q31_t *pCoeffs;
3573  uint8_t postShift;
3575 
3576 
3585  q31_t * pSrc,
3586  q31_t * pDst,
3587  uint32_t blockSize);
3588 
3589 
3599  uint8_t numStages,
3600  q31_t * pCoeffs,
3601  q63_t * pState,
3602  uint8_t postShift);
3603 
3604 
3608  typedef struct
3609  {
3610  uint8_t numStages;
3611  float32_t *pState;
3612  float32_t *pCoeffs;
3614 
3618  typedef struct
3619  {
3620  uint8_t numStages;
3621  float32_t *pState;
3622  float32_t *pCoeffs;
3624 
3628  typedef struct
3629  {
3630  uint8_t numStages;
3631  float64_t *pState;
3632  float64_t *pCoeffs;
3634 
3635 
3645  float32_t * pSrc,
3646  float32_t * pDst,
3647  uint32_t blockSize);
3648 
3649 
3659  float32_t * pSrc,
3660  float32_t * pDst,
3661  uint32_t blockSize);
3662 
3663 
3673  float64_t * pSrc,
3674  float64_t * pDst,
3675  uint32_t blockSize);
3676 
3677 
3687  uint8_t numStages,
3688  float32_t * pCoeffs,
3689  float32_t * pState);
3690 
3691 
3701  uint8_t numStages,
3702  float32_t * pCoeffs,
3703  float32_t * pState);
3704 
3705 
3715  uint8_t numStages,
3716  float64_t * pCoeffs,
3717  float64_t * pState);
3718 
3719 
3723  typedef struct
3724  {
3725  uint16_t numStages;
3726  q15_t *pState;
3727  q15_t *pCoeffs;
3729 
3733  typedef struct
3734  {
3735  uint16_t numStages;
3736  q31_t *pState;
3737  q31_t *pCoeffs;
3739 
3743  typedef struct
3744  {
3745  uint16_t numStages;
3746  float32_t *pState;
3747  float32_t *pCoeffs;
3749 
3750 
3760  uint16_t numStages,
3761  q15_t * pCoeffs,
3762  q15_t * pState);
3763 
3764 
3772  void arm_fir_lattice_q15(
3773  const arm_fir_lattice_instance_q15 * S,
3774  q15_t * pSrc,
3775  q15_t * pDst,
3776  uint32_t blockSize);
3777 
3778 
3788  uint16_t numStages,
3789  q31_t * pCoeffs,
3790  q31_t * pState);
3791 
3792 
3800  void arm_fir_lattice_q31(
3801  const arm_fir_lattice_instance_q31 * S,
3802  q31_t * pSrc,
3803  q31_t * pDst,
3804  uint32_t blockSize);
3805 
3806 
3816  uint16_t numStages,
3817  float32_t * pCoeffs,
3818  float32_t * pState);
3819 
3820 
3828  void arm_fir_lattice_f32(
3829  const arm_fir_lattice_instance_f32 * S,
3830  float32_t * pSrc,
3831  float32_t * pDst,
3832  uint32_t blockSize);
3833 
3834 
3838  typedef struct
3839  {
3840  uint16_t numStages;
3841  q15_t *pState;
3842  q15_t *pkCoeffs;
3843  q15_t *pvCoeffs;
3845 
3849  typedef struct
3850  {
3851  uint16_t numStages;
3852  q31_t *pState;
3853  q31_t *pkCoeffs;
3854  q31_t *pvCoeffs;
3856 
3860  typedef struct
3861  {
3862  uint16_t numStages;
3863  float32_t *pState;
3864  float32_t *pkCoeffs;
3865  float32_t *pvCoeffs;
3867 
3868 
3876  void arm_iir_lattice_f32(
3877  const arm_iir_lattice_instance_f32 * S,
3878  float32_t * pSrc,
3879  float32_t * pDst,
3880  uint32_t blockSize);
3881 
3882 
3894  uint16_t numStages,
3895  float32_t * pkCoeffs,
3896  float32_t * pvCoeffs,
3897  float32_t * pState,
3898  uint32_t blockSize);
3899 
3900 
3908  void arm_iir_lattice_q31(
3909  const arm_iir_lattice_instance_q31 * S,
3910  q31_t * pSrc,
3911  q31_t * pDst,
3912  uint32_t blockSize);
3913 
3914 
3926  uint16_t numStages,
3927  q31_t * pkCoeffs,
3928  q31_t * pvCoeffs,
3929  q31_t * pState,
3930  uint32_t blockSize);
3931 
3932 
3940  void arm_iir_lattice_q15(
3941  const arm_iir_lattice_instance_q15 * S,
3942  q15_t * pSrc,
3943  q15_t * pDst,
3944  uint32_t blockSize);
3945 
3946 
3958  uint16_t numStages,
3959  q15_t * pkCoeffs,
3960  q15_t * pvCoeffs,
3961  q15_t * pState,
3962  uint32_t blockSize);
3963 
3964 
3968  typedef struct
3969  {
3970  uint16_t numTaps;
3971  float32_t *pState;
3972  float32_t *pCoeffs;
3973  float32_t mu;
3975 
3976 
3986  void arm_lms_f32(
3987  const arm_lms_instance_f32 * S,
3988  float32_t * pSrc,
3989  float32_t * pRef,
3990  float32_t * pOut,
3991  float32_t * pErr,
3992  uint32_t blockSize);
3993 
3994 
4004  void arm_lms_init_f32(
4006  uint16_t numTaps,
4007  float32_t * pCoeffs,
4008  float32_t * pState,
4009  float32_t mu,
4010  uint32_t blockSize);
4011 
4012 
4016  typedef struct
4017  {
4018  uint16_t numTaps;
4019  q15_t *pState;
4020  q15_t *pCoeffs;
4021  q15_t mu;
4022  uint32_t postShift;
4024 
4025 
4036  void arm_lms_init_q15(
4038  uint16_t numTaps,
4039  q15_t * pCoeffs,
4040  q15_t * pState,
4041  q15_t mu,
4042  uint32_t blockSize,
4043  uint32_t postShift);
4044 
4045 
4055  void arm_lms_q15(
4056  const arm_lms_instance_q15 * S,
4057  q15_t * pSrc,
4058  q15_t * pRef,
4059  q15_t * pOut,
4060  q15_t * pErr,
4061  uint32_t blockSize);
4062 
4063 
4067  typedef struct
4068  {
4069  uint16_t numTaps;
4070  q31_t *pState;
4071  q31_t *pCoeffs;
4072  q31_t mu;
4073  uint32_t postShift;
4075 
4076 
4086  void arm_lms_q31(
4087  const arm_lms_instance_q31 * S,
4088  q31_t * pSrc,
4089  q31_t * pRef,
4090  q31_t * pOut,
4091  q31_t * pErr,
4092  uint32_t blockSize);
4093 
4094 
4105  void arm_lms_init_q31(
4107  uint16_t numTaps,
4108  q31_t * pCoeffs,
4109  q31_t * pState,
4110  q31_t mu,
4111  uint32_t blockSize,
4112  uint32_t postShift);
4113 
4114 
4118  typedef struct
4119  {
4120  uint16_t numTaps;
4121  float32_t *pState;
4122  float32_t *pCoeffs;
4123  float32_t mu;
4124  float32_t energy;
4125  float32_t x0;
4127 
4128 
4138  void arm_lms_norm_f32(
4140  float32_t * pSrc,
4141  float32_t * pRef,
4142  float32_t * pOut,
4143  float32_t * pErr,
4144  uint32_t blockSize);
4145 
4146 
4156  void arm_lms_norm_init_f32(
4158  uint16_t numTaps,
4159  float32_t * pCoeffs,
4160  float32_t * pState,
4161  float32_t mu,
4162  uint32_t blockSize);
4163 
4164 
4168  typedef struct
4169  {
4170  uint16_t numTaps;
4171  q31_t *pState;
4172  q31_t *pCoeffs;
4173  q31_t mu;
4174  uint8_t postShift;
4175  q31_t *recipTable;
4176  q31_t energy;
4177  q31_t x0;
4179 
4180 
4190  void arm_lms_norm_q31(
4192  q31_t * pSrc,
4193  q31_t * pRef,
4194  q31_t * pOut,
4195  q31_t * pErr,
4196  uint32_t blockSize);
4197 
4198 
4209  void arm_lms_norm_init_q31(
4211  uint16_t numTaps,
4212  q31_t * pCoeffs,
4213  q31_t * pState,
4214  q31_t mu,
4215  uint32_t blockSize,
4216  uint8_t postShift);
4217 
4218 
4222  typedef struct
4223  {
4224  uint16_t numTaps;
4225  q15_t *pState;
4226  q15_t *pCoeffs;
4227  q15_t mu;
4228  uint8_t postShift;
4229  q15_t *recipTable;
4230  q15_t energy;
4231  q15_t x0;
4233 
4234 
4244  void arm_lms_norm_q15(
4246  q15_t * pSrc,
4247  q15_t * pRef,
4248  q15_t * pOut,
4249  q15_t * pErr,
4250  uint32_t blockSize);
4251 
4252 
4263  void arm_lms_norm_init_q15(
4265  uint16_t numTaps,
4266  q15_t * pCoeffs,
4267  q15_t * pState,
4268  q15_t mu,
4269  uint32_t blockSize,
4270  uint8_t postShift);
4271 
4272 
4281  void arm_correlate_f32(
4282  float32_t * pSrcA,
4283  uint32_t srcALen,
4284  float32_t * pSrcB,
4285  uint32_t srcBLen,
4286  float32_t * pDst);
4287 
4288 
4298  void arm_correlate_opt_q15(
4299  q15_t * pSrcA,
4300  uint32_t srcALen,
4301  q15_t * pSrcB,
4302  uint32_t srcBLen,
4303  q15_t * pDst,
4304  q15_t * pScratch);
4305 
4306 
4316  void arm_correlate_q15(
4317  q15_t * pSrcA,
4318  uint32_t srcALen,
4319  q15_t * pSrcB,
4320  uint32_t srcBLen,
4321  q15_t * pDst);
4322 
4323 
4334  q15_t * pSrcA,
4335  uint32_t srcALen,
4336  q15_t * pSrcB,
4337  uint32_t srcBLen,
4338  q15_t * pDst);
4339 
4340 
4351  q15_t * pSrcA,
4352  uint32_t srcALen,
4353  q15_t * pSrcB,
4354  uint32_t srcBLen,
4355  q15_t * pDst,
4356  q15_t * pScratch);
4357 
4358 
4367  void arm_correlate_q31(
4368  q31_t * pSrcA,
4369  uint32_t srcALen,
4370  q31_t * pSrcB,
4371  uint32_t srcBLen,
4372  q31_t * pDst);
4373 
4374 
4384  q31_t * pSrcA,
4385  uint32_t srcALen,
4386  q31_t * pSrcB,
4387  uint32_t srcBLen,
4388  q31_t * pDst);
4389 
4390 
4401  void arm_correlate_opt_q7(
4402  q7_t * pSrcA,
4403  uint32_t srcALen,
4404  q7_t * pSrcB,
4405  uint32_t srcBLen,
4406  q7_t * pDst,
4407  q15_t * pScratch1,
4408  q15_t * pScratch2);
4409 
4410 
4419  void arm_correlate_q7(
4420  q7_t * pSrcA,
4421  uint32_t srcALen,
4422  q7_t * pSrcB,
4423  uint32_t srcBLen,
4424  q7_t * pDst);
4425 
4426 
4430  typedef struct
4431  {
4432  uint16_t numTaps;
4433  uint16_t stateIndex;
4434  float32_t *pState;
4435  float32_t *pCoeffs;
4436  uint16_t maxDelay;
4437  int32_t *pTapDelay;
4439 
4443  typedef struct
4444  {
4445  uint16_t numTaps;
4446  uint16_t stateIndex;
4447  q31_t *pState;
4448  q31_t *pCoeffs;
4449  uint16_t maxDelay;
4450  int32_t *pTapDelay;
4452 
4456  typedef struct
4457  {
4458  uint16_t numTaps;
4459  uint16_t stateIndex;
4460  q15_t *pState;
4461  q15_t *pCoeffs;
4462  uint16_t maxDelay;
4463  int32_t *pTapDelay;
4465 
4469  typedef struct
4470  {
4471  uint16_t numTaps;
4472  uint16_t stateIndex;
4473  q7_t *pState;
4474  q7_t *pCoeffs;
4475  uint16_t maxDelay;
4476  int32_t *pTapDelay;
4478 
4479 
4488  void arm_fir_sparse_f32(
4490  float32_t * pSrc,
4491  float32_t * pDst,
4492  float32_t * pScratchIn,
4493  uint32_t blockSize);
4494 
4495 
4508  uint16_t numTaps,
4509  float32_t * pCoeffs,
4510  float32_t * pState,
4511  int32_t * pTapDelay,
4512  uint16_t maxDelay,
4513  uint32_t blockSize);
4514 
4515 
4524  void arm_fir_sparse_q31(
4526  q31_t * pSrc,
4527  q31_t * pDst,
4528  q31_t * pScratchIn,
4529  uint32_t blockSize);
4530 
4531 
4544  uint16_t numTaps,
4545  q31_t * pCoeffs,
4546  q31_t * pState,
4547  int32_t * pTapDelay,
4548  uint16_t maxDelay,
4549  uint32_t blockSize);
4550 
4551 
4561  void arm_fir_sparse_q15(
4563  q15_t * pSrc,
4564  q15_t * pDst,
4565  q15_t * pScratchIn,
4566  q31_t * pScratchOut,
4567  uint32_t blockSize);
4568 
4569 
4582  uint16_t numTaps,
4583  q15_t * pCoeffs,
4584  q15_t * pState,
4585  int32_t * pTapDelay,
4586  uint16_t maxDelay,
4587  uint32_t blockSize);
4588 
4589 
4599  void arm_fir_sparse_q7(
4601  q7_t * pSrc,
4602  q7_t * pDst,
4603  q7_t * pScratchIn,
4604  q31_t * pScratchOut,
4605  uint32_t blockSize);
4606 
4607 
4620  uint16_t numTaps,
4621  q7_t * pCoeffs,
4622  q7_t * pState,
4623  int32_t * pTapDelay,
4624  uint16_t maxDelay,
4625  uint32_t blockSize);
4626 
4627 
4634  void arm_sin_cos_f32(
4635  float32_t theta,
4636  float32_t * pSinVal,
4637  float32_t * pCosVal);
4638 
4639 
4646  void arm_sin_cos_q31(
4647  q31_t theta,
4648  q31_t * pSinVal,
4649  q31_t * pCosVal);
4650 
4651 
4658  void arm_cmplx_conj_f32(
4659  float32_t * pSrc,
4660  float32_t * pDst,
4661  uint32_t numSamples);
4662 
4669  void arm_cmplx_conj_q31(
4670  q31_t * pSrc,
4671  q31_t * pDst,
4672  uint32_t numSamples);
4673 
4674 
4681  void arm_cmplx_conj_q15(
4682  q15_t * pSrc,
4683  q15_t * pDst,
4684  uint32_t numSamples);
4685 
4686 
4694  float32_t * pSrc,
4695  float32_t * pDst,
4696  uint32_t numSamples);
4697 
4698 
4706  q31_t * pSrc,
4707  q31_t * pDst,
4708  uint32_t numSamples);
4709 
4710 
4718  q15_t * pSrc,
4719  q15_t * pDst,
4720  uint32_t numSamples);
4721 
4722 
4795  static __INLINE float32_t arm_pid_f32(
4797  float32_t in)
4798  {
4799  float32_t out;
4800 
4801  /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */
4802  out = (S->A0 * in) +
4803  (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]);
4804 
4805  /* Update state */
4806  S->state[1] = S->state[0];
4807  S->state[0] = in;
4808  S->state[2] = out;
4809 
4810  /* return to application */
4811  return (out);
4812 
4813  }
4814 
4829  static __INLINE q31_t arm_pid_q31(
4831  q31_t in)
4832  {
4833  q63_t acc;
4834  q31_t out;
4835 
4836  /* acc = A0 * x[n] */
4837  acc = (q63_t) S->A0 * in;
4838 
4839  /* acc += A1 * x[n-1] */
4840  acc += (q63_t) S->A1 * S->state[0];
4841 
4842  /* acc += A2 * x[n-2] */
4843  acc += (q63_t) S->A2 * S->state[1];
4844 
4845  /* convert output to 1.31 format to add y[n-1] */
4846  out = (q31_t) (acc >> 31u);
4847 
4848  /* out += y[n-1] */
4849  out += S->state[2];
4850 
4851  /* Update state */
4852  S->state[1] = S->state[0];
4853  S->state[0] = in;
4854  S->state[2] = out;
4855 
4856  /* return to application */
4857  return (out);
4858  }
4859 
4860 
4876  static __INLINE q15_t arm_pid_q15(
4878  q15_t in)
4879  {
4880  q63_t acc;
4881  q15_t out;
4882 
4883 #ifndef ARM_MATH_CM0_FAMILY
4884  __SIMD32_TYPE *vstate;
4885 
4886  /* Implementation of PID controller */
4887 
4888  /* acc = A0 * x[n] */
4889  acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in);
4890 
4891  /* acc += A1 * x[n-1] + A2 * x[n-2] */
4892  vstate = __SIMD32_CONST(S->state);
4893  acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)*vstate, (uint64_t)acc);
4894 #else
4895  /* acc = A0 * x[n] */
4896  acc = ((q31_t) S->A0) * in;
4897 
4898  /* acc += A1 * x[n-1] + A2 * x[n-2] */
4899  acc += (q31_t) S->A1 * S->state[0];
4900  acc += (q31_t) S->A2 * S->state[1];
4901 #endif
4902 
4903  /* acc += y[n-1] */
4904  acc += (q31_t) S->state[2] << 15;
4905 
4906  /* saturate the output */
4907  out = (q15_t) (__SSAT((acc >> 15), 16));
4908 
4909  /* Update state */
4910  S->state[1] = S->state[0];
4911  S->state[0] = in;
4912  S->state[2] = out;
4913 
4914  /* return to application */
4915  return (out);
4916  }
4917 
4931  const arm_matrix_instance_f32 * src,
4932  arm_matrix_instance_f32 * dst);
4933 
4934 
4943  const arm_matrix_instance_f64 * src,
4944  arm_matrix_instance_f64 * dst);
4945 
4946 
4947 
4987  static __INLINE void arm_clarke_f32(
4988  float32_t Ia,
4989  float32_t Ib,
4990  float32_t * pIalpha,
4991  float32_t * pIbeta)
4992  {
4993  /* Calculate pIalpha using the equation, pIalpha = Ia */
4994  *pIalpha = Ia;
4995 
4996  /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */
4997  *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib);
4998  }
4999 
5000 
5014  static __INLINE void arm_clarke_q31(
5015  q31_t Ia,
5016  q31_t Ib,
5017  q31_t * pIalpha,
5018  q31_t * pIbeta)
5019  {
5020  q31_t product1, product2; /* Temporary variables used to store intermediate results */
5021 
5022  /* Calculating pIalpha from Ia by equation pIalpha = Ia */
5023  *pIalpha = Ia;
5024 
5025  /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */
5026  product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30);
5027 
5028  /* Intermediate product is calculated by (2/sqrt(3) * Ib) */
5029  product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30);
5030 
5031  /* pIbeta is calculated by adding the intermediate products */
5032  *pIbeta = __QADD(product1, product2);
5033  }
5034 
5045  void arm_q7_to_q31(
5046  q7_t * pSrc,
5047  q31_t * pDst,
5048  uint32_t blockSize);
5049 
5050 
5051 
5084  static __INLINE void arm_inv_clarke_f32(
5085  float32_t Ialpha,
5086  float32_t Ibeta,
5087  float32_t * pIa,
5088  float32_t * pIb)
5089  {
5090  /* Calculating pIa from Ialpha by equation pIa = Ialpha */
5091  *pIa = Ialpha;
5092 
5093  /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */
5094  *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta;
5095  }
5096 
5097 
5111  static __INLINE void arm_inv_clarke_q31(
5112  q31_t Ialpha,
5113  q31_t Ibeta,
5114  q31_t * pIa,
5115  q31_t * pIb)
5116  {
5117  q31_t product1, product2; /* Temporary variables used to store intermediate results */
5118 
5119  /* Calculating pIa from Ialpha by equation pIa = Ialpha */
5120  *pIa = Ialpha;
5121 
5122  /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */
5123  product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31);
5124 
5125  /* Intermediate product is calculated by (1/sqrt(3) * pIb) */
5126  product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31);
5127 
5128  /* pIb is calculated by subtracting the products */
5129  *pIb = __QSUB(product2, product1);
5130  }
5131 
5142  void arm_q7_to_q15(
5143  q7_t * pSrc,
5144  q15_t * pDst,
5145  uint32_t blockSize);
5146 
5147 
5148 
5194  static __INLINE void arm_park_f32(
5195  float32_t Ialpha,
5196  float32_t Ibeta,
5197  float32_t * pId,
5198  float32_t * pIq,
5199  float32_t sinVal,
5200  float32_t cosVal)
5201  {
5202  /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */
5203  *pId = Ialpha * cosVal + Ibeta * sinVal;
5204 
5205  /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */
5206  *pIq = -Ialpha * sinVal + Ibeta * cosVal;
5207  }
5208 
5209 
5225  static __INLINE void arm_park_q31(
5226  q31_t Ialpha,
5227  q31_t Ibeta,
5228  q31_t * pId,
5229  q31_t * pIq,
5230  q31_t sinVal,
5231  q31_t cosVal)
5232  {
5233  q31_t product1, product2; /* Temporary variables used to store intermediate results */
5234  q31_t product3, product4; /* Temporary variables used to store intermediate results */
5235 
5236  /* Intermediate product is calculated by (Ialpha * cosVal) */
5237  product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31);
5238 
5239  /* Intermediate product is calculated by (Ibeta * sinVal) */
5240  product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31);
5241 
5242 
5243  /* Intermediate product is calculated by (Ialpha * sinVal) */
5244  product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31);
5245 
5246  /* Intermediate product is calculated by (Ibeta * cosVal) */
5247  product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31);
5248 
5249  /* Calculate pId by adding the two intermediate products 1 and 2 */
5250  *pId = __QADD(product1, product2);
5251 
5252  /* Calculate pIq by subtracting the two intermediate products 3 from 4 */
5253  *pIq = __QSUB(product4, product3);
5254  }
5255 
5266  void arm_q7_to_float(
5267  q7_t * pSrc,
5268  float32_t * pDst,
5269  uint32_t blockSize);
5270 
5271 
5307  static __INLINE void arm_inv_park_f32(
5308  float32_t Id,
5309  float32_t Iq,
5310  float32_t * pIalpha,
5311  float32_t * pIbeta,
5312  float32_t sinVal,
5313  float32_t cosVal)
5314  {
5315  /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */
5316  *pIalpha = Id * cosVal - Iq * sinVal;
5317 
5318  /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */
5319  *pIbeta = Id * sinVal + Iq * cosVal;
5320  }
5321 
5322 
5338  static __INLINE void arm_inv_park_q31(
5339  q31_t Id,
5340  q31_t Iq,
5341  q31_t * pIalpha,
5342  q31_t * pIbeta,
5343  q31_t sinVal,
5344  q31_t cosVal)
5345  {
5346  q31_t product1, product2; /* Temporary variables used to store intermediate results */
5347  q31_t product3, product4; /* Temporary variables used to store intermediate results */
5348 
5349  /* Intermediate product is calculated by (Id * cosVal) */
5350  product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31);
5351 
5352  /* Intermediate product is calculated by (Iq * sinVal) */
5353  product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31);
5354 
5355 
5356  /* Intermediate product is calculated by (Id * sinVal) */
5357  product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31);
5358 
5359  /* Intermediate product is calculated by (Iq * cosVal) */
5360  product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31);
5361 
5362  /* Calculate pIalpha by using the two intermediate products 1 and 2 */
5363  *pIalpha = __QSUB(product1, product2);
5364 
5365  /* Calculate pIbeta by using the two intermediate products 3 and 4 */
5366  *pIbeta = __QADD(product4, product3);
5367  }
5368 
5380  void arm_q31_to_float(
5381  q31_t * pSrc,
5382  float32_t * pDst,
5383  uint32_t blockSize);
5384 
5433  static __INLINE float32_t arm_linear_interp_f32(
5435  float32_t x)
5436  {
5437  float32_t y;
5438  float32_t x0, x1; /* Nearest input values */
5439  float32_t y0, y1; /* Nearest output values */
5440  float32_t xSpacing = S->xSpacing; /* spacing between input values */
5441  int32_t i; /* Index variable */
5442  float32_t *pYData = S->pYData; /* pointer to output table */
5443 
5444  /* Calculation of index */
5445  i = (int32_t) ((x - S->x1) / xSpacing);
5446 
5447  if(i < 0)
5448  {
5449  /* Iniatilize output for below specified range as least output value of table */
5450  y = pYData[0];
5451  }
5452  else if((uint32_t)i >= S->nValues)
5453  {
5454  /* Iniatilize output for above specified range as last output value of table */
5455  y = pYData[S->nValues - 1];
5456  }
5457  else
5458  {
5459  /* Calculation of nearest input values */
5460  x0 = S->x1 + i * xSpacing;
5461  x1 = S->x1 + (i + 1) * xSpacing;
5462 
5463  /* Read of nearest output values */
5464  y0 = pYData[i];
5465  y1 = pYData[i + 1];
5466 
5467  /* Calculation of output */
5468  y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0));
5469 
5470  }
5471 
5472  /* returns output value */
5473  return (y);
5474  }
5475 
5476 
5490  static __INLINE q31_t arm_linear_interp_q31(
5491  q31_t * pYData,
5492  q31_t x,
5493  uint32_t nValues)
5494  {
5495  q31_t y; /* output */
5496  q31_t y0, y1; /* Nearest output values */
5497  q31_t fract; /* fractional part */
5498  int32_t index; /* Index to read nearest output values */
5499 
5500  /* Input is in 12.20 format */
5501  /* 12 bits for the table index */
5502  /* Index value calculation */
5503  index = ((x & (q31_t)0xFFF00000) >> 20);
5504 
5505  if(index >= (int32_t)(nValues - 1))
5506  {
5507  return (pYData[nValues - 1]);
5508  }
5509  else if(index < 0)
5510  {
5511  return (pYData[0]);
5512  }
5513  else
5514  {
5515  /* 20 bits for the fractional part */
5516  /* shift left by 11 to keep fract in 1.31 format */
5517  fract = (x & 0x000FFFFF) << 11;
5518 
5519  /* Read two nearest output values from the index in 1.31(q31) format */
5520  y0 = pYData[index];
5521  y1 = pYData[index + 1];
5522 
5523  /* Calculation of y0 * (1-fract) and y is in 2.30 format */
5524  y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32));
5525 
5526  /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */
5527  y += ((q31_t) (((q63_t) y1 * fract) >> 32));
5528 
5529  /* Convert y to 1.31 format */
5530  return (y << 1u);
5531  }
5532  }
5533 
5534 
5548  static __INLINE q15_t arm_linear_interp_q15(
5549  q15_t * pYData,
5550  q31_t x,
5551  uint32_t nValues)
5552  {
5553  q63_t y; /* output */
5554  q15_t y0, y1; /* Nearest output values */
5555  q31_t fract; /* fractional part */
5556  int32_t index; /* Index to read nearest output values */
5557 
5558  /* Input is in 12.20 format */
5559  /* 12 bits for the table index */
5560  /* Index value calculation */
5561  index = ((x & (int32_t)0xFFF00000) >> 20);
5562 
5563  if(index >= (int32_t)(nValues - 1))
5564  {
5565  return (pYData[nValues - 1]);
5566  }
5567  else if(index < 0)
5568  {
5569  return (pYData[0]);
5570  }
5571  else
5572  {
5573  /* 20 bits for the fractional part */
5574  /* fract is in 12.20 format */
5575  fract = (x & 0x000FFFFF);
5576 
5577  /* Read two nearest output values from the index */
5578  y0 = pYData[index];
5579  y1 = pYData[index + 1];
5580 
5581  /* Calculation of y0 * (1-fract) and y is in 13.35 format */
5582  y = ((q63_t) y0 * (0xFFFFF - fract));
5583 
5584  /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */
5585  y += ((q63_t) y1 * (fract));
5586 
5587  /* convert y to 1.15 format */
5588  return (q15_t) (y >> 20);
5589  }
5590  }
5591 
5592 
5605  static __INLINE q7_t arm_linear_interp_q7(
5606  q7_t * pYData,
5607  q31_t x,
5608  uint32_t nValues)
5609  {
5610  q31_t y; /* output */
5611  q7_t y0, y1; /* Nearest output values */
5612  q31_t fract; /* fractional part */
5613  uint32_t index; /* Index to read nearest output values */
5614 
5615  /* Input is in 12.20 format */
5616  /* 12 bits for the table index */
5617  /* Index value calculation */
5618  if (x < 0)
5619  {
5620  return (pYData[0]);
5621  }
5622  index = (x >> 20) & 0xfff;
5623 
5624  if(index >= (nValues - 1))
5625  {
5626  return (pYData[nValues - 1]);
5627  }
5628  else
5629  {
5630  /* 20 bits for the fractional part */
5631  /* fract is in 12.20 format */
5632  fract = (x & 0x000FFFFF);
5633 
5634  /* Read two nearest output values from the index and are in 1.7(q7) format */
5635  y0 = pYData[index];
5636  y1 = pYData[index + 1];
5637 
5638  /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */
5639  y = ((y0 * (0xFFFFF - fract)));
5640 
5641  /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */
5642  y += (y1 * fract);
5643 
5644  /* convert y to 1.7(q7) format */
5645  return (q7_t) (y >> 20);
5646  }
5647  }
5648 
5658  float32_t arm_sin_f32(
5659  float32_t x);
5660 
5661 
5667  q31_t arm_sin_q31(
5668  q31_t x);
5669 
5670 
5676  q15_t arm_sin_q15(
5677  q15_t x);
5678 
5679 
5685  float32_t arm_cos_f32(
5686  float32_t x);
5687 
5688 
5694  q31_t arm_cos_q31(
5695  q31_t x);
5696 
5697 
5703  q15_t arm_cos_q15(
5704  q15_t x);
5705 
5706 
5745  static __INLINE arm_status arm_sqrt_f32(
5746  float32_t in,
5747  float32_t * pOut)
5748  {
5749  if(in >= 0.0f)
5750  {
5751 
5752 #if (__FPU_USED == 1) && defined ( __CC_ARM )
5753  *pOut = __sqrtf(in);
5754 #elif (__FPU_USED == 1) && (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
5755  *pOut = __builtin_sqrtf(in);
5756 #elif (__FPU_USED == 1) && defined(__GNUC__)
5757  *pOut = __builtin_sqrtf(in);
5758 #elif (__FPU_USED == 1) && defined ( __ICCARM__ ) && (__VER__ >= 6040000)
5759  __ASM("VSQRT.F32 %0,%1" : "=t"(*pOut) : "t"(in));
5760 #else
5761  *pOut = sqrtf(in);
5762 #endif
5763 
5764  return (ARM_MATH_SUCCESS);
5765  }
5766  else
5767  {
5768  *pOut = 0.0f;
5769  return (ARM_MATH_ARGUMENT_ERROR);
5770  }
5771  }
5772 
5773 
5782  q31_t in,
5783  q31_t * pOut);
5784 
5785 
5794  q15_t in,
5795  q15_t * pOut);
5796 
5805  static __INLINE void arm_circularWrite_f32(
5806  int32_t * circBuffer,
5807  int32_t L,
5808  uint16_t * writeOffset,
5809  int32_t bufferInc,
5810  const int32_t * src,
5811  int32_t srcInc,
5812  uint32_t blockSize)
5813  {
5814  uint32_t i = 0u;
5815  int32_t wOffset;
5816 
5817  /* Copy the value of Index pointer that points
5818  * to the current location where the input samples to be copied */
5819  wOffset = *writeOffset;
5820 
5821  /* Loop over the blockSize */
5822  i = blockSize;
5823 
5824  while(i > 0u)
5825  {
5826  /* copy the input sample to the circular buffer */
5827  circBuffer[wOffset] = *src;
5828 
5829  /* Update the input pointer */
5830  src += srcInc;
5831 
5832  /* Circularly update wOffset. Watch out for positive and negative value */
5833  wOffset += bufferInc;
5834  if(wOffset >= L)
5835  wOffset -= L;
5836 
5837  /* Decrement the loop counter */
5838  i--;
5839  }
5840 
5841  /* Update the index pointer */
5842  *writeOffset = (uint16_t)wOffset;
5843  }
5844 
5845 
5846 
5850  static __INLINE void arm_circularRead_f32(
5851  int32_t * circBuffer,
5852  int32_t L,
5853  int32_t * readOffset,
5854  int32_t bufferInc,
5855  int32_t * dst,
5856  int32_t * dst_base,
5857  int32_t dst_length,
5858  int32_t dstInc,
5859  uint32_t blockSize)
5860  {
5861  uint32_t i = 0u;
5862  int32_t rOffset, dst_end;
5863 
5864  /* Copy the value of Index pointer that points
5865  * to the current location from where the input samples to be read */
5866  rOffset = *readOffset;
5867  dst_end = (int32_t) (dst_base + dst_length);
5868 
5869  /* Loop over the blockSize */
5870  i = blockSize;
5871 
5872  while(i > 0u)
5873  {
5874  /* copy the sample from the circular buffer to the destination buffer */
5875  *dst = circBuffer[rOffset];
5876 
5877  /* Update the input pointer */
5878  dst += dstInc;
5879 
5880  if(dst == (int32_t *) dst_end)
5881  {
5882  dst = dst_base;
5883  }
5884 
5885  /* Circularly update rOffset. Watch out for positive and negative value */
5886  rOffset += bufferInc;
5887 
5888  if(rOffset >= L)
5889  {
5890  rOffset -= L;
5891  }
5892 
5893  /* Decrement the loop counter */
5894  i--;
5895  }
5896 
5897  /* Update the index pointer */
5898  *readOffset = rOffset;
5899  }
5900 
5901 
5905  static __INLINE void arm_circularWrite_q15(
5906  q15_t * circBuffer,
5907  int32_t L,
5908  uint16_t * writeOffset,
5909  int32_t bufferInc,
5910  const q15_t * src,
5911  int32_t srcInc,
5912  uint32_t blockSize)
5913  {
5914  uint32_t i = 0u;
5915  int32_t wOffset;
5916 
5917  /* Copy the value of Index pointer that points
5918  * to the current location where the input samples to be copied */
5919  wOffset = *writeOffset;
5920 
5921  /* Loop over the blockSize */
5922  i = blockSize;
5923 
5924  while(i > 0u)
5925  {
5926  /* copy the input sample to the circular buffer */
5927  circBuffer[wOffset] = *src;
5928 
5929  /* Update the input pointer */
5930  src += srcInc;
5931 
5932  /* Circularly update wOffset. Watch out for positive and negative value */
5933  wOffset += bufferInc;
5934  if(wOffset >= L)
5935  wOffset -= L;
5936 
5937  /* Decrement the loop counter */
5938  i--;
5939  }
5940 
5941  /* Update the index pointer */
5942  *writeOffset = (uint16_t)wOffset;
5943  }
5944 
5945 
5949  static __INLINE void arm_circularRead_q15(
5950  q15_t * circBuffer,
5951  int32_t L,
5952  int32_t * readOffset,
5953  int32_t bufferInc,
5954  q15_t * dst,
5955  q15_t * dst_base,
5956  int32_t dst_length,
5957  int32_t dstInc,
5958  uint32_t blockSize)
5959  {
5960  uint32_t i = 0;
5961  int32_t rOffset, dst_end;
5962 
5963  /* Copy the value of Index pointer that points
5964  * to the current location from where the input samples to be read */
5965  rOffset = *readOffset;
5966 
5967  dst_end = (int32_t) (dst_base + dst_length);
5968 
5969  /* Loop over the blockSize */
5970  i = blockSize;
5971 
5972  while(i > 0u)
5973  {
5974  /* copy the sample from the circular buffer to the destination buffer */
5975  *dst = circBuffer[rOffset];
5976 
5977  /* Update the input pointer */
5978  dst += dstInc;
5979 
5980  if(dst == (q15_t *) dst_end)
5981  {
5982  dst = dst_base;
5983  }
5984 
5985  /* Circularly update wOffset. Watch out for positive and negative value */
5986  rOffset += bufferInc;
5987 
5988  if(rOffset >= L)
5989  {
5990  rOffset -= L;
5991  }
5992 
5993  /* Decrement the loop counter */
5994  i--;
5995  }
5996 
5997  /* Update the index pointer */
5998  *readOffset = rOffset;
5999  }
6000 
6001 
6005  static __INLINE void arm_circularWrite_q7(
6006  q7_t * circBuffer,
6007  int32_t L,
6008  uint16_t * writeOffset,
6009  int32_t bufferInc,
6010  const q7_t * src,
6011  int32_t srcInc,
6012  uint32_t blockSize)
6013  {
6014  uint32_t i = 0u;
6015  int32_t wOffset;
6016 
6017  /* Copy the value of Index pointer that points
6018  * to the current location where the input samples to be copied */
6019  wOffset = *writeOffset;
6020 
6021  /* Loop over the blockSize */
6022  i = blockSize;
6023 
6024  while(i > 0u)
6025  {
6026  /* copy the input sample to the circular buffer */
6027  circBuffer[wOffset] = *src;
6028 
6029  /* Update the input pointer */
6030  src += srcInc;
6031 
6032  /* Circularly update wOffset. Watch out for positive and negative value */
6033  wOffset += bufferInc;
6034  if(wOffset >= L)
6035  wOffset -= L;
6036 
6037  /* Decrement the loop counter */
6038  i--;
6039  }
6040 
6041  /* Update the index pointer */
6042  *writeOffset = (uint16_t)wOffset;
6043  }
6044 
6045 
6049  static __INLINE void arm_circularRead_q7(
6050  q7_t * circBuffer,
6051  int32_t L,
6052  int32_t * readOffset,
6053  int32_t bufferInc,
6054  q7_t * dst,
6055  q7_t * dst_base,
6056  int32_t dst_length,
6057  int32_t dstInc,
6058  uint32_t blockSize)
6059  {
6060  uint32_t i = 0;
6061  int32_t rOffset, dst_end;
6062 
6063  /* Copy the value of Index pointer that points
6064  * to the current location from where the input samples to be read */
6065  rOffset = *readOffset;
6066 
6067  dst_end = (int32_t) (dst_base + dst_length);
6068 
6069  /* Loop over the blockSize */
6070  i = blockSize;
6071 
6072  while(i > 0u)
6073  {
6074  /* copy the sample from the circular buffer to the destination buffer */
6075  *dst = circBuffer[rOffset];
6076 
6077  /* Update the input pointer */
6078  dst += dstInc;
6079 
6080  if(dst == (q7_t *) dst_end)
6081  {
6082  dst = dst_base;
6083  }
6084 
6085  /* Circularly update rOffset. Watch out for positive and negative value */
6086  rOffset += bufferInc;
6087 
6088  if(rOffset >= L)
6089  {
6090  rOffset -= L;
6091  }
6092 
6093  /* Decrement the loop counter */
6094  i--;
6095  }
6096 
6097  /* Update the index pointer */
6098  *readOffset = rOffset;
6099  }
6100 
6101 
6108  void arm_power_q31(
6109  q31_t * pSrc,
6110  uint32_t blockSize,
6111  q63_t * pResult);
6112 
6113 
6120  void arm_power_f32(
6121  float32_t * pSrc,
6122  uint32_t blockSize,
6123  float32_t * pResult);
6124 
6125 
6132  void arm_power_q15(
6133  q15_t * pSrc,
6134  uint32_t blockSize,
6135  q63_t * pResult);
6136 
6137 
6144  void arm_power_q7(
6145  q7_t * pSrc,
6146  uint32_t blockSize,
6147  q31_t * pResult);
6148 
6149 
6156  void arm_mean_q7(
6157  q7_t * pSrc,
6158  uint32_t blockSize,
6159  q7_t * pResult);
6160 
6161 
6168  void arm_mean_q15(
6169  q15_t * pSrc,
6170  uint32_t blockSize,
6171  q15_t * pResult);
6172 
6173 
6180  void arm_mean_q31(
6181  q31_t * pSrc,
6182  uint32_t blockSize,
6183  q31_t * pResult);
6184 
6185 
6192  void arm_mean_f32(
6193  float32_t * pSrc,
6194  uint32_t blockSize,
6195  float32_t * pResult);
6196 
6197 
6204  void arm_var_f32(
6205  float32_t * pSrc,
6206  uint32_t blockSize,
6207  float32_t * pResult);
6208 
6209 
6216  void arm_var_q31(
6217  q31_t * pSrc,
6218  uint32_t blockSize,
6219  q31_t * pResult);
6220 
6221 
6228  void arm_var_q15(
6229  q15_t * pSrc,
6230  uint32_t blockSize,
6231  q15_t * pResult);
6232 
6233 
6240  void arm_rms_f32(
6241  float32_t * pSrc,
6242  uint32_t blockSize,
6243  float32_t * pResult);
6244 
6245 
6252  void arm_rms_q31(
6253  q31_t * pSrc,
6254  uint32_t blockSize,
6255  q31_t * pResult);
6256 
6257 
6264  void arm_rms_q15(
6265  q15_t * pSrc,
6266  uint32_t blockSize,
6267  q15_t * pResult);
6268 
6269 
6276  void arm_std_f32(
6277  float32_t * pSrc,
6278  uint32_t blockSize,
6279  float32_t * pResult);
6280 
6281 
6288  void arm_std_q31(
6289  q31_t * pSrc,
6290  uint32_t blockSize,
6291  q31_t * pResult);
6292 
6293 
6300  void arm_std_q15(
6301  q15_t * pSrc,
6302  uint32_t blockSize,
6303  q15_t * pResult);
6304 
6305 
6312  void arm_cmplx_mag_f32(
6313  float32_t * pSrc,
6314  float32_t * pDst,
6315  uint32_t numSamples);
6316 
6317 
6324  void arm_cmplx_mag_q31(
6325  q31_t * pSrc,
6326  q31_t * pDst,
6327  uint32_t numSamples);
6328 
6329 
6336  void arm_cmplx_mag_q15(
6337  q15_t * pSrc,
6338  q15_t * pDst,
6339  uint32_t numSamples);
6340 
6341 
6351  q15_t * pSrcA,
6352  q15_t * pSrcB,
6353  uint32_t numSamples,
6354  q31_t * realResult,
6355  q31_t * imagResult);
6356 
6357 
6367  q31_t * pSrcA,
6368  q31_t * pSrcB,
6369  uint32_t numSamples,
6370  q63_t * realResult,
6371  q63_t * imagResult);
6372 
6373 
6383  float32_t * pSrcA,
6384  float32_t * pSrcB,
6385  uint32_t numSamples,
6386  float32_t * realResult,
6387  float32_t * imagResult);
6388 
6389 
6398  q15_t * pSrcCmplx,
6399  q15_t * pSrcReal,
6400  q15_t * pCmplxDst,
6401  uint32_t numSamples);
6402 
6403 
6412  q31_t * pSrcCmplx,
6413  q31_t * pSrcReal,
6414  q31_t * pCmplxDst,
6415  uint32_t numSamples);
6416 
6417 
6426  float32_t * pSrcCmplx,
6427  float32_t * pSrcReal,
6428  float32_t * pCmplxDst,
6429  uint32_t numSamples);
6430 
6431 
6439  void arm_min_q7(
6440  q7_t * pSrc,
6441  uint32_t blockSize,
6442  q7_t * result,
6443  uint32_t * index);
6444 
6445 
6453  void arm_min_q15(
6454  q15_t * pSrc,
6455  uint32_t blockSize,
6456  q15_t * pResult,
6457  uint32_t * pIndex);
6458 
6459 
6467  void arm_min_q31(
6468  q31_t * pSrc,
6469  uint32_t blockSize,
6470  q31_t * pResult,
6471  uint32_t * pIndex);
6472 
6473 
6481  void arm_min_f32(
6482  float32_t * pSrc,
6483  uint32_t blockSize,
6484  float32_t * pResult,
6485  uint32_t * pIndex);
6486 
6487 
6495  void arm_max_q7(
6496  q7_t * pSrc,
6497  uint32_t blockSize,
6498  q7_t * pResult,
6499  uint32_t * pIndex);
6500 
6501 
6509  void arm_max_q15(
6510  q15_t * pSrc,
6511  uint32_t blockSize,
6512  q15_t * pResult,
6513  uint32_t * pIndex);
6514 
6515 
6523  void arm_max_q31(
6524  q31_t * pSrc,
6525  uint32_t blockSize,
6526  q31_t * pResult,
6527  uint32_t * pIndex);
6528 
6529 
6537  void arm_max_f32(
6538  float32_t * pSrc,
6539  uint32_t blockSize,
6540  float32_t * pResult,
6541  uint32_t * pIndex);
6542 
6543 
6552  q15_t * pSrcA,
6553  q15_t * pSrcB,
6554  q15_t * pDst,
6555  uint32_t numSamples);
6556 
6557 
6566  q31_t * pSrcA,
6567  q31_t * pSrcB,
6568  q31_t * pDst,
6569  uint32_t numSamples);
6570 
6571 
6580  float32_t * pSrcA,
6581  float32_t * pSrcB,
6582  float32_t * pDst,
6583  uint32_t numSamples);
6584 
6585 
6592  void arm_float_to_q31(
6593  float32_t * pSrc,
6594  q31_t * pDst,
6595  uint32_t blockSize);
6596 
6597 
6604  void arm_float_to_q15(
6605  float32_t * pSrc,
6606  q15_t * pDst,
6607  uint32_t blockSize);
6608 
6609 
6616  void arm_float_to_q7(
6617  float32_t * pSrc,
6618  q7_t * pDst,
6619  uint32_t blockSize);
6620 
6621 
6628  void arm_q31_to_q15(
6629  q31_t * pSrc,
6630  q15_t * pDst,
6631  uint32_t blockSize);
6632 
6633 
6640  void arm_q31_to_q7(
6641  q31_t * pSrc,
6642  q7_t * pDst,
6643  uint32_t blockSize);
6644 
6645 
6652  void arm_q15_to_float(
6653  q15_t * pSrc,
6654  float32_t * pDst,
6655  uint32_t blockSize);
6656 
6657 
6664  void arm_q15_to_q31(
6665  q15_t * pSrc,
6666  q31_t * pDst,
6667  uint32_t blockSize);
6668 
6669 
6676  void arm_q15_to_q7(
6677  q15_t * pSrc,
6678  q7_t * pDst,
6679  uint32_t blockSize);
6680 
6681 
6752  static __INLINE float32_t arm_bilinear_interp_f32(
6754  float32_t X,
6755  float32_t Y)
6756  {
6757  float32_t out;
6758  float32_t f00, f01, f10, f11;
6759  float32_t *pData = S->pData;
6760  int32_t xIndex, yIndex, index;
6761  float32_t xdiff, ydiff;
6762  float32_t b1, b2, b3, b4;
6763 
6764  xIndex = (int32_t) X;
6765  yIndex = (int32_t) Y;
6766 
6767  /* Care taken for table outside boundary */
6768  /* Returns zero output when values are outside table boundary */
6769  if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1))
6770  {
6771  return (0);
6772  }
6773 
6774  /* Calculation of index for two nearest points in X-direction */
6775  index = (xIndex - 1) + (yIndex - 1) * S->numCols;
6776 
6777 
6778  /* Read two nearest points in X-direction */
6779  f00 = pData[index];
6780  f01 = pData[index + 1];
6781 
6782  /* Calculation of index for two nearest points in Y-direction */
6783  index = (xIndex - 1) + (yIndex) * S->numCols;
6784 
6785 
6786  /* Read two nearest points in Y-direction */
6787  f10 = pData[index];
6788  f11 = pData[index + 1];
6789 
6790  /* Calculation of intermediate values */
6791  b1 = f00;
6792  b2 = f01 - f00;
6793  b3 = f10 - f00;
6794  b4 = f00 - f01 - f10 + f11;
6795 
6796  /* Calculation of fractional part in X */
6797  xdiff = X - xIndex;
6798 
6799  /* Calculation of fractional part in Y */
6800  ydiff = Y - yIndex;
6801 
6802  /* Calculation of bi-linear interpolated output */
6803  out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff;
6804 
6805  /* return to application */
6806  return (out);
6807  }
6808 
6809 
6818  static __INLINE q31_t arm_bilinear_interp_q31(
6820  q31_t X,
6821  q31_t Y)
6822  {
6823  q31_t out; /* Temporary output */
6824  q31_t acc = 0; /* output */
6825  q31_t xfract, yfract; /* X, Y fractional parts */
6826  q31_t x1, x2, y1, y2; /* Nearest output values */
6827  int32_t rI, cI; /* Row and column indices */
6828  q31_t *pYData = S->pData; /* pointer to output table values */
6829  uint32_t nCols = S->numCols; /* num of rows */
6830 
6831  /* Input is in 12.20 format */
6832  /* 12 bits for the table index */
6833  /* Index value calculation */
6834  rI = ((X & (q31_t)0xFFF00000) >> 20);
6835 
6836  /* Input is in 12.20 format */
6837  /* 12 bits for the table index */
6838  /* Index value calculation */
6839  cI = ((Y & (q31_t)0xFFF00000) >> 20);
6840 
6841  /* Care taken for table outside boundary */
6842  /* Returns zero output when values are outside table boundary */
6843  if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
6844  {
6845  return (0);
6846  }
6847 
6848  /* 20 bits for the fractional part */
6849  /* shift left xfract by 11 to keep 1.31 format */
6850  xfract = (X & 0x000FFFFF) << 11u;
6851 
6852  /* Read two nearest output values from the index */
6853  x1 = pYData[(rI) + (int32_t)nCols * (cI) ];
6854  x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1];
6855 
6856  /* 20 bits for the fractional part */
6857  /* shift left yfract by 11 to keep 1.31 format */
6858  yfract = (Y & 0x000FFFFF) << 11u;
6859 
6860  /* Read two nearest output values from the index */
6861  y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ];
6862  y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1];
6863 
6864  /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */
6865  out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32));
6866  acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32));
6867 
6868  /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */
6869  out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32));
6870  acc += ((q31_t) ((q63_t) out * (xfract) >> 32));
6871 
6872  /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */
6873  out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32));
6874  acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
6875 
6876  /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */
6877  out = ((q31_t) ((q63_t) y2 * (xfract) >> 32));
6878  acc += ((q31_t) ((q63_t) out * (yfract) >> 32));
6879 
6880  /* Convert acc to 1.31(q31) format */
6881  return ((q31_t)(acc << 2));
6882  }
6883 
6884 
6892  static __INLINE q15_t arm_bilinear_interp_q15(
6894  q31_t X,
6895  q31_t Y)
6896  {
6897  q63_t acc = 0; /* output */
6898  q31_t out; /* Temporary output */
6899  q15_t x1, x2, y1, y2; /* Nearest output values */
6900  q31_t xfract, yfract; /* X, Y fractional parts */
6901  int32_t rI, cI; /* Row and column indices */
6902  q15_t *pYData = S->pData; /* pointer to output table values */
6903  uint32_t nCols = S->numCols; /* num of rows */
6904 
6905  /* Input is in 12.20 format */
6906  /* 12 bits for the table index */
6907  /* Index value calculation */
6908  rI = ((X & (q31_t)0xFFF00000) >> 20);
6909 
6910  /* Input is in 12.20 format */
6911  /* 12 bits for the table index */
6912  /* Index value calculation */
6913  cI = ((Y & (q31_t)0xFFF00000) >> 20);
6914 
6915  /* Care taken for table outside boundary */
6916  /* Returns zero output when values are outside table boundary */
6917  if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
6918  {
6919  return (0);
6920  }
6921 
6922  /* 20 bits for the fractional part */
6923  /* xfract should be in 12.20 format */
6924  xfract = (X & 0x000FFFFF);
6925 
6926  /* Read two nearest output values from the index */
6927  x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ];
6928  x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1];
6929 
6930  /* 20 bits for the fractional part */
6931  /* yfract should be in 12.20 format */
6932  yfract = (Y & 0x000FFFFF);
6933 
6934  /* Read two nearest output values from the index */
6935  y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ];
6936  y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1];
6937 
6938  /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */
6939 
6940  /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */
6941  /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */
6942  out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u);
6943  acc = ((q63_t) out * (0xFFFFF - yfract));
6944 
6945  /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */
6946  out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u);
6947  acc += ((q63_t) out * (xfract));
6948 
6949  /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */
6950  out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u);
6951  acc += ((q63_t) out * (yfract));
6952 
6953  /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */
6954  out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u);
6955  acc += ((q63_t) out * (yfract));
6956 
6957  /* acc is in 13.51 format and down shift acc by 36 times */
6958  /* Convert out to 1.15 format */
6959  return ((q15_t)(acc >> 36));
6960  }
6961 
6962 
6970  static __INLINE q7_t arm_bilinear_interp_q7(
6972  q31_t X,
6973  q31_t Y)
6974  {
6975  q63_t acc = 0; /* output */
6976  q31_t out; /* Temporary output */
6977  q31_t xfract, yfract; /* X, Y fractional parts */
6978  q7_t x1, x2, y1, y2; /* Nearest output values */
6979  int32_t rI, cI; /* Row and column indices */
6980  q7_t *pYData = S->pData; /* pointer to output table values */
6981  uint32_t nCols = S->numCols; /* num of rows */
6982 
6983  /* Input is in 12.20 format */
6984  /* 12 bits for the table index */
6985  /* Index value calculation */
6986  rI = ((X & (q31_t)0xFFF00000) >> 20);
6987 
6988  /* Input is in 12.20 format */
6989  /* 12 bits for the table index */
6990  /* Index value calculation */
6991  cI = ((Y & (q31_t)0xFFF00000) >> 20);
6992 
6993  /* Care taken for table outside boundary */
6994  /* Returns zero output when values are outside table boundary */
6995  if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1))
6996  {
6997  return (0);
6998  }
6999 
7000  /* 20 bits for the fractional part */
7001  /* xfract should be in 12.20 format */
7002  xfract = (X & (q31_t)0x000FFFFF);
7003 
7004  /* Read two nearest output values from the index */
7005  x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ];
7006  x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1];
7007 
7008  /* 20 bits for the fractional part */
7009  /* yfract should be in 12.20 format */
7010  yfract = (Y & (q31_t)0x000FFFFF);
7011 
7012  /* Read two nearest output values from the index */
7013  y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ];
7014  y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1];
7015 
7016  /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */
7017  out = ((x1 * (0xFFFFF - xfract)));
7018  acc = (((q63_t) out * (0xFFFFF - yfract)));
7019 
7020  /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */
7021  out = ((x2 * (0xFFFFF - yfract)));
7022  acc += (((q63_t) out * (xfract)));
7023 
7024  /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */
7025  out = ((y1 * (0xFFFFF - xfract)));
7026  acc += (((q63_t) out * (yfract)));
7027 
7028  /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */
7029  out = ((y2 * (yfract)));
7030  acc += (((q63_t) out * (xfract)));
7031 
7032  /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */
7033  return ((q7_t)(acc >> 40));
7034  }
7035 
7041 /* SMMLAR */
7042 #define multAcc_32x32_keep32_R(a, x, y) \
7043  a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32)
7044 
7045 /* SMMLSR */
7046 #define multSub_32x32_keep32_R(a, x, y) \
7047  a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32)
7048 
7049 /* SMMULR */
7050 #define mult_32x32_keep32_R(a, x, y) \
7051  a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32)
7052 
7053 /* SMMLA */
7054 #define multAcc_32x32_keep32(a, x, y) \
7055  a += (q31_t) (((q63_t) x * y) >> 32)
7056 
7057 /* SMMLS */
7058 #define multSub_32x32_keep32(a, x, y) \
7059  a -= (q31_t) (((q63_t) x * y) >> 32)
7060 
7061 /* SMMUL */
7062 #define mult_32x32_keep32(a, x, y) \
7063  a = (q31_t) (((q63_t) x * y ) >> 32)
7064 
7065 
7066 #if defined ( __CC_ARM )
7067  /* Enter low optimization region - place directly above function definition */
7068  #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7)
7069  #define LOW_OPTIMIZATION_ENTER \
7070  _Pragma ("push") \
7071  _Pragma ("O1")
7072  #else
7073  #define LOW_OPTIMIZATION_ENTER
7074  #endif
7075 
7076  /* Exit low optimization region - place directly after end of function definition */
7077  #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7)
7078  #define LOW_OPTIMIZATION_EXIT \
7079  _Pragma ("pop")
7080  #else
7081  #define LOW_OPTIMIZATION_EXIT
7082  #endif
7083 
7084  /* Enter low optimization region - place directly above function definition */
7085  #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
7086 
7087  /* Exit low optimization region - place directly after end of function definition */
7088  #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
7089 
7090 #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
7091  #define LOW_OPTIMIZATION_ENTER
7092  #define LOW_OPTIMIZATION_EXIT
7093  #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
7094  #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
7095 
7096 #elif defined(__GNUC__)
7097  #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") ))
7098  #define LOW_OPTIMIZATION_EXIT
7099  #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
7100  #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
7101 
7102 #elif defined(__ICCARM__)
7103  /* Enter low optimization region - place directly above function definition */
7104  #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7)
7105  #define LOW_OPTIMIZATION_ENTER \
7106  _Pragma ("optimize=low")
7107  #else
7108  #define LOW_OPTIMIZATION_ENTER
7109  #endif
7110 
7111  /* Exit low optimization region - place directly after end of function definition */
7112  #define LOW_OPTIMIZATION_EXIT
7113 
7114  /* Enter low optimization region - place directly above function definition */
7115  #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7)
7116  #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \
7117  _Pragma ("optimize=low")
7118  #else
7119  #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
7120  #endif
7121 
7122  /* Exit low optimization region - place directly after end of function definition */
7123  #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
7124 
7125 #elif defined(__CSMC__)
7126  #define LOW_OPTIMIZATION_ENTER
7127  #define LOW_OPTIMIZATION_EXIT
7128  #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
7129  #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
7130 
7131 #elif defined(__TASKING__)
7132  #define LOW_OPTIMIZATION_ENTER
7133  #define LOW_OPTIMIZATION_EXIT
7134  #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
7135  #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
7136 
7137 #endif
7138 
7139 
7140 #ifdef __cplusplus
7141 }
7142 #endif
7143 
7144 
7145 #if defined ( __GNUC__ )
7146 #pragma GCC diagnostic pop
7147 #endif
7148 
7149 #endif /* _ARM_MATH_H */
7150 
void arm_rms_q31(q31_t *pSrc, uint32_t blockSize, q31_t *pResult)
Root Mean Square of the elements of a Q31 vector.
Definition: arm_rms_q31.c:73
Instance structure for the floating-point FIR interpolator.
Definition: arm_math.h:3454
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)
Processing function for floating-point normalized LMS filter.
float32_t * pCosFactor
Definition: arm_math.h:2260
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)
Initialization function for floating-point LMS filter.
void arm_cmplx_conj_q15(q15_t *pSrc, q15_t *pDst, uint32_t numSamples)
Q15 complex conjugate.
void arm_negate_q31(q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Negates the elements of a Q31 vector.
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)
Processing function for Q15 LMS filter.
Definition: arm_lms_q15.c:74
void arm_fir_lattice_init_q15(arm_fir_lattice_instance_q15 *S, uint16_t numStages, q15_t *pCoeffs, q15_t *pState)
Initialization function for the Q15 FIR lattice filter.
arm_status arm_rfft_init_q15(arm_rfft_instance_q15 *S, uint32_t fftLenReal, uint32_t ifftFlagR, uint32_t bitReverseFlag)
Initialization function for the Q15 RFFT/RIFFT.
arm_status arm_mat_add_f32(const arm_matrix_instance_f32 *pSrcA, const arm_matrix_instance_f32 *pSrcB, arm_matrix_instance_f32 *pDst)
Floating-point matrix addition.
arm_status arm_rfft_init_q31(arm_rfft_instance_q31 *S, uint32_t fftLenReal, uint32_t ifftFlagR, uint32_t bitReverseFlag)
Initialization function for the Q31 RFFT/RIFFT.
int8_t q7_t
8-bit fractional data type in 1.7 format.
Definition: arm_math.h:387
void arm_fir_lattice_init_q31(arm_fir_lattice_instance_q31 *S, uint16_t numStages, q31_t *pCoeffs, q31_t *pState)
Initialization function for the Q31 FIR lattice filter.
Instance structure for the Q15 FIR filter.
Definition: arm_math.h:1039
void arm_sin_cos_f32(float32_t theta, float32_t *pSinVal, float32_t *pCosVal)
Floating-point sin_cos function.
arm_status arm_dct4_init_q15(arm_dct4_instance_q15 *S, arm_rfft_instance_q15 *S_RFFT, arm_cfft_radix4_instance_q15 *S_CFFT, uint16_t N, uint16_t Nby2, q15_t normalize)
Initialization function for the Q15 DCT4/IDCT4.
void arm_sub_f32(float32_t *pSrcA, float32_t *pSrcB, float32_t *pDst, uint32_t blockSize)
Floating-point vector subtraction.
Definition: arm_sub_f32.c:74
q31_t arm_cos_q31(q31_t x)
Fast approximation to the trigonometric cosine function for Q31 data.
Definition: arm_cos_q31.c:62
Instance structure for the Q31 FIR lattice filter.
Definition: arm_math.h:3733
float32_t state[3]
Definition: arm_math.h:1774
arm_status arm_mat_mult_q15(const arm_matrix_instance_q15 *pSrcA, const arm_matrix_instance_q15 *pSrcB, arm_matrix_instance_q15 *pDst, q15_t *pState)
Q15 matrix multiplication.
void arm_copy_q31(q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Copies the elements of a Q31 vector.
Definition: arm_copy_q31.c:61
void arm_dot_prod_q7(q7_t *pSrcA, q7_t *pSrcB, uint32_t blockSize, q31_t *result)
Dot product of Q7 vectors.
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)
Initialization function for the floating-point IIR lattice filter.
void arm_cfft_f32(const arm_cfft_instance_f32 *S, float32_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag)
Processing function for the floating-point complex FFT.
Definition: arm_cfft_f32.c:574
void arm_iir_lattice_q31(const arm_iir_lattice_instance_q31 *S, q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 IIR lattice filter.
void arm_cmplx_mult_cmplx_q15(q15_t *pSrcA, q15_t *pSrcB, q15_t *pDst, uint32_t numSamples)
Q15 complex-by-complex multiplication.
void arm_fir_sparse_init_q7(arm_fir_sparse_instance_q7 *S, uint16_t numTaps, q7_t *pCoeffs, q7_t *pState, int32_t *pTapDelay, uint16_t maxDelay, uint32_t blockSize)
Initialization function for the Q7 sparse FIR filter.
Instance structure for the Q31 IIR lattice filter.
Definition: arm_math.h:3849
arm_status arm_mat_trans_f32(const arm_matrix_instance_f32 *pSrc, arm_matrix_instance_f32 *pDst)
Floating-point matrix transpose.
void arm_fir_decimate_f32(const arm_fir_decimate_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point FIR decimator.
void arm_scale_q15(q15_t *pSrc, q15_t scaleFract, int8_t shift, q15_t *pDst, uint32_t blockSize)
Multiplies a Q15 vector by a scalar.
Definition: arm_scale_q15.c:68
void arm_pid_reset_q15(arm_pid_instance_q15 *S)
Reset function for the Q15 PID Control.
void arm_cmplx_conj_q31(q31_t *pSrc, q31_t *pDst, uint32_t numSamples)
Q31 complex conjugate.
q31_t arm_sin_q31(q31_t x)
Fast approximation to the trigonometric sine function for Q31 data.
Definition: arm_sin_q31.c:60
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)
void arm_conv_q31(q31_t *pSrcA, uint32_t srcALen, q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst)
Convolution of Q31 sequences.
Definition: arm_conv_q31.c:78
void arm_rfft_q31(const arm_rfft_instance_q31 *S, q31_t *pSrc, q31_t *pDst)
Processing function for the Q31 RFFT/RIFFT.
Definition: arm_rfft_q31.c:87
arm_status arm_cfft_radix2_init_q15(arm_cfft_radix2_instance_q15 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
Initialization function for the Q15 CFFT/CIFFT.
arm_status arm_rfft_fast_init_f32(arm_rfft_fast_instance_f32 *S, uint16_t fftLen)
Initialization function for the floating-point real FFT.
void arm_dot_prod_q31(q31_t *pSrcA, q31_t *pSrcB, uint32_t blockSize, q63_t *result)
Dot product of Q31 vectors.
void arm_copy_q7(q7_t *pSrc, q7_t *pDst, uint32_t blockSize)
Copies the elements of a Q7 vector.
Definition: arm_copy_q7.c:61
arm_status arm_mat_inverse_f32(const arm_matrix_instance_f32 *src, arm_matrix_instance_f32 *dst)
Floating-point matrix inverse.
void arm_dot_prod_f32(float32_t *pSrcA, float32_t *pSrcB, uint32_t blockSize, float32_t *result)
Dot product of floating-point vectors.
float float32_t
32-bit floating-point type definition.
Definition: arm_math.h:407
void arm_mult_q31(q31_t *pSrcA, q31_t *pSrcB, q31_t *pDst, uint32_t blockSize)
Q31 vector multiplication.
Definition: arm_mult_q31.c:66
arm_status arm_conv_partial_fast_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
void arm_offset_f32(float32_t *pSrc, float32_t offset, float32_t *pDst, uint32_t blockSize)
Adds a constant offset to a floating-point vector.
CMSIS Cortex-M0 Core Peripheral Access Layer Header File.
const arm_cfft_instance_q15 * pCfft
Definition: arm_math.h:2166
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)
Initialization function for the floating-point sparse FIR filter.
void arm_iir_lattice_q15(const arm_iir_lattice_instance_q15 *S, q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 IIR lattice filter.
arm_status arm_mat_trans_q31(const arm_matrix_instance_q31 *pSrc, arm_matrix_instance_q31 *pDst)
Q31 matrix transpose.
void arm_cfft_q31(const arm_cfft_instance_q31 *S, q31_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag)
Processing function for the fixed-point complex FFT in Q31 format.
Definition: arm_cfft_q31.c:89
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)
Correlation of Q7 sequences.
arm_status arm_mat_mult_q31(const arm_matrix_instance_q31 *pSrcA, const arm_matrix_instance_q31 *pSrcB, arm_matrix_instance_q31 *pDst)
Q31 matrix multiplication.
Instance structure for the Q31 bilinear interpolation function.
Definition: arm_math.h:1861
void arm_fir_q31(const arm_fir_instance_q31 *S, q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 FIR filter.
Definition: arm_fir_q31.c:72
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)
Initialization function for Q31 normalized LMS filter.
Instance structure for the floating-point IIR lattice filter.
Definition: arm_math.h:3860
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)
Initialization function for the Q15 sparse FIR filter.
void arm_mean_q7(q7_t *pSrc, uint32_t blockSize, q7_t *pResult)
Mean value of a Q7 vector.
Definition: arm_mean_q7.c:72
Instance structure for the Q7 FIR filter.
Definition: arm_math.h:1029
void arm_fir_interpolate_f32(const arm_fir_interpolate_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point FIR interpolator.
int64_t q63_t
64-bit fractional data type in 1.63 format.
Definition: arm_math.h:402
void arm_negate_q15(q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Negates the elements of a Q15 vector.
void arm_fir_fast_q31(const arm_fir_instance_q31 *S, q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4.
Instance structure for the Q15 bilinear interpolation function.
Definition: arm_math.h:1871
void arm_cmplx_dot_prod_f32(float32_t *pSrcA, float32_t *pSrcB, uint32_t numSamples, float32_t *realResult, float32_t *imagResult)
Floating-point complex dot product.
Instance structure for the floating-point FIR lattice filter.
Definition: arm_math.h:3743
void arm_fir_sparse_f32(arm_fir_sparse_instance_f32 *S, float32_t *pSrc, float32_t *pDst, float32_t *pScratchIn, uint32_t blockSize)
Processing function for the floating-point sparse FIR filter.
arm_status arm_rfft_init_f32(arm_rfft_instance_f32 *S, arm_cfft_radix4_instance_f32 *S_CFFT, uint32_t fftLenReal, uint32_t ifftFlagR, uint32_t bitReverseFlag)
Initialization function for the floating-point RFFT/RIFFT.
Instance structure for the floating-point DCT4/IDCT4 function.
Definition: arm_math.h:2254
void arm_cmplx_mag_squared_f32(float32_t *pSrc, float32_t *pDst, uint32_t numSamples)
Floating-point complex magnitude squared.
arm_status arm_conv_partial_opt_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)
Partial convolution of Q15 sequences.
arm_status arm_fir_decimate_init_q31(arm_fir_decimate_instance_q31 *S, uint16_t numTaps, uint8_t M, q31_t *pCoeffs, q31_t *pState, uint32_t blockSize)
Initialization function for the Q31 FIR decimator.
arm_status arm_mat_mult_f32(const arm_matrix_instance_f32 *pSrcA, const arm_matrix_instance_f32 *pSrcB, arm_matrix_instance_f32 *pDst)
Floating-point matrix multiplication.
void arm_pid_init_q15(arm_pid_instance_q15 *S, int32_t resetStateFlag)
Initialization function for the Q15 PID Control.
arm_cfft_instance_f32 Sint
Definition: arm_math.h:2237
Instance structure for the Q15 sparse FIR filter.
Definition: arm_math.h:4456
arm_status arm_dct4_init_f32(arm_dct4_instance_f32 *S, arm_rfft_instance_f32 *S_RFFT, arm_cfft_radix4_instance_f32 *S_CFFT, uint16_t N, uint16_t Nby2, float32_t normalize)
Initialization function for the floating-point DCT4/IDCT4.
arm_status arm_cfft_radix4_init_f32(arm_cfft_radix4_instance_f32 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
Initialization function for the floating-point CFFT/CIFFT.
CMSIS Cortex-M4 Core Peripheral Access Layer Header File.
void arm_biquad_cascade_df2T_f64(const arm_biquad_cascade_df2T_instance_f64 *S, float64_t *pSrc, float64_t *pDst, uint32_t blockSize)
Processing function for the floating-point transposed direct form II Biquad cascade filter...
void arm_sin_cos_q31(q31_t theta, q31_t *pSinVal, q31_t *pCosVal)
Q31 sin_cos function.
Instance structure for the floating-point PID Control.
Definition: arm_math.h:1769
void arm_correlate_fast_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst)
Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
void arm_scale_q31(q31_t *pSrc, q31_t scaleFract, int8_t shift, q31_t *pDst, uint32_t blockSize)
Multiplies a Q31 vector by a scalar.
Definition: arm_scale_q31.c:67
const q15_t * pTwiddle
Definition: arm_math.h:2110
void arm_copy_q15(q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Copies the elements of a Q15 vector.
Definition: arm_copy_q15.c:60
void arm_correlate_f32(float32_t *pSrcA, uint32_t srcALen, float32_t *pSrcB, uint32_t srcBLen, float32_t *pDst)
Correlation of floating-point sequences.
void arm_float_to_q15(float32_t *pSrc, q15_t *pDst, uint32_t blockSize)
Converts the elements of the floating-point vector to Q15 vector.
Instance structure for the floating-point FIR filter.
Definition: arm_math.h:1059
void arm_pid_init_q31(arm_pid_instance_q31 *S, int32_t resetStateFlag)
Initialization function for the Q31 PID Control.
void arm_q7_to_q15(q7_t *pSrc, q15_t *pDst, uint32_t blockSize)
Converts the elements of the Q7 vector to Q15 vector.
Definition: arm_q7_to_q15.c:73
arm_status arm_mat_cmplx_mult_q15(const arm_matrix_instance_q15 *pSrcA, const arm_matrix_instance_q15 *pSrcB, arm_matrix_instance_q15 *pDst, q15_t *pScratch)
Q15, complex, matrix multiplication.
void arm_rfft_f32(const arm_rfft_instance_f32 *S, float32_t *pSrc, float32_t *pDst)
Processing function for the floating-point RFFT/RIFFT.
Definition: arm_rfft_f32.c:100
arm_status arm_conv_partial_q7(q7_t *pSrcA, uint32_t srcALen, q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of Q7 sequences.
void arm_cmplx_dot_prod_q31(q31_t *pSrcA, q31_t *pSrcB, uint32_t numSamples, q63_t *realResult, q63_t *imagResult)
Q31 complex dot product.
void arm_biquad_cascade_df1_init_f32(arm_biquad_casd_df1_inst_f32 *S, uint8_t numStages, float32_t *pCoeffs, float32_t *pState)
Initialization function for the floating-point Biquad cascade filter.
arm_status arm_conv_partial_fast_q31(q31_t *pSrcA, uint32_t srcALen, q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4.
void arm_conv_opt_q7(q7_t *pSrcA, uint32_t srcALen, q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst, q15_t *pScratch1, q15_t *pScratch2)
Convolution of Q7 sequences.
uint32_t twidCoefRModifier
Definition: arm_math.h:2163
void arm_fir_init_q7(arm_fir_instance_q7 *S, uint16_t numTaps, q7_t *pCoeffs, q7_t *pState, uint32_t blockSize)
Initialization function for the Q7 FIR filter.
void arm_conv_opt_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, q15_t *pScratch1, q15_t *pScratch2)
Convolution of Q15 sequences.
void arm_mean_q31(q31_t *pSrc, uint32_t blockSize, q31_t *pResult)
Mean value of a Q31 vector.
Definition: arm_mean_q31.c:72
void arm_biquad_cascade_df2T_init_f32(arm_biquad_cascade_df2T_instance_f32 *S, uint8_t numStages, float32_t *pCoeffs, float32_t *pState)
Initialization function for the floating-point transposed direct form II Biquad cascade filter...
Instance structure for the fixed-point CFFT/CIFFT function.
Definition: arm_math.h:2124
arm_status arm_mat_sub_q31(const arm_matrix_instance_q31 *pSrcA, const arm_matrix_instance_q31 *pSrcB, arm_matrix_instance_q31 *pDst)
Q31 matrix subtraction.
CMSIS Cortex-M3 Core Peripheral Access Layer Header File.
float32_t * pCoeffs
Definition: arm_math.h:1063
void arm_correlate_q31(q31_t *pSrcA, uint32_t srcALen, q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst)
Correlation of Q31 sequences.
void arm_q15_to_q7(q15_t *pSrc, q7_t *pDst, uint32_t blockSize)
Converts the elements of the Q15 vector to Q7 vector.
Definition: arm_q15_to_q7.c:71
const q31_t * pTwiddle
Definition: arm_math.h:2127
#define __SIMD32_CONST(addr)
Definition: arm_math.h:446
Instance structure for the Q31 LMS filter.
Definition: arm_math.h:4067
void arm_conv_fast_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst)
Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
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)
Processing function for Q15 normalized LMS filter.
void arm_cmplx_mag_q15(q15_t *pSrc, q15_t *pDst, uint32_t numSamples)
Q15 complex magnitude.
arm_cfft_radix4_instance_f32 * pCfft
Definition: arm_math.h:2262
void arm_abs_q15(q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Q15 vector absolute value.
Definition: arm_abs_q15.c:65
void arm_min_q31(q31_t *pSrc, uint32_t blockSize, q31_t *pResult, uint32_t *pIndex)
Minimum value of a Q31 vector.
Definition: arm_min_q31.c:64
void arm_fir_lattice_init_f32(arm_fir_lattice_instance_f32 *S, uint16_t numStages, float32_t *pCoeffs, float32_t *pState)
Initialization function for the floating-point FIR lattice filter.
arm_status arm_mat_sub_q15(const arm_matrix_instance_q15 *pSrcA, const arm_matrix_instance_q15 *pSrcB, arm_matrix_instance_q15 *pDst)
Q15 matrix subtraction.
void arm_min_q7(q7_t *pSrc, uint32_t blockSize, q7_t *result, uint32_t *index)
Minimum value of a Q7 vector.
Definition: arm_min_q7.c:63
void arm_cmplx_mag_q31(q31_t *pSrc, q31_t *pDst, uint32_t numSamples)
Q31 complex magnitude.
void arm_var_q15(q15_t *pSrc, uint32_t blockSize, q15_t *pResult)
Variance of the elements of a Q15 vector.
Definition: arm_var_q15.c:75
Instance structure for the floating-point RFFT/RIFFT function.
Definition: arm_math.h:2235
void arm_min_f32(float32_t *pSrc, uint32_t blockSize, float32_t *pResult, uint32_t *pIndex)
Minimum value of a floating-point vector.
Definition: arm_min_f32.c:71
const uint16_t * pBitRevTable
Definition: arm_math.h:2145
void arm_shift_q7(q7_t *pSrc, int8_t shiftBits, q7_t *pDst, uint32_t blockSize)
Shifts the elements of a Q7 vector a specified number of bits.
Definition: arm_shift_q7.c:71
void arm_sub_q15(q15_t *pSrcA, q15_t *pSrcB, q15_t *pDst, uint32_t blockSize)
Q15 vector subtraction.
Definition: arm_sub_q15.c:66
void arm_q31_to_float(q31_t *pSrc, float32_t *pDst, uint32_t blockSize)
Converts the elements of the Q31 vector to floating-point vector.
void arm_cfft_radix2_q15(const arm_cfft_radix2_instance_q15 *S, q15_t *pSrc)
Processing function for the fixed-point CFFT/CIFFT.
arm_status arm_fir_interpolate_init_q31(arm_fir_interpolate_instance_q31 *S, uint8_t L, uint16_t numTaps, q31_t *pCoeffs, q31_t *pState, uint32_t blockSize)
Initialization function for the Q31 FIR interpolator.
void arm_biquad_cascade_df1_fast_q15(const arm_biquad_casd_df1_inst_q15 *S, q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-...
arm_status arm_sqrt_q31(q31_t in, q31_t *pOut)
Q31 square root function.
Definition: arm_sqrt_q31.c:61
void arm_sub_q7(q7_t *pSrcA, q7_t *pSrcB, q7_t *pDst, uint32_t blockSize)
Q7 vector subtraction.
Definition: arm_sub_q7.c:66
void arm_std_q31(q31_t *pSrc, uint32_t blockSize, q31_t *pResult)
Standard deviation of the elements of a Q31 vector.
Definition: arm_std_q31.c:78
void arm_fir_q7(const arm_fir_instance_q7 *S, q7_t *pSrc, q7_t *pDst, uint32_t blockSize)
Processing function for the Q7 FIR filter.
Definition: arm_fir_q7.c:69
void arm_fir_init_q31(arm_fir_instance_q31 *S, uint16_t numTaps, q31_t *pCoeffs, q31_t *pState, uint32_t blockSize)
Initialization function for the Q31 FIR filter.
Instance structure for the Q15 bilinear interpolation function.
Definition: arm_math.h:1881
Instance structure for the Q31 CFFT/CIFFT function.
Definition: arm_math.h:2027
void arm_cfft_radix4_q15(const arm_cfft_radix4_instance_q15 *S, q15_t *pSrc)
Processing function for the Q15 CFFT/CIFFT.
void arm_add_q31(q31_t *pSrcA, q31_t *pSrcB, q31_t *pDst, uint32_t blockSize)
Q31 vector addition.
Definition: arm_add_q31.c:67
arm_status arm_mat_trans_q15(const arm_matrix_instance_q15 *pSrc, arm_matrix_instance_q15 *pDst)
Q15 matrix transpose.
void arm_offset_q15(q15_t *pSrc, q15_t offset, q15_t *pDst, uint32_t blockSize)
Adds a constant offset to a Q15 vector.
void arm_std_q15(q15_t *pSrc, uint32_t blockSize, q15_t *pResult)
Standard deviation of the elements of a Q15 vector.
Definition: arm_std_q15.c:73
void arm_abs_q31(q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Q31 vector absolute value.
Definition: arm_abs_q31.c:66
arm_status arm_cfft_radix4_init_q31(arm_cfft_radix4_instance_q31 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
Initialization function for the Q31 CFFT/CIFFT.
CMSIS Cortex-M7 Core Peripheral Access Layer Header File.
void arm_cmplx_mult_real_f32(float32_t *pSrcCmplx, float32_t *pSrcReal, float32_t *pCmplxDst, uint32_t numSamples)
Floating-point complex-by-real multiplication.
void arm_biquad_cascade_df1_q31(const arm_biquad_casd_df1_inst_q31 *S, q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 Biquad cascade filter.
arm_status arm_mat_mult_fast_q31(const arm_matrix_instance_q31 *pSrcA, const arm_matrix_instance_q31 *pSrcB, arm_matrix_instance_q31 *pDst)
Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4.
void arm_iir_lattice_f32(const arm_iir_lattice_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point IIR lattice filter.
void arm_shift_q31(q31_t *pSrc, int8_t shiftBits, q31_t *pDst, uint32_t blockSize)
Shifts the elements of a Q31 vector a specified number of bits.
Definition: arm_shift_q31.c:84
arm_status arm_mat_scale_q15(const arm_matrix_instance_q15 *pSrc, q15_t scaleFract, int32_t shift, arm_matrix_instance_q15 *pDst)
Q15 matrix scaling.
Instance structure for the Q7 sparse FIR filter.
Definition: arm_math.h:4469
Instance structure for the floating-point transposed direct form II Biquad cascade filter...
Definition: arm_math.h:3618
arm_status arm_fir_decimate_init_f32(arm_fir_decimate_instance_f32 *S, uint16_t numTaps, uint8_t M, float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR decimator.
Instance structure for the floating-point RFFT/RIFFT function.
Definition: arm_math.h:2208
void arm_biquad_cascade_df1_fast_q31(const arm_biquad_casd_df1_inst_q31 *S, q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-...
const uint16_t * pBitRevTable
Definition: arm_math.h:2128
void arm_fir_interpolate_q31(const arm_fir_interpolate_instance_q31 *S, q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 FIR interpolator.
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)
Initialization function for the Q31 IIR lattice filter.
Instance structure for the floating-point CFFT/CIFFT function.
Definition: arm_math.h:2141
void arm_cfft_q15(const arm_cfft_instance_q15 *S, q15_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag)
Processing function for the Q15 complex FFT.
Definition: arm_cfft_q15.c:89
arm_status arm_cfft_radix4_init_q15(arm_cfft_radix4_instance_q15 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
Initialization function for the Q15 CFFT/CIFFT.
Instance structure for the Radix-2 Q31 CFFT/CIFFT function.
Definition: arm_math.h:2001
Instance structure for the Q31 sparse FIR filter.
Definition: arm_math.h:4443
void arm_sub_q31(q31_t *pSrcA, q31_t *pSrcB, q31_t *pDst, uint32_t blockSize)
Q31 vector subtraction.
Definition: arm_sub_q31.c:66
void arm_cmplx_dot_prod_q15(q15_t *pSrcA, q15_t *pSrcB, uint32_t numSamples, q31_t *realResult, q31_t *imagResult)
Q15 complex dot product.
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)
Initialization function for the Q31 sparse FIR filter.
void arm_fir_lattice_q31(const arm_fir_lattice_instance_q31 *S, q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 FIR lattice filter.
arm_status arm_mat_cmplx_mult_f32(const arm_matrix_instance_f32 *pSrcA, const arm_matrix_instance_f32 *pSrcB, arm_matrix_instance_f32 *pDst)
Floating-point, complex, matrix multiplication.
Instance structure for the floating-point LMS filter.
Definition: arm_math.h:3968
arm_status arm_mat_add_q15(const arm_matrix_instance_q15 *pSrcA, const arm_matrix_instance_q15 *pSrcB, arm_matrix_instance_q15 *pDst)
Q15 matrix addition.
arm_status arm_mat_scale_f32(const arm_matrix_instance_f32 *pSrc, float32_t scale, arm_matrix_instance_f32 *pDst)
Floating-point matrix scaling.
Instance structure for the floating-point FIR decimator.
Definition: arm_math.h:3291
double float64_t
64-bit floating-point type definition.
Definition: arm_math.h:412
void arm_q7_to_q31(q7_t *pSrc, q31_t *pDst, uint32_t blockSize)
Converts the elements of the Q7 vector to Q31 vector.
Definition: arm_q7_to_q31.c:70
float32_t * pCoeffs
Definition: arm_math.h:3972
arm_status arm_cfft_radix2_init_f32(arm_cfft_radix2_instance_f32 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
Initialization function for the floating-point CFFT/CIFFT.
float32_t * pState
Definition: arm_math.h:3971
Instance structure for the Q31 DCT4/IDCT4 function.
Definition: arm_math.h:2300
void arm_var_f32(float32_t *pSrc, uint32_t blockSize, float32_t *pResult)
Variance of the elements of a floating-point vector.
Definition: arm_var_f32.c:80
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)
Processing function for Q31 normalized LMS filter.
void arm_dct4_q31(const arm_dct4_instance_q31 *S, q31_t *pState, q31_t *pInlineBuffer)
Processing function for the Q31 DCT4/IDCT4.
Definition: arm_dct4_q31.c:64
void arm_fir_sparse_q7(arm_fir_sparse_instance_q7 *S, q7_t *pSrc, q7_t *pDst, q7_t *pScratchIn, q31_t *pScratchOut, uint32_t blockSize)
Processing function for the Q7 sparse FIR filter.
void arm_cmplx_mult_real_q15(q15_t *pSrcCmplx, q15_t *pSrcReal, q15_t *pCmplxDst, uint32_t numSamples)
Q15 complex-by-real multiplication.
CMSIS Cortex-M0+ Core Peripheral Access Layer Header File.
void arm_fill_q7(q7_t value, q7_t *pDst, uint32_t blockSize)
Fills a constant value into a Q7 vector.
Definition: arm_fill_q7.c:61
Instance structure for the Q31 FIR filter.
Definition: arm_math.h:1049
arm_status arm_fir_decimate_init_q15(arm_fir_decimate_instance_q15 *S, uint16_t numTaps, uint8_t M, q15_t *pCoeffs, q15_t *pState, uint32_t blockSize)
Initialization function for the Q15 FIR decimator.
void arm_cfft_radix4_q31(const arm_cfft_radix4_instance_q31 *S, q31_t *pSrc)
Processing function for the Q31 CFFT/CIFFT.
void arm_fir_init_f32(arm_fir_instance_f32 *S, uint16_t numTaps, float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR filter.
Instance structure for the Q15 FIR lattice filter.
Definition: arm_math.h:3723
int16_t q15_t
16-bit fractional data type in 1.15 format.
Definition: arm_math.h:392
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)
Processing function for floating-point LMS filter.
Definition: arm_lms_f32.c:181
const uint16_t * pBitRevTable
Definition: arm_math.h:2111
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)
Initialization function for the Q15 IIR lattice filter.
Instance structure for the floating-point CFFT/CIFFT function.
Definition: arm_math.h:2080
void arm_biquad_cascade_stereo_df2T_f32(const arm_biquad_cascade_stereo_df2T_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point transposed direct form II Biquad cascade filter...
#define INDEX_MASK
Definition: arm_math.h:332
Instance structure for the Q15 IIR lattice filter.
Definition: arm_math.h:3838
arm_status arm_mat_mult_fast_q15(const arm_matrix_instance_q15 *pSrcA, const arm_matrix_instance_q15 *pSrcB, arm_matrix_instance_q15 *pDst, q15_t *pState)
Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4.
void arm_cmplx_mag_squared_q31(q31_t *pSrc, q31_t *pDst, uint32_t numSamples)
Q31 complex magnitude squared.
void arm_cfft_radix2_f32(const arm_cfft_radix2_instance_f32 *S, float32_t *pSrc)
Radix-2 CFFT/CIFFT.
Instance structure for the Q31 normalized LMS filter.
Definition: arm_math.h:4168
Instance structure for the Q15 FIR decimator.
Definition: arm_math.h:3269
void arm_conv_fast_opt_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, q15_t *pScratch1, q15_t *pScratch2)
Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
void arm_mult_f32(float32_t *pSrcA, float32_t *pSrcB, float32_t *pDst, uint32_t blockSize)
Floating-point vector multiplication.
Definition: arm_mult_f32.c:73
void arm_min_q15(q15_t *pSrc, uint32_t blockSize, q15_t *pResult, uint32_t *pIndex)
Minimum value of a Q15 vector.
Definition: arm_min_q15.c:64
void arm_cmplx_mult_real_q31(q31_t *pSrcCmplx, q31_t *pSrcReal, q31_t *pCmplxDst, uint32_t numSamples)
Q31 complex-by-real multiplication.
void arm_fir_lattice_q15(const arm_fir_lattice_instance_q15 *S, q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 FIR lattice filter.
void arm_pid_init_f32(arm_pid_instance_f32 *S, int32_t resetStateFlag)
Initialization function for the floating-point PID Control.
void arm_abs_f32(float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Floating-point vector absolute value.
Definition: arm_abs_f32.c:75
arm_status arm_dct4_init_q31(arm_dct4_instance_q31 *S, arm_rfft_instance_q31 *S_RFFT, arm_cfft_radix4_instance_q31 *S_CFFT, uint16_t N, uint16_t Nby2, q31_t normalize)
Initialization function for the Q31 DCT4/IDCT4.
void arm_fill_q31(q31_t value, q31_t *pDst, uint32_t blockSize)
Fills a constant value into a Q31 vector.
Definition: arm_fill_q31.c:61
void arm_fir_q15(const arm_fir_instance_q15 *S, q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 FIR filter.
Definition: arm_fir_q15.c:85
void arm_biquad_cascade_df2T_f32(const arm_biquad_cascade_df2T_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point transposed direct form II Biquad cascade filter...
void arm_q31_to_q15(q31_t *pSrc, q15_t *pDst, uint32_t blockSize)
Converts the elements of the Q31 vector to Q15 vector.
void arm_fill_f32(float32_t value, float32_t *pDst, uint32_t blockSize)
Fills a constant value into a floating-point vector.
Definition: arm_fill_f32.c:74
void arm_copy_f32(float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Copies the elements of a floating-point vector.
Definition: arm_copy_f32.c:74
Instance structure for the Q15 normalized LMS filter.
Definition: arm_math.h:4222
void arm_fir_interpolate_q15(const arm_fir_interpolate_instance_q15 *S, q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 FIR interpolator.
void arm_pid_reset_f32(arm_pid_instance_f32 *S)
Reset function for the floating-point PID Control.
void arm_cfft_radix2_q31(const arm_cfft_radix2_instance_q31 *S, q31_t *pSrc)
Processing function for the fixed-point CFFT/CIFFT.
void arm_abs_q7(q7_t *pSrc, q7_t *pDst, uint32_t blockSize)
Q7 vector absolute value.
Definition: arm_abs_q7.c:69
void arm_q7_to_float(q7_t *pSrc, float32_t *pDst, uint32_t blockSize)
Converts the elements of the Q7 vector to floating-point vector.
void arm_q31_to_q7(q31_t *pSrc, q7_t *pDst, uint32_t blockSize)
Converts the elements of the Q31 vector to Q7 vector.
Definition: arm_q31_to_q7.c:70
arm_rfft_instance_q15 * pRfft
Definition: arm_math.h:2353
Instance structure for the Q15 matrix structure.
Definition: arm_math.h:1390
arm_status arm_conv_partial_q31(q31_t *pSrcA, uint32_t srcALen, q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of Q31 sequences.
void arm_cmplx_mult_cmplx_q31(q31_t *pSrcA, q31_t *pSrcB, q31_t *pDst, uint32_t numSamples)
Q31 complex-by-complex multiplication.
void arm_rfft_q15(const arm_rfft_instance_q15 *S, q15_t *pSrc, q15_t *pDst)
Processing function for the Q15 RFFT/RIFFT.
Definition: arm_rfft_q15.c:87
arm_status arm_mat_scale_q31(const arm_matrix_instance_q31 *pSrc, q31_t scaleFract, int32_t shift, arm_matrix_instance_q31 *pDst)
Q31 matrix scaling.
Instance structure for the floating-point sparse FIR filter.
Definition: arm_math.h:4430
void arm_dct4_f32(const arm_dct4_instance_f32 *S, float32_t *pState, float32_t *pInlineBuffer)
Processing function for the floating-point DCT4/IDCT4.
Definition: arm_dct4_f32.c:137
void arm_biquad_cascade_df1_init_q31(arm_biquad_casd_df1_inst_q31 *S, uint8_t numStages, q31_t *pCoeffs, q31_t *pState, int8_t postShift)
Initialization function for the Q31 Biquad cascade filter.
void arm_power_f32(float32_t *pSrc, uint32_t blockSize, float32_t *pResult)
Sum of the squares of the elements of a floating-point vector.
Definition: arm_power_f32.c:76
Instance structure for the Q15 Biquad cascade filter.
Definition: arm_math.h:1220
void arm_mean_q15(q15_t *pSrc, uint32_t blockSize, q15_t *pResult)
Mean value of a Q15 vector.
Definition: arm_mean_q15.c:72
void arm_add_q15(q15_t *pSrcA, q15_t *pSrcB, q15_t *pDst, uint32_t blockSize)
Q15 vector addition.
Definition: arm_add_q15.c:66
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)
Initialization function for Q31 LMS filter.
arm_status arm_fir_interpolate_init_f32(arm_fir_interpolate_instance_f32 *S, uint8_t L, uint16_t numTaps, float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR interpolator.
arm_status arm_mat_add_q31(const arm_matrix_instance_q31 *pSrcA, const arm_matrix_instance_q31 *pSrcB, arm_matrix_instance_q31 *pDst)
Q31 matrix addition.
uint32_t twidCoefRModifier
Definition: arm_math.h:2214
void arm_power_q7(q7_t *pSrc, uint32_t blockSize, q31_t *pResult)
Sum of the squares of the elements of a Q7 vector.
Definition: arm_power_q7.c:73
void arm_float_to_q7(float32_t *pSrc, q7_t *pDst, uint32_t blockSize)
Converts the elements of the floating-point vector to Q7 vector.
q15_t arm_sin_q15(q15_t x)
Fast approximation to the trigonometric sine function for Q15 data.
Definition: arm_sin_q15.c:61
void arm_conv_fast_q31(q31_t *pSrcA, uint32_t srcALen, q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst)
Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4.
void arm_dot_prod_q15(q15_t *pSrcA, q15_t *pSrcB, uint32_t blockSize, q63_t *result)
Dot product of Q15 vectors.
void arm_negate_q7(q7_t *pSrc, q7_t *pDst, uint32_t blockSize)
Negates the elements of a Q7 vector.
Definition: arm_negate_q7.c:65
void arm_cmplx_conj_f32(float32_t *pSrc, float32_t *pDst, uint32_t numSamples)
Floating-point complex conjugate.
Instance structure for the Q15 LMS filter.
Definition: arm_math.h:4016
void arm_cfft_radix4_f32(const arm_cfft_radix4_instance_f32 *S, float32_t *pSrc)
Processing function for the floating-point Radix-4 CFFT/CIFFT.
void arm_mult_q15(q15_t *pSrcA, q15_t *pSrcB, q15_t *pDst, uint32_t blockSize)
Q15 vector multiplication.
Definition: arm_mult_q15.c:67
Instance structure for the Q31 FIR interpolator.
Definition: arm_math.h:3443
void arm_correlate_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst)
Correlation of Q15 sequences.
void arm_negate_f32(float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Negates the elements of a floating-point vector.
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)
Initialization function for floating-point normalized LMS filter.
Instance structure for the Q31 Biquad cascade filter.
Definition: arm_math.h:1231
void arm_correlate_q7(q7_t *pSrcA, uint32_t srcALen, q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst)
Correlation of Q7 sequences.
void arm_biquad_cascade_df2T_init_f64(arm_biquad_cascade_df2T_instance_f64 *S, uint8_t numStages, float64_t *pCoeffs, float64_t *pState)
Initialization function for the floating-point transposed direct form II Biquad cascade filter...
void arm_biquad_cascade_df1_f32(const arm_biquad_casd_df1_inst_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point Biquad cascade filter.
arm_status arm_fir_init_q15(arm_fir_instance_q15 *S, uint16_t numTaps, q15_t *pCoeffs, q15_t *pState, uint32_t blockSize)
Initialization function for the Q15 FIR filter.
arm_status arm_mat_cmplx_mult_q31(const arm_matrix_instance_q31 *pSrcA, const arm_matrix_instance_q31 *pSrcB, arm_matrix_instance_q31 *pDst)
Q31, complex, matrix multiplication.
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)
Initialization function for the Q15 LMS filter.
void arm_correlate_fast_opt_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, q15_t *pScratch)
Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
void arm_power_q15(q15_t *pSrc, uint32_t blockSize, q63_t *pResult)
Sum of the squares of the elements of a Q15 vector.
Definition: arm_power_q15.c:73
const arm_cfft_instance_q31 * pCfft
Definition: arm_math.h:2191
void arm_pid_reset_q31(arm_pid_instance_q31 *S)
Reset function for the Q31 PID Control.
void arm_rms_q15(q15_t *pSrc, uint32_t blockSize, q15_t *pResult)
Root Mean Square of the elements of a Q15 vector.
Definition: arm_rms_q15.c:70
Instance structure for the floating-point CFFT/CIFFT function.
Definition: arm_math.h:2053
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)
Processing function for Q31 LMS filter.
Definition: arm_lms_q31.c:77
Instance structure for the Q15 FIR interpolator.
Definition: arm_math.h:3432
int32_t q31_t
32-bit fractional data type in 1.31 format.
Definition: arm_math.h:397
void arm_mat_init_q15(arm_matrix_instance_q15 *S, uint16_t nRows, uint16_t nColumns, q15_t *pData)
Q15 matrix initialization.
arm_status arm_sqrt_q15(q15_t in, q15_t *pOut)
Q15 square root function.
Definition: arm_sqrt_q15.c:62
arm_cfft_radix4_instance_f32 * pCfft
Definition: arm_math.h:2217
void arm_shift_q15(q15_t *pSrc, int8_t shiftBits, q15_t *pDst, uint32_t blockSize)
Shifts the elements of a Q15 vector a specified number of bits.
Definition: arm_shift_q15.c:66
void arm_float_to_q31(float32_t *pSrc, q31_t *pDst, uint32_t blockSize)
Converts the elements of the floating-point vector to Q31 vector.
arm_status arm_conv_partial_fast_opt_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)
Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
void arm_add_f32(float32_t *pSrcA, float32_t *pSrcB, float32_t *pDst, uint32_t blockSize)
Floating-point vector addition.
Definition: arm_add_f32.c:73
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)
Processing function for the Q15 sparse FIR filter.
Instance structure for the Q15 CFFT/CIFFT function.
Definition: arm_math.h:1975
void arm_std_f32(float32_t *pSrc, uint32_t blockSize, float32_t *pResult)
Standard deviation of the elements of a floating-point vector.
Definition: arm_std_f32.c:80
Instance structure for the Q15 PID Control.
Definition: arm_math.h:1737
void arm_offset_q7(q7_t *pSrc, q7_t offset, q7_t *pDst, uint32_t blockSize)
Adds a constant offset to a Q7 vector.
Definition: arm_offset_q7.c:66
arm_status arm_conv_partial_f32(float32_t *pSrcA, uint32_t srcALen, float32_t *pSrcB, uint32_t srcBLen, float32_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of floating-point sequences.
Instance structure for the Q15 DCT4/IDCT4 function.
Definition: arm_math.h:2346
arm_cfft_radix4_instance_q31 * pCfft
Definition: arm_math.h:2308
Instance structure for the floating-point normalized LMS filter.
Definition: arm_math.h:4118
Instance structure for the Q31 RFFT/RIFFT function.
Definition: arm_math.h:2183
float32_t * pTwiddleBReal
Definition: arm_math.h:2216
arm_status arm_conv_partial_opt_q7(q7_t *pSrcA, uint32_t srcALen, q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)
Partial convolution of Q7 sequences.
void arm_max_q31(q31_t *pSrc, uint32_t blockSize, q31_t *pResult, uint32_t *pIndex)
Maximum value of a Q31 vector.
Definition: arm_max_q31.c:62
Instance structure for the floating-point transposed direct form II Biquad cascade filter...
Definition: arm_math.h:3608
void arm_cmplx_mag_f32(float32_t *pSrc, float32_t *pDst, uint32_t numSamples)
Floating-point complex magnitude.
void arm_conv_f32(float32_t *pSrcA, uint32_t srcALen, float32_t *pSrcB, uint32_t srcBLen, float32_t *pDst)
Convolution of floating-point sequences.
Definition: arm_conv_f32.c:124
void arm_conv_q7(q7_t *pSrcA, uint32_t srcALen, q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst)
Convolution of Q7 sequences.
Definition: arm_conv_q7.c:76
void arm_var_q31(q31_t *pSrc, uint32_t blockSize, q31_t *pResult)
Variance of the elements of a Q31 vector.
Definition: arm_var_q31.c:78
Instance structure for the high precision Q31 Biquad cascade filter.
Definition: arm_math.h:3568
arm_cfft_radix4_instance_q15 * pCfft
Definition: arm_math.h:2354
Instance structure for the Q15 RFFT/RIFFT function.
Definition: arm_math.h:2158
const float32_t * pTwiddle
Definition: arm_math.h:2144
Instance structure for the floating-point matrix structure.
Definition: arm_math.h:1380
Instance structure for the Q15 CFFT/CIFFT function.
Definition: arm_math.h:1948
Instance structure for the floating-point matrix structure.
Definition: arm_math.h:1369
float32_t arm_cos_f32(float32_t x)
Fast approximation to the trigonometric cosine function for floating-point data.
Definition: arm_cos_f32.c:82
void arm_offset_q31(q31_t *pSrc, q31_t offset, q31_t *pDst, uint32_t blockSize)
Adds a constant offset to a Q31 vector.
void arm_fir_sparse_q31(arm_fir_sparse_instance_q31 *S, q31_t *pSrc, q31_t *pDst, q31_t *pScratchIn, uint32_t blockSize)
Processing function for the Q31 sparse FIR filter.
arm_status arm_fir_interpolate_init_q15(arm_fir_interpolate_instance_q15 *S, uint8_t L, uint16_t numTaps, q15_t *pCoeffs, q15_t *pState, uint32_t blockSize)
Initialization function for the Q15 FIR interpolator.
void arm_fir_f32(const arm_fir_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point FIR filter.
Definition: arm_fir_f32.c:565
Instance structure for the Q31 FIR decimator.
Definition: arm_math.h:3280
arm_status arm_cfft_radix2_init_q31(arm_cfft_radix2_instance_q31 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
Initialization function for the Q31 CFFT/CIFFT.
#define __CLZ
Count leading zeros.
Definition: cmsis_armcc.h:463
float32_t * pTwiddle
Definition: arm_math.h:2259
void arm_max_q15(q15_t *pSrc, uint32_t blockSize, q15_t *pResult, uint32_t *pIndex)
Maximum value of a Q15 vector.
Definition: arm_max_q15.c:62
Instance structure for the fixed-point CFFT/CIFFT function.
Definition: arm_math.h:2107
void arm_mat_init_f32(arm_matrix_instance_f32 *S, uint16_t nRows, uint16_t nColumns, float32_t *pData)
Floating-point matrix initialization.
void arm_fir_decimate_q15(const arm_fir_decimate_instance_q15 *S, q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 FIR decimator.
void arm_max_q7(q7_t *pSrc, uint32_t blockSize, q7_t *pResult, uint32_t *pIndex)
Maximum value of a Q7 vector.
Definition: arm_max_q7.c:62
void arm_rfft_fast_f32(arm_rfft_fast_instance_f32 *S, float32_t *p, float32_t *pOut, uint8_t ifftFlag)
Processing function for the floating-point real FFT.
void arm_fir_lattice_f32(const arm_fir_lattice_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point FIR lattice filter.
uint32_t twidCoefRModifier
Definition: arm_math.h:2188
void arm_fir_fast_q15(const arm_fir_instance_q15 *S, q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4.
void arm_power_q31(q31_t *pSrc, uint32_t blockSize, q63_t *pResult)
Sum of the squares of the elements of a Q31 vector.
Definition: arm_power_q31.c:74
void arm_scale_q7(q7_t *pSrc, q7_t scaleFract, int8_t shift, q7_t *pDst, uint32_t blockSize)
Multiplies a Q7 vector by a scalar.
Definition: arm_scale_q7.c:67
void arm_correlate_opt_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, q15_t *pScratch)
Correlation of Q15 sequences.
arm_status arm_mat_sub_f32(const arm_matrix_instance_f32 *pSrcA, const arm_matrix_instance_f32 *pSrcB, arm_matrix_instance_f32 *pDst)
Floating-point matrix subtraction.
Instance structure for the floating-point transposed direct form II Biquad cascade filter...
Definition: arm_math.h:3628
arm_status arm_mat_inverse_f64(const arm_matrix_instance_f64 *src, arm_matrix_instance_f64 *dst)
Floating-point matrix inverse.
void arm_max_f32(float32_t *pSrc, uint32_t blockSize, float32_t *pResult, uint32_t *pIndex)
Maximum value of a floating-point vector.
Definition: arm_max_f32.c:70
void arm_q15_to_q31(q15_t *pSrc, q31_t *pDst, uint32_t blockSize)
Converts the elements of the Q15 vector to Q31 vector.
void arm_correlate_fast_q31(q31_t *pSrcA, uint32_t srcALen, q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst)
Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4.
q15_t arm_cos_q15(q15_t x)
Fast approximation to the trigonometric cosine function for Q15 data.
Definition: arm_cos_q15.c:62
void arm_biquad_cas_df1_32x64_q31(const arm_biquad_cas_df1_32x64_ins_q31 *S, q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
void arm_cmplx_mag_squared_q15(q15_t *pSrc, q15_t *pDst, uint32_t numSamples)
Q15 complex magnitude squared.
void arm_mat_init_q31(arm_matrix_instance_q31 *S, uint16_t nRows, uint16_t nColumns, q31_t *pData)
Q31 matrix initialization.
float32_t arm_sin_f32(float32_t x)
Fast approximation to the trigonometric sine function for floating-point data.
Definition: arm_sin_f32.c:84
arm_status arm_conv_partial_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of Q15 sequences.
void arm_mult_q7(q7_t *pSrcA, q7_t *pSrcB, q7_t *pDst, uint32_t blockSize)
Q7 vector multiplication.
Definition: arm_mult_q7.c:66
float32_t * pTwiddleAReal
Definition: arm_math.h:2215
void arm_fill_q15(q15_t value, q15_t *pDst, uint32_t blockSize)
Fills a constant value into a Q15 vector.
Definition: arm_fill_q15.c:61
Instance structure for the floating-point Linear Interpolate function.
Definition: arm_math.h:1840
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)
Initialization function for Q15 normalized LMS filter.
void arm_add_q7(q7_t *pSrcA, q7_t *pSrcB, q7_t *pDst, uint32_t blockSize)
Q7 vector addition.
Definition: arm_add_q7.c:66
arm_rfft_instance_q31 * pRfft
Definition: arm_math.h:2307
float32_t * pState
Definition: arm_math.h:1062
Instance structure for the floating-point Biquad cascade filter.
Definition: arm_math.h:1242
arm_status
Error status returned by some functions in the library.
Definition: arm_math.h:373
void arm_fir_decimate_q31(const arm_fir_decimate_instance_q31 *S, q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 FIR decimator.
Instance structure for the floating-point bilinear interpolation function.
Definition: arm_math.h:1851
arm_rfft_instance_f32 * pRfft
Definition: arm_math.h:2261
void arm_rms_f32(float32_t *pSrc, uint32_t blockSize, float32_t *pResult)
Root Mean Square of the elements of a floating-point vector.
Definition: arm_rms_f32.c:76
void arm_fir_decimate_fast_q15(const arm_fir_decimate_instance_q15 *S, q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
Instance structure for the Q31 matrix structure.
Definition: arm_math.h:1400
void arm_biquad_cascade_df1_q15(const arm_biquad_casd_df1_inst_q15 *S, q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 Biquad cascade filter.
void arm_dct4_q15(const arm_dct4_instance_q15 *S, q15_t *pState, q15_t *pInlineBuffer)
Processing function for the Q15 DCT4/IDCT4.
Definition: arm_dct4_q15.c:63
uint32_t ifftFlag
Definition: FFT.c:112
void arm_q15_to_float(q15_t *pSrc, float32_t *pDst, uint32_t blockSize)
Converts the elements of the Q15 vector to floating-point vector.
void arm_conv_q15(q15_t *pSrcA, uint32_t srcALen, q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst)
Convolution of Q15 sequences.
Definition: arm_conv_q15.c:79
void arm_mean_f32(float32_t *pSrc, uint32_t blockSize, float32_t *pResult)
Mean value of a floating-point vector.
Definition: arm_mean_f32.c:75
void arm_fir_decimate_fast_q31(arm_fir_decimate_instance_q31 *S, q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
void arm_biquad_cascade_df1_init_q15(arm_biquad_casd_df1_inst_q15 *S, uint8_t numStages, q15_t *pCoeffs, q15_t *pState, int8_t postShift)
Initialization function for the Q15 Biquad cascade filter.
void arm_cmplx_mult_cmplx_f32(float32_t *pSrcA, float32_t *pSrcB, float32_t *pDst, uint32_t numSamples)
Floating-point complex-by-complex multiplication.
void arm_scale_f32(float32_t *pSrc, float32_t scale, float32_t *pDst, uint32_t blockSize)
Multiplies a floating-point vector by a scalar.
Definition: arm_scale_f32.c:89
void arm_biquad_cascade_stereo_df2T_init_f32(arm_biquad_cascade_stereo_df2T_instance_f32 *S, uint8_t numStages, float32_t *pCoeffs, float32_t *pState)
Initialization function for the floating-point transposed direct form II Biquad cascade filter...
Instance structure for the Q31 PID Control.
Definition: arm_math.h:1755