Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 5 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* ---------------------------------------------------------------------- |
1 | /* ---------------------------------------------------------------------- |
2 | * Copyright (C) 2010-2015 ARM Limited. All rights reserved. |
2 | * Copyright (C) 2010-2015 ARM Limited. All rights reserved. |
3 | * |
3 | * |
4 | * $Date: 19. March 2015 |
4 | * $Date: 20. October 2015 |
5 | * $Revision: V.1.4.5 |
5 | * $Revision: V1.4.5 b |
6 | * |
6 | * |
7 | * Project: CMSIS DSP Library |
7 | * Project: CMSIS DSP Library |
8 | * Title: arm_math.h |
8 | * Title: arm_math.h |
9 | * |
9 | * |
10 | * Description: Public header file for CMSIS DSP Library |
10 | * Description: Public header file for CMSIS DSP Library |
11 | * |
11 | * |
12 | * Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0 |
12 | * Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0 |
13 | * |
13 | * |
14 | * Redistribution and use in source and binary forms, with or without |
14 | * Redistribution and use in source and binary forms, with or without |
15 | * modification, are permitted provided that the following conditions |
15 | * modification, are permitted provided that the following conditions |
Line 139... | Line 139... | ||
139 | * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries |
139 | * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries |
140 | * |
140 | * |
141 | * <hr> |
141 | * <hr> |
142 | * CMSIS-DSP in ARM::CMSIS Pack |
142 | * CMSIS-DSP in ARM::CMSIS Pack |
143 | * ----------------------------- |
143 | * ----------------------------- |
144 | * |
144 | * |
145 | * The following files relevant to CMSIS-DSP are present in the <b>ARM::CMSIS</b> Pack directories: |
145 | * The following files relevant to CMSIS-DSP are present in the <b>ARM::CMSIS</b> Pack directories: |
146 | * |File/Folder |Content | |
146 | * |File/Folder |Content | |
147 | * |------------------------------|------------------------------------------------------------------------| |
147 | * |------------------------------|------------------------------------------------------------------------| |
148 | * |\b CMSIS\\Documentation\\DSP | This documentation | |
148 | * |\b CMSIS\\Documentation\\DSP | This documentation | |
149 | * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) | |
149 | * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) | |
150 | * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions | |
150 | * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions | |
151 | * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library | |
151 | * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library | |
152 | * |
152 | * |
153 | * <hr> |
153 | * <hr> |
154 | * Revision History of CMSIS-DSP |
154 | * Revision History of CMSIS-DSP |
155 | * ------------ |
155 | * ------------ |
156 | * Please refer to \ref ChangeLog_pg. |
156 | * Please refer to \ref ChangeLog_pg. |
157 | * |
157 | * |
Line 286... | Line 286... | ||
286 | * @defgroup groupExamples Examples |
286 | * @defgroup groupExamples Examples |
287 | */ |
287 | */ |
288 | #ifndef _ARM_MATH_H |
288 | #ifndef _ARM_MATH_H |
289 | #define _ARM_MATH_H |
289 | #define _ARM_MATH_H |
290 | 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 | ||
291 | #define __CMSIS_GENERIC /* disable NVIC and Systick functions */ |
299 | #define __CMSIS_GENERIC /* disable NVIC and Systick functions */ |
292 | 300 | ||
293 | #if defined(ARM_MATH_CM7) |
301 | #if defined(ARM_MATH_CM7) |
294 | #include "core_cm7.h" |
302 | #include "core_cm7.h" |
295 | #elif defined (ARM_MATH_CM4) |
303 | #elif defined (ARM_MATH_CM4) |
296 | #include "core_cm4.h" |
304 | #include "core_cm4.h" |
297 | #elif defined (ARM_MATH_CM3) |
305 | #elif defined (ARM_MATH_CM3) |
298 | #include "core_cm3.h" |
306 | #include "core_cm3.h" |
299 | #elif defined (ARM_MATH_CM0) |
307 | #elif defined (ARM_MATH_CM0) |
300 | #include "core_cm0.h" |
308 | #include "core_cm0.h" |
301 | #define ARM_MATH_CM0_FAMILY |
309 | #define ARM_MATH_CM0_FAMILY |
302 | #elif defined (ARM_MATH_CM0PLUS) |
310 | #elif defined (ARM_MATH_CM0PLUS) |
303 | #include "core_cm0plus.h" |
311 | #include "core_cm0plus.h" |
304 | #define ARM_MATH_CM0_FAMILY |
312 | #define ARM_MATH_CM0_FAMILY |
305 | #else |
313 | #else |
306 | #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0" |
314 | #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0" |
307 | #endif |
315 | #endif |
308 | 316 | ||
309 | #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ |
317 | #undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ |
310 | #include "string.h" |
318 | #include "string.h" |
311 | #include "math.h" |
319 | #include "math.h" |
312 | #ifdef __cplusplus |
320 | #ifdef __cplusplus |
313 | extern "C" |
321 | extern "C" |
314 | { |
322 | { |
315 | #endif |
323 | #endif |
316 | 324 | ||
317 | 325 | ||
318 | /** |
326 | /** |
319 | * @brief Macros required for reciprocal calculation in Normalized LMS |
327 | * @brief Macros required for reciprocal calculation in Normalized LMS |
320 | */ |
328 | */ |
321 | 329 | ||
322 | #define DELTA_Q31 (0x100) |
330 | #define DELTA_Q31 (0x100) |
323 | #define DELTA_Q15 0x5 |
331 | #define DELTA_Q15 0x5 |
324 | #define INDEX_MASK 0x0000003F |
332 | #define INDEX_MASK 0x0000003F |
325 | #ifndef PI |
333 | #ifndef PI |
326 | #define PI 3.14159265358979f |
334 | #define PI 3.14159265358979f |
327 | #endif |
335 | #endif |
328 | 336 | ||
329 | /** |
337 | /** |
330 | * @brief Macros required for SINE and COSINE Fast math approximations |
338 | * @brief Macros required for SINE and COSINE Fast math approximations |
331 | */ |
339 | */ |
Line 333... | Line 341... | ||
333 | #define FAST_MATH_TABLE_SIZE 512 |
341 | #define FAST_MATH_TABLE_SIZE 512 |
334 | #define FAST_MATH_Q31_SHIFT (32 - 10) |
342 | #define FAST_MATH_Q31_SHIFT (32 - 10) |
335 | #define FAST_MATH_Q15_SHIFT (16 - 10) |
343 | #define FAST_MATH_Q15_SHIFT (16 - 10) |
336 | #define CONTROLLER_Q31_SHIFT (32 - 9) |
344 | #define CONTROLLER_Q31_SHIFT (32 - 9) |
337 | #define TABLE_SIZE 256 |
345 | #define TABLE_SIZE 256 |
338 | #define TABLE_SPACING_Q31 0x400000 |
346 | #define TABLE_SPACING_Q31 0x400000 |
339 | #define TABLE_SPACING_Q15 0x80 |
347 | #define TABLE_SPACING_Q15 0x80 |
340 | 348 | ||
341 | /** |
349 | /** |
342 | * @brief Macros required for SINE and COSINE Controller functions |
350 | * @brief Macros required for SINE and COSINE Controller functions |
343 | */ |
351 | */ |
344 | /* 1.31(q31) Fixed value of 2/360 */ |
352 | /* 1.31(q31) Fixed value of 2/360 */ |
345 | /* -1 to +1 is divided into 360 values so total spacing is (2/360) */ |
353 | /* -1 to +1 is divided into 360 values so total spacing is (2/360) */ |
346 | #define INPUT_SPACING 0xB60B61 |
354 | #define INPUT_SPACING 0xB60B61 |
347 | 355 | ||
348 | /** |
356 | /** |
349 | * @brief Macro for Unaligned Support |
357 | * @brief Macro for Unaligned Support |
350 | */ |
358 | */ |
351 | #ifndef UNALIGNED_SUPPORT_DISABLE |
359 | #ifndef UNALIGNED_SUPPORT_DISABLE |
Line 354... | Line 362... | ||
354 | #if defined (__GNUC__) |
362 | #if defined (__GNUC__) |
355 | #define ALIGN4 __attribute__((aligned(4))) |
363 | #define ALIGN4 __attribute__((aligned(4))) |
356 | #else |
364 | #else |
357 | #define ALIGN4 __align(4) |
365 | #define ALIGN4 __align(4) |
358 | #endif |
366 | #endif |
359 | #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ |
367 | #endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ |
360 | 368 | ||
361 | /** |
369 | /** |
362 | * @brief Error status returned by some functions in the library. |
370 | * @brief Error status returned by some functions in the library. |
363 | */ |
371 | */ |
364 | 372 | ||
Line 407... | Line 415... | ||
407 | * @brief definition to read/write two 16 bit values. |
415 | * @brief definition to read/write two 16 bit values. |
408 | */ |
416 | */ |
409 | #if defined __CC_ARM |
417 | #if defined __CC_ARM |
410 | #define __SIMD32_TYPE int32_t __packed |
418 | #define __SIMD32_TYPE int32_t __packed |
411 | #define CMSIS_UNUSED __attribute__((unused)) |
419 | #define CMSIS_UNUSED __attribute__((unused)) |
- | 420 | ||
412 | #elif defined __ICCARM__ |
421 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) |
413 | #define __SIMD32_TYPE int32_t __packed |
422 | #define __SIMD32_TYPE int32_t |
414 | #define CMSIS_UNUSED |
423 | #define CMSIS_UNUSED __attribute__((unused)) |
- | 424 | ||
415 | #elif defined __GNUC__ |
425 | #elif defined __GNUC__ |
416 | #define __SIMD32_TYPE int32_t |
426 | #define __SIMD32_TYPE int32_t |
417 | #define CMSIS_UNUSED __attribute__((unused)) |
427 | #define CMSIS_UNUSED __attribute__((unused)) |
- | 428 | ||
- | 429 | #elif defined __ICCARM__ |
|
- | 430 | #define __SIMD32_TYPE int32_t __packed |
|
- | 431 | #define CMSIS_UNUSED |
|
- | 432 | ||
418 | #elif defined __CSMC__ /* Cosmic */ |
433 | #elif defined __CSMC__ |
419 | #define __SIMD32_TYPE int32_t |
434 | #define __SIMD32_TYPE int32_t |
420 | #define CMSIS_UNUSED |
435 | #define CMSIS_UNUSED |
- | 436 | ||
421 | #elif defined __TASKING__ |
437 | #elif defined __TASKING__ |
422 | #define __SIMD32_TYPE __unaligned int32_t |
438 | #define __SIMD32_TYPE __unaligned int32_t |
423 | #define CMSIS_UNUSED |
439 | #define CMSIS_UNUSED |
- | 440 | ||
424 | #else |
441 | #else |
425 | #error Unknown compiler |
442 | #error Unknown compiler |
426 | #endif |
443 | #endif |
427 | 444 | ||
428 | #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) |
445 | #define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) |
429 | #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) |
446 | #define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) |
430 | - | ||
431 | #define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) |
447 | #define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) |
432 | - | ||
433 | #define __SIMD64(addr) (*(int64_t **) & (addr)) |
448 | #define __SIMD64(addr) (*(int64_t **) & (addr)) |
434 | 449 | ||
435 | #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) |
450 | #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) |
436 | /** |
451 | /** |
437 | * @brief definition to pack two 16 bit values. |
452 | * @brief definition to pack two 16 bit values. |
438 | */ |
453 | */ |
Line 447... | Line 462... | ||
447 | /** |
462 | /** |
448 | * @brief definition to pack four 8 bit values. |
463 | * @brief definition to pack four 8 bit values. |
449 | */ |
464 | */ |
450 | #ifndef ARM_MATH_BIG_ENDIAN |
465 | #ifndef ARM_MATH_BIG_ENDIAN |
451 | 466 | ||
452 | #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ |
467 | #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ |
453 | (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ |
468 | (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ |
454 | (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ |
469 | (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ |
455 | (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) |
470 | (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) |
456 | #else |
471 | #else |
457 | 472 | ||
458 | #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ |
473 | #define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ |
459 | (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ |
474 | (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ |
460 | (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ |
475 | (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ |
461 | (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) |
476 | (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) |
462 | 477 | ||
463 | #endif |
478 | #endif |
464 | 479 | ||
465 | 480 | ||
466 | /** |
481 | /** |
Line 513... | Line 528... | ||
513 | { |
528 | { |
514 | return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) + |
529 | return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) + |
515 | (((q63_t) (x >> 32) * y))); |
530 | (((q63_t) (x >> 32) * y))); |
516 | } |
531 | } |
517 | 532 | ||
518 | 533 | /* |
|
519 | //#if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) |
534 | #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) |
520 | //#define __CLZ __clz |
535 | #define __CLZ __clz |
521 | //#endif |
536 | #endif |
522 | 537 | */ |
|
523 | //note: function can be removed when all toolchain support __CLZ for Cortex-M0 |
538 | /* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */ |
524 | #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) |
539 | #if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) |
525 | - | ||
526 | static __INLINE uint32_t __CLZ( |
540 | static __INLINE uint32_t __CLZ( |
527 | q31_t data); |
541 | q31_t data); |
528 | 542 | ||
529 | - | ||
530 | static __INLINE uint32_t __CLZ( |
543 | static __INLINE uint32_t __CLZ( |
531 | q31_t data) |
544 | q31_t data) |
532 | { |
545 | { |
533 | uint32_t count = 0; |
546 | uint32_t count = 0; |
534 | uint32_t mask = 0x80000000; |
547 | uint32_t mask = 0x80000000; |
Line 538... | Line 551... | ||
538 | count += 1u; |
551 | count += 1u; |
539 | mask = mask >> 1u; |
552 | mask = mask >> 1u; |
540 | } |
553 | } |
541 | 554 | ||
542 | return (count); |
555 | return (count); |
543 | - | ||
544 | } |
556 | } |
545 | - | ||
546 | #endif |
557 | #endif |
547 | 558 | ||
548 | /** |
559 | /** |
549 | * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. |
560 | * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. |
550 | */ |
561 | */ |
Line 552... | Line 563... | ||
552 | static __INLINE uint32_t arm_recip_q31( |
563 | static __INLINE uint32_t arm_recip_q31( |
553 | q31_t in, |
564 | q31_t in, |
554 | q31_t * dst, |
565 | q31_t * dst, |
555 | q31_t * pRecipTable) |
566 | q31_t * pRecipTable) |
556 | { |
567 | { |
557 | 568 | q31_t out; |
|
558 | uint32_t out, tempVal; |
569 | uint32_t tempVal; |
559 | uint32_t index, i; |
570 | uint32_t index, i; |
560 | uint32_t signBits; |
571 | uint32_t signBits; |
561 | 572 | ||
562 | if(in > 0) |
573 | if(in > 0) |
563 | { |
574 | { |
564 | signBits = __CLZ(in) - 1; |
575 | signBits = ((uint32_t) (__CLZ( in) - 1)); |
565 | } |
576 | } |
566 | else |
577 | else |
567 | { |
578 | { |
568 | signBits = __CLZ(-in) - 1; |
579 | signBits = ((uint32_t) (__CLZ(-in) - 1)); |
569 | } |
580 | } |
570 | 581 | ||
571 | /* Convert input sample to 1.31 format */ |
582 | /* Convert input sample to 1.31 format */ |
572 | in = in << signBits; |
583 | in = (in << signBits); |
573 | 584 | ||
574 | /* calculation of index for initial approximated Val */ |
585 | /* calculation of index for initial approximated Val */ |
575 | index = (uint32_t) (in >> 24u); |
586 | index = (uint32_t)(in >> 24); |
576 | index = (index & INDEX_MASK); |
587 | index = (index & INDEX_MASK); |
577 | 588 | ||
578 | /* 1.31 with exp 1 */ |
589 | /* 1.31 with exp 1 */ |
579 | out = pRecipTable[index]; |
590 | out = pRecipTable[index]; |
580 | 591 | ||
581 | /* calculation of reciprocal value */ |
592 | /* calculation of reciprocal value */ |
582 | /* running approximation for two iterations */ |
593 | /* running approximation for two iterations */ |
583 | for (i = 0u; i < 2u; i++) |
594 | for (i = 0u; i < 2u; i++) |
584 | { |
595 | { |
585 | tempVal = (q31_t) (((q63_t) in * out) >> 31u); |
596 | tempVal = (uint32_t) (((q63_t) in * out) >> 31); |
586 | tempVal = 0x7FFFFFFF - tempVal; |
597 | tempVal = 0x7FFFFFFFu - tempVal; |
587 | /* 1.31 with exp 1 */ |
598 | /* 1.31 with exp 1 */ |
588 | //out = (q31_t) (((q63_t) out * tempVal) >> 30u); |
599 | /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */ |
589 | out = (q31_t) clip_q63_to_q31(((q63_t) out * tempVal) >> 30u); |
600 | out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30); |
590 | } |
601 | } |
591 | 602 | ||
592 | /* write output */ |
603 | /* write output */ |
593 | *dst = out; |
604 | *dst = out; |
594 | 605 | ||
595 | /* return num of signbits of out = 1/in value */ |
606 | /* return num of signbits of out = 1/in value */ |
596 | return (signBits + 1u); |
607 | return (signBits + 1u); |
597 | - | ||
598 | } |
608 | } |
599 | 609 | ||
- | 610 | ||
600 | /** |
611 | /** |
601 | * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. |
612 | * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. |
602 | */ |
613 | */ |
603 | static __INLINE uint32_t arm_recip_q15( |
614 | static __INLINE uint32_t arm_recip_q15( |
604 | q15_t in, |
615 | q15_t in, |
605 | q15_t * dst, |
616 | q15_t * dst, |
606 | q15_t * pRecipTable) |
617 | q15_t * pRecipTable) |
607 | { |
618 | { |
608 | - | ||
- | 619 | q15_t out = 0; |
|
609 | uint32_t out = 0, tempVal = 0; |
620 | uint32_t tempVal = 0; |
610 | uint32_t index = 0, i = 0; |
621 | uint32_t index = 0, i = 0; |
611 | uint32_t signBits = 0; |
622 | uint32_t signBits = 0; |
612 | 623 | ||
613 | if(in > 0) |
624 | if(in > 0) |
614 | { |
625 | { |
615 | signBits = __CLZ(in) - 17; |
626 | signBits = ((uint32_t)(__CLZ( in) - 17)); |
616 | } |
627 | } |
617 | else |
628 | else |
618 | { |
629 | { |
619 | signBits = __CLZ(-in) - 17; |
630 | signBits = ((uint32_t)(__CLZ(-in) - 17)); |
620 | } |
631 | } |
621 | 632 | ||
622 | /* Convert input sample to 1.15 format */ |
633 | /* Convert input sample to 1.15 format */ |
623 | in = in << signBits; |
634 | in = (in << signBits); |
624 | 635 | ||
625 | /* calculation of index for initial approximated Val */ |
636 | /* calculation of index for initial approximated Val */ |
626 | index = in >> 8; |
637 | index = (uint32_t)(in >> 8); |
627 | index = (index & INDEX_MASK); |
638 | index = (index & INDEX_MASK); |
628 | 639 | ||
629 | /* 1.15 with exp 1 */ |
640 | /* 1.15 with exp 1 */ |
630 | out = pRecipTable[index]; |
641 | out = pRecipTable[index]; |
631 | 642 | ||
632 | /* calculation of reciprocal value */ |
643 | /* calculation of reciprocal value */ |
633 | /* running approximation for two iterations */ |
644 | /* running approximation for two iterations */ |
634 | for (i = 0; i < 2; i++) |
645 | for (i = 0u; i < 2u; i++) |
635 | { |
646 | { |
636 | tempVal = (q15_t) (((q31_t) in * out) >> 15); |
647 | tempVal = (uint32_t) (((q31_t) in * out) >> 15); |
637 | tempVal = 0x7FFF - tempVal; |
648 | tempVal = 0x7FFFu - tempVal; |
638 | /* 1.15 with exp 1 */ |
649 | /* 1.15 with exp 1 */ |
639 | out = (q15_t) (((q31_t) out * tempVal) >> 14); |
650 | out = (q15_t) (((q31_t) out * tempVal) >> 14); |
- | 651 | /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */ |
|
640 | } |
652 | } |
641 | 653 | ||
642 | /* write output */ |
654 | /* write output */ |
643 | *dst = out; |
655 | *dst = out; |
644 | 656 | ||
645 | /* return num of signbits of out = 1/in value */ |
657 | /* return num of signbits of out = 1/in value */ |
646 | return (signBits + 1); |
658 | return (signBits + 1); |
647 | - | ||
648 | } |
659 | } |
649 | 660 | ||
650 | 661 | ||
651 | /* |
662 | /* |
652 | * @brief C custom defined intrinisic function for only M0 processors |
663 | * @brief C custom defined intrinisic function for only M0 processors |
653 | */ |
664 | */ |
654 | #if defined(ARM_MATH_CM0_FAMILY) |
665 | #if defined(ARM_MATH_CM0_FAMILY) |
655 | - | ||
656 | static __INLINE q31_t __SSAT( |
666 | static __INLINE q31_t __SSAT( |
657 | q31_t x, |
667 | q31_t x, |
658 | uint32_t y) |
668 | uint32_t y) |
659 | { |
669 | { |
660 | int32_t posMax, negMin; |
670 | int32_t posMax, negMin; |
Line 683... | Line 693... | ||
683 | { |
693 | { |
684 | x = negMin; |
694 | x = negMin; |
685 | } |
695 | } |
686 | } |
696 | } |
687 | return (x); |
697 | return (x); |
688 | - | ||
689 | - | ||
690 | } |
698 | } |
691 | - | ||
692 | #endif /* end of ARM_MATH_CM0_FAMILY */ |
699 | #endif /* end of ARM_MATH_CM0_FAMILY */ |
693 | 700 | ||
694 | 701 | ||
695 | - | ||
696 | /* |
702 | /* |
697 | * @brief C custom defined intrinsic function for M3 and M0 processors |
703 | * @brief C custom defined intrinsic function for M3 and M0 processors |
698 | */ |
704 | */ |
699 | #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) |
705 | #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) |
700 | 706 | ||
701 | /* |
707 | /* |
702 | * @brief C custom defined QADD8 for M3 and M0 processors |
708 | * @brief C custom defined QADD8 for M3 and M0 processors |
703 | */ |
709 | */ |
704 | static __INLINE q31_t __QADD8( |
710 | static __INLINE uint32_t __QADD8( |
705 | q31_t x, |
711 | uint32_t x, |
706 | q31_t y) |
712 | uint32_t y) |
707 | { |
713 | { |
- | 714 | q31_t r, s, t, u; |
|
708 | 715 | ||
709 | q31_t sum; |
- | |
710 | q7_t r, s, t, u; |
- | |
711 | - | ||
712 | r = (q7_t) x; |
- | |
713 | s = (q7_t) y; |
- | |
714 | - | ||
715 | r = __SSAT((q31_t) (r + s), 8); |
- | |
716 | s = __SSAT(((q31_t) (((x << 16) >> 24) + ((y << 16) >> 24))), 8); |
716 | r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; |
717 | t = __SSAT(((q31_t) (((x << 8) >> 24) + ((y << 8) >> 24))), 8); |
717 | s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; |
718 | u = __SSAT(((q31_t) ((x >> 24) + (y >> 24))), 8); |
718 | t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; |
719 | - | ||
720 | sum = |
- | |
721 | (((q31_t) u << 24) & 0xFF000000) | (((q31_t) t << 16) & 0x00FF0000) | |
719 | u = __SSAT(((((q31_t)x ) >> 24) + (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; |
722 | (((q31_t) s << 8) & 0x0000FF00) | (r & 0x000000FF); |
- | |
723 | - | ||
724 | return sum; |
- | |
725 | 720 | ||
- | 721 | return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); |
|
726 | } |
722 | } |
727 | 723 | ||
- | 724 | ||
728 | /* |
725 | /* |
729 | * @brief C custom defined QSUB8 for M3 and M0 processors |
726 | * @brief C custom defined QSUB8 for M3 and M0 processors |
730 | */ |
727 | */ |
731 | static __INLINE q31_t __QSUB8( |
728 | static __INLINE uint32_t __QSUB8( |
732 | q31_t x, |
729 | uint32_t x, |
733 | q31_t y) |
730 | uint32_t y) |
734 | { |
731 | { |
735 | - | ||
736 | q31_t sum; |
- | |
737 | q31_t r, s, t, u; |
732 | q31_t r, s, t, u; |
738 | 733 | ||
739 | r = (q7_t) x; |
- | |
740 | s = (q7_t) y; |
- | |
741 | - | ||
742 | r = __SSAT((r - s), 8); |
- | |
743 | s = __SSAT(((q31_t) (((x << 16) >> 24) - ((y << 16) >> 24))), 8) << 8; |
734 | r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; |
744 | t = __SSAT(((q31_t) (((x << 8) >> 24) - ((y << 8) >> 24))), 8) << 16; |
735 | s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; |
745 | u = __SSAT(((q31_t) ((x >> 24) - (y >> 24))), 8) << 24; |
736 | t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; |
746 | - | ||
747 | sum = |
- | |
748 | (u & 0xFF000000) | (t & 0x00FF0000) | (s & 0x0000FF00) | (r & |
- | |
749 | 0x000000FF); |
737 | u = __SSAT(((((q31_t)x ) >> 24) - (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; |
750 | 738 | ||
751 | return sum; |
739 | return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); |
752 | } |
740 | } |
753 | 741 | ||
754 | /* |
- | |
755 | * @brief C custom defined QADD16 for M3 and M0 processors |
- | |
756 | */ |
- | |
757 | 742 | ||
758 | /* |
743 | /* |
759 | * @brief C custom defined QADD16 for M3 and M0 processors |
744 | * @brief C custom defined QADD16 for M3 and M0 processors |
760 | */ |
745 | */ |
761 | static __INLINE q31_t __QADD16( |
746 | static __INLINE uint32_t __QADD16( |
762 | q31_t x, |
747 | uint32_t x, |
763 | q31_t y) |
748 | uint32_t y) |
764 | { |
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; |
|
765 | 752 | ||
766 | q31_t sum; |
- | |
767 | q31_t r, s; |
- | |
768 | - | ||
769 | r = (q15_t) x; |
- | |
770 | s = (q15_t) y; |
- | |
771 | - | ||
772 | r = __SSAT(r + s, 16); |
- | |
773 | s = __SSAT(((q31_t) ((x >> 16) + (y >> 16))), 16) << 16; |
753 | r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; |
774 | - | ||
775 | sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
754 | s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; |
776 | - | ||
777 | return sum; |
- | |
778 | 755 | ||
- | 756 | return ((uint32_t)((s << 16) | (r ))); |
|
779 | } |
757 | } |
780 | 758 | ||
- | 759 | ||
781 | /* |
760 | /* |
782 | * @brief C custom defined SHADD16 for M3 and M0 processors |
761 | * @brief C custom defined SHADD16 for M3 and M0 processors |
783 | */ |
762 | */ |
784 | static __INLINE q31_t __SHADD16( |
763 | static __INLINE uint32_t __SHADD16( |
785 | q31_t x, |
764 | uint32_t x, |
786 | q31_t y) |
765 | uint32_t y) |
787 | { |
766 | { |
788 | - | ||
789 | q31_t sum; |
- | |
790 | q31_t r, s; |
767 | q31_t r, s; |
791 | 768 | ||
792 | r = (q15_t) x; |
- | |
793 | s = (q15_t) y; |
- | |
794 | - | ||
795 | r = ((r >> 1) + (s >> 1)); |
- | |
796 | s = ((q31_t) ((x >> 17) + (y >> 17))) << 16; |
769 | r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; |
797 | - | ||
798 | sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
770 | s = (((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; |
799 | - | ||
800 | return sum; |
- | |
801 | 771 | ||
- | 772 | return ((uint32_t)((s << 16) | (r ))); |
|
802 | } |
773 | } |
803 | 774 | ||
- | 775 | ||
804 | /* |
776 | /* |
805 | * @brief C custom defined QSUB16 for M3 and M0 processors |
777 | * @brief C custom defined QSUB16 for M3 and M0 processors |
806 | */ |
778 | */ |
807 | static __INLINE q31_t __QSUB16( |
779 | static __INLINE uint32_t __QSUB16( |
808 | q31_t x, |
780 | uint32_t x, |
809 | q31_t y) |
781 | uint32_t y) |
810 | { |
782 | { |
811 | - | ||
812 | q31_t sum; |
- | |
813 | q31_t r, s; |
783 | q31_t r, s; |
814 | 784 | ||
815 | r = (q15_t) x; |
- | |
816 | s = (q15_t) y; |
- | |
817 | - | ||
818 | r = __SSAT(r - s, 16); |
785 | r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; |
819 | s = __SSAT(((q31_t) ((x >> 16) - (y >> 16))), 16) << 16; |
786 | s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; |
820 | 787 | ||
821 | sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
788 | return ((uint32_t)((s << 16) | (r ))); |
822 | - | ||
823 | return sum; |
- | |
824 | } |
789 | } |
825 | 790 | ||
- | 791 | ||
826 | /* |
792 | /* |
827 | * @brief C custom defined SHSUB16 for M3 and M0 processors |
793 | * @brief C custom defined SHSUB16 for M3 and M0 processors |
828 | */ |
794 | */ |
829 | static __INLINE q31_t __SHSUB16( |
795 | static __INLINE uint32_t __SHSUB16( |
830 | q31_t x, |
796 | uint32_t x, |
831 | q31_t y) |
797 | uint32_t y) |
832 | { |
798 | { |
833 | - | ||
834 | q31_t diff; |
- | |
835 | q31_t r, s; |
799 | q31_t r, s; |
836 | 800 | ||
837 | r = (q15_t) x; |
801 | r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; |
838 | s = (q15_t) y; |
802 | s = (((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; |
839 | 803 | ||
840 | r = ((r >> 1) - (s >> 1)); |
804 | return ((uint32_t)((s << 16) | (r ))); |
841 | s = (((x >> 17) - (y >> 17)) << 16); |
- | |
842 | - | ||
843 | diff = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
- | |
844 | - | ||
845 | return diff; |
- | |
846 | } |
805 | } |
847 | 806 | ||
- | 807 | ||
848 | /* |
808 | /* |
849 | * @brief C custom defined QASX for M3 and M0 processors |
809 | * @brief C custom defined QASX for M3 and M0 processors |
850 | */ |
810 | */ |
851 | static __INLINE q31_t __QASX( |
811 | static __INLINE uint32_t __QASX( |
852 | q31_t x, |
812 | uint32_t x, |
853 | q31_t y) |
813 | uint32_t y) |
854 | { |
814 | { |
- | 815 | q31_t r, s; |
|
855 | 816 | ||
856 | q31_t sum = 0; |
- | |
857 | - | ||
858 | sum = |
- | |
859 | ((sum + |
- | |
860 | clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) + (q15_t) y))) << 16) + |
817 | r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; |
861 | clip_q31_to_q15((q31_t) ((q15_t) x - (q15_t) (y >> 16))); |
818 | s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; |
862 | 819 | ||
863 | return sum; |
820 | return ((uint32_t)((s << 16) | (r ))); |
864 | } |
821 | } |
865 | 822 | ||
- | 823 | ||
866 | /* |
824 | /* |
867 | * @brief C custom defined SHASX for M3 and M0 processors |
825 | * @brief C custom defined SHASX for M3 and M0 processors |
868 | */ |
826 | */ |
869 | static __INLINE q31_t __SHASX( |
827 | static __INLINE uint32_t __SHASX( |
870 | q31_t x, |
828 | uint32_t x, |
871 | q31_t y) |
829 | uint32_t y) |
872 | { |
830 | { |
873 | - | ||
874 | q31_t sum; |
- | |
875 | q31_t r, s; |
831 | q31_t r, s; |
876 | 832 | ||
877 | r = (q15_t) x; |
- | |
878 | s = (q15_t) y; |
- | |
879 | - | ||
880 | r = ((r >> 1) - (y >> 17)); |
- | |
881 | s = (((x >> 17) + (s >> 1)) << 16); |
833 | r = (((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; |
882 | - | ||
883 | sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
834 | s = (((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; |
884 | 835 | ||
885 | return sum; |
836 | return ((uint32_t)((s << 16) | (r ))); |
886 | } |
837 | } |
887 | 838 | ||
888 | 839 | ||
889 | /* |
840 | /* |
890 | * @brief C custom defined QSAX for M3 and M0 processors |
841 | * @brief C custom defined QSAX for M3 and M0 processors |
891 | */ |
842 | */ |
892 | static __INLINE q31_t __QSAX( |
843 | static __INLINE uint32_t __QSAX( |
893 | q31_t x, |
844 | uint32_t x, |
894 | q31_t y) |
845 | uint32_t y) |
895 | { |
846 | { |
- | 847 | q31_t r, s; |
|
896 | 848 | ||
897 | q31_t sum = 0; |
- | |
898 | - | ||
899 | sum = |
- | |
900 | ((sum + |
- | |
901 | clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) - (q15_t) y))) << 16) + |
849 | r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; |
902 | clip_q31_to_q15((q31_t) ((q15_t) x + (q15_t) (y >> 16))); |
850 | s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; |
903 | 851 | ||
904 | return sum; |
852 | return ((uint32_t)((s << 16) | (r ))); |
905 | } |
853 | } |
906 | 854 | ||
- | 855 | ||
907 | /* |
856 | /* |
908 | * @brief C custom defined SHSAX for M3 and M0 processors |
857 | * @brief C custom defined SHSAX for M3 and M0 processors |
909 | */ |
858 | */ |
910 | static __INLINE q31_t __SHSAX( |
859 | static __INLINE uint32_t __SHSAX( |
911 | q31_t x, |
860 | uint32_t x, |
912 | q31_t y) |
861 | uint32_t y) |
913 | { |
862 | { |
914 | - | ||
915 | q31_t sum; |
- | |
916 | q31_t r, s; |
863 | q31_t r, s; |
917 | 864 | ||
918 | r = (q15_t) x; |
865 | r = (((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; |
919 | s = (q15_t) y; |
866 | s = (((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; |
920 | 867 | ||
921 | r = ((r >> 1) + (y >> 17)); |
868 | return ((uint32_t)((s << 16) | (r ))); |
922 | s = (((x >> 17) - (s >> 1)) << 16); |
- | |
923 | - | ||
924 | sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); |
- | |
925 | - | ||
926 | return sum; |
- | |
927 | } |
869 | } |
928 | 870 | ||
- | 871 | ||
929 | /* |
872 | /* |
930 | * @brief C custom defined SMUSDX for M3 and M0 processors |
873 | * @brief C custom defined SMUSDX for M3 and M0 processors |
931 | */ |
874 | */ |
932 | static __INLINE q31_t __SMUSDX( |
875 | static __INLINE uint32_t __SMUSDX( |
933 | q31_t x, |
876 | uint32_t x, |
934 | q31_t y) |
877 | uint32_t y) |
935 | { |
878 | { |
936 | - | ||
937 | return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) - |
879 | return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - |
938 | ((q15_t) (x >> 16) * (q15_t) y))); |
880 | ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); |
939 | } |
881 | } |
940 | 882 | ||
941 | /* |
883 | /* |
942 | * @brief C custom defined SMUADX for M3 and M0 processors |
884 | * @brief C custom defined SMUADX for M3 and M0 processors |
943 | */ |
885 | */ |
944 | static __INLINE q31_t __SMUADX( |
886 | static __INLINE uint32_t __SMUADX( |
945 | q31_t x, |
887 | uint32_t x, |
946 | q31_t y) |
888 | uint32_t y) |
947 | { |
889 | { |
948 | - | ||
949 | return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) + |
890 | return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + |
950 | ((q15_t) (x >> 16) * (q15_t) y))); |
891 | ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); |
951 | } |
892 | } |
952 | 893 | ||
- | 894 | ||
953 | /* |
895 | /* |
954 | * @brief C custom defined QADD for M3 and M0 processors |
896 | * @brief C custom defined QADD for M3 and M0 processors |
955 | */ |
897 | */ |
956 | static __INLINE q31_t __QADD( |
898 | static __INLINE int32_t __QADD( |
957 | q31_t x, |
899 | int32_t x, |
958 | q31_t y) |
900 | int32_t y) |
959 | { |
901 | { |
960 | return clip_q63_to_q31((q63_t) x + y); |
902 | return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y))); |
961 | } |
903 | } |
962 | 904 | ||
- | 905 | ||
963 | /* |
906 | /* |
964 | * @brief C custom defined QSUB for M3 and M0 processors |
907 | * @brief C custom defined QSUB for M3 and M0 processors |
965 | */ |
908 | */ |
966 | static __INLINE q31_t __QSUB( |
909 | static __INLINE int32_t __QSUB( |
967 | q31_t x, |
910 | int32_t x, |
968 | q31_t y) |
911 | int32_t y) |
969 | { |
912 | { |
970 | return clip_q63_to_q31((q63_t) x - y); |
913 | return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y))); |
971 | } |
914 | } |
972 | 915 | ||
- | 916 | ||
973 | /* |
917 | /* |
974 | * @brief C custom defined SMLAD for M3 and M0 processors |
918 | * @brief C custom defined SMLAD for M3 and M0 processors |
975 | */ |
919 | */ |
976 | static __INLINE q31_t __SMLAD( |
920 | static __INLINE uint32_t __SMLAD( |
977 | q31_t x, |
921 | uint32_t x, |
978 | q31_t y, |
922 | uint32_t y, |
979 | q31_t sum) |
923 | uint32_t sum) |
980 | { |
924 | { |
981 | - | ||
982 | return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + |
925 | return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + |
983 | ((q15_t) x * (q15_t) y)); |
926 | ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + |
- | 927 | ( ((q31_t)sum ) ) )); |
|
984 | } |
928 | } |
985 | 929 | ||
- | 930 | ||
986 | /* |
931 | /* |
987 | * @brief C custom defined SMLADX for M3 and M0 processors |
932 | * @brief C custom defined SMLADX for M3 and M0 processors |
988 | */ |
933 | */ |
989 | static __INLINE q31_t __SMLADX( |
934 | static __INLINE uint32_t __SMLADX( |
990 | q31_t x, |
935 | uint32_t x, |
991 | q31_t y, |
936 | uint32_t y, |
992 | q31_t sum) |
937 | uint32_t sum) |
993 | { |
938 | { |
994 | - | ||
995 | return (sum + ((q15_t) (x >> 16) * (q15_t) (y)) + |
939 | return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + |
996 | ((q15_t) x * (q15_t) (y >> 16))); |
940 | ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + |
- | 941 | ( ((q31_t)sum ) ) )); |
|
997 | } |
942 | } |
998 | 943 | ||
- | 944 | ||
999 | /* |
945 | /* |
1000 | * @brief C custom defined SMLSDX for M3 and M0 processors |
946 | * @brief C custom defined SMLSDX for M3 and M0 processors |
1001 | */ |
947 | */ |
1002 | static __INLINE q31_t __SMLSDX( |
948 | static __INLINE uint32_t __SMLSDX( |
1003 | q31_t x, |
949 | uint32_t x, |
1004 | q31_t y, |
950 | uint32_t y, |
1005 | q31_t sum) |
951 | uint32_t sum) |
1006 | { |
952 | { |
1007 | - | ||
1008 | return (sum - ((q15_t) (x >> 16) * (q15_t) (y)) + |
953 | return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - |
1009 | ((q15_t) x * (q15_t) (y >> 16))); |
954 | ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + |
- | 955 | ( ((q31_t)sum ) ) )); |
|
1010 | } |
956 | } |
1011 | 957 | ||
- | 958 | ||
1012 | /* |
959 | /* |
1013 | * @brief C custom defined SMLALD for M3 and M0 processors |
960 | * @brief C custom defined SMLALD for M3 and M0 processors |
1014 | */ |
961 | */ |
1015 | static __INLINE q63_t __SMLALD( |
962 | static __INLINE uint64_t __SMLALD( |
1016 | q31_t x, |
963 | uint32_t x, |
1017 | q31_t y, |
964 | uint32_t y, |
1018 | q63_t sum) |
965 | uint64_t sum) |
1019 | { |
966 | { |
1020 | - | ||
1021 | return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + |
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)) + |
|
1022 | ((q15_t) x * (q15_t) y)); |
969 | ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + |
- | 970 | ( ((q63_t)sum ) ) )); |
|
1023 | } |
971 | } |
1024 | 972 | ||
- | 973 | ||
1025 | /* |
974 | /* |
1026 | * @brief C custom defined SMLALDX for M3 and M0 processors |
975 | * @brief C custom defined SMLALDX for M3 and M0 processors |
1027 | */ |
976 | */ |
1028 | static __INLINE q63_t __SMLALDX( |
977 | static __INLINE uint64_t __SMLALDX( |
1029 | q31_t x, |
978 | uint32_t x, |
1030 | q31_t y, |
979 | uint32_t y, |
1031 | q63_t sum) |
980 | uint64_t sum) |
1032 | { |
981 | { |
1033 | - | ||
1034 | return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + |
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)) + |
|
1035 | ((q15_t) x * (q15_t) (y >> 16)); |
984 | ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + |
- | 985 | ( ((q63_t)sum ) ) )); |
|
1036 | } |
986 | } |
1037 | 987 | ||
- | 988 | ||
1038 | /* |
989 | /* |
1039 | * @brief C custom defined SMUAD for M3 and M0 processors |
990 | * @brief C custom defined SMUAD for M3 and M0 processors |
1040 | */ |
991 | */ |
1041 | static __INLINE q31_t __SMUAD( |
992 | static __INLINE uint32_t __SMUAD( |
1042 | q31_t x, |
993 | uint32_t x, |
1043 | q31_t y) |
994 | uint32_t y) |
1044 | { |
995 | { |
1045 | - | ||
1046 | return (((x >> 16) * (y >> 16)) + |
996 | return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + |
1047 | (((x << 16) >> 16) * ((y << 16) >> 16))); |
997 | ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); |
1048 | } |
998 | } |
1049 | 999 | ||
- | 1000 | ||
1050 | /* |
1001 | /* |
1051 | * @brief C custom defined SMUSD for M3 and M0 processors |
1002 | * @brief C custom defined SMUSD for M3 and M0 processors |
1052 | */ |
1003 | */ |
1053 | static __INLINE q31_t __SMUSD( |
1004 | static __INLINE uint32_t __SMUSD( |
1054 | q31_t x, |
1005 | uint32_t x, |
1055 | q31_t y) |
1006 | uint32_t y) |
1056 | { |
1007 | { |
1057 | - | ||
1058 | return (-((x >> 16) * (y >> 16)) + |
1008 | return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) - |
1059 | (((x << 16) >> 16) * ((y << 16) >> 16))); |
1009 | ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); |
1060 | } |
1010 | } |
1061 | 1011 | ||
1062 | 1012 | ||
1063 | /* |
1013 | /* |
1064 | * @brief C custom defined SXTB16 for M3 and M0 processors |
1014 | * @brief C custom defined SXTB16 for M3 and M0 processors |
1065 | */ |
1015 | */ |
1066 | static __INLINE q31_t __SXTB16( |
1016 | static __INLINE uint32_t __SXTB16( |
1067 | q31_t x) |
1017 | uint32_t x) |
1068 | { |
1018 | { |
1069 | - | ||
1070 | return ((((x << 24) >> 24) & 0x0000FFFF) | |
1019 | return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) | |
1071 | (((x << 8) >> 8) & 0xFFFF0000)); |
1020 | ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000) )); |
1072 | } |
1021 | } |
1073 | 1022 | ||
1074 | - | ||
1075 | #endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ |
1023 | #endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ |
1076 | 1024 | ||
1077 | 1025 | ||
1078 | /** |
1026 | /** |
1079 | * @brief Instance structure for the Q7 FIR filter. |
1027 | * @brief Instance structure for the Q7 FIR filter. |
Line 1116... | Line 1064... | ||
1116 | } arm_fir_instance_f32; |
1064 | } arm_fir_instance_f32; |
1117 | 1065 | ||
1118 | 1066 | ||
1119 | /** |
1067 | /** |
1120 | * @brief Processing function for the Q7 FIR filter. |
1068 | * @brief Processing function for the Q7 FIR filter. |
1121 | * @param[in] *S points to an instance of the Q7 FIR filter structure. |
1069 | * @param[in] S points to an instance of the Q7 FIR filter structure. |
1122 | * @param[in] *pSrc points to the block of input data. |
1070 | * @param[in] pSrc points to the block of input data. |
1123 | * @param[out] *pDst points to the block of output data. |
1071 | * @param[out] pDst points to the block of output data. |
1124 | * @param[in] blockSize number of samples to process. |
1072 | * @param[in] blockSize number of samples to process. |
1125 | * @return none. |
- | |
1126 | */ |
1073 | */ |
1127 | void arm_fir_q7( |
1074 | void arm_fir_q7( |
1128 | const arm_fir_instance_q7 * S, |
1075 | const arm_fir_instance_q7 * S, |
1129 | q7_t * pSrc, |
1076 | q7_t * pSrc, |
1130 | q7_t * pDst, |
1077 | q7_t * pDst, |
1131 | uint32_t blockSize); |
1078 | uint32_t blockSize); |
1132 | 1079 | ||
1133 | 1080 | ||
1134 | /** |
1081 | /** |
1135 | * @brief Initialization function for the Q7 FIR filter. |
1082 | * @brief Initialization function for the Q7 FIR filter. |
1136 | * @param[in,out] *S points to an instance of the Q7 FIR structure. |
1083 | * @param[in,out] S points to an instance of the Q7 FIR structure. |
1137 | * @param[in] numTaps Number of filter coefficients in the filter. |
1084 | * @param[in] numTaps Number of filter coefficients in the filter. |
1138 | * @param[in] *pCoeffs points to the filter coefficients. |
1085 | * @param[in] pCoeffs points to the filter coefficients. |
1139 | * @param[in] *pState points to the state buffer. |
1086 | * @param[in] pState points to the state buffer. |
1140 | * @param[in] blockSize number of samples that are processed. |
1087 | * @param[in] blockSize number of samples that are processed. |
1141 | * @return none |
- | |
1142 | */ |
1088 | */ |
1143 | void arm_fir_init_q7( |
1089 | void arm_fir_init_q7( |
1144 | arm_fir_instance_q7 * S, |
1090 | arm_fir_instance_q7 * S, |
1145 | uint16_t numTaps, |
1091 | uint16_t numTaps, |
1146 | q7_t * pCoeffs, |
1092 | q7_t * pCoeffs, |
Line 1148... | Line 1094... | ||
1148 | uint32_t blockSize); |
1094 | uint32_t blockSize); |
1149 | 1095 | ||
1150 | 1096 | ||
1151 | /** |
1097 | /** |
1152 | * @brief Processing function for the Q15 FIR filter. |
1098 | * @brief Processing function for the Q15 FIR filter. |
1153 | * @param[in] *S points to an instance of the Q15 FIR structure. |
1099 | * @param[in] S points to an instance of the Q15 FIR structure. |
1154 | * @param[in] *pSrc points to the block of input data. |
1100 | * @param[in] pSrc points to the block of input data. |
1155 | * @param[out] *pDst points to the block of output data. |
1101 | * @param[out] pDst points to the block of output data. |
1156 | * @param[in] blockSize number of samples to process. |
1102 | * @param[in] blockSize number of samples to process. |
1157 | * @return none. |
- | |
1158 | */ |
1103 | */ |
1159 | void arm_fir_q15( |
1104 | void arm_fir_q15( |
1160 | const arm_fir_instance_q15 * S, |
1105 | const arm_fir_instance_q15 * S, |
1161 | q15_t * pSrc, |
1106 | q15_t * pSrc, |
1162 | q15_t * pDst, |
1107 | q15_t * pDst, |
1163 | uint32_t blockSize); |
1108 | uint32_t blockSize); |
1164 | 1109 | ||
- | 1110 | ||
1165 | /** |
1111 | /** |
1166 | * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. |
1112 | * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. |
1167 | * @param[in] *S points to an instance of the Q15 FIR filter structure. |
1113 | * @param[in] S points to an instance of the Q15 FIR filter structure. |
1168 | * @param[in] *pSrc points to the block of input data. |
1114 | * @param[in] pSrc points to the block of input data. |
1169 | * @param[out] *pDst points to the block of output data. |
1115 | * @param[out] pDst points to the block of output data. |
1170 | * @param[in] blockSize number of samples to process. |
1116 | * @param[in] blockSize number of samples to process. |
1171 | * @return none. |
- | |
1172 | */ |
1117 | */ |
1173 | void arm_fir_fast_q15( |
1118 | void arm_fir_fast_q15( |
1174 | const arm_fir_instance_q15 * S, |
1119 | const arm_fir_instance_q15 * S, |
1175 | q15_t * pSrc, |
1120 | q15_t * pSrc, |
1176 | q15_t * pDst, |
1121 | q15_t * pDst, |
1177 | uint32_t blockSize); |
1122 | uint32_t blockSize); |
1178 | 1123 | ||
- | 1124 | ||
1179 | /** |
1125 | /** |
1180 | * @brief Initialization function for the Q15 FIR filter. |
1126 | * @brief Initialization function for the Q15 FIR filter. |
1181 | * @param[in,out] *S points to an instance of the Q15 FIR filter structure. |
1127 | * @param[in,out] S points to an instance of the Q15 FIR filter structure. |
1182 | * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. |
1128 | * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. |
1183 | * @param[in] *pCoeffs points to the filter coefficients. |
1129 | * @param[in] pCoeffs points to the filter coefficients. |
1184 | * @param[in] *pState points to the state buffer. |
1130 | * @param[in] pState points to the state buffer. |
1185 | * @param[in] blockSize number of samples that are processed at a time. |
1131 | * @param[in] blockSize number of samples that are processed at a time. |
1186 | * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if |
1132 | * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if |
1187 | * <code>numTaps</code> is not a supported value. |
1133 | * <code>numTaps</code> is not a supported value. |
1188 | */ |
1134 | */ |
1189 | - | ||
1190 | arm_status arm_fir_init_q15( |
1135 | arm_status arm_fir_init_q15( |
1191 | arm_fir_instance_q15 * S, |
1136 | arm_fir_instance_q15 * S, |
1192 | uint16_t numTaps, |
1137 | uint16_t numTaps, |
1193 | q15_t * pCoeffs, |
1138 | q15_t * pCoeffs, |
1194 | q15_t * pState, |
1139 | q15_t * pState, |
1195 | uint32_t blockSize); |
1140 | uint32_t blockSize); |
1196 | 1141 | ||
- | 1142 | ||
1197 | /** |
1143 | /** |
1198 | * @brief Processing function for the Q31 FIR filter. |
1144 | * @brief Processing function for the Q31 FIR filter. |
1199 | * @param[in] *S points to an instance of the Q31 FIR filter structure. |
1145 | * @param[in] S points to an instance of the Q31 FIR filter structure. |
1200 | * @param[in] *pSrc points to the block of input data. |
1146 | * @param[in] pSrc points to the block of input data. |
1201 | * @param[out] *pDst points to the block of output data. |
1147 | * @param[out] pDst points to the block of output data. |
1202 | * @param[in] blockSize number of samples to process. |
1148 | * @param[in] blockSize number of samples to process. |
1203 | * @return none. |
- | |
1204 | */ |
1149 | */ |
1205 | void arm_fir_q31( |
1150 | void arm_fir_q31( |
1206 | const arm_fir_instance_q31 * S, |
1151 | const arm_fir_instance_q31 * S, |
1207 | q31_t * pSrc, |
1152 | q31_t * pSrc, |
1208 | q31_t * pDst, |
1153 | q31_t * pDst, |
1209 | uint32_t blockSize); |
1154 | uint32_t blockSize); |
1210 | 1155 | ||
- | 1156 | ||
1211 | /** |
1157 | /** |
1212 | * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. |
1158 | * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. |
1213 | * @param[in] *S points to an instance of the Q31 FIR structure. |
1159 | * @param[in] S points to an instance of the Q31 FIR structure. |
1214 | * @param[in] *pSrc points to the block of input data. |
1160 | * @param[in] pSrc points to the block of input data. |
1215 | * @param[out] *pDst points to the block of output data. |
1161 | * @param[out] pDst points to the block of output data. |
1216 | * @param[in] blockSize number of samples to process. |
1162 | * @param[in] blockSize number of samples to process. |
1217 | * @return none. |
- | |
1218 | */ |
1163 | */ |
1219 | void arm_fir_fast_q31( |
1164 | void arm_fir_fast_q31( |
1220 | const arm_fir_instance_q31 * S, |
1165 | const arm_fir_instance_q31 * S, |
1221 | q31_t * pSrc, |
1166 | q31_t * pSrc, |
1222 | q31_t * pDst, |
1167 | q31_t * pDst, |
1223 | uint32_t blockSize); |
1168 | uint32_t blockSize); |
1224 | 1169 | ||
- | 1170 | ||
1225 | /** |
1171 | /** |
1226 | * @brief Initialization function for the Q31 FIR filter. |
1172 | * @brief Initialization function for the Q31 FIR filter. |
1227 | * @param[in,out] *S points to an instance of the Q31 FIR structure. |
1173 | * @param[in,out] S points to an instance of the Q31 FIR structure. |
1228 | * @param[in] numTaps Number of filter coefficients in the filter. |
1174 | * @param[in] numTaps Number of filter coefficients in the filter. |
1229 | * @param[in] *pCoeffs points to the filter coefficients. |
1175 | * @param[in] pCoeffs points to the filter coefficients. |
1230 | * @param[in] *pState points to the state buffer. |
1176 | * @param[in] pState points to the state buffer. |
1231 | * @param[in] blockSize number of samples that are processed at a time. |
1177 | * @param[in] blockSize number of samples that are processed at a time. |
1232 | * @return none. |
- | |
1233 | */ |
1178 | */ |
1234 | void arm_fir_init_q31( |
1179 | void arm_fir_init_q31( |
1235 | arm_fir_instance_q31 * S, |
1180 | arm_fir_instance_q31 * S, |
1236 | uint16_t numTaps, |
1181 | uint16_t numTaps, |
1237 | q31_t * pCoeffs, |
1182 | q31_t * pCoeffs, |
1238 | q31_t * pState, |
1183 | q31_t * pState, |
1239 | uint32_t blockSize); |
1184 | uint32_t blockSize); |
1240 | 1185 | ||
- | 1186 | ||
1241 | /** |
1187 | /** |
1242 | * @brief Processing function for the floating-point FIR filter. |
1188 | * @brief Processing function for the floating-point FIR filter. |
1243 | * @param[in] *S points to an instance of the floating-point FIR structure. |
1189 | * @param[in] S points to an instance of the floating-point FIR structure. |
1244 | * @param[in] *pSrc points to the block of input data. |
1190 | * @param[in] pSrc points to the block of input data. |
1245 | * @param[out] *pDst points to the block of output data. |
1191 | * @param[out] pDst points to the block of output data. |
1246 | * @param[in] blockSize number of samples to process. |
1192 | * @param[in] blockSize number of samples to process. |
1247 | * @return none. |
- | |
1248 | */ |
1193 | */ |
1249 | void arm_fir_f32( |
1194 | void arm_fir_f32( |
1250 | const arm_fir_instance_f32 * S, |
1195 | const arm_fir_instance_f32 * S, |
1251 | float32_t * pSrc, |
1196 | float32_t * pSrc, |
1252 | float32_t * pDst, |
1197 | float32_t * pDst, |
1253 | uint32_t blockSize); |
1198 | uint32_t blockSize); |
1254 | 1199 | ||
- | 1200 | ||
1255 | /** |
1201 | /** |
1256 | * @brief Initialization function for the floating-point FIR filter. |
1202 | * @brief Initialization function for the floating-point FIR filter. |
1257 | * @param[in,out] *S points to an instance of the floating-point FIR filter structure. |
1203 | * @param[in,out] S points to an instance of the floating-point FIR filter structure. |
1258 | * @param[in] numTaps Number of filter coefficients in the filter. |
1204 | * @param[in] numTaps Number of filter coefficients in the filter. |
1259 | * @param[in] *pCoeffs points to the filter coefficients. |
1205 | * @param[in] pCoeffs points to the filter coefficients. |
1260 | * @param[in] *pState points to the state buffer. |
1206 | * @param[in] pState points to the state buffer. |
1261 | * @param[in] blockSize number of samples that are processed at a time. |
1207 | * @param[in] blockSize number of samples that are processed at a time. |
1262 | * @return none. |
- | |
1263 | */ |
1208 | */ |
1264 | void arm_fir_init_f32( |
1209 | void arm_fir_init_f32( |
1265 | arm_fir_instance_f32 * S, |
1210 | arm_fir_instance_f32 * S, |
1266 | uint16_t numTaps, |
1211 | uint16_t numTaps, |
1267 | float32_t * pCoeffs, |
1212 | float32_t * pCoeffs, |
Line 1272... | Line 1217... | ||
1272 | /** |
1217 | /** |
1273 | * @brief Instance structure for the Q15 Biquad cascade filter. |
1218 | * @brief Instance structure for the Q15 Biquad cascade filter. |
1274 | */ |
1219 | */ |
1275 | typedef struct |
1220 | typedef struct |
1276 | { |
1221 | { |
1277 | int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
1222 | int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
1278 | q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ |
1223 | q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ |
1279 | q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ |
1224 | q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ |
1280 | int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ |
1225 | int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ |
1281 | - | ||
1282 | } arm_biquad_casd_df1_inst_q15; |
1226 | } arm_biquad_casd_df1_inst_q15; |
1283 | 1227 | ||
1284 | - | ||
1285 | /** |
1228 | /** |
1286 | * @brief Instance structure for the Q31 Biquad cascade filter. |
1229 | * @brief Instance structure for the Q31 Biquad cascade filter. |
1287 | */ |
1230 | */ |
1288 | typedef struct |
1231 | typedef struct |
1289 | { |
1232 | { |
1290 | uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
1233 | uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
1291 | q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ |
1234 | q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ |
1292 | q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ |
1235 | q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ |
1293 | uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ |
1236 | uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ |
1294 | - | ||
1295 | } arm_biquad_casd_df1_inst_q31; |
1237 | } arm_biquad_casd_df1_inst_q31; |
1296 | 1238 | ||
1297 | /** |
1239 | /** |
1298 | * @brief Instance structure for the floating-point Biquad cascade filter. |
1240 | * @brief Instance structure for the floating-point Biquad cascade filter. |
1299 | */ |
1241 | */ |
1300 | typedef struct |
1242 | typedef struct |
1301 | { |
1243 | { |
1302 | uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
1244 | uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
1303 | float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ |
1245 | float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ |
1304 | float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ |
1246 | float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ |
1305 | - | ||
1306 | - | ||
1307 | } arm_biquad_casd_df1_inst_f32; |
1247 | } arm_biquad_casd_df1_inst_f32; |
1308 | 1248 | ||
1309 | 1249 | ||
1310 | - | ||
1311 | /** |
1250 | /** |
1312 | * @brief Processing function for the Q15 Biquad cascade filter. |
1251 | * @brief Processing function for the Q15 Biquad cascade filter. |
1313 | * @param[in] *S points to an instance of the Q15 Biquad cascade structure. |
1252 | * @param[in] S points to an instance of the Q15 Biquad cascade structure. |
1314 | * @param[in] *pSrc points to the block of input data. |
1253 | * @param[in] pSrc points to the block of input data. |
1315 | * @param[out] *pDst points to the block of output data. |
1254 | * @param[out] pDst points to the block of output data. |
1316 | * @param[in] blockSize number of samples to process. |
1255 | * @param[in] blockSize number of samples to process. |
1317 | * @return none. |
- | |
1318 | */ |
1256 | */ |
1319 | - | ||
1320 | void arm_biquad_cascade_df1_q15( |
1257 | void arm_biquad_cascade_df1_q15( |
1321 | const arm_biquad_casd_df1_inst_q15 * S, |
1258 | const arm_biquad_casd_df1_inst_q15 * S, |
1322 | q15_t * pSrc, |
1259 | q15_t * pSrc, |
1323 | q15_t * pDst, |
1260 | q15_t * pDst, |
1324 | uint32_t blockSize); |
1261 | uint32_t blockSize); |
1325 | 1262 | ||
- | 1263 | ||
1326 | /** |
1264 | /** |
1327 | * @brief Initialization function for the Q15 Biquad cascade filter. |
1265 | * @brief Initialization function for the Q15 Biquad cascade filter. |
1328 | * @param[in,out] *S points to an instance of the Q15 Biquad cascade structure. |
1266 | * @param[in,out] S points to an instance of the Q15 Biquad cascade structure. |
1329 | * @param[in] numStages number of 2nd order stages in the filter. |
1267 | * @param[in] numStages number of 2nd order stages in the filter. |
1330 | * @param[in] *pCoeffs points to the filter coefficients. |
1268 | * @param[in] pCoeffs points to the filter coefficients. |
1331 | * @param[in] *pState points to the state buffer. |
1269 | * @param[in] pState points to the state buffer. |
1332 | * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format |
1270 | * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format |
1333 | * @return none |
- | |
1334 | */ |
1271 | */ |
1335 | - | ||
1336 | void arm_biquad_cascade_df1_init_q15( |
1272 | void arm_biquad_cascade_df1_init_q15( |
1337 | arm_biquad_casd_df1_inst_q15 * S, |
1273 | arm_biquad_casd_df1_inst_q15 * S, |
1338 | uint8_t numStages, |
1274 | uint8_t numStages, |
1339 | q15_t * pCoeffs, |
1275 | q15_t * pCoeffs, |
1340 | q15_t * pState, |
1276 | q15_t * pState, |
1341 | int8_t postShift); |
1277 | int8_t postShift); |
1342 | 1278 | ||
1343 | 1279 | ||
1344 | /** |
1280 | /** |
1345 | * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. |
1281 | * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. |
1346 | * @param[in] *S points to an instance of the Q15 Biquad cascade structure. |
1282 | * @param[in] S points to an instance of the Q15 Biquad cascade structure. |
1347 | * @param[in] *pSrc points to the block of input data. |
1283 | * @param[in] pSrc points to the block of input data. |
1348 | * @param[out] *pDst points to the block of output data. |
1284 | * @param[out] pDst points to the block of output data. |
1349 | * @param[in] blockSize number of samples to process. |
1285 | * @param[in] blockSize number of samples to process. |
1350 | * @return none. |
- | |
1351 | */ |
1286 | */ |
1352 | - | ||
1353 | void arm_biquad_cascade_df1_fast_q15( |
1287 | void arm_biquad_cascade_df1_fast_q15( |
1354 | const arm_biquad_casd_df1_inst_q15 * S, |
1288 | const arm_biquad_casd_df1_inst_q15 * S, |
1355 | q15_t * pSrc, |
1289 | q15_t * pSrc, |
1356 | q15_t * pDst, |
1290 | q15_t * pDst, |
1357 | uint32_t blockSize); |
1291 | uint32_t blockSize); |
1358 | 1292 | ||
1359 | 1293 | ||
1360 | /** |
1294 | /** |
1361 | * @brief Processing function for the Q31 Biquad cascade filter |
1295 | * @brief Processing function for the Q31 Biquad cascade filter |
1362 | * @param[in] *S points to an instance of the Q31 Biquad cascade structure. |
1296 | * @param[in] S points to an instance of the Q31 Biquad cascade structure. |
1363 | * @param[in] *pSrc points to the block of input data. |
1297 | * @param[in] pSrc points to the block of input data. |
1364 | * @param[out] *pDst points to the block of output data. |
1298 | * @param[out] pDst points to the block of output data. |
1365 | * @param[in] blockSize number of samples to process. |
1299 | * @param[in] blockSize number of samples to process. |
1366 | * @return none. |
- | |
1367 | */ |
1300 | */ |
1368 | - | ||
1369 | void arm_biquad_cascade_df1_q31( |
1301 | void arm_biquad_cascade_df1_q31( |
1370 | const arm_biquad_casd_df1_inst_q31 * S, |
1302 | const arm_biquad_casd_df1_inst_q31 * S, |
1371 | q31_t * pSrc, |
1303 | q31_t * pSrc, |
1372 | q31_t * pDst, |
1304 | q31_t * pDst, |
1373 | uint32_t blockSize); |
1305 | uint32_t blockSize); |
1374 | 1306 | ||
- | 1307 | ||
1375 | /** |
1308 | /** |
1376 | * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. |
1309 | * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. |
1377 | * @param[in] *S points to an instance of the Q31 Biquad cascade structure. |
1310 | * @param[in] S points to an instance of the Q31 Biquad cascade structure. |
1378 | * @param[in] *pSrc points to the block of input data. |
1311 | * @param[in] pSrc points to the block of input data. |
1379 | * @param[out] *pDst points to the block of output data. |
1312 | * @param[out] pDst points to the block of output data. |
1380 | * @param[in] blockSize number of samples to process. |
1313 | * @param[in] blockSize number of samples to process. |
1381 | * @return none. |
- | |
1382 | */ |
1314 | */ |
1383 | - | ||
1384 | void arm_biquad_cascade_df1_fast_q31( |
1315 | void arm_biquad_cascade_df1_fast_q31( |
1385 | const arm_biquad_casd_df1_inst_q31 * S, |
1316 | const arm_biquad_casd_df1_inst_q31 * S, |
1386 | q31_t * pSrc, |
1317 | q31_t * pSrc, |
1387 | q31_t * pDst, |
1318 | q31_t * pDst, |
1388 | uint32_t blockSize); |
1319 | uint32_t blockSize); |
1389 | 1320 | ||
- | 1321 | ||
1390 | /** |
1322 | /** |
1391 | * @brief Initialization function for the Q31 Biquad cascade filter. |
1323 | * @brief Initialization function for the Q31 Biquad cascade filter. |
1392 | * @param[in,out] *S points to an instance of the Q31 Biquad cascade structure. |
1324 | * @param[in,out] S points to an instance of the Q31 Biquad cascade structure. |
1393 | * @param[in] numStages number of 2nd order stages in the filter. |
1325 | * @param[in] numStages number of 2nd order stages in the filter. |
1394 | * @param[in] *pCoeffs points to the filter coefficients. |
1326 | * @param[in] pCoeffs points to the filter coefficients. |
1395 | * @param[in] *pState points to the state buffer. |
1327 | * @param[in] pState points to the state buffer. |
1396 | * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format |
1328 | * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format |
1397 | * @return none |
- | |
1398 | */ |
1329 | */ |
1399 | - | ||
1400 | void arm_biquad_cascade_df1_init_q31( |
1330 | void arm_biquad_cascade_df1_init_q31( |
1401 | arm_biquad_casd_df1_inst_q31 * S, |
1331 | arm_biquad_casd_df1_inst_q31 * S, |
1402 | uint8_t numStages, |
1332 | uint8_t numStages, |
1403 | q31_t * pCoeffs, |
1333 | q31_t * pCoeffs, |
1404 | q31_t * pState, |
1334 | q31_t * pState, |
1405 | int8_t postShift); |
1335 | int8_t postShift); |
1406 | 1336 | ||
- | 1337 | ||
1407 | /** |
1338 | /** |
1408 | * @brief Processing function for the floating-point Biquad cascade filter. |
1339 | * @brief Processing function for the floating-point Biquad cascade filter. |
1409 | * @param[in] *S points to an instance of the floating-point Biquad cascade structure. |
1340 | * @param[in] S points to an instance of the floating-point Biquad cascade structure. |
1410 | * @param[in] *pSrc points to the block of input data. |
1341 | * @param[in] pSrc points to the block of input data. |
1411 | * @param[out] *pDst points to the block of output data. |
1342 | * @param[out] pDst points to the block of output data. |
1412 | * @param[in] blockSize number of samples to process. |
1343 | * @param[in] blockSize number of samples to process. |
1413 | * @return none. |
- | |
1414 | */ |
1344 | */ |
1415 | - | ||
1416 | void arm_biquad_cascade_df1_f32( |
1345 | void arm_biquad_cascade_df1_f32( |
1417 | const arm_biquad_casd_df1_inst_f32 * S, |
1346 | const arm_biquad_casd_df1_inst_f32 * S, |
1418 | float32_t * pSrc, |
1347 | float32_t * pSrc, |
1419 | float32_t * pDst, |
1348 | float32_t * pDst, |
1420 | uint32_t blockSize); |
1349 | uint32_t blockSize); |
1421 | 1350 | ||
- | 1351 | ||
1422 | /** |
1352 | /** |
1423 | * @brief Initialization function for the floating-point Biquad cascade filter. |
1353 | * @brief Initialization function for the floating-point Biquad cascade filter. |
1424 | * @param[in,out] *S points to an instance of the floating-point Biquad cascade structure. |
1354 | * @param[in,out] S points to an instance of the floating-point Biquad cascade structure. |
1425 | * @param[in] numStages number of 2nd order stages in the filter. |
1355 | * @param[in] numStages number of 2nd order stages in the filter. |
1426 | * @param[in] *pCoeffs points to the filter coefficients. |
1356 | * @param[in] pCoeffs points to the filter coefficients. |
1427 | * @param[in] *pState points to the state buffer. |
1357 | * @param[in] pState points to the state buffer. |
1428 | * @return none |
- | |
1429 | */ |
1358 | */ |
1430 | - | ||
1431 | void arm_biquad_cascade_df1_init_f32( |
1359 | void arm_biquad_cascade_df1_init_f32( |
1432 | arm_biquad_casd_df1_inst_f32 * S, |
1360 | arm_biquad_casd_df1_inst_f32 * S, |
1433 | uint8_t numStages, |
1361 | uint8_t numStages, |
1434 | float32_t * pCoeffs, |
1362 | float32_t * pCoeffs, |
1435 | float32_t * pState); |
1363 | float32_t * pState); |
1436 | 1364 | ||
1437 | 1365 | ||
1438 | /** |
1366 | /** |
1439 | * @brief Instance structure for the floating-point matrix structure. |
1367 | * @brief Instance structure for the floating-point matrix structure. |
1440 | */ |
1368 | */ |
1441 | - | ||
1442 | typedef struct |
1369 | typedef struct |
1443 | { |
1370 | { |
1444 | uint16_t numRows; /**< number of rows of the matrix. */ |
1371 | uint16_t numRows; /**< number of rows of the matrix. */ |
1445 | uint16_t numCols; /**< number of columns of the matrix. */ |
1372 | uint16_t numCols; /**< number of columns of the matrix. */ |
1446 | float32_t *pData; /**< points to the data of the matrix. */ |
1373 | float32_t *pData; /**< points to the data of the matrix. */ |
Line 1448... | Line 1375... | ||
1448 | 1375 | ||
1449 | 1376 | ||
1450 | /** |
1377 | /** |
1451 | * @brief Instance structure for the floating-point matrix structure. |
1378 | * @brief Instance structure for the floating-point matrix structure. |
1452 | */ |
1379 | */ |
1453 | - | ||
1454 | typedef struct |
1380 | typedef struct |
1455 | { |
1381 | { |
1456 | uint16_t numRows; /**< number of rows of the matrix. */ |
1382 | uint16_t numRows; /**< number of rows of the matrix. */ |
1457 | uint16_t numCols; /**< number of columns of the matrix. */ |
1383 | uint16_t numCols; /**< number of columns of the matrix. */ |
1458 | float64_t *pData; /**< points to the data of the matrix. */ |
1384 | float64_t *pData; /**< points to the data of the matrix. */ |
1459 | } arm_matrix_instance_f64; |
1385 | } arm_matrix_instance_f64; |
1460 | 1386 | ||
1461 | /** |
1387 | /** |
1462 | * @brief Instance structure for the Q15 matrix structure. |
1388 | * @brief Instance structure for the Q15 matrix structure. |
1463 | */ |
1389 | */ |
1464 | - | ||
1465 | typedef struct |
1390 | typedef struct |
1466 | { |
1391 | { |
1467 | uint16_t numRows; /**< number of rows of the matrix. */ |
1392 | uint16_t numRows; /**< number of rows of the matrix. */ |
1468 | uint16_t numCols; /**< number of columns of the matrix. */ |
1393 | uint16_t numCols; /**< number of columns of the matrix. */ |
1469 | q15_t *pData; /**< points to the data of the matrix. */ |
1394 | q15_t *pData; /**< points to the data of the matrix. */ |
1470 | - | ||
1471 | } arm_matrix_instance_q15; |
1395 | } arm_matrix_instance_q15; |
1472 | 1396 | ||
1473 | /** |
1397 | /** |
1474 | * @brief Instance structure for the Q31 matrix structure. |
1398 | * @brief Instance structure for the Q31 matrix structure. |
1475 | */ |
1399 | */ |
1476 | - | ||
1477 | typedef struct |
1400 | typedef struct |
1478 | { |
1401 | { |
1479 | uint16_t numRows; /**< number of rows of the matrix. */ |
1402 | uint16_t numRows; /**< number of rows of the matrix. */ |
1480 | uint16_t numCols; /**< number of columns of the matrix. */ |
1403 | uint16_t numCols; /**< number of columns of the matrix. */ |
1481 | q31_t *pData; /**< points to the data of the matrix. */ |
1404 | q31_t *pData; /**< points to the data of the matrix. */ |
1482 | - | ||
1483 | } arm_matrix_instance_q31; |
1405 | } arm_matrix_instance_q31; |
1484 | 1406 | ||
1485 | 1407 | ||
1486 | - | ||
1487 | /** |
1408 | /** |
1488 | * @brief Floating-point matrix addition. |
1409 | * @brief Floating-point matrix addition. |
1489 | * @param[in] *pSrcA points to the first input matrix structure |
1410 | * @param[in] pSrcA points to the first input matrix structure |
1490 | * @param[in] *pSrcB points to the second input matrix structure |
1411 | * @param[in] pSrcB points to the second input matrix structure |
1491 | * @param[out] *pDst points to output matrix structure |
1412 | * @param[out] pDst points to output matrix structure |
1492 | * @return The function returns either |
1413 | * @return The function returns either |
1493 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1414 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1494 | */ |
1415 | */ |
1495 | - | ||
1496 | arm_status arm_mat_add_f32( |
1416 | arm_status arm_mat_add_f32( |
1497 | const arm_matrix_instance_f32 * pSrcA, |
1417 | const arm_matrix_instance_f32 * pSrcA, |
1498 | const arm_matrix_instance_f32 * pSrcB, |
1418 | const arm_matrix_instance_f32 * pSrcB, |
1499 | arm_matrix_instance_f32 * pDst); |
1419 | arm_matrix_instance_f32 * pDst); |
1500 | 1420 | ||
- | 1421 | ||
1501 | /** |
1422 | /** |
1502 | * @brief Q15 matrix addition. |
1423 | * @brief Q15 matrix addition. |
1503 | * @param[in] *pSrcA points to the first input matrix structure |
1424 | * @param[in] pSrcA points to the first input matrix structure |
1504 | * @param[in] *pSrcB points to the second input matrix structure |
1425 | * @param[in] pSrcB points to the second input matrix structure |
1505 | * @param[out] *pDst points to output matrix structure |
1426 | * @param[out] pDst points to output matrix structure |
1506 | * @return The function returns either |
1427 | * @return The function returns either |
1507 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1428 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1508 | */ |
1429 | */ |
1509 | - | ||
1510 | arm_status arm_mat_add_q15( |
1430 | arm_status arm_mat_add_q15( |
1511 | const arm_matrix_instance_q15 * pSrcA, |
1431 | const arm_matrix_instance_q15 * pSrcA, |
1512 | const arm_matrix_instance_q15 * pSrcB, |
1432 | const arm_matrix_instance_q15 * pSrcB, |
1513 | arm_matrix_instance_q15 * pDst); |
1433 | arm_matrix_instance_q15 * pDst); |
1514 | 1434 | ||
- | 1435 | ||
1515 | /** |
1436 | /** |
1516 | * @brief Q31 matrix addition. |
1437 | * @brief Q31 matrix addition. |
1517 | * @param[in] *pSrcA points to the first input matrix structure |
1438 | * @param[in] pSrcA points to the first input matrix structure |
1518 | * @param[in] *pSrcB points to the second input matrix structure |
1439 | * @param[in] pSrcB points to the second input matrix structure |
1519 | * @param[out] *pDst points to output matrix structure |
1440 | * @param[out] pDst points to output matrix structure |
1520 | * @return The function returns either |
1441 | * @return The function returns either |
1521 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1442 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1522 | */ |
1443 | */ |
1523 | - | ||
1524 | arm_status arm_mat_add_q31( |
1444 | arm_status arm_mat_add_q31( |
1525 | const arm_matrix_instance_q31 * pSrcA, |
1445 | const arm_matrix_instance_q31 * pSrcA, |
1526 | const arm_matrix_instance_q31 * pSrcB, |
1446 | const arm_matrix_instance_q31 * pSrcB, |
1527 | arm_matrix_instance_q31 * pDst); |
1447 | arm_matrix_instance_q31 * pDst); |
1528 | 1448 | ||
- | 1449 | ||
1529 | /** |
1450 | /** |
1530 | * @brief Floating-point, complex, matrix multiplication. |
1451 | * @brief Floating-point, complex, matrix multiplication. |
1531 | * @param[in] *pSrcA points to the first input matrix structure |
1452 | * @param[in] pSrcA points to the first input matrix structure |
1532 | * @param[in] *pSrcB points to the second input matrix structure |
1453 | * @param[in] pSrcB points to the second input matrix structure |
1533 | * @param[out] *pDst points to output matrix structure |
1454 | * @param[out] pDst points to output matrix structure |
1534 | * @return The function returns either |
1455 | * @return The function returns either |
1535 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1456 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1536 | */ |
1457 | */ |
1537 | - | ||
1538 | arm_status arm_mat_cmplx_mult_f32( |
1458 | arm_status arm_mat_cmplx_mult_f32( |
1539 | const arm_matrix_instance_f32 * pSrcA, |
1459 | const arm_matrix_instance_f32 * pSrcA, |
1540 | const arm_matrix_instance_f32 * pSrcB, |
1460 | const arm_matrix_instance_f32 * pSrcB, |
1541 | arm_matrix_instance_f32 * pDst); |
1461 | arm_matrix_instance_f32 * pDst); |
1542 | 1462 | ||
- | 1463 | ||
1543 | /** |
1464 | /** |
1544 | * @brief Q15, complex, matrix multiplication. |
1465 | * @brief Q15, complex, matrix multiplication. |
1545 | * @param[in] *pSrcA points to the first input matrix structure |
1466 | * @param[in] pSrcA points to the first input matrix structure |
1546 | * @param[in] *pSrcB points to the second input matrix structure |
1467 | * @param[in] pSrcB points to the second input matrix structure |
1547 | * @param[out] *pDst points to output matrix structure |
1468 | * @param[out] pDst points to output matrix structure |
1548 | * @return The function returns either |
1469 | * @return The function returns either |
1549 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1470 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1550 | */ |
1471 | */ |
1551 | - | ||
1552 | arm_status arm_mat_cmplx_mult_q15( |
1472 | arm_status arm_mat_cmplx_mult_q15( |
1553 | const arm_matrix_instance_q15 * pSrcA, |
1473 | const arm_matrix_instance_q15 * pSrcA, |
1554 | const arm_matrix_instance_q15 * pSrcB, |
1474 | const arm_matrix_instance_q15 * pSrcB, |
1555 | arm_matrix_instance_q15 * pDst, |
1475 | arm_matrix_instance_q15 * pDst, |
1556 | q15_t * pScratch); |
1476 | q15_t * pScratch); |
1557 | 1477 | ||
- | 1478 | ||
1558 | /** |
1479 | /** |
1559 | * @brief Q31, complex, matrix multiplication. |
1480 | * @brief Q31, complex, matrix multiplication. |
1560 | * @param[in] *pSrcA points to the first input matrix structure |
1481 | * @param[in] pSrcA points to the first input matrix structure |
1561 | * @param[in] *pSrcB points to the second input matrix structure |
1482 | * @param[in] pSrcB points to the second input matrix structure |
1562 | * @param[out] *pDst points to output matrix structure |
1483 | * @param[out] pDst points to output matrix structure |
1563 | * @return The function returns either |
1484 | * @return The function returns either |
1564 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1485 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1565 | */ |
1486 | */ |
1566 | - | ||
1567 | arm_status arm_mat_cmplx_mult_q31( |
1487 | arm_status arm_mat_cmplx_mult_q31( |
1568 | const arm_matrix_instance_q31 * pSrcA, |
1488 | const arm_matrix_instance_q31 * pSrcA, |
1569 | const arm_matrix_instance_q31 * pSrcB, |
1489 | const arm_matrix_instance_q31 * pSrcB, |
1570 | arm_matrix_instance_q31 * pDst); |
1490 | arm_matrix_instance_q31 * pDst); |
1571 | 1491 | ||
1572 | 1492 | ||
1573 | /** |
1493 | /** |
1574 | * @brief Floating-point matrix transpose. |
1494 | * @brief Floating-point matrix transpose. |
1575 | * @param[in] *pSrc points to the input matrix |
1495 | * @param[in] pSrc points to the input matrix |
1576 | * @param[out] *pDst points to the output matrix |
1496 | * @param[out] pDst points to the output matrix |
1577 | * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> |
1497 | * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> |
1578 | * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1498 | * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1579 | */ |
1499 | */ |
1580 | - | ||
1581 | arm_status arm_mat_trans_f32( |
1500 | arm_status arm_mat_trans_f32( |
1582 | const arm_matrix_instance_f32 * pSrc, |
1501 | const arm_matrix_instance_f32 * pSrc, |
1583 | arm_matrix_instance_f32 * pDst); |
1502 | arm_matrix_instance_f32 * pDst); |
1584 | 1503 | ||
1585 | 1504 | ||
1586 | /** |
1505 | /** |
1587 | * @brief Q15 matrix transpose. |
1506 | * @brief Q15 matrix transpose. |
1588 | * @param[in] *pSrc points to the input matrix |
1507 | * @param[in] pSrc points to the input matrix |
1589 | * @param[out] *pDst points to the output matrix |
1508 | * @param[out] pDst points to the output matrix |
1590 | * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> |
1509 | * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> |
1591 | * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1510 | * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1592 | */ |
1511 | */ |
1593 | - | ||
1594 | arm_status arm_mat_trans_q15( |
1512 | arm_status arm_mat_trans_q15( |
1595 | const arm_matrix_instance_q15 * pSrc, |
1513 | const arm_matrix_instance_q15 * pSrc, |
1596 | arm_matrix_instance_q15 * pDst); |
1514 | arm_matrix_instance_q15 * pDst); |
1597 | 1515 | ||
- | 1516 | ||
1598 | /** |
1517 | /** |
1599 | * @brief Q31 matrix transpose. |
1518 | * @brief Q31 matrix transpose. |
1600 | * @param[in] *pSrc points to the input matrix |
1519 | * @param[in] pSrc points to the input matrix |
1601 | * @param[out] *pDst points to the output matrix |
1520 | * @param[out] pDst points to the output matrix |
1602 | * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> |
1521 | * @return The function returns either <code>ARM_MATH_SIZE_MISMATCH</code> |
1603 | * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1522 | * or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1604 | */ |
1523 | */ |
1605 | - | ||
1606 | arm_status arm_mat_trans_q31( |
1524 | arm_status arm_mat_trans_q31( |
1607 | const arm_matrix_instance_q31 * pSrc, |
1525 | const arm_matrix_instance_q31 * pSrc, |
1608 | arm_matrix_instance_q31 * pDst); |
1526 | arm_matrix_instance_q31 * pDst); |
1609 | 1527 | ||
1610 | 1528 | ||
1611 | /** |
1529 | /** |
1612 | * @brief Floating-point matrix multiplication |
1530 | * @brief Floating-point matrix multiplication |
1613 | * @param[in] *pSrcA points to the first input matrix structure |
1531 | * @param[in] pSrcA points to the first input matrix structure |
1614 | * @param[in] *pSrcB points to the second input matrix structure |
1532 | * @param[in] pSrcB points to the second input matrix structure |
1615 | * @param[out] *pDst points to output matrix structure |
1533 | * @param[out] pDst points to output matrix structure |
1616 | * @return The function returns either |
1534 | * @return The function returns either |
1617 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1535 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1618 | */ |
1536 | */ |
1619 | - | ||
1620 | arm_status arm_mat_mult_f32( |
1537 | arm_status arm_mat_mult_f32( |
1621 | const arm_matrix_instance_f32 * pSrcA, |
1538 | const arm_matrix_instance_f32 * pSrcA, |
1622 | const arm_matrix_instance_f32 * pSrcB, |
1539 | const arm_matrix_instance_f32 * pSrcB, |
1623 | arm_matrix_instance_f32 * pDst); |
1540 | arm_matrix_instance_f32 * pDst); |
1624 | 1541 | ||
- | 1542 | ||
1625 | /** |
1543 | /** |
1626 | * @brief Q15 matrix multiplication |
1544 | * @brief Q15 matrix multiplication |
1627 | * @param[in] *pSrcA points to the first input matrix structure |
1545 | * @param[in] pSrcA points to the first input matrix structure |
1628 | * @param[in] *pSrcB points to the second input matrix structure |
1546 | * @param[in] pSrcB points to the second input matrix structure |
1629 | * @param[out] *pDst points to output matrix structure |
1547 | * @param[out] pDst points to output matrix structure |
1630 | * @param[in] *pState points to the array for storing intermediate results |
1548 | * @param[in] pState points to the array for storing intermediate results |
1631 | * @return The function returns either |
1549 | * @return The function returns either |
1632 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1550 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1633 | */ |
1551 | */ |
1634 | - | ||
1635 | arm_status arm_mat_mult_q15( |
1552 | arm_status arm_mat_mult_q15( |
1636 | const arm_matrix_instance_q15 * pSrcA, |
1553 | const arm_matrix_instance_q15 * pSrcA, |
1637 | const arm_matrix_instance_q15 * pSrcB, |
1554 | const arm_matrix_instance_q15 * pSrcB, |
1638 | arm_matrix_instance_q15 * pDst, |
1555 | arm_matrix_instance_q15 * pDst, |
1639 | q15_t * pState); |
1556 | q15_t * pState); |
1640 | 1557 | ||
- | 1558 | ||
1641 | /** |
1559 | /** |
1642 | * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 |
1560 | * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 |
1643 | * @param[in] *pSrcA points to the first input matrix structure |
1561 | * @param[in] pSrcA points to the first input matrix structure |
1644 | * @param[in] *pSrcB points to the second input matrix structure |
1562 | * @param[in] pSrcB points to the second input matrix structure |
1645 | * @param[out] *pDst points to output matrix structure |
1563 | * @param[out] pDst points to output matrix structure |
1646 | * @param[in] *pState points to the array for storing intermediate results |
1564 | * @param[in] pState points to the array for storing intermediate results |
1647 | * @return The function returns either |
1565 | * @return The function returns either |
1648 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1566 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1649 | */ |
1567 | */ |
1650 | - | ||
1651 | arm_status arm_mat_mult_fast_q15( |
1568 | arm_status arm_mat_mult_fast_q15( |
1652 | const arm_matrix_instance_q15 * pSrcA, |
1569 | const arm_matrix_instance_q15 * pSrcA, |
1653 | const arm_matrix_instance_q15 * pSrcB, |
1570 | const arm_matrix_instance_q15 * pSrcB, |
1654 | arm_matrix_instance_q15 * pDst, |
1571 | arm_matrix_instance_q15 * pDst, |
1655 | q15_t * pState); |
1572 | q15_t * pState); |
1656 | 1573 | ||
- | 1574 | ||
1657 | /** |
1575 | /** |
1658 | * @brief Q31 matrix multiplication |
1576 | * @brief Q31 matrix multiplication |
1659 | * @param[in] *pSrcA points to the first input matrix structure |
1577 | * @param[in] pSrcA points to the first input matrix structure |
1660 | * @param[in] *pSrcB points to the second input matrix structure |
1578 | * @param[in] pSrcB points to the second input matrix structure |
1661 | * @param[out] *pDst points to output matrix structure |
1579 | * @param[out] pDst points to output matrix structure |
1662 | * @return The function returns either |
1580 | * @return The function returns either |
1663 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1581 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1664 | */ |
1582 | */ |
1665 | - | ||
1666 | arm_status arm_mat_mult_q31( |
1583 | arm_status arm_mat_mult_q31( |
1667 | const arm_matrix_instance_q31 * pSrcA, |
1584 | const arm_matrix_instance_q31 * pSrcA, |
1668 | const arm_matrix_instance_q31 * pSrcB, |
1585 | const arm_matrix_instance_q31 * pSrcB, |
1669 | arm_matrix_instance_q31 * pDst); |
1586 | arm_matrix_instance_q31 * pDst); |
1670 | 1587 | ||
- | 1588 | ||
1671 | /** |
1589 | /** |
1672 | * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 |
1590 | * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 |
1673 | * @param[in] *pSrcA points to the first input matrix structure |
1591 | * @param[in] pSrcA points to the first input matrix structure |
1674 | * @param[in] *pSrcB points to the second input matrix structure |
1592 | * @param[in] pSrcB points to the second input matrix structure |
1675 | * @param[out] *pDst points to output matrix structure |
1593 | * @param[out] pDst points to output matrix structure |
1676 | * @return The function returns either |
1594 | * @return The function returns either |
1677 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1595 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1678 | */ |
1596 | */ |
1679 | - | ||
1680 | arm_status arm_mat_mult_fast_q31( |
1597 | arm_status arm_mat_mult_fast_q31( |
1681 | const arm_matrix_instance_q31 * pSrcA, |
1598 | const arm_matrix_instance_q31 * pSrcA, |
1682 | const arm_matrix_instance_q31 * pSrcB, |
1599 | const arm_matrix_instance_q31 * pSrcB, |
1683 | arm_matrix_instance_q31 * pDst); |
1600 | arm_matrix_instance_q31 * pDst); |
1684 | 1601 | ||
1685 | 1602 | ||
1686 | /** |
1603 | /** |
1687 | * @brief Floating-point matrix subtraction |
1604 | * @brief Floating-point matrix subtraction |
1688 | * @param[in] *pSrcA points to the first input matrix structure |
1605 | * @param[in] pSrcA points to the first input matrix structure |
1689 | * @param[in] *pSrcB points to the second input matrix structure |
1606 | * @param[in] pSrcB points to the second input matrix structure |
1690 | * @param[out] *pDst points to output matrix structure |
1607 | * @param[out] pDst points to output matrix structure |
1691 | * @return The function returns either |
1608 | * @return The function returns either |
1692 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1609 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1693 | */ |
1610 | */ |
1694 | - | ||
1695 | arm_status arm_mat_sub_f32( |
1611 | arm_status arm_mat_sub_f32( |
1696 | const arm_matrix_instance_f32 * pSrcA, |
1612 | const arm_matrix_instance_f32 * pSrcA, |
1697 | const arm_matrix_instance_f32 * pSrcB, |
1613 | const arm_matrix_instance_f32 * pSrcB, |
1698 | arm_matrix_instance_f32 * pDst); |
1614 | arm_matrix_instance_f32 * pDst); |
1699 | 1615 | ||
- | 1616 | ||
1700 | /** |
1617 | /** |
1701 | * @brief Q15 matrix subtraction |
1618 | * @brief Q15 matrix subtraction |
1702 | * @param[in] *pSrcA points to the first input matrix structure |
1619 | * @param[in] pSrcA points to the first input matrix structure |
1703 | * @param[in] *pSrcB points to the second input matrix structure |
1620 | * @param[in] pSrcB points to the second input matrix structure |
1704 | * @param[out] *pDst points to output matrix structure |
1621 | * @param[out] pDst points to output matrix structure |
1705 | * @return The function returns either |
1622 | * @return The function returns either |
1706 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1623 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1707 | */ |
1624 | */ |
1708 | - | ||
1709 | arm_status arm_mat_sub_q15( |
1625 | arm_status arm_mat_sub_q15( |
1710 | const arm_matrix_instance_q15 * pSrcA, |
1626 | const arm_matrix_instance_q15 * pSrcA, |
1711 | const arm_matrix_instance_q15 * pSrcB, |
1627 | const arm_matrix_instance_q15 * pSrcB, |
1712 | arm_matrix_instance_q15 * pDst); |
1628 | arm_matrix_instance_q15 * pDst); |
1713 | 1629 | ||
- | 1630 | ||
1714 | /** |
1631 | /** |
1715 | * @brief Q31 matrix subtraction |
1632 | * @brief Q31 matrix subtraction |
1716 | * @param[in] *pSrcA points to the first input matrix structure |
1633 | * @param[in] pSrcA points to the first input matrix structure |
1717 | * @param[in] *pSrcB points to the second input matrix structure |
1634 | * @param[in] pSrcB points to the second input matrix structure |
1718 | * @param[out] *pDst points to output matrix structure |
1635 | * @param[out] pDst points to output matrix structure |
1719 | * @return The function returns either |
1636 | * @return The function returns either |
1720 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1637 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1721 | */ |
1638 | */ |
1722 | - | ||
1723 | arm_status arm_mat_sub_q31( |
1639 | arm_status arm_mat_sub_q31( |
1724 | const arm_matrix_instance_q31 * pSrcA, |
1640 | const arm_matrix_instance_q31 * pSrcA, |
1725 | const arm_matrix_instance_q31 * pSrcB, |
1641 | const arm_matrix_instance_q31 * pSrcB, |
1726 | arm_matrix_instance_q31 * pDst); |
1642 | arm_matrix_instance_q31 * pDst); |
1727 | 1643 | ||
- | 1644 | ||
1728 | /** |
1645 | /** |
1729 | * @brief Floating-point matrix scaling. |
1646 | * @brief Floating-point matrix scaling. |
1730 | * @param[in] *pSrc points to the input matrix |
1647 | * @param[in] pSrc points to the input matrix |
1731 | * @param[in] scale scale factor |
1648 | * @param[in] scale scale factor |
1732 | * @param[out] *pDst points to the output matrix |
1649 | * @param[out] pDst points to the output matrix |
1733 | * @return The function returns either |
1650 | * @return The function returns either |
1734 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1651 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1735 | */ |
1652 | */ |
1736 | - | ||
1737 | arm_status arm_mat_scale_f32( |
1653 | arm_status arm_mat_scale_f32( |
1738 | const arm_matrix_instance_f32 * pSrc, |
1654 | const arm_matrix_instance_f32 * pSrc, |
1739 | float32_t scale, |
1655 | float32_t scale, |
1740 | arm_matrix_instance_f32 * pDst); |
1656 | arm_matrix_instance_f32 * pDst); |
1741 | 1657 | ||
- | 1658 | ||
1742 | /** |
1659 | /** |
1743 | * @brief Q15 matrix scaling. |
1660 | * @brief Q15 matrix scaling. |
1744 | * @param[in] *pSrc points to input matrix |
1661 | * @param[in] pSrc points to input matrix |
1745 | * @param[in] scaleFract fractional portion of the scale factor |
1662 | * @param[in] scaleFract fractional portion of the scale factor |
1746 | * @param[in] shift number of bits to shift the result by |
1663 | * @param[in] shift number of bits to shift the result by |
1747 | * @param[out] *pDst points to output matrix |
1664 | * @param[out] pDst points to output matrix |
1748 | * @return The function returns either |
1665 | * @return The function returns either |
1749 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1666 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1750 | */ |
1667 | */ |
1751 | - | ||
1752 | arm_status arm_mat_scale_q15( |
1668 | arm_status arm_mat_scale_q15( |
1753 | const arm_matrix_instance_q15 * pSrc, |
1669 | const arm_matrix_instance_q15 * pSrc, |
1754 | q15_t scaleFract, |
1670 | q15_t scaleFract, |
1755 | int32_t shift, |
1671 | int32_t shift, |
1756 | arm_matrix_instance_q15 * pDst); |
1672 | arm_matrix_instance_q15 * pDst); |
1757 | 1673 | ||
- | 1674 | ||
1758 | /** |
1675 | /** |
1759 | * @brief Q31 matrix scaling. |
1676 | * @brief Q31 matrix scaling. |
1760 | * @param[in] *pSrc points to input matrix |
1677 | * @param[in] pSrc points to input matrix |
1761 | * @param[in] scaleFract fractional portion of the scale factor |
1678 | * @param[in] scaleFract fractional portion of the scale factor |
1762 | * @param[in] shift number of bits to shift the result by |
1679 | * @param[in] shift number of bits to shift the result by |
1763 | * @param[out] *pDst points to output matrix structure |
1680 | * @param[out] pDst points to output matrix structure |
1764 | * @return The function returns either |
1681 | * @return The function returns either |
1765 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1682 | * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. |
1766 | */ |
1683 | */ |
1767 | - | ||
1768 | arm_status arm_mat_scale_q31( |
1684 | arm_status arm_mat_scale_q31( |
1769 | const arm_matrix_instance_q31 * pSrc, |
1685 | const arm_matrix_instance_q31 * pSrc, |
1770 | q31_t scaleFract, |
1686 | q31_t scaleFract, |
1771 | int32_t shift, |
1687 | int32_t shift, |
1772 | arm_matrix_instance_q31 * pDst); |
1688 | arm_matrix_instance_q31 * pDst); |
1773 | 1689 | ||
1774 | 1690 | ||
1775 | /** |
1691 | /** |
1776 | * @brief Q31 matrix initialization. |
1692 | * @brief Q31 matrix initialization. |
1777 | * @param[in,out] *S points to an instance of the floating-point matrix structure. |
1693 | * @param[in,out] S points to an instance of the floating-point matrix structure. |
1778 | * @param[in] nRows number of rows in the matrix. |
1694 | * @param[in] nRows number of rows in the matrix. |
1779 | * @param[in] nColumns number of columns in the matrix. |
1695 | * @param[in] nColumns number of columns in the matrix. |
1780 | * @param[in] *pData points to the matrix data array. |
1696 | * @param[in] pData points to the matrix data array. |
1781 | * @return none |
- | |
1782 | */ |
1697 | */ |
1783 | - | ||
1784 | void arm_mat_init_q31( |
1698 | void arm_mat_init_q31( |
1785 | arm_matrix_instance_q31 * S, |
1699 | arm_matrix_instance_q31 * S, |
1786 | uint16_t nRows, |
1700 | uint16_t nRows, |
1787 | uint16_t nColumns, |
1701 | uint16_t nColumns, |
1788 | q31_t * pData); |
1702 | q31_t * pData); |
1789 | 1703 | ||
- | 1704 | ||
1790 | /** |
1705 | /** |
1791 | * @brief Q15 matrix initialization. |
1706 | * @brief Q15 matrix initialization. |
1792 | * @param[in,out] *S points to an instance of the floating-point matrix structure. |
1707 | * @param[in,out] S points to an instance of the floating-point matrix structure. |
1793 | * @param[in] nRows number of rows in the matrix. |
1708 | * @param[in] nRows number of rows in the matrix. |
1794 | * @param[in] nColumns number of columns in the matrix. |
1709 | * @param[in] nColumns number of columns in the matrix. |
1795 | * @param[in] *pData points to the matrix data array. |
1710 | * @param[in] pData points to the matrix data array. |
1796 | * @return none |
- | |
1797 | */ |
1711 | */ |
1798 | - | ||
1799 | void arm_mat_init_q15( |
1712 | void arm_mat_init_q15( |
1800 | arm_matrix_instance_q15 * S, |
1713 | arm_matrix_instance_q15 * S, |
1801 | uint16_t nRows, |
1714 | uint16_t nRows, |
1802 | uint16_t nColumns, |
1715 | uint16_t nColumns, |
1803 | q15_t * pData); |
1716 | q15_t * pData); |
1804 | 1717 | ||
- | 1718 | ||
1805 | /** |
1719 | /** |
1806 | * @brief Floating-point matrix initialization. |
1720 | * @brief Floating-point matrix initialization. |
1807 | * @param[in,out] *S points to an instance of the floating-point matrix structure. |
1721 | * @param[in,out] S points to an instance of the floating-point matrix structure. |
1808 | * @param[in] nRows number of rows in the matrix. |
1722 | * @param[in] nRows number of rows in the matrix. |
1809 | * @param[in] nColumns number of columns in the matrix. |
1723 | * @param[in] nColumns number of columns in the matrix. |
1810 | * @param[in] *pData points to the matrix data array. |
1724 | * @param[in] pData points to the matrix data array. |
1811 | * @return none |
- | |
1812 | */ |
1725 | */ |
1813 | - | ||
1814 | void arm_mat_init_f32( |
1726 | void arm_mat_init_f32( |
1815 | arm_matrix_instance_f32 * S, |
1727 | arm_matrix_instance_f32 * S, |
1816 | uint16_t nRows, |
1728 | uint16_t nRows, |
1817 | uint16_t nColumns, |
1729 | uint16_t nColumns, |
1818 | float32_t * pData); |
1730 | float32_t * pData); |
Line 1822... | Line 1734... | ||
1822 | /** |
1734 | /** |
1823 | * @brief Instance structure for the Q15 PID Control. |
1735 | * @brief Instance structure for the Q15 PID Control. |
1824 | */ |
1736 | */ |
1825 | typedef struct |
1737 | typedef struct |
1826 | { |
1738 | { |
1827 | q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ |
1739 | q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ |
1828 | #ifdef ARM_MATH_CM0_FAMILY |
1740 | #ifdef ARM_MATH_CM0_FAMILY |
1829 | q15_t A1; |
1741 | q15_t A1; |
1830 | q15_t A2; |
1742 | q15_t A2; |
1831 | #else |
1743 | #else |
1832 | q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ |
1744 | q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ |
1833 | #endif |
1745 | #endif |
1834 | q15_t state[3]; /**< The state array of length 3. */ |
1746 | q15_t state[3]; /**< The state array of length 3. */ |
1835 | q15_t Kp; /**< The proportional gain. */ |
1747 | q15_t Kp; /**< The proportional gain. */ |
1836 | q15_t Ki; /**< The integral gain. */ |
1748 | q15_t Ki; /**< The integral gain. */ |
1837 | q15_t Kd; /**< The derivative gain. */ |
1749 | q15_t Kd; /**< The derivative gain. */ |
1838 | } arm_pid_instance_q15; |
1750 | } arm_pid_instance_q15; |
1839 | 1751 | ||
Line 1847... | Line 1759... | ||
1847 | q31_t A2; /**< The derived gain, A2 = Kd . */ |
1759 | q31_t A2; /**< The derived gain, A2 = Kd . */ |
1848 | q31_t state[3]; /**< The state array of length 3. */ |
1760 | q31_t state[3]; /**< The state array of length 3. */ |
1849 | q31_t Kp; /**< The proportional gain. */ |
1761 | q31_t Kp; /**< The proportional gain. */ |
1850 | q31_t Ki; /**< The integral gain. */ |
1762 | q31_t Ki; /**< The integral gain. */ |
1851 | q31_t Kd; /**< The derivative gain. */ |
1763 | q31_t Kd; /**< The derivative gain. */ |
1852 | - | ||
1853 | } arm_pid_instance_q31; |
1764 | } arm_pid_instance_q31; |
1854 | 1765 | ||
1855 | /** |
1766 | /** |
1856 | * @brief Instance structure for the floating-point PID Control. |
1767 | * @brief Instance structure for the floating-point PID Control. |
1857 | */ |
1768 | */ |
Line 1859... | Line 1770... | ||
1859 | { |
1770 | { |
1860 | float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ |
1771 | float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ |
1861 | float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ |
1772 | float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ |
1862 | float32_t A2; /**< The derived gain, A2 = Kd . */ |
1773 | float32_t A2; /**< The derived gain, A2 = Kd . */ |
1863 | float32_t state[3]; /**< The state array of length 3. */ |
1774 | float32_t state[3]; /**< The state array of length 3. */ |
1864 | float32_t Kp; /**< The proportional gain. */ |
1775 | float32_t Kp; /**< The proportional gain. */ |
1865 | float32_t Ki; /**< The integral gain. */ |
1776 | float32_t Ki; /**< The integral gain. */ |
1866 | float32_t Kd; /**< The derivative gain. */ |
1777 | float32_t Kd; /**< The derivative gain. */ |
1867 | } arm_pid_instance_f32; |
1778 | } arm_pid_instance_f32; |
1868 | 1779 | ||
1869 | 1780 | ||
1870 | 1781 | ||
1871 | /** |
1782 | /** |
1872 | * @brief Initialization function for the floating-point PID Control. |
1783 | * @brief Initialization function for the floating-point PID Control. |
1873 | * @param[in,out] *S points to an instance of the PID structure. |
1784 | * @param[in,out] S points to an instance of the PID structure. |
1874 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. |
1785 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. |
1875 | * @return none. |
- | |
1876 | */ |
1786 | */ |
1877 | void arm_pid_init_f32( |
1787 | void arm_pid_init_f32( |
1878 | arm_pid_instance_f32 * S, |
1788 | arm_pid_instance_f32 * S, |
1879 | int32_t resetStateFlag); |
1789 | int32_t resetStateFlag); |
1880 | 1790 | ||
- | 1791 | ||
1881 | /** |
1792 | /** |
1882 | * @brief Reset function for the floating-point PID Control. |
1793 | * @brief Reset function for the floating-point PID Control. |
1883 | * @param[in,out] *S is an instance of the floating-point PID Control structure |
1794 | * @param[in,out] S is an instance of the floating-point PID Control structure |
1884 | * @return none |
- | |
1885 | */ |
1795 | */ |
1886 | void arm_pid_reset_f32( |
1796 | void arm_pid_reset_f32( |
1887 | arm_pid_instance_f32 * S); |
1797 | arm_pid_instance_f32 * S); |
1888 | 1798 | ||
1889 | 1799 | ||
1890 | /** |
1800 | /** |
1891 | * @brief Initialization function for the Q31 PID Control. |
1801 | * @brief Initialization function for the Q31 PID Control. |
1892 | * @param[in,out] *S points to an instance of the Q15 PID structure. |
1802 | * @param[in,out] S points to an instance of the Q15 PID structure. |
1893 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. |
1803 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. |
1894 | * @return none. |
- | |
1895 | */ |
1804 | */ |
1896 | void arm_pid_init_q31( |
1805 | void arm_pid_init_q31( |
1897 | arm_pid_instance_q31 * S, |
1806 | arm_pid_instance_q31 * S, |
1898 | int32_t resetStateFlag); |
1807 | int32_t resetStateFlag); |
1899 | 1808 | ||
1900 | 1809 | ||
1901 | /** |
1810 | /** |
1902 | * @brief Reset function for the Q31 PID Control. |
1811 | * @brief Reset function for the Q31 PID Control. |
1903 | * @param[in,out] *S points to an instance of the Q31 PID Control structure |
1812 | * @param[in,out] S points to an instance of the Q31 PID Control structure |
1904 | * @return none |
- | |
1905 | */ |
1813 | */ |
1906 | 1814 | ||
1907 | void arm_pid_reset_q31( |
1815 | void arm_pid_reset_q31( |
1908 | arm_pid_instance_q31 * S); |
1816 | arm_pid_instance_q31 * S); |
1909 | 1817 | ||
- | 1818 | ||
1910 | /** |
1819 | /** |
1911 | * @brief Initialization function for the Q15 PID Control. |
1820 | * @brief Initialization function for the Q15 PID Control. |
1912 | * @param[in,out] *S points to an instance of the Q15 PID structure. |
1821 | * @param[in,out] S points to an instance of the Q15 PID structure. |
1913 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. |
1822 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. |
1914 | * @return none. |
- | |
1915 | */ |
1823 | */ |
1916 | void arm_pid_init_q15( |
1824 | void arm_pid_init_q15( |
1917 | arm_pid_instance_q15 * S, |
1825 | arm_pid_instance_q15 * S, |
1918 | int32_t resetStateFlag); |
1826 | int32_t resetStateFlag); |
1919 | 1827 | ||
- | 1828 | ||
1920 | /** |
1829 | /** |
1921 | * @brief Reset function for the Q15 PID Control. |
1830 | * @brief Reset function for the Q15 PID Control. |
1922 | * @param[in,out] *S points to an instance of the q15 PID Control structure |
1831 | * @param[in,out] S points to an instance of the q15 PID Control structure |
1923 | * @return none |
- | |
1924 | */ |
1832 | */ |
1925 | void arm_pid_reset_q15( |
1833 | void arm_pid_reset_q15( |
1926 | arm_pid_instance_q15 * S); |
1834 | arm_pid_instance_q15 * S); |
1927 | 1835 | ||
1928 | 1836 | ||
Line 1938... | Line 1846... | ||
1938 | } arm_linear_interp_instance_f32; |
1846 | } arm_linear_interp_instance_f32; |
1939 | 1847 | ||
1940 | /** |
1848 | /** |
1941 | * @brief Instance structure for the floating-point bilinear interpolation function. |
1849 | * @brief Instance structure for the floating-point bilinear interpolation function. |
1942 | */ |
1850 | */ |
1943 | - | ||
1944 | typedef struct |
1851 | typedef struct |
1945 | { |
1852 | { |
1946 | uint16_t numRows; /**< number of rows in the data table. */ |
1853 | uint16_t numRows; /**< number of rows in the data table. */ |
1947 | uint16_t numCols; /**< number of columns in the data table. */ |
1854 | uint16_t numCols; /**< number of columns in the data table. */ |
1948 | float32_t *pData; /**< points to the data table. */ |
1855 | float32_t *pData; /**< points to the data table. */ |
1949 | } arm_bilinear_interp_instance_f32; |
1856 | } arm_bilinear_interp_instance_f32; |
1950 | 1857 | ||
1951 | /** |
1858 | /** |
1952 | * @brief Instance structure for the Q31 bilinear interpolation function. |
1859 | * @brief Instance structure for the Q31 bilinear interpolation function. |
1953 | */ |
1860 | */ |
1954 | - | ||
1955 | typedef struct |
1861 | typedef struct |
1956 | { |
1862 | { |
1957 | uint16_t numRows; /**< number of rows in the data table. */ |
1863 | uint16_t numRows; /**< number of rows in the data table. */ |
1958 | uint16_t numCols; /**< number of columns in the data table. */ |
1864 | uint16_t numCols; /**< number of columns in the data table. */ |
1959 | q31_t *pData; /**< points to the data table. */ |
1865 | q31_t *pData; /**< points to the data table. */ |
1960 | } arm_bilinear_interp_instance_q31; |
1866 | } arm_bilinear_interp_instance_q31; |
1961 | 1867 | ||
1962 | /** |
1868 | /** |
1963 | * @brief Instance structure for the Q15 bilinear interpolation function. |
1869 | * @brief Instance structure for the Q15 bilinear interpolation function. |
1964 | */ |
1870 | */ |
1965 | - | ||
1966 | typedef struct |
1871 | typedef struct |
1967 | { |
1872 | { |
1968 | uint16_t numRows; /**< number of rows in the data table. */ |
1873 | uint16_t numRows; /**< number of rows in the data table. */ |
1969 | uint16_t numCols; /**< number of columns in the data table. */ |
1874 | uint16_t numCols; /**< number of columns in the data table. */ |
1970 | q15_t *pData; /**< points to the data table. */ |
1875 | q15_t *pData; /**< points to the data table. */ |
1971 | } arm_bilinear_interp_instance_q15; |
1876 | } arm_bilinear_interp_instance_q15; |
1972 | 1877 | ||
1973 | /** |
1878 | /** |
1974 | * @brief Instance structure for the Q15 bilinear interpolation function. |
1879 | * @brief Instance structure for the Q15 bilinear interpolation function. |
1975 | */ |
1880 | */ |
1976 | - | ||
1977 | typedef struct |
1881 | typedef struct |
1978 | { |
1882 | { |
1979 | uint16_t numRows; /**< number of rows in the data table. */ |
1883 | uint16_t numRows; /**< number of rows in the data table. */ |
1980 | uint16_t numCols; /**< number of columns in the data table. */ |
1884 | uint16_t numCols; /**< number of columns in the data table. */ |
1981 | q7_t *pData; /**< points to the data table. */ |
1885 | q7_t *pData; /**< points to the data table. */ |
1982 | } arm_bilinear_interp_instance_q7; |
1886 | } arm_bilinear_interp_instance_q7; |
1983 | 1887 | ||
1984 | 1888 | ||
1985 | /** |
1889 | /** |
1986 | * @brief Q7 vector multiplication. |
1890 | * @brief Q7 vector multiplication. |
1987 | * @param[in] *pSrcA points to the first input vector |
1891 | * @param[in] pSrcA points to the first input vector |
1988 | * @param[in] *pSrcB points to the second input vector |
1892 | * @param[in] pSrcB points to the second input vector |
1989 | * @param[out] *pDst points to the output vector |
1893 | * @param[out] pDst points to the output vector |
1990 | * @param[in] blockSize number of samples in each vector |
1894 | * @param[in] blockSize number of samples in each vector |
1991 | * @return none. |
- | |
1992 | */ |
1895 | */ |
1993 | - | ||
1994 | void arm_mult_q7( |
1896 | void arm_mult_q7( |
1995 | q7_t * pSrcA, |
1897 | q7_t * pSrcA, |
1996 | q7_t * pSrcB, |
1898 | q7_t * pSrcB, |
1997 | q7_t * pDst, |
1899 | q7_t * pDst, |
1998 | uint32_t blockSize); |
1900 | uint32_t blockSize); |
1999 | 1901 | ||
- | 1902 | ||
2000 | /** |
1903 | /** |
2001 | * @brief Q15 vector multiplication. |
1904 | * @brief Q15 vector multiplication. |
2002 | * @param[in] *pSrcA points to the first input vector |
1905 | * @param[in] pSrcA points to the first input vector |
2003 | * @param[in] *pSrcB points to the second input vector |
1906 | * @param[in] pSrcB points to the second input vector |
2004 | * @param[out] *pDst points to the output vector |
1907 | * @param[out] pDst points to the output vector |
2005 | * @param[in] blockSize number of samples in each vector |
1908 | * @param[in] blockSize number of samples in each vector |
2006 | * @return none. |
- | |
2007 | */ |
1909 | */ |
2008 | - | ||
2009 | void arm_mult_q15( |
1910 | void arm_mult_q15( |
2010 | q15_t * pSrcA, |
1911 | q15_t * pSrcA, |
2011 | q15_t * pSrcB, |
1912 | q15_t * pSrcB, |
2012 | q15_t * pDst, |
1913 | q15_t * pDst, |
2013 | uint32_t blockSize); |
1914 | uint32_t blockSize); |
2014 | 1915 | ||
- | 1916 | ||
2015 | /** |
1917 | /** |
2016 | * @brief Q31 vector multiplication. |
1918 | * @brief Q31 vector multiplication. |
2017 | * @param[in] *pSrcA points to the first input vector |
1919 | * @param[in] pSrcA points to the first input vector |
2018 | * @param[in] *pSrcB points to the second input vector |
1920 | * @param[in] pSrcB points to the second input vector |
2019 | * @param[out] *pDst points to the output vector |
1921 | * @param[out] pDst points to the output vector |
2020 | * @param[in] blockSize number of samples in each vector |
1922 | * @param[in] blockSize number of samples in each vector |
2021 | * @return none. |
- | |
2022 | */ |
1923 | */ |
2023 | - | ||
2024 | void arm_mult_q31( |
1924 | void arm_mult_q31( |
2025 | q31_t * pSrcA, |
1925 | q31_t * pSrcA, |
2026 | q31_t * pSrcB, |
1926 | q31_t * pSrcB, |
2027 | q31_t * pDst, |
1927 | q31_t * pDst, |
2028 | uint32_t blockSize); |
1928 | uint32_t blockSize); |
2029 | 1929 | ||
- | 1930 | ||
2030 | /** |
1931 | /** |
2031 | * @brief Floating-point vector multiplication. |
1932 | * @brief Floating-point vector multiplication. |
2032 | * @param[in] *pSrcA points to the first input vector |
1933 | * @param[in] pSrcA points to the first input vector |
2033 | * @param[in] *pSrcB points to the second input vector |
1934 | * @param[in] pSrcB points to the second input vector |
2034 | * @param[out] *pDst points to the output vector |
1935 | * @param[out] pDst points to the output vector |
2035 | * @param[in] blockSize number of samples in each vector |
1936 | * @param[in] blockSize number of samples in each vector |
2036 | * @return none. |
- | |
2037 | */ |
1937 | */ |
2038 | - | ||
2039 | void arm_mult_f32( |
1938 | void arm_mult_f32( |
2040 | float32_t * pSrcA, |
1939 | float32_t * pSrcA, |
2041 | float32_t * pSrcB, |
1940 | float32_t * pSrcB, |
2042 | float32_t * pDst, |
1941 | float32_t * pDst, |
2043 | uint32_t blockSize); |
1942 | uint32_t blockSize); |
2044 | 1943 | ||
2045 | 1944 | ||
2046 | - | ||
2047 | - | ||
2048 | - | ||
2049 | - | ||
2050 | /** |
1945 | /** |
2051 | * @brief Instance structure for the Q15 CFFT/CIFFT function. |
1946 | * @brief Instance structure for the Q15 CFFT/CIFFT function. |
2052 | */ |
1947 | */ |
2053 | - | ||
2054 | typedef struct |
1948 | typedef struct |
2055 | { |
1949 | { |
2056 | uint16_t fftLen; /**< length of the FFT. */ |
1950 | uint16_t fftLen; /**< length of the FFT. */ |
2057 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
1951 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
2058 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
1952 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
2059 | q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ |
1953 | q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ |
2060 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
1954 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2061 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
1955 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
2062 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
1956 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
2063 | } arm_cfft_radix2_instance_q15; |
1957 | } arm_cfft_radix2_instance_q15; |
2064 | 1958 | ||
Line 2073... | Line 1967... | ||
2073 | void arm_cfft_radix2_q15( |
1967 | void arm_cfft_radix2_q15( |
2074 | const arm_cfft_radix2_instance_q15 * S, |
1968 | const arm_cfft_radix2_instance_q15 * S, |
2075 | q15_t * pSrc); |
1969 | q15_t * pSrc); |
2076 | 1970 | ||
2077 | 1971 | ||
2078 | - | ||
2079 | /** |
1972 | /** |
2080 | * @brief Instance structure for the Q15 CFFT/CIFFT function. |
1973 | * @brief Instance structure for the Q15 CFFT/CIFFT function. |
2081 | */ |
1974 | */ |
2082 | - | ||
2083 | typedef struct |
1975 | typedef struct |
2084 | { |
1976 | { |
2085 | uint16_t fftLen; /**< length of the FFT. */ |
1977 | uint16_t fftLen; /**< length of the FFT. */ |
2086 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
1978 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
2087 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
1979 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
Line 2104... | Line 1996... | ||
2104 | q15_t * pSrc); |
1996 | q15_t * pSrc); |
2105 | 1997 | ||
2106 | /** |
1998 | /** |
2107 | * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. |
1999 | * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. |
2108 | */ |
2000 | */ |
2109 | - | ||
2110 | typedef struct |
2001 | typedef struct |
2111 | { |
2002 | { |
2112 | uint16_t fftLen; /**< length of the FFT. */ |
2003 | uint16_t fftLen; /**< length of the FFT. */ |
2113 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
2004 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
2114 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
2005 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
2115 | q31_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2006 | q31_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2116 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2007 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2117 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
2008 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
2118 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
2009 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
2119 | } arm_cfft_radix2_instance_q31; |
2010 | } arm_cfft_radix2_instance_q31; |
2120 | 2011 | ||
Line 2131... | Line 2022... | ||
2131 | q31_t * pSrc); |
2022 | q31_t * pSrc); |
2132 | 2023 | ||
2133 | /** |
2024 | /** |
2134 | * @brief Instance structure for the Q31 CFFT/CIFFT function. |
2025 | * @brief Instance structure for the Q31 CFFT/CIFFT function. |
2135 | */ |
2026 | */ |
2136 | - | ||
2137 | typedef struct |
2027 | typedef struct |
2138 | { |
2028 | { |
2139 | uint16_t fftLen; /**< length of the FFT. */ |
2029 | uint16_t fftLen; /**< length of the FFT. */ |
2140 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
2030 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
2141 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
2031 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
Line 2158... | Line 2048... | ||
2158 | uint8_t bitReverseFlag); |
2048 | uint8_t bitReverseFlag); |
2159 | 2049 | ||
2160 | /** |
2050 | /** |
2161 | * @brief Instance structure for the floating-point CFFT/CIFFT function. |
2051 | * @brief Instance structure for the floating-point CFFT/CIFFT function. |
2162 | */ |
2052 | */ |
2163 | - | ||
2164 | typedef struct |
2053 | typedef struct |
2165 | { |
2054 | { |
2166 | uint16_t fftLen; /**< length of the FFT. */ |
2055 | uint16_t fftLen; /**< length of the FFT. */ |
2167 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
2056 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
2168 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
2057 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
2169 | float32_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2058 | float32_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2170 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2059 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2171 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
2060 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
2172 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
2061 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
2173 | float32_t onebyfftLen; /**< value of 1/fftLen. */ |
2062 | float32_t onebyfftLen; /**< value of 1/fftLen. */ |
2174 | } arm_cfft_radix2_instance_f32; |
2063 | } arm_cfft_radix2_instance_f32; |
2175 | 2064 | ||
2176 | /* Deprecated */ |
2065 | /* Deprecated */ |
2177 | arm_status arm_cfft_radix2_init_f32( |
2066 | arm_status arm_cfft_radix2_init_f32( |
2178 | arm_cfft_radix2_instance_f32 * S, |
2067 | arm_cfft_radix2_instance_f32 * S, |
Line 2186... | Line 2075... | ||
2186 | float32_t * pSrc); |
2075 | float32_t * pSrc); |
2187 | 2076 | ||
2188 | /** |
2077 | /** |
2189 | * @brief Instance structure for the floating-point CFFT/CIFFT function. |
2078 | * @brief Instance structure for the floating-point CFFT/CIFFT function. |
2190 | */ |
2079 | */ |
2191 | - | ||
2192 | typedef struct |
2080 | typedef struct |
2193 | { |
2081 | { |
2194 | uint16_t fftLen; /**< length of the FFT. */ |
2082 | uint16_t fftLen; /**< length of the FFT. */ |
2195 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
2083 | uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ |
2196 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
2084 | uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ |
2197 | float32_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2085 | float32_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2198 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2086 | uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2199 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
2087 | uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ |
2200 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
2088 | uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ |
2201 | float32_t onebyfftLen; /**< value of 1/fftLen. */ |
2089 | float32_t onebyfftLen; /**< value of 1/fftLen. */ |
2202 | } arm_cfft_radix4_instance_f32; |
2090 | } arm_cfft_radix4_instance_f32; |
2203 | 2091 | ||
2204 | /* Deprecated */ |
2092 | /* Deprecated */ |
2205 | arm_status arm_cfft_radix4_init_f32( |
2093 | arm_status arm_cfft_radix4_init_f32( |
2206 | arm_cfft_radix4_instance_f32 * S, |
2094 | arm_cfft_radix4_instance_f32 * S, |
Line 2214... | Line 2102... | ||
2214 | float32_t * pSrc); |
2102 | float32_t * pSrc); |
2215 | 2103 | ||
2216 | /** |
2104 | /** |
2217 | * @brief Instance structure for the fixed-point CFFT/CIFFT function. |
2105 | * @brief Instance structure for the fixed-point CFFT/CIFFT function. |
2218 | */ |
2106 | */ |
2219 | - | ||
2220 | typedef struct |
2107 | typedef struct |
2221 | { |
2108 | { |
2222 | uint16_t fftLen; /**< length of the FFT. */ |
2109 | uint16_t fftLen; /**< length of the FFT. */ |
2223 | const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2110 | const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2224 | const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2111 | const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2225 | uint16_t bitRevLength; /**< bit reversal table length. */ |
2112 | uint16_t bitRevLength; /**< bit reversal table length. */ |
2226 | } arm_cfft_instance_q15; |
2113 | } arm_cfft_instance_q15; |
2227 | 2114 | ||
2228 | void arm_cfft_q15( |
2115 | void arm_cfft_q15( |
2229 | const arm_cfft_instance_q15 * S, |
2116 | const arm_cfft_instance_q15 * S, |
2230 | q15_t * p1, |
2117 | q15_t * p1, |
2231 | uint8_t ifftFlag, |
2118 | uint8_t ifftFlag, |
2232 | uint8_t bitReverseFlag); |
2119 | uint8_t bitReverseFlag); |
2233 | 2120 | ||
2234 | /** |
2121 | /** |
2235 | * @brief Instance structure for the fixed-point CFFT/CIFFT function. |
2122 | * @brief Instance structure for the fixed-point CFFT/CIFFT function. |
2236 | */ |
2123 | */ |
2237 | - | ||
2238 | typedef struct |
2124 | typedef struct |
2239 | { |
2125 | { |
2240 | uint16_t fftLen; /**< length of the FFT. */ |
2126 | uint16_t fftLen; /**< length of the FFT. */ |
2241 | const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2127 | const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2242 | const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2128 | const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2243 | uint16_t bitRevLength; /**< bit reversal table length. */ |
2129 | uint16_t bitRevLength; /**< bit reversal table length. */ |
2244 | } arm_cfft_instance_q31; |
2130 | } arm_cfft_instance_q31; |
2245 | 2131 | ||
2246 | void arm_cfft_q31( |
2132 | void arm_cfft_q31( |
2247 | const arm_cfft_instance_q31 * S, |
2133 | const arm_cfft_instance_q31 * S, |
2248 | q31_t * p1, |
2134 | q31_t * p1, |
2249 | uint8_t ifftFlag, |
2135 | uint8_t ifftFlag, |
2250 | uint8_t bitReverseFlag); |
2136 | uint8_t bitReverseFlag); |
2251 | 2137 | ||
2252 | /** |
2138 | /** |
2253 | * @brief Instance structure for the floating-point CFFT/CIFFT function. |
2139 | * @brief Instance structure for the floating-point CFFT/CIFFT function. |
2254 | */ |
2140 | */ |
2255 | - | ||
2256 | typedef struct |
2141 | typedef struct |
2257 | { |
2142 | { |
2258 | uint16_t fftLen; /**< length of the FFT. */ |
2143 | uint16_t fftLen; /**< length of the FFT. */ |
2259 | const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2144 | const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ |
2260 | const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
2145 | const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ |
Line 2268... | Line 2153... | ||
2268 | uint8_t bitReverseFlag); |
2153 | uint8_t bitReverseFlag); |
2269 | 2154 | ||
2270 | /** |
2155 | /** |
2271 | * @brief Instance structure for the Q15 RFFT/RIFFT function. |
2156 | * @brief Instance structure for the Q15 RFFT/RIFFT function. |
2272 | */ |
2157 | */ |
2273 | - | ||
2274 | typedef struct |
2158 | typedef struct |
2275 | { |
2159 | { |
2276 | uint32_t fftLenReal; /**< length of the real FFT. */ |
2160 | uint32_t fftLenReal; /**< length of the real FFT. */ |
2277 | uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ |
2161 | uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ |
2278 | uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ |
2162 | uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ |
Line 2294... | Line 2178... | ||
2294 | q15_t * pDst); |
2178 | q15_t * pDst); |
2295 | 2179 | ||
2296 | /** |
2180 | /** |
2297 | * @brief Instance structure for the Q31 RFFT/RIFFT function. |
2181 | * @brief Instance structure for the Q31 RFFT/RIFFT function. |
2298 | */ |
2182 | */ |
2299 | - | ||
2300 | typedef struct |
2183 | typedef struct |
2301 | { |
2184 | { |
2302 | uint32_t fftLenReal; /**< length of the real FFT. */ |
2185 | uint32_t fftLenReal; /**< length of the real FFT. */ |
2303 | uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ |
2186 | uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ |
2304 | uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ |
2187 | uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ |
Line 2320... | Line 2203... | ||
2320 | q31_t * pDst); |
2203 | q31_t * pDst); |
2321 | 2204 | ||
2322 | /** |
2205 | /** |
2323 | * @brief Instance structure for the floating-point RFFT/RIFFT function. |
2206 | * @brief Instance structure for the floating-point RFFT/RIFFT function. |
2324 | */ |
2207 | */ |
2325 | - | ||
2326 | typedef struct |
2208 | typedef struct |
2327 | { |
2209 | { |
2328 | uint32_t fftLenReal; /**< length of the real FFT. */ |
2210 | uint32_t fftLenReal; /**< length of the real FFT. */ |
2329 | uint16_t fftLenBy2; /**< length of the complex FFT. */ |
2211 | uint16_t fftLenBy2; /**< length of the complex FFT. */ |
2330 | uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ |
2212 | uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ |
Line 2348... | Line 2230... | ||
2348 | float32_t * pDst); |
2230 | float32_t * pDst); |
2349 | 2231 | ||
2350 | /** |
2232 | /** |
2351 | * @brief Instance structure for the floating-point RFFT/RIFFT function. |
2233 | * @brief Instance structure for the floating-point RFFT/RIFFT function. |
2352 | */ |
2234 | */ |
2353 | - | ||
2354 | typedef struct |
2235 | typedef struct |
2355 | { |
2236 | { |
2356 | arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ |
2237 | arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ |
2357 | uint16_t fftLenRFFT; /**< length of the real sequence */ |
2238 | uint16_t fftLenRFFT; /**< length of the real sequence */ |
2358 | float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */ |
2239 | float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */ |
2359 | } arm_rfft_fast_instance_f32 ; |
2240 | } arm_rfft_fast_instance_f32 ; |
2360 | 2241 | ||
2361 | arm_status arm_rfft_fast_init_f32 ( |
2242 | arm_status arm_rfft_fast_init_f32 ( |
2362 | arm_rfft_fast_instance_f32 * S, |
2243 | arm_rfft_fast_instance_f32 * S, |
2363 | uint16_t fftLen); |
2244 | uint16_t fftLen); |
2364 | 2245 | ||
2365 | void arm_rfft_fast_f32( |
2246 | void arm_rfft_fast_f32( |
2366 | arm_rfft_fast_instance_f32 * S, |
2247 | arm_rfft_fast_instance_f32 * S, |
2367 | float32_t * p, float32_t * pOut, |
2248 | float32_t * p, float32_t * pOut, |
2368 | uint8_t ifftFlag); |
2249 | uint8_t ifftFlag); |
2369 | 2250 | ||
2370 | /** |
2251 | /** |
2371 | * @brief Instance structure for the floating-point DCT4/IDCT4 function. |
2252 | * @brief Instance structure for the floating-point DCT4/IDCT4 function. |
2372 | */ |
2253 | */ |
2373 | - | ||
2374 | typedef struct |
2254 | typedef struct |
2375 | { |
2255 | { |
2376 | uint16_t N; /**< length of the DCT4. */ |
2256 | uint16_t N; /**< length of the DCT4. */ |
2377 | uint16_t Nby2; /**< half of the length of the DCT4. */ |
2257 | uint16_t Nby2; /**< half of the length of the DCT4. */ |
2378 | float32_t normalize; /**< normalizing factor. */ |
2258 | float32_t normalize; /**< normalizing factor. */ |
2379 | float32_t *pTwiddle; /**< points to the twiddle factor table. */ |
2259 | float32_t *pTwiddle; /**< points to the twiddle factor table. */ |
2380 | float32_t *pCosFactor; /**< points to the cosFactor table. */ |
2260 | float32_t *pCosFactor; /**< points to the cosFactor table. */ |
2381 | arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ |
2261 | arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ |
2382 | arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ |
2262 | arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ |
2383 | } arm_dct4_instance_f32; |
2263 | } arm_dct4_instance_f32; |
2384 | 2264 | ||
- | 2265 | ||
2385 | /** |
2266 | /** |
2386 | * @brief Initialization function for the floating-point DCT4/IDCT4. |
2267 | * @brief Initialization function for the floating-point DCT4/IDCT4. |
2387 | * @param[in,out] *S points to an instance of floating-point DCT4/IDCT4 structure. |
2268 | * @param[in,out] S points to an instance of floating-point DCT4/IDCT4 structure. |
2388 | * @param[in] *S_RFFT points to an instance of floating-point RFFT/RIFFT structure. |
2269 | * @param[in] S_RFFT points to an instance of floating-point RFFT/RIFFT structure. |
2389 | * @param[in] *S_CFFT points to an instance of floating-point CFFT/CIFFT structure. |
2270 | * @param[in] S_CFFT points to an instance of floating-point CFFT/CIFFT structure. |
2390 | * @param[in] N length of the DCT4. |
2271 | * @param[in] N length of the DCT4. |
2391 | * @param[in] Nby2 half of the length of the DCT4. |
2272 | * @param[in] Nby2 half of the length of the DCT4. |
2392 | * @param[in] normalize normalizing factor. |
2273 | * @param[in] normalize normalizing factor. |
2393 | * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLenReal</code> is not a supported transform length. |
2274 | * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLenReal</code> is not a supported transform length. |
2394 | */ |
2275 | */ |
2395 | - | ||
2396 | arm_status arm_dct4_init_f32( |
2276 | arm_status arm_dct4_init_f32( |
2397 | arm_dct4_instance_f32 * S, |
2277 | arm_dct4_instance_f32 * S, |
2398 | arm_rfft_instance_f32 * S_RFFT, |
2278 | arm_rfft_instance_f32 * S_RFFT, |
2399 | arm_cfft_radix4_instance_f32 * S_CFFT, |
2279 | arm_cfft_radix4_instance_f32 * S_CFFT, |
2400 | uint16_t N, |
2280 | uint16_t N, |
2401 | uint16_t Nby2, |
2281 | uint16_t Nby2, |
2402 | float32_t normalize); |
2282 | float32_t normalize); |
2403 | 2283 | ||
- | 2284 | ||
2404 | /** |
2285 | /** |
2405 | * @brief Processing function for the floating-point DCT4/IDCT4. |
2286 | * @brief Processing function for the floating-point DCT4/IDCT4. |
2406 | * @param[in] *S points to an instance of the floating-point DCT4/IDCT4 structure. |
2287 | * @param[in] S points to an instance of the floating-point DCT4/IDCT4 structure. |
2407 | * @param[in] *pState points to state buffer. |
2288 | * @param[in] pState points to state buffer. |
2408 | * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. |
2289 | * @param[in,out] pInlineBuffer points to the in-place input and output buffer. |
2409 | * @return none. |
- | |
2410 | */ |
2290 | */ |
2411 | - | ||
2412 | void arm_dct4_f32( |
2291 | void arm_dct4_f32( |
2413 | const arm_dct4_instance_f32 * S, |
2292 | const arm_dct4_instance_f32 * S, |
2414 | float32_t * pState, |
2293 | float32_t * pState, |
2415 | float32_t * pInlineBuffer); |
2294 | float32_t * pInlineBuffer); |
2416 | 2295 | ||
- | 2296 | ||
2417 | /** |
2297 | /** |
2418 | * @brief Instance structure for the Q31 DCT4/IDCT4 function. |
2298 | * @brief Instance structure for the Q31 DCT4/IDCT4 function. |
2419 | */ |
2299 | */ |
2420 | - | ||
2421 | typedef struct |
2300 | typedef struct |
2422 | { |
2301 | { |
2423 | uint16_t N; /**< length of the DCT4. */ |
2302 | uint16_t N; /**< length of the DCT4. */ |
2424 | uint16_t Nby2; /**< half of the length of the DCT4. */ |
2303 | uint16_t Nby2; /**< half of the length of the DCT4. */ |
2425 | q31_t normalize; /**< normalizing factor. */ |
2304 | q31_t normalize; /**< normalizing factor. */ |
2426 | q31_t *pTwiddle; /**< points to the twiddle factor table. */ |
2305 | q31_t *pTwiddle; /**< points to the twiddle factor table. */ |
2427 | q31_t *pCosFactor; /**< points to the cosFactor table. */ |
2306 | q31_t *pCosFactor; /**< points to the cosFactor table. */ |
2428 | arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ |
2307 | arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ |
2429 | arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ |
2308 | arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ |
2430 | } arm_dct4_instance_q31; |
2309 | } arm_dct4_instance_q31; |
2431 | 2310 | ||
- | 2311 | ||
2432 | /** |
2312 | /** |
2433 | * @brief Initialization function for the Q31 DCT4/IDCT4. |
2313 | * @brief Initialization function for the Q31 DCT4/IDCT4. |
2434 | * @param[in,out] *S points to an instance of Q31 DCT4/IDCT4 structure. |
2314 | * @param[in,out] S points to an instance of Q31 DCT4/IDCT4 structure. |
2435 | * @param[in] *S_RFFT points to an instance of Q31 RFFT/RIFFT structure |
2315 | * @param[in] S_RFFT points to an instance of Q31 RFFT/RIFFT structure |
2436 | * @param[in] *S_CFFT points to an instance of Q31 CFFT/CIFFT structure |
2316 | * @param[in] S_CFFT points to an instance of Q31 CFFT/CIFFT structure |
2437 | * @param[in] N length of the DCT4. |
2317 | * @param[in] N length of the DCT4. |
2438 | * @param[in] Nby2 half of the length of the DCT4. |
2318 | * @param[in] Nby2 half of the length of the DCT4. |
2439 | * @param[in] normalize normalizing factor. |
2319 | * @param[in] normalize normalizing factor. |
2440 | * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>N</code> is not a supported transform length. |
2320 | * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>N</code> is not a supported transform length. |
2441 | */ |
2321 | */ |
2442 | - | ||
2443 | arm_status arm_dct4_init_q31( |
2322 | arm_status arm_dct4_init_q31( |
2444 | arm_dct4_instance_q31 * S, |
2323 | arm_dct4_instance_q31 * S, |
2445 | arm_rfft_instance_q31 * S_RFFT, |
2324 | arm_rfft_instance_q31 * S_RFFT, |
2446 | arm_cfft_radix4_instance_q31 * S_CFFT, |
2325 | arm_cfft_radix4_instance_q31 * S_CFFT, |
2447 | uint16_t N, |
2326 | uint16_t N, |
2448 | uint16_t Nby2, |
2327 | uint16_t Nby2, |
2449 | q31_t normalize); |
2328 | q31_t normalize); |
2450 | 2329 | ||
- | 2330 | ||
2451 | /** |
2331 | /** |
2452 | * @brief Processing function for the Q31 DCT4/IDCT4. |
2332 | * @brief Processing function for the Q31 DCT4/IDCT4. |
2453 | * @param[in] *S points to an instance of the Q31 DCT4 structure. |
2333 | * @param[in] S points to an instance of the Q31 DCT4 structure. |
2454 | * @param[in] *pState points to state buffer. |
2334 | * @param[in] pState points to state buffer. |
2455 | * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. |
2335 | * @param[in,out] pInlineBuffer points to the in-place input and output buffer. |
2456 | * @return none. |
- | |
2457 | */ |
2336 | */ |
2458 | - | ||
2459 | void arm_dct4_q31( |
2337 | void arm_dct4_q31( |
2460 | const arm_dct4_instance_q31 * S, |
2338 | const arm_dct4_instance_q31 * S, |
2461 | q31_t * pState, |
2339 | q31_t * pState, |
2462 | q31_t * pInlineBuffer); |
2340 | q31_t * pInlineBuffer); |
2463 | 2341 | ||
- | 2342 | ||
2464 | /** |
2343 | /** |
2465 | * @brief Instance structure for the Q15 DCT4/IDCT4 function. |
2344 | * @brief Instance structure for the Q15 DCT4/IDCT4 function. |
2466 | */ |
2345 | */ |
2467 | - | ||
2468 | typedef struct |
2346 | typedef struct |
2469 | { |
2347 | { |
2470 | uint16_t N; /**< length of the DCT4. */ |
2348 | uint16_t N; /**< length of the DCT4. */ |
2471 | uint16_t Nby2; /**< half of the length of the DCT4. */ |
2349 | uint16_t Nby2; /**< half of the length of the DCT4. */ |
2472 | q15_t normalize; /**< normalizing factor. */ |
2350 | q15_t normalize; /**< normalizing factor. */ |
2473 | q15_t *pTwiddle; /**< points to the twiddle factor table. */ |
2351 | q15_t *pTwiddle; /**< points to the twiddle factor table. */ |
2474 | q15_t *pCosFactor; /**< points to the cosFactor table. */ |
2352 | q15_t *pCosFactor; /**< points to the cosFactor table. */ |
2475 | arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ |
2353 | arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ |
2476 | arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ |
2354 | arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ |
2477 | } arm_dct4_instance_q15; |
2355 | } arm_dct4_instance_q15; |
2478 | 2356 | ||
- | 2357 | ||
2479 | /** |
2358 | /** |
2480 | * @brief Initialization function for the Q15 DCT4/IDCT4. |
2359 | * @brief Initialization function for the Q15 DCT4/IDCT4. |
2481 | * @param[in,out] *S points to an instance of Q15 DCT4/IDCT4 structure. |
2360 | * @param[in,out] S points to an instance of Q15 DCT4/IDCT4 structure. |
2482 | * @param[in] *S_RFFT points to an instance of Q15 RFFT/RIFFT structure. |
2361 | * @param[in] S_RFFT points to an instance of Q15 RFFT/RIFFT structure. |
2483 | * @param[in] *S_CFFT points to an instance of Q15 CFFT/CIFFT structure. |
2362 | * @param[in] S_CFFT points to an instance of Q15 CFFT/CIFFT structure. |
2484 | * @param[in] N length of the DCT4. |
2363 | * @param[in] N length of the DCT4. |
2485 | * @param[in] Nby2 half of the length of the DCT4. |
2364 | * @param[in] Nby2 half of the length of the DCT4. |
2486 | * @param[in] normalize normalizing factor. |
2365 | * @param[in] normalize normalizing factor. |
2487 | * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>N</code> is not a supported transform length. |
2366 | * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>N</code> is not a supported transform length. |
2488 | */ |
2367 | */ |
2489 | - | ||
2490 | arm_status arm_dct4_init_q15( |
2368 | arm_status arm_dct4_init_q15( |
2491 | arm_dct4_instance_q15 * S, |
2369 | arm_dct4_instance_q15 * S, |
2492 | arm_rfft_instance_q15 * S_RFFT, |
2370 | arm_rfft_instance_q15 * S_RFFT, |
2493 | arm_cfft_radix4_instance_q15 * S_CFFT, |
2371 | arm_cfft_radix4_instance_q15 * S_CFFT, |
2494 | uint16_t N, |
2372 | uint16_t N, |
2495 | uint16_t Nby2, |
2373 | uint16_t Nby2, |
2496 | q15_t normalize); |
2374 | q15_t normalize); |
2497 | 2375 | ||
- | 2376 | ||
2498 | /** |
2377 | /** |
2499 | * @brief Processing function for the Q15 DCT4/IDCT4. |
2378 | * @brief Processing function for the Q15 DCT4/IDCT4. |
2500 | * @param[in] *S points to an instance of the Q15 DCT4 structure. |
2379 | * @param[in] S points to an instance of the Q15 DCT4 structure. |
2501 | * @param[in] *pState points to state buffer. |
2380 | * @param[in] pState points to state buffer. |
2502 | * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. |
2381 | * @param[in,out] pInlineBuffer points to the in-place input and output buffer. |
2503 | * @return none. |
- | |
2504 | */ |
2382 | */ |
2505 | - | ||
2506 | void arm_dct4_q15( |
2383 | void arm_dct4_q15( |
2507 | const arm_dct4_instance_q15 * S, |
2384 | const arm_dct4_instance_q15 * S, |
2508 | q15_t * pState, |
2385 | q15_t * pState, |
2509 | q15_t * pInlineBuffer); |
2386 | q15_t * pInlineBuffer); |
2510 | 2387 | ||
- | 2388 | ||
2511 | /** |
2389 | /** |
2512 | * @brief Floating-point vector addition. |
2390 | * @brief Floating-point vector addition. |
2513 | * @param[in] *pSrcA points to the first input vector |
2391 | * @param[in] pSrcA points to the first input vector |
2514 | * @param[in] *pSrcB points to the second input vector |
2392 | * @param[in] pSrcB points to the second input vector |
2515 | * @param[out] *pDst points to the output vector |
2393 | * @param[out] pDst points to the output vector |
2516 | * @param[in] blockSize number of samples in each vector |
2394 | * @param[in] blockSize number of samples in each vector |
2517 | * @return none. |
- | |
2518 | */ |
2395 | */ |
2519 | - | ||
2520 | void arm_add_f32( |
2396 | void arm_add_f32( |
2521 | float32_t * pSrcA, |
2397 | float32_t * pSrcA, |
2522 | float32_t * pSrcB, |
2398 | float32_t * pSrcB, |
2523 | float32_t * pDst, |
2399 | float32_t * pDst, |
2524 | uint32_t blockSize); |
2400 | uint32_t blockSize); |
2525 | 2401 | ||
- | 2402 | ||
2526 | /** |
2403 | /** |
2527 | * @brief Q7 vector addition. |
2404 | * @brief Q7 vector addition. |
2528 | * @param[in] *pSrcA points to the first input vector |
2405 | * @param[in] pSrcA points to the first input vector |
2529 | * @param[in] *pSrcB points to the second input vector |
2406 | * @param[in] pSrcB points to the second input vector |
2530 | * @param[out] *pDst points to the output vector |
2407 | * @param[out] pDst points to the output vector |
2531 | * @param[in] blockSize number of samples in each vector |
2408 | * @param[in] blockSize number of samples in each vector |
2532 | * @return none. |
- | |
2533 | */ |
2409 | */ |
2534 | - | ||
2535 | void arm_add_q7( |
2410 | void arm_add_q7( |
2536 | q7_t * pSrcA, |
2411 | q7_t * pSrcA, |
2537 | q7_t * pSrcB, |
2412 | q7_t * pSrcB, |
2538 | q7_t * pDst, |
2413 | q7_t * pDst, |
2539 | uint32_t blockSize); |
2414 | uint32_t blockSize); |
2540 | 2415 | ||
- | 2416 | ||
2541 | /** |
2417 | /** |
2542 | * @brief Q15 vector addition. |
2418 | * @brief Q15 vector addition. |
2543 | * @param[in] *pSrcA points to the first input vector |
2419 | * @param[in] pSrcA points to the first input vector |
2544 | * @param[in] *pSrcB points to the second input vector |
2420 | * @param[in] pSrcB points to the second input vector |
2545 | * @param[out] *pDst points to the output vector |
2421 | * @param[out] pDst points to the output vector |
2546 | * @param[in] blockSize number of samples in each vector |
2422 | * @param[in] blockSize number of samples in each vector |
2547 | * @return none. |
- | |
2548 | */ |
2423 | */ |
2549 | - | ||
2550 | void arm_add_q15( |
2424 | void arm_add_q15( |
2551 | q15_t * pSrcA, |
2425 | q15_t * pSrcA, |
2552 | q15_t * pSrcB, |
2426 | q15_t * pSrcB, |
2553 | q15_t * pDst, |
2427 | q15_t * pDst, |
2554 | uint32_t blockSize); |
2428 | uint32_t blockSize); |
2555 | 2429 | ||
- | 2430 | ||
2556 | /** |
2431 | /** |
2557 | * @brief Q31 vector addition. |
2432 | * @brief Q31 vector addition. |
2558 | * @param[in] *pSrcA points to the first input vector |
2433 | * @param[in] pSrcA points to the first input vector |
2559 | * @param[in] *pSrcB points to the second input vector |
2434 | * @param[in] pSrcB points to the second input vector |
2560 | * @param[out] *pDst points to the output vector |
2435 | * @param[out] pDst points to the output vector |
2561 | * @param[in] blockSize number of samples in each vector |
2436 | * @param[in] blockSize number of samples in each vector |
2562 | * @return none. |
- | |
2563 | */ |
2437 | */ |
2564 | - | ||
2565 | void arm_add_q31( |
2438 | void arm_add_q31( |
2566 | q31_t * pSrcA, |
2439 | q31_t * pSrcA, |
2567 | q31_t * pSrcB, |
2440 | q31_t * pSrcB, |
2568 | q31_t * pDst, |
2441 | q31_t * pDst, |
2569 | uint32_t blockSize); |
2442 | uint32_t blockSize); |
2570 | 2443 | ||
- | 2444 | ||
2571 | /** |
2445 | /** |
2572 | * @brief Floating-point vector subtraction. |
2446 | * @brief Floating-point vector subtraction. |
2573 | * @param[in] *pSrcA points to the first input vector |
2447 | * @param[in] pSrcA points to the first input vector |
2574 | * @param[in] *pSrcB points to the second input vector |
2448 | * @param[in] pSrcB points to the second input vector |
2575 | * @param[out] *pDst points to the output vector |
2449 | * @param[out] pDst points to the output vector |
2576 | * @param[in] blockSize number of samples in each vector |
2450 | * @param[in] blockSize number of samples in each vector |
2577 | * @return none. |
- | |
2578 | */ |
2451 | */ |
2579 | - | ||
2580 | void arm_sub_f32( |
2452 | void arm_sub_f32( |
2581 | float32_t * pSrcA, |
2453 | float32_t * pSrcA, |
2582 | float32_t * pSrcB, |
2454 | float32_t * pSrcB, |
2583 | float32_t * pDst, |
2455 | float32_t * pDst, |
2584 | uint32_t blockSize); |
2456 | uint32_t blockSize); |
2585 | 2457 | ||
- | 2458 | ||
2586 | /** |
2459 | /** |
2587 | * @brief Q7 vector subtraction. |
2460 | * @brief Q7 vector subtraction. |
2588 | * @param[in] *pSrcA points to the first input vector |
2461 | * @param[in] pSrcA points to the first input vector |
2589 | * @param[in] *pSrcB points to the second input vector |
2462 | * @param[in] pSrcB points to the second input vector |
2590 | * @param[out] *pDst points to the output vector |
2463 | * @param[out] pDst points to the output vector |
2591 | * @param[in] blockSize number of samples in each vector |
2464 | * @param[in] blockSize number of samples in each vector |
2592 | * @return none. |
- | |
2593 | */ |
2465 | */ |
2594 | - | ||
2595 | void arm_sub_q7( |
2466 | void arm_sub_q7( |
2596 | q7_t * pSrcA, |
2467 | q7_t * pSrcA, |
2597 | q7_t * pSrcB, |
2468 | q7_t * pSrcB, |
2598 | q7_t * pDst, |
2469 | q7_t * pDst, |
2599 | uint32_t blockSize); |
2470 | uint32_t blockSize); |
2600 | 2471 | ||
- | 2472 | ||
2601 | /** |
2473 | /** |
2602 | * @brief Q15 vector subtraction. |
2474 | * @brief Q15 vector subtraction. |
2603 | * @param[in] *pSrcA points to the first input vector |
2475 | * @param[in] pSrcA points to the first input vector |
2604 | * @param[in] *pSrcB points to the second input vector |
2476 | * @param[in] pSrcB points to the second input vector |
2605 | * @param[out] *pDst points to the output vector |
2477 | * @param[out] pDst points to the output vector |
2606 | * @param[in] blockSize number of samples in each vector |
2478 | * @param[in] blockSize number of samples in each vector |
2607 | * @return none. |
- | |
2608 | */ |
2479 | */ |
2609 | - | ||
2610 | void arm_sub_q15( |
2480 | void arm_sub_q15( |
2611 | q15_t * pSrcA, |
2481 | q15_t * pSrcA, |
2612 | q15_t * pSrcB, |
2482 | q15_t * pSrcB, |
2613 | q15_t * pDst, |
2483 | q15_t * pDst, |
2614 | uint32_t blockSize); |
2484 | uint32_t blockSize); |
2615 | 2485 | ||
- | 2486 | ||
2616 | /** |
2487 | /** |
2617 | * @brief Q31 vector subtraction. |
2488 | * @brief Q31 vector subtraction. |
2618 | * @param[in] *pSrcA points to the first input vector |
2489 | * @param[in] pSrcA points to the first input vector |
2619 | * @param[in] *pSrcB points to the second input vector |
2490 | * @param[in] pSrcB points to the second input vector |
2620 | * @param[out] *pDst points to the output vector |
2491 | * @param[out] pDst points to the output vector |
2621 | * @param[in] blockSize number of samples in each vector |
2492 | * @param[in] blockSize number of samples in each vector |
2622 | * @return none. |
- | |
2623 | */ |
2493 | */ |
2624 | - | ||
2625 | void arm_sub_q31( |
2494 | void arm_sub_q31( |
2626 | q31_t * pSrcA, |
2495 | q31_t * pSrcA, |
2627 | q31_t * pSrcB, |
2496 | q31_t * pSrcB, |
2628 | q31_t * pDst, |
2497 | q31_t * pDst, |
2629 | uint32_t blockSize); |
2498 | uint32_t blockSize); |
2630 | 2499 | ||
- | 2500 | ||
2631 | /** |
2501 | /** |
2632 | * @brief Multiplies a floating-point vector by a scalar. |
2502 | * @brief Multiplies a floating-point vector by a scalar. |
2633 | * @param[in] *pSrc points to the input vector |
2503 | * @param[in] pSrc points to the input vector |
2634 | * @param[in] scale scale factor to be applied |
2504 | * @param[in] scale scale factor to be applied |
2635 | * @param[out] *pDst points to the output vector |
2505 | * @param[out] pDst points to the output vector |
2636 | * @param[in] blockSize number of samples in the vector |
2506 | * @param[in] blockSize number of samples in the vector |
2637 | * @return none. |
- | |
2638 | */ |
2507 | */ |
2639 | - | ||
2640 | void arm_scale_f32( |
2508 | void arm_scale_f32( |
2641 | float32_t * pSrc, |
2509 | float32_t * pSrc, |
2642 | float32_t scale, |
2510 | float32_t scale, |
2643 | float32_t * pDst, |
2511 | float32_t * pDst, |
2644 | uint32_t blockSize); |
2512 | uint32_t blockSize); |
2645 | 2513 | ||
- | 2514 | ||
2646 | /** |
2515 | /** |
2647 | * @brief Multiplies a Q7 vector by a scalar. |
2516 | * @brief Multiplies a Q7 vector by a scalar. |
2648 | * @param[in] *pSrc points to the input vector |
2517 | * @param[in] pSrc points to the input vector |
2649 | * @param[in] scaleFract fractional portion of the scale value |
2518 | * @param[in] scaleFract fractional portion of the scale value |
2650 | * @param[in] shift number of bits to shift the result by |
2519 | * @param[in] shift number of bits to shift the result by |
2651 | * @param[out] *pDst points to the output vector |
2520 | * @param[out] pDst points to the output vector |
2652 | * @param[in] blockSize number of samples in the vector |
2521 | * @param[in] blockSize number of samples in the vector |
2653 | * @return none. |
- | |
2654 | */ |
2522 | */ |
2655 | - | ||
2656 | void arm_scale_q7( |
2523 | void arm_scale_q7( |
2657 | q7_t * pSrc, |
2524 | q7_t * pSrc, |
2658 | q7_t scaleFract, |
2525 | q7_t scaleFract, |
2659 | int8_t shift, |
2526 | int8_t shift, |
2660 | q7_t * pDst, |
2527 | q7_t * pDst, |
2661 | uint32_t blockSize); |
2528 | uint32_t blockSize); |
2662 | 2529 | ||
- | 2530 | ||
2663 | /** |
2531 | /** |
2664 | * @brief Multiplies a Q15 vector by a scalar. |
2532 | * @brief Multiplies a Q15 vector by a scalar. |
2665 | * @param[in] *pSrc points to the input vector |
2533 | * @param[in] pSrc points to the input vector |
2666 | * @param[in] scaleFract fractional portion of the scale value |
2534 | * @param[in] scaleFract fractional portion of the scale value |
2667 | * @param[in] shift number of bits to shift the result by |
2535 | * @param[in] shift number of bits to shift the result by |
2668 | * @param[out] *pDst points to the output vector |
2536 | * @param[out] pDst points to the output vector |
2669 | * @param[in] blockSize number of samples in the vector |
2537 | * @param[in] blockSize number of samples in the vector |
2670 | * @return none. |
- | |
2671 | */ |
2538 | */ |
2672 | - | ||
2673 | void arm_scale_q15( |
2539 | void arm_scale_q15( |
2674 | q15_t * pSrc, |
2540 | q15_t * pSrc, |
2675 | q15_t scaleFract, |
2541 | q15_t scaleFract, |
2676 | int8_t shift, |
2542 | int8_t shift, |
2677 | q15_t * pDst, |
2543 | q15_t * pDst, |
2678 | uint32_t blockSize); |
2544 | uint32_t blockSize); |
2679 | 2545 | ||
- | 2546 | ||
2680 | /** |
2547 | /** |
2681 | * @brief Multiplies a Q31 vector by a scalar. |
2548 | * @brief Multiplies a Q31 vector by a scalar. |
2682 | * @param[in] *pSrc points to the input vector |
2549 | * @param[in] pSrc points to the input vector |
2683 | * @param[in] scaleFract fractional portion of the scale value |
2550 | * @param[in] scaleFract fractional portion of the scale value |
2684 | * @param[in] shift number of bits to shift the result by |
2551 | * @param[in] shift number of bits to shift the result by |
2685 | * @param[out] *pDst points to the output vector |
2552 | * @param[out] pDst points to the output vector |
2686 | * @param[in] blockSize number of samples in the vector |
2553 | * @param[in] blockSize number of samples in the vector |
2687 | * @return none. |
- | |
2688 | */ |
2554 | */ |
2689 | - | ||
2690 | void arm_scale_q31( |
2555 | void arm_scale_q31( |
2691 | q31_t * pSrc, |
2556 | q31_t * pSrc, |
2692 | q31_t scaleFract, |
2557 | q31_t scaleFract, |
2693 | int8_t shift, |
2558 | int8_t shift, |
2694 | q31_t * pDst, |
2559 | q31_t * pDst, |
2695 | uint32_t blockSize); |
2560 | uint32_t blockSize); |
2696 | 2561 | ||
- | 2562 | ||
2697 | /** |
2563 | /** |
2698 | * @brief Q7 vector absolute value. |
2564 | * @brief Q7 vector absolute value. |
2699 | * @param[in] *pSrc points to the input buffer |
2565 | * @param[in] pSrc points to the input buffer |
2700 | * @param[out] *pDst points to the output buffer |
2566 | * @param[out] pDst points to the output buffer |
2701 | * @param[in] blockSize number of samples in each vector |
2567 | * @param[in] blockSize number of samples in each vector |
2702 | * @return none. |
- | |
2703 | */ |
2568 | */ |
2704 | - | ||
2705 | void arm_abs_q7( |
2569 | void arm_abs_q7( |
2706 | q7_t * pSrc, |
2570 | q7_t * pSrc, |
2707 | q7_t * pDst, |
2571 | q7_t * pDst, |
2708 | uint32_t blockSize); |
2572 | uint32_t blockSize); |
2709 | 2573 | ||
- | 2574 | ||
2710 | /** |
2575 | /** |
2711 | * @brief Floating-point vector absolute value. |
2576 | * @brief Floating-point vector absolute value. |
2712 | * @param[in] *pSrc points to the input buffer |
2577 | * @param[in] pSrc points to the input buffer |
2713 | * @param[out] *pDst points to the output buffer |
2578 | * @param[out] pDst points to the output buffer |
2714 | * @param[in] blockSize number of samples in each vector |
2579 | * @param[in] blockSize number of samples in each vector |
2715 | * @return none. |
- | |
2716 | */ |
2580 | */ |
2717 | - | ||
2718 | void arm_abs_f32( |
2581 | void arm_abs_f32( |
2719 | float32_t * pSrc, |
2582 | float32_t * pSrc, |
2720 | float32_t * pDst, |
2583 | float32_t * pDst, |
2721 | uint32_t blockSize); |
2584 | uint32_t blockSize); |
2722 | 2585 | ||
- | 2586 | ||
2723 | /** |
2587 | /** |
2724 | * @brief Q15 vector absolute value. |
2588 | * @brief Q15 vector absolute value. |
2725 | * @param[in] *pSrc points to the input buffer |
2589 | * @param[in] pSrc points to the input buffer |
2726 | * @param[out] *pDst points to the output buffer |
2590 | * @param[out] pDst points to the output buffer |
2727 | * @param[in] blockSize number of samples in each vector |
2591 | * @param[in] blockSize number of samples in each vector |
2728 | * @return none. |
- | |
2729 | */ |
2592 | */ |
2730 | - | ||
2731 | void arm_abs_q15( |
2593 | void arm_abs_q15( |
2732 | q15_t * pSrc, |
2594 | q15_t * pSrc, |
2733 | q15_t * pDst, |
2595 | q15_t * pDst, |
2734 | uint32_t blockSize); |
2596 | uint32_t blockSize); |
2735 | 2597 | ||
- | 2598 | ||
2736 | /** |
2599 | /** |
2737 | * @brief Q31 vector absolute value. |
2600 | * @brief Q31 vector absolute value. |
2738 | * @param[in] *pSrc points to the input buffer |
2601 | * @param[in] pSrc points to the input buffer |
2739 | * @param[out] *pDst points to the output buffer |
2602 | * @param[out] pDst points to the output buffer |
2740 | * @param[in] blockSize number of samples in each vector |
2603 | * @param[in] blockSize number of samples in each vector |
2741 | * @return none. |
- | |
2742 | */ |
2604 | */ |
2743 | - | ||
2744 | void arm_abs_q31( |
2605 | void arm_abs_q31( |
2745 | q31_t * pSrc, |
2606 | q31_t * pSrc, |
2746 | q31_t * pDst, |
2607 | q31_t * pDst, |
2747 | uint32_t blockSize); |
2608 | uint32_t blockSize); |
2748 | 2609 | ||
- | 2610 | ||
2749 | /** |
2611 | /** |
2750 | * @brief Dot product of floating-point vectors. |
2612 | * @brief Dot product of floating-point vectors. |
2751 | * @param[in] *pSrcA points to the first input vector |
2613 | * @param[in] pSrcA points to the first input vector |
2752 | * @param[in] *pSrcB points to the second input vector |
2614 | * @param[in] pSrcB points to the second input vector |
2753 | * @param[in] blockSize number of samples in each vector |
2615 | * @param[in] blockSize number of samples in each vector |
2754 | * @param[out] *result output result returned here |
2616 | * @param[out] result output result returned here |
2755 | * @return none. |
- | |
2756 | */ |
2617 | */ |
2757 | - | ||
2758 | void arm_dot_prod_f32( |
2618 | void arm_dot_prod_f32( |
2759 | float32_t * pSrcA, |
2619 | float32_t * pSrcA, |
2760 | float32_t * pSrcB, |
2620 | float32_t * pSrcB, |
2761 | uint32_t blockSize, |
2621 | uint32_t blockSize, |
2762 | float32_t * result); |
2622 | float32_t * result); |
2763 | 2623 | ||
- | 2624 | ||
2764 | /** |
2625 | /** |
2765 | * @brief Dot product of Q7 vectors. |
2626 | * @brief Dot product of Q7 vectors. |
2766 | * @param[in] *pSrcA points to the first input vector |
2627 | * @param[in] pSrcA points to the first input vector |
2767 | * @param[in] *pSrcB points to the second input vector |
2628 | * @param[in] pSrcB points to the second input vector |
2768 | * @param[in] blockSize number of samples in each vector |
2629 | * @param[in] blockSize number of samples in each vector |
2769 | * @param[out] *result output result returned here |
2630 | * @param[out] result output result returned here |
2770 | * @return none. |
- | |
2771 | */ |
2631 | */ |
2772 | - | ||
2773 | void arm_dot_prod_q7( |
2632 | void arm_dot_prod_q7( |
2774 | q7_t * pSrcA, |
2633 | q7_t * pSrcA, |
2775 | q7_t * pSrcB, |
2634 | q7_t * pSrcB, |
2776 | uint32_t blockSize, |
2635 | uint32_t blockSize, |
2777 | q31_t * result); |
2636 | q31_t * result); |
2778 | 2637 | ||
- | 2638 | ||
2779 | /** |
2639 | /** |
2780 | * @brief Dot product of Q15 vectors. |
2640 | * @brief Dot product of Q15 vectors. |
2781 | * @param[in] *pSrcA points to the first input vector |
2641 | * @param[in] pSrcA points to the first input vector |
2782 | * @param[in] *pSrcB points to the second input vector |
2642 | * @param[in] pSrcB points to the second input vector |
2783 | * @param[in] blockSize number of samples in each vector |
2643 | * @param[in] blockSize number of samples in each vector |
2784 | * @param[out] *result output result returned here |
2644 | * @param[out] result output result returned here |
2785 | * @return none. |
- | |
2786 | */ |
2645 | */ |
2787 | - | ||
2788 | void arm_dot_prod_q15( |
2646 | void arm_dot_prod_q15( |
2789 | q15_t * pSrcA, |
2647 | q15_t * pSrcA, |
2790 | q15_t * pSrcB, |
2648 | q15_t * pSrcB, |
2791 | uint32_t blockSize, |
2649 | uint32_t blockSize, |
2792 | q63_t * result); |
2650 | q63_t * result); |
2793 | 2651 | ||
- | 2652 | ||
2794 | /** |
2653 | /** |
2795 | * @brief Dot product of Q31 vectors. |
2654 | * @brief Dot product of Q31 vectors. |
2796 | * @param[in] *pSrcA points to the first input vector |
2655 | * @param[in] pSrcA points to the first input vector |
2797 | * @param[in] *pSrcB points to the second input vector |
2656 | * @param[in] pSrcB points to the second input vector |
2798 | * @param[in] blockSize number of samples in each vector |
2657 | * @param[in] blockSize number of samples in each vector |
2799 | * @param[out] *result output result returned here |
2658 | * @param[out] result output result returned here |
2800 | * @return none. |
- | |
2801 | */ |
2659 | */ |
2802 | - | ||
2803 | void arm_dot_prod_q31( |
2660 | void arm_dot_prod_q31( |
2804 | q31_t * pSrcA, |
2661 | q31_t * pSrcA, |
2805 | q31_t * pSrcB, |
2662 | q31_t * pSrcB, |
2806 | uint32_t blockSize, |
2663 | uint32_t blockSize, |
2807 | q63_t * result); |
2664 | q63_t * result); |
2808 | 2665 | ||
- | 2666 | ||
2809 | /** |
2667 | /** |
2810 | * @brief Shifts the elements of a Q7 vector a specified number of bits. |
2668 | * @brief Shifts the elements of a Q7 vector a specified number of bits. |
2811 | * @param[in] *pSrc points to the input vector |
2669 | * @param[in] pSrc points to the input vector |
2812 | * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. |
2670 | * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. |
2813 | * @param[out] *pDst points to the output vector |
2671 | * @param[out] pDst points to the output vector |
2814 | * @param[in] blockSize number of samples in the vector |
2672 | * @param[in] blockSize number of samples in the vector |
2815 | * @return none. |
- | |
2816 | */ |
2673 | */ |
2817 | - | ||
2818 | void arm_shift_q7( |
2674 | void arm_shift_q7( |
2819 | q7_t * pSrc, |
2675 | q7_t * pSrc, |
2820 | int8_t shiftBits, |
2676 | int8_t shiftBits, |
2821 | q7_t * pDst, |
2677 | q7_t * pDst, |
2822 | uint32_t blockSize); |
2678 | uint32_t blockSize); |
2823 | 2679 | ||
- | 2680 | ||
2824 | /** |
2681 | /** |
2825 | * @brief Shifts the elements of a Q15 vector a specified number of bits. |
2682 | * @brief Shifts the elements of a Q15 vector a specified number of bits. |
2826 | * @param[in] *pSrc points to the input vector |
2683 | * @param[in] pSrc points to the input vector |
2827 | * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. |
2684 | * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. |
2828 | * @param[out] *pDst points to the output vector |
2685 | * @param[out] pDst points to the output vector |
2829 | * @param[in] blockSize number of samples in the vector |
2686 | * @param[in] blockSize number of samples in the vector |
2830 | * @return none. |
- | |
2831 | */ |
2687 | */ |
2832 | - | ||
2833 | void arm_shift_q15( |
2688 | void arm_shift_q15( |
2834 | q15_t * pSrc, |
2689 | q15_t * pSrc, |
2835 | int8_t shiftBits, |
2690 | int8_t shiftBits, |
2836 | q15_t * pDst, |
2691 | q15_t * pDst, |
2837 | uint32_t blockSize); |
2692 | uint32_t blockSize); |
2838 | 2693 | ||
- | 2694 | ||
2839 | /** |
2695 | /** |
2840 | * @brief Shifts the elements of a Q31 vector a specified number of bits. |
2696 | * @brief Shifts the elements of a Q31 vector a specified number of bits. |
2841 | * @param[in] *pSrc points to the input vector |
2697 | * @param[in] pSrc points to the input vector |
2842 | * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. |
2698 | * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. |
2843 | * @param[out] *pDst points to the output vector |
2699 | * @param[out] pDst points to the output vector |
2844 | * @param[in] blockSize number of samples in the vector |
2700 | * @param[in] blockSize number of samples in the vector |
2845 | * @return none. |
- | |
2846 | */ |
2701 | */ |
2847 | - | ||
2848 | void arm_shift_q31( |
2702 | void arm_shift_q31( |
2849 | q31_t * pSrc, |
2703 | q31_t * pSrc, |
2850 | int8_t shiftBits, |
2704 | int8_t shiftBits, |
2851 | q31_t * pDst, |
2705 | q31_t * pDst, |
2852 | uint32_t blockSize); |
2706 | uint32_t blockSize); |
2853 | 2707 | ||
- | 2708 | ||
2854 | /** |
2709 | /** |
2855 | * @brief Adds a constant offset to a floating-point vector. |
2710 | * @brief Adds a constant offset to a floating-point vector. |
2856 | * @param[in] *pSrc points to the input vector |
2711 | * @param[in] pSrc points to the input vector |
2857 | * @param[in] offset is the offset to be added |
2712 | * @param[in] offset is the offset to be added |
2858 | * @param[out] *pDst points to the output vector |
2713 | * @param[out] pDst points to the output vector |
2859 | * @param[in] blockSize number of samples in the vector |
2714 | * @param[in] blockSize number of samples in the vector |
2860 | * @return none. |
- | |
2861 | */ |
2715 | */ |
2862 | - | ||
2863 | void arm_offset_f32( |
2716 | void arm_offset_f32( |
2864 | float32_t * pSrc, |
2717 | float32_t * pSrc, |
2865 | float32_t offset, |
2718 | float32_t offset, |
2866 | float32_t * pDst, |
2719 | float32_t * pDst, |
2867 | uint32_t blockSize); |
2720 | uint32_t blockSize); |
2868 | 2721 | ||
- | 2722 | ||
2869 | /** |
2723 | /** |
2870 | * @brief Adds a constant offset to a Q7 vector. |
2724 | * @brief Adds a constant offset to a Q7 vector. |
2871 | * @param[in] *pSrc points to the input vector |
2725 | * @param[in] pSrc points to the input vector |
2872 | * @param[in] offset is the offset to be added |
2726 | * @param[in] offset is the offset to be added |
2873 | * @param[out] *pDst points to the output vector |
2727 | * @param[out] pDst points to the output vector |
2874 | * @param[in] blockSize number of samples in the vector |
2728 | * @param[in] blockSize number of samples in the vector |
2875 | * @return none. |
- | |
2876 | */ |
2729 | */ |
2877 | - | ||
2878 | void arm_offset_q7( |
2730 | void arm_offset_q7( |
2879 | q7_t * pSrc, |
2731 | q7_t * pSrc, |
2880 | q7_t offset, |
2732 | q7_t offset, |
2881 | q7_t * pDst, |
2733 | q7_t * pDst, |
2882 | uint32_t blockSize); |
2734 | uint32_t blockSize); |
2883 | 2735 | ||
- | 2736 | ||
2884 | /** |
2737 | /** |
2885 | * @brief Adds a constant offset to a Q15 vector. |
2738 | * @brief Adds a constant offset to a Q15 vector. |
2886 | * @param[in] *pSrc points to the input vector |
2739 | * @param[in] pSrc points to the input vector |
2887 | * @param[in] offset is the offset to be added |
2740 | * @param[in] offset is the offset to be added |
2888 | * @param[out] *pDst points to the output vector |
2741 | * @param[out] pDst points to the output vector |
2889 | * @param[in] blockSize number of samples in the vector |
2742 | * @param[in] blockSize number of samples in the vector |
2890 | * @return none. |
- | |
2891 | */ |
2743 | */ |
2892 | - | ||
2893 | void arm_offset_q15( |
2744 | void arm_offset_q15( |
2894 | q15_t * pSrc, |
2745 | q15_t * pSrc, |
2895 | q15_t offset, |
2746 | q15_t offset, |
2896 | q15_t * pDst, |
2747 | q15_t * pDst, |
2897 | uint32_t blockSize); |
2748 | uint32_t blockSize); |
2898 | 2749 | ||
- | 2750 | ||
2899 | /** |
2751 | /** |
2900 | * @brief Adds a constant offset to a Q31 vector. |
2752 | * @brief Adds a constant offset to a Q31 vector. |
2901 | * @param[in] *pSrc points to the input vector |
2753 | * @param[in] pSrc points to the input vector |
2902 | * @param[in] offset is the offset to be added |
2754 | * @param[in] offset is the offset to be added |
2903 | * @param[out] *pDst points to the output vector |
2755 | * @param[out] pDst points to the output vector |
2904 | * @param[in] blockSize number of samples in the vector |
2756 | * @param[in] blockSize number of samples in the vector |
2905 | * @return none. |
- | |
2906 | */ |
2757 | */ |
2907 | - | ||
2908 | void arm_offset_q31( |
2758 | void arm_offset_q31( |
2909 | q31_t * pSrc, |
2759 | q31_t * pSrc, |
2910 | q31_t offset, |
2760 | q31_t offset, |
2911 | q31_t * pDst, |
2761 | q31_t * pDst, |
2912 | uint32_t blockSize); |
2762 | uint32_t blockSize); |
2913 | 2763 | ||
- | 2764 | ||
2914 | /** |
2765 | /** |
2915 | * @brief Negates the elements of a floating-point vector. |
2766 | * @brief Negates the elements of a floating-point vector. |
2916 | * @param[in] *pSrc points to the input vector |
2767 | * @param[in] pSrc points to the input vector |
2917 | * @param[out] *pDst points to the output vector |
2768 | * @param[out] pDst points to the output vector |
2918 | * @param[in] blockSize number of samples in the vector |
2769 | * @param[in] blockSize number of samples in the vector |
2919 | * @return none. |
- | |
2920 | */ |
2770 | */ |
2921 | - | ||
2922 | void arm_negate_f32( |
2771 | void arm_negate_f32( |
2923 | float32_t * pSrc, |
2772 | float32_t * pSrc, |
2924 | float32_t * pDst, |
2773 | float32_t * pDst, |
2925 | uint32_t blockSize); |
2774 | uint32_t blockSize); |
2926 | 2775 | ||
- | 2776 | ||
2927 | /** |
2777 | /** |
2928 | * @brief Negates the elements of a Q7 vector. |
2778 | * @brief Negates the elements of a Q7 vector. |
2929 | * @param[in] *pSrc points to the input vector |
2779 | * @param[in] pSrc points to the input vector |
2930 | * @param[out] *pDst points to the output vector |
2780 | * @param[out] pDst points to the output vector |
2931 | * @param[in] blockSize number of samples in the vector |
2781 | * @param[in] blockSize number of samples in the vector |
2932 | * @return none. |
- | |
2933 | */ |
2782 | */ |
2934 | - | ||
2935 | void arm_negate_q7( |
2783 | void arm_negate_q7( |
2936 | q7_t * pSrc, |
2784 | q7_t * pSrc, |
2937 | q7_t * pDst, |
2785 | q7_t * pDst, |
2938 | uint32_t blockSize); |
2786 | uint32_t blockSize); |
2939 | 2787 | ||
- | 2788 | ||
2940 | /** |
2789 | /** |
2941 | * @brief Negates the elements of a Q15 vector. |
2790 | * @brief Negates the elements of a Q15 vector. |
2942 | * @param[in] *pSrc points to the input vector |
2791 | * @param[in] pSrc points to the input vector |
2943 | * @param[out] *pDst points to the output vector |
2792 | * @param[out] pDst points to the output vector |
2944 | * @param[in] blockSize number of samples in the vector |
2793 | * @param[in] blockSize number of samples in the vector |
2945 | * @return none. |
- | |
2946 | */ |
2794 | */ |
2947 | - | ||
2948 | void arm_negate_q15( |
2795 | void arm_negate_q15( |
2949 | q15_t * pSrc, |
2796 | q15_t * pSrc, |
2950 | q15_t * pDst, |
2797 | q15_t * pDst, |
2951 | uint32_t blockSize); |
2798 | uint32_t blockSize); |
2952 | 2799 | ||
- | 2800 | ||
2953 | /** |
2801 | /** |
2954 | * @brief Negates the elements of a Q31 vector. |
2802 | * @brief Negates the elements of a Q31 vector. |
2955 | * @param[in] *pSrc points to the input vector |
2803 | * @param[in] pSrc points to the input vector |
2956 | * @param[out] *pDst points to the output vector |
2804 | * @param[out] pDst points to the output vector |
2957 | * @param[in] blockSize number of samples in the vector |
2805 | * @param[in] blockSize number of samples in the vector |
2958 | * @return none. |
- | |
2959 | */ |
2806 | */ |
2960 | - | ||
2961 | void arm_negate_q31( |
2807 | void arm_negate_q31( |
2962 | q31_t * pSrc, |
2808 | q31_t * pSrc, |
2963 | q31_t * pDst, |
2809 | q31_t * pDst, |
2964 | uint32_t blockSize); |
2810 | uint32_t blockSize); |
- | 2811 | ||
- | 2812 | ||
2965 | /** |
2813 | /** |
2966 | * @brief Copies the elements of a floating-point vector. |
2814 | * @brief Copies the elements of a floating-point vector. |
2967 | * @param[in] *pSrc input pointer |
2815 | * @param[in] pSrc input pointer |
2968 | * @param[out] *pDst output pointer |
2816 | * @param[out] pDst output pointer |
2969 | * @param[in] blockSize number of samples to process |
2817 | * @param[in] blockSize number of samples to process |
2970 | * @return none. |
- | |
2971 | */ |
2818 | */ |
2972 | void arm_copy_f32( |
2819 | void arm_copy_f32( |
2973 | float32_t * pSrc, |
2820 | float32_t * pSrc, |
2974 | float32_t * pDst, |
2821 | float32_t * pDst, |
2975 | uint32_t blockSize); |
2822 | uint32_t blockSize); |
2976 | 2823 | ||
- | 2824 | ||
2977 | /** |
2825 | /** |
2978 | * @brief Copies the elements of a Q7 vector. |
2826 | * @brief Copies the elements of a Q7 vector. |
2979 | * @param[in] *pSrc input pointer |
2827 | * @param[in] pSrc input pointer |
2980 | * @param[out] *pDst output pointer |
2828 | * @param[out] pDst output pointer |
2981 | * @param[in] blockSize number of samples to process |
2829 | * @param[in] blockSize number of samples to process |
2982 | * @return none. |
- | |
2983 | */ |
2830 | */ |
2984 | void arm_copy_q7( |
2831 | void arm_copy_q7( |
2985 | q7_t * pSrc, |
2832 | q7_t * pSrc, |
2986 | q7_t * pDst, |
2833 | q7_t * pDst, |
2987 | uint32_t blockSize); |
2834 | uint32_t blockSize); |
2988 | 2835 | ||
- | 2836 | ||
2989 | /** |
2837 | /** |
2990 | * @brief Copies the elements of a Q15 vector. |
2838 | * @brief Copies the elements of a Q15 vector. |
2991 | * @param[in] *pSrc input pointer |
2839 | * @param[in] pSrc input pointer |
2992 | * @param[out] *pDst output pointer |
2840 | * @param[out] pDst output pointer |
2993 | * @param[in] blockSize number of samples to process |
2841 | * @param[in] blockSize number of samples to process |
2994 | * @return none. |
- | |
2995 | */ |
2842 | */ |
2996 | void arm_copy_q15( |
2843 | void arm_copy_q15( |
2997 | q15_t * pSrc, |
2844 | q15_t * pSrc, |
2998 | q15_t * pDst, |
2845 | q15_t * pDst, |
2999 | uint32_t blockSize); |
2846 | uint32_t blockSize); |
3000 | 2847 | ||
- | 2848 | ||
3001 | /** |
2849 | /** |
3002 | * @brief Copies the elements of a Q31 vector. |
2850 | * @brief Copies the elements of a Q31 vector. |
3003 | * @param[in] *pSrc input pointer |
2851 | * @param[in] pSrc input pointer |
3004 | * @param[out] *pDst output pointer |
2852 | * @param[out] pDst output pointer |
3005 | * @param[in] blockSize number of samples to process |
2853 | * @param[in] blockSize number of samples to process |
3006 | * @return none. |
- | |
3007 | */ |
2854 | */ |
3008 | void arm_copy_q31( |
2855 | void arm_copy_q31( |
3009 | q31_t * pSrc, |
2856 | q31_t * pSrc, |
3010 | q31_t * pDst, |
2857 | q31_t * pDst, |
3011 | uint32_t blockSize); |
2858 | uint32_t blockSize); |
- | 2859 | ||
- | 2860 | ||
3012 | /** |
2861 | /** |
3013 | * @brief Fills a constant value into a floating-point vector. |
2862 | * @brief Fills a constant value into a floating-point vector. |
3014 | * @param[in] value input value to be filled |
2863 | * @param[in] value input value to be filled |
3015 | * @param[out] *pDst output pointer |
2864 | * @param[out] pDst output pointer |
3016 | * @param[in] blockSize number of samples to process |
2865 | * @param[in] blockSize number of samples to process |
3017 | * @return none. |
- | |
3018 | */ |
2866 | */ |
3019 | void arm_fill_f32( |
2867 | void arm_fill_f32( |
3020 | float32_t value, |
2868 | float32_t value, |
3021 | float32_t * pDst, |
2869 | float32_t * pDst, |
3022 | uint32_t blockSize); |
2870 | uint32_t blockSize); |
3023 | 2871 | ||
- | 2872 | ||
3024 | /** |
2873 | /** |
3025 | * @brief Fills a constant value into a Q7 vector. |
2874 | * @brief Fills a constant value into a Q7 vector. |
3026 | * @param[in] value input value to be filled |
2875 | * @param[in] value input value to be filled |
3027 | * @param[out] *pDst output pointer |
2876 | * @param[out] pDst output pointer |
3028 | * @param[in] blockSize number of samples to process |
2877 | * @param[in] blockSize number of samples to process |
3029 | * @return none. |
- | |
3030 | */ |
2878 | */ |
3031 | void arm_fill_q7( |
2879 | void arm_fill_q7( |
3032 | q7_t value, |
2880 | q7_t value, |
3033 | q7_t * pDst, |
2881 | q7_t * pDst, |
3034 | uint32_t blockSize); |
2882 | uint32_t blockSize); |
3035 | 2883 | ||
- | 2884 | ||
3036 | /** |
2885 | /** |
3037 | * @brief Fills a constant value into a Q15 vector. |
2886 | * @brief Fills a constant value into a Q15 vector. |
3038 | * @param[in] value input value to be filled |
2887 | * @param[in] value input value to be filled |
3039 | * @param[out] *pDst output pointer |
2888 | * @param[out] pDst output pointer |
3040 | * @param[in] blockSize number of samples to process |
2889 | * @param[in] blockSize number of samples to process |
3041 | * @return none. |
- | |
3042 | */ |
2890 | */ |
3043 | void arm_fill_q15( |
2891 | void arm_fill_q15( |
3044 | q15_t value, |
2892 | q15_t value, |
3045 | q15_t * pDst, |
2893 | q15_t * pDst, |
3046 | uint32_t blockSize); |
2894 | uint32_t blockSize); |
3047 | 2895 | ||
- | 2896 | ||
3048 | /** |
2897 | /** |
3049 | * @brief Fills a constant value into a Q31 vector. |
2898 | * @brief Fills a constant value into a Q31 vector. |
3050 | * @param[in] value input value to be filled |
2899 | * @param[in] value input value to be filled |
3051 | * @param[out] *pDst output pointer |
2900 | * @param[out] pDst output pointer |
3052 | * @param[in] blockSize number of samples to process |
2901 | * @param[in] blockSize number of samples to process |
3053 | * @return none. |
- | |
3054 | */ |
2902 | */ |
3055 | void arm_fill_q31( |
2903 | void arm_fill_q31( |
3056 | q31_t value, |
2904 | q31_t value, |
3057 | q31_t * pDst, |
2905 | q31_t * pDst, |
3058 | uint32_t blockSize); |
2906 | uint32_t blockSize); |
3059 | 2907 | ||
- | 2908 | ||
3060 | /** |
2909 | /** |
3061 | * @brief Convolution of floating-point sequences. |
2910 | * @brief Convolution of floating-point sequences. |
3062 | * @param[in] *pSrcA points to the first input sequence. |
2911 | * @param[in] pSrcA points to the first input sequence. |
3063 | * @param[in] srcALen length of the first input sequence. |
2912 | * @param[in] srcALen length of the first input sequence. |
3064 | * @param[in] *pSrcB points to the second input sequence. |
2913 | * @param[in] pSrcB points to the second input sequence. |
3065 | * @param[in] srcBLen length of the second input sequence. |
2914 | * @param[in] srcBLen length of the second input sequence. |
3066 | * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1. |
2915 | * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. |
3067 | * @return none. |
- | |
3068 | */ |
2916 | */ |
3069 | - | ||
3070 | void arm_conv_f32( |
2917 | void arm_conv_f32( |
3071 | float32_t * pSrcA, |
2918 | float32_t * pSrcA, |
3072 | uint32_t srcALen, |
2919 | uint32_t srcALen, |
3073 | float32_t * pSrcB, |
2920 | float32_t * pSrcB, |
3074 | uint32_t srcBLen, |
2921 | uint32_t srcBLen, |
3075 | float32_t * pDst); |
2922 | float32_t * pDst); |
3076 | 2923 | ||
3077 | 2924 | ||
3078 | /** |
2925 | /** |
3079 | * @brief Convolution of Q15 sequences. |
2926 | * @brief Convolution of Q15 sequences. |
3080 | * @param[in] *pSrcA points to the first input sequence. |
2927 | * @param[in] pSrcA points to the first input sequence. |
3081 | * @param[in] srcALen length of the first input sequence. |
2928 | * @param[in] srcALen length of the first input sequence. |
3082 | * @param[in] *pSrcB points to the second input sequence. |
2929 | * @param[in] pSrcB points to the second input sequence. |
3083 | * @param[in] srcBLen length of the second input sequence. |
2930 | * @param[in] srcBLen length of the second input sequence. |
3084 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
2931 | * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. |
3085 | * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
2932 | * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
3086 | * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
2933 | * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
3087 | * @return none. |
- | |
3088 | */ |
2934 | */ |
3089 | - | ||
3090 | - | ||
3091 | void arm_conv_opt_q15( |
2935 | void arm_conv_opt_q15( |
3092 | q15_t * pSrcA, |
2936 | q15_t * pSrcA, |
3093 | uint32_t srcALen, |
2937 | uint32_t srcALen, |
3094 | q15_t * pSrcB, |
2938 | q15_t * pSrcB, |
3095 | uint32_t srcBLen, |
2939 | uint32_t srcBLen, |
Line 3098... | Line 2942... | ||
3098 | q15_t * pScratch2); |
2942 | q15_t * pScratch2); |
3099 | 2943 | ||
3100 | 2944 | ||
3101 | /** |
2945 | /** |
3102 | * @brief Convolution of Q15 sequences. |
2946 | * @brief Convolution of Q15 sequences. |
3103 | * @param[in] *pSrcA points to the first input sequence. |
2947 | * @param[in] pSrcA points to the first input sequence. |
3104 | * @param[in] srcALen length of the first input sequence. |
2948 | * @param[in] srcALen length of the first input sequence. |
3105 | * @param[in] *pSrcB points to the second input sequence. |
2949 | * @param[in] pSrcB points to the second input sequence. |
3106 | * @param[in] srcBLen length of the second input sequence. |
2950 | * @param[in] srcBLen length of the second input sequence. |
3107 | * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1. |
2951 | * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. |
3108 | * @return none. |
- | |
3109 | */ |
2952 | */ |
3110 | - | ||
3111 | void arm_conv_q15( |
2953 | void arm_conv_q15( |
3112 | q15_t * pSrcA, |
2954 | q15_t * pSrcA, |
3113 | uint32_t srcALen, |
2955 | uint32_t srcALen, |
3114 | q15_t * pSrcB, |
2956 | q15_t * pSrcB, |
3115 | uint32_t srcBLen, |
2957 | uint32_t srcBLen, |
3116 | q15_t * pDst); |
2958 | q15_t * pDst); |
3117 | 2959 | ||
- | 2960 | ||
3118 | /** |
2961 | /** |
3119 | * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
2962 | * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
3120 | * @param[in] *pSrcA points to the first input sequence. |
2963 | * @param[in] pSrcA points to the first input sequence. |
3121 | * @param[in] srcALen length of the first input sequence. |
2964 | * @param[in] srcALen length of the first input sequence. |
3122 | * @param[in] *pSrcB points to the second input sequence. |
2965 | * @param[in] pSrcB points to the second input sequence. |
3123 | * @param[in] srcBLen length of the second input sequence. |
2966 | * @param[in] srcBLen length of the second input sequence. |
3124 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
2967 | * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. |
3125 | * @return none. |
- | |
3126 | */ |
2968 | */ |
3127 | - | ||
3128 | void arm_conv_fast_q15( |
2969 | void arm_conv_fast_q15( |
3129 | q15_t * pSrcA, |
2970 | q15_t * pSrcA, |
3130 | uint32_t srcALen, |
2971 | uint32_t srcALen, |
3131 | q15_t * pSrcB, |
2972 | q15_t * pSrcB, |
3132 | uint32_t srcBLen, |
2973 | uint32_t srcBLen, |
3133 | q15_t * pDst); |
2974 | q15_t * pDst); |
- | 2975 | ||
3134 | 2976 | ||
3135 | /** |
2977 | /** |
3136 | * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
2978 | * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
3137 | * @param[in] *pSrcA points to the first input sequence. |
2979 | * @param[in] pSrcA points to the first input sequence. |
3138 | * @param[in] srcALen length of the first input sequence. |
2980 | * @param[in] srcALen length of the first input sequence. |
3139 | * @param[in] *pSrcB points to the second input sequence. |
2981 | * @param[in] pSrcB points to the second input sequence. |
3140 | * @param[in] srcBLen length of the second input sequence. |
2982 | * @param[in] srcBLen length of the second input sequence. |
3141 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
2983 | * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. |
3142 | * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
2984 | * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
3143 | * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
2985 | * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
3144 | * @return none. |
- | |
3145 | */ |
2986 | */ |
3146 | - | ||
3147 | void arm_conv_fast_opt_q15( |
2987 | void arm_conv_fast_opt_q15( |
3148 | q15_t * pSrcA, |
2988 | q15_t * pSrcA, |
3149 | uint32_t srcALen, |
2989 | uint32_t srcALen, |
3150 | q15_t * pSrcB, |
2990 | q15_t * pSrcB, |
3151 | uint32_t srcBLen, |
2991 | uint32_t srcBLen, |
3152 | q15_t * pDst, |
2992 | q15_t * pDst, |
3153 | q15_t * pScratch1, |
2993 | q15_t * pScratch1, |
3154 | q15_t * pScratch2); |
2994 | q15_t * pScratch2); |
3155 | 2995 | ||
3156 | 2996 | ||
3157 | - | ||
3158 | /** |
2997 | /** |
3159 | * @brief Convolution of Q31 sequences. |
2998 | * @brief Convolution of Q31 sequences. |
3160 | * @param[in] *pSrcA points to the first input sequence. |
2999 | * @param[in] pSrcA points to the first input sequence. |
3161 | * @param[in] srcALen length of the first input sequence. |
3000 | * @param[in] srcALen length of the first input sequence. |
3162 | * @param[in] *pSrcB points to the second input sequence. |
3001 | * @param[in] pSrcB points to the second input sequence. |
3163 | * @param[in] srcBLen length of the second input sequence. |
3002 | * @param[in] srcBLen length of the second input sequence. |
3164 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
3003 | * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. |
3165 | * @return none. |
- | |
3166 | */ |
3004 | */ |
3167 | - | ||
3168 | void arm_conv_q31( |
3005 | void arm_conv_q31( |
3169 | q31_t * pSrcA, |
3006 | q31_t * pSrcA, |
3170 | uint32_t srcALen, |
3007 | uint32_t srcALen, |
3171 | q31_t * pSrcB, |
3008 | q31_t * pSrcB, |
3172 | uint32_t srcBLen, |
3009 | uint32_t srcBLen, |
3173 | q31_t * pDst); |
3010 | q31_t * pDst); |
3174 | 3011 | ||
- | 3012 | ||
3175 | /** |
3013 | /** |
3176 | * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 |
3014 | * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 |
3177 | * @param[in] *pSrcA points to the first input sequence. |
3015 | * @param[in] pSrcA points to the first input sequence. |
3178 | * @param[in] srcALen length of the first input sequence. |
3016 | * @param[in] srcALen length of the first input sequence. |
3179 | * @param[in] *pSrcB points to the second input sequence. |
3017 | * @param[in] pSrcB points to the second input sequence. |
3180 | * @param[in] srcBLen length of the second input sequence. |
3018 | * @param[in] srcBLen length of the second input sequence. |
3181 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
3019 | * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. |
3182 | * @return none. |
- | |
3183 | */ |
3020 | */ |
3184 | - | ||
3185 | void arm_conv_fast_q31( |
3021 | void arm_conv_fast_q31( |
3186 | q31_t * pSrcA, |
3022 | q31_t * pSrcA, |
3187 | uint32_t srcALen, |
3023 | uint32_t srcALen, |
3188 | q31_t * pSrcB, |
3024 | q31_t * pSrcB, |
3189 | uint32_t srcBLen, |
3025 | uint32_t srcBLen, |
3190 | q31_t * pDst); |
3026 | q31_t * pDst); |
3191 | 3027 | ||
3192 | 3028 | ||
3193 | /** |
3029 | /** |
3194 | * @brief Convolution of Q7 sequences. |
3030 | * @brief Convolution of Q7 sequences. |
3195 | * @param[in] *pSrcA points to the first input sequence. |
3031 | * @param[in] pSrcA points to the first input sequence. |
3196 | * @param[in] srcALen length of the first input sequence. |
3032 | * @param[in] srcALen length of the first input sequence. |
3197 | * @param[in] *pSrcB points to the second input sequence. |
3033 | * @param[in] pSrcB points to the second input sequence. |
3198 | * @param[in] srcBLen length of the second input sequence. |
3034 | * @param[in] srcBLen length of the second input sequence. |
3199 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
3035 | * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. |
3200 | * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
3036 | * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
3201 | * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). |
3037 | * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). |
3202 | * @return none. |
- | |
3203 | */ |
3038 | */ |
3204 | - | ||
3205 | void arm_conv_opt_q7( |
3039 | void arm_conv_opt_q7( |
3206 | q7_t * pSrcA, |
3040 | q7_t * pSrcA, |
3207 | uint32_t srcALen, |
3041 | uint32_t srcALen, |
3208 | q7_t * pSrcB, |
3042 | q7_t * pSrcB, |
3209 | uint32_t srcBLen, |
3043 | uint32_t srcBLen, |
3210 | q7_t * pDst, |
3044 | q7_t * pDst, |
3211 | q15_t * pScratch1, |
3045 | q15_t * pScratch1, |
3212 | q15_t * pScratch2); |
3046 | q15_t * pScratch2); |
3213 | 3047 | ||
3214 | 3048 | ||
3215 | - | ||
3216 | /** |
3049 | /** |
3217 | * @brief Convolution of Q7 sequences. |
3050 | * @brief Convolution of Q7 sequences. |
3218 | * @param[in] *pSrcA points to the first input sequence. |
3051 | * @param[in] pSrcA points to the first input sequence. |
3219 | * @param[in] srcALen length of the first input sequence. |
3052 | * @param[in] srcALen length of the first input sequence. |
3220 | * @param[in] *pSrcB points to the second input sequence. |
3053 | * @param[in] pSrcB points to the second input sequence. |
3221 | * @param[in] srcBLen length of the second input sequence. |
3054 | * @param[in] srcBLen length of the second input sequence. |
3222 | * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. |
3055 | * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. |
3223 | * @return none. |
- | |
3224 | */ |
3056 | */ |
3225 | - | ||
3226 | void arm_conv_q7( |
3057 | void arm_conv_q7( |
3227 | q7_t * pSrcA, |
3058 | q7_t * pSrcA, |
3228 | uint32_t srcALen, |
3059 | uint32_t srcALen, |
3229 | q7_t * pSrcB, |
3060 | q7_t * pSrcB, |
3230 | uint32_t srcBLen, |
3061 | uint32_t srcBLen, |
3231 | q7_t * pDst); |
3062 | q7_t * pDst); |
3232 | 3063 | ||
3233 | 3064 | ||
3234 | /** |
3065 | /** |
3235 | * @brief Partial convolution of floating-point sequences. |
3066 | * @brief Partial convolution of floating-point sequences. |
3236 | * @param[in] *pSrcA points to the first input sequence. |
3067 | * @param[in] pSrcA points to the first input sequence. |
3237 | * @param[in] srcALen length of the first input sequence. |
3068 | * @param[in] srcALen length of the first input sequence. |
3238 | * @param[in] *pSrcB points to the second input sequence. |
3069 | * @param[in] pSrcB points to the second input sequence. |
3239 | * @param[in] srcBLen length of the second input sequence. |
3070 | * @param[in] srcBLen length of the second input sequence. |
3240 | * @param[out] *pDst points to the block of output data |
3071 | * @param[out] pDst points to the block of output data |
3241 | * @param[in] firstIndex is the first output sample to start with. |
3072 | * @param[in] firstIndex is the first output sample to start with. |
3242 | * @param[in] numPoints is the number of output points to be computed. |
3073 | * @param[in] numPoints is the number of output points to be computed. |
3243 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3074 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3244 | */ |
3075 | */ |
3245 | - | ||
3246 | arm_status arm_conv_partial_f32( |
3076 | arm_status arm_conv_partial_f32( |
3247 | float32_t * pSrcA, |
3077 | float32_t * pSrcA, |
3248 | uint32_t srcALen, |
3078 | uint32_t srcALen, |
3249 | float32_t * pSrcB, |
3079 | float32_t * pSrcB, |
3250 | uint32_t srcBLen, |
3080 | uint32_t srcBLen, |
3251 | float32_t * pDst, |
3081 | float32_t * pDst, |
3252 | uint32_t firstIndex, |
3082 | uint32_t firstIndex, |
3253 | uint32_t numPoints); |
3083 | uint32_t numPoints); |
3254 | 3084 | ||
- | 3085 | ||
3255 | /** |
3086 | /** |
3256 | * @brief Partial convolution of Q15 sequences. |
3087 | * @brief Partial convolution of Q15 sequences. |
3257 | * @param[in] *pSrcA points to the first input sequence. |
3088 | * @param[in] pSrcA points to the first input sequence. |
3258 | * @param[in] srcALen length of the first input sequence. |
3089 | * @param[in] srcALen length of the first input sequence. |
3259 | * @param[in] *pSrcB points to the second input sequence. |
3090 | * @param[in] pSrcB points to the second input sequence. |
3260 | * @param[in] srcBLen length of the second input sequence. |
3091 | * @param[in] srcBLen length of the second input sequence. |
3261 | * @param[out] *pDst points to the block of output data |
3092 | * @param[out] pDst points to the block of output data |
3262 | * @param[in] firstIndex is the first output sample to start with. |
3093 | * @param[in] firstIndex is the first output sample to start with. |
3263 | * @param[in] numPoints is the number of output points to be computed. |
3094 | * @param[in] numPoints is the number of output points to be computed. |
3264 | * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
3095 | * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
3265 | * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
3096 | * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
3266 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3097 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3267 | */ |
3098 | */ |
3268 | - | ||
3269 | arm_status arm_conv_partial_opt_q15( |
3099 | arm_status arm_conv_partial_opt_q15( |
3270 | q15_t * pSrcA, |
3100 | q15_t * pSrcA, |
3271 | uint32_t srcALen, |
3101 | uint32_t srcALen, |
3272 | q15_t * pSrcB, |
3102 | q15_t * pSrcB, |
3273 | uint32_t srcBLen, |
3103 | uint32_t srcBLen, |
Line 3276... | Line 3106... | ||
3276 | uint32_t numPoints, |
3106 | uint32_t numPoints, |
3277 | q15_t * pScratch1, |
3107 | q15_t * pScratch1, |
3278 | q15_t * pScratch2); |
3108 | q15_t * pScratch2); |
3279 | 3109 | ||
3280 | 3110 | ||
3281 | /** |
3111 | /** |
3282 | * @brief Partial convolution of Q15 sequences. |
3112 | * @brief Partial convolution of Q15 sequences. |
3283 | * @param[in] *pSrcA points to the first input sequence. |
3113 | * @param[in] pSrcA points to the first input sequence. |
3284 | * @param[in] srcALen length of the first input sequence. |
3114 | * @param[in] srcALen length of the first input sequence. |
3285 | * @param[in] *pSrcB points to the second input sequence. |
3115 | * @param[in] pSrcB points to the second input sequence. |
3286 | * @param[in] srcBLen length of the second input sequence. |
3116 | * @param[in] srcBLen length of the second input sequence. |
3287 | * @param[out] *pDst points to the block of output data |
3117 | * @param[out] pDst points to the block of output data |
3288 | * @param[in] firstIndex is the first output sample to start with. |
3118 | * @param[in] firstIndex is the first output sample to start with. |
3289 | * @param[in] numPoints is the number of output points to be computed. |
3119 | * @param[in] numPoints is the number of output points to be computed. |
3290 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3120 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3291 | */ |
3121 | */ |
3292 | - | ||
3293 | arm_status arm_conv_partial_q15( |
3122 | arm_status arm_conv_partial_q15( |
3294 | q15_t * pSrcA, |
3123 | q15_t * pSrcA, |
3295 | uint32_t srcALen, |
3124 | uint32_t srcALen, |
3296 | q15_t * pSrcB, |
3125 | q15_t * pSrcB, |
3297 | uint32_t srcBLen, |
3126 | uint32_t srcBLen, |
3298 | q15_t * pDst, |
3127 | q15_t * pDst, |
3299 | uint32_t firstIndex, |
3128 | uint32_t firstIndex, |
3300 | uint32_t numPoints); |
3129 | uint32_t numPoints); |
3301 | 3130 | ||
- | 3131 | ||
3302 | /** |
3132 | /** |
3303 | * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
3133 | * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
3304 | * @param[in] *pSrcA points to the first input sequence. |
3134 | * @param[in] pSrcA points to the first input sequence. |
3305 | * @param[in] srcALen length of the first input sequence. |
3135 | * @param[in] srcALen length of the first input sequence. |
3306 | * @param[in] *pSrcB points to the second input sequence. |
3136 | * @param[in] pSrcB points to the second input sequence. |
3307 | * @param[in] srcBLen length of the second input sequence. |
3137 | * @param[in] srcBLen length of the second input sequence. |
3308 | * @param[out] *pDst points to the block of output data |
3138 | * @param[out] pDst points to the block of output data |
3309 | * @param[in] firstIndex is the first output sample to start with. |
3139 | * @param[in] firstIndex is the first output sample to start with. |
3310 | * @param[in] numPoints is the number of output points to be computed. |
3140 | * @param[in] numPoints is the number of output points to be computed. |
3311 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3141 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3312 | */ |
3142 | */ |
3313 | - | ||
3314 | arm_status arm_conv_partial_fast_q15( |
3143 | arm_status arm_conv_partial_fast_q15( |
3315 | q15_t * pSrcA, |
3144 | q15_t * pSrcA, |
3316 | uint32_t srcALen, |
3145 | uint32_t srcALen, |
3317 | q15_t * pSrcB, |
3146 | q15_t * pSrcB, |
3318 | uint32_t srcBLen, |
3147 | uint32_t srcBLen, |
3319 | q15_t * pDst, |
3148 | q15_t * pDst, |
3320 | uint32_t firstIndex, |
3149 | uint32_t firstIndex, |
3321 | uint32_t numPoints); |
3150 | uint32_t numPoints); |
3322 | 3151 | ||
3323 | 3152 | ||
3324 | /** |
3153 | /** |
3325 | * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
3154 | * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 |
3326 | * @param[in] *pSrcA points to the first input sequence. |
3155 | * @param[in] pSrcA points to the first input sequence. |
3327 | * @param[in] srcALen length of the first input sequence. |
3156 | * @param[in] srcALen length of the first input sequence. |
3328 | * @param[in] *pSrcB points to the second input sequence. |
3157 | * @param[in] pSrcB points to the second input sequence. |
3329 | * @param[in] srcBLen length of the second input sequence. |
3158 | * @param[in] srcBLen length of the second input sequence. |
3330 | * @param[out] *pDst points to the block of output data |
3159 | * @param[out] pDst points to the block of output data |
3331 | * @param[in] firstIndex is the first output sample to start with. |
3160 | * @param[in] firstIndex is the first output sample to start with. |
3332 | * @param[in] numPoints is the number of output points to be computed. |
3161 | * @param[in] numPoints is the number of output points to be computed. |
3333 | * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
3162 | * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
3334 | * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
3163 | * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). |
3335 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3164 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3336 | */ |
3165 | */ |
3337 | - | ||
3338 | arm_status arm_conv_partial_fast_opt_q15( |
3166 | arm_status arm_conv_partial_fast_opt_q15( |
3339 | q15_t * pSrcA, |
3167 | q15_t * pSrcA, |
3340 | uint32_t srcALen, |
3168 | uint32_t srcALen, |
3341 | q15_t * pSrcB, |
3169 | q15_t * pSrcB, |
3342 | uint32_t srcBLen, |
3170 | uint32_t srcBLen, |
Line 3347... | Line 3175... | ||
3347 | q15_t * pScratch2); |
3175 | q15_t * pScratch2); |
3348 | 3176 | ||
3349 | 3177 | ||
3350 | /** |
3178 | /** |
3351 | * @brief Partial convolution of Q31 sequences. |
3179 | * @brief Partial convolution of Q31 sequences. |
3352 | * @param[in] *pSrcA points to the first input sequence. |
3180 | * @param[in] pSrcA points to the first input sequence. |
3353 | * @param[in] srcALen length of the first input sequence. |
3181 | * @param[in] srcALen length of the first input sequence. |
3354 | * @param[in] *pSrcB points to the second input sequence. |
3182 | * @param[in] pSrcB points to the second input sequence. |
3355 | * @param[in] srcBLen length of the second input sequence. |
3183 | * @param[in] srcBLen length of the second input sequence. |
3356 | * @param[out] *pDst points to the block of output data |
3184 | * @param[out] pDst points to the block of output data |
3357 | * @param[in] firstIndex is the first output sample to start with. |
3185 | * @param[in] firstIndex is the first output sample to start with. |
3358 | * @param[in] numPoints is the number of output points to be computed. |
3186 | * @param[in] numPoints is the number of output points to be computed. |
3359 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3187 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3360 | */ |
3188 | */ |
3361 | - | ||
3362 | arm_status arm_conv_partial_q31( |
3189 | arm_status arm_conv_partial_q31( |
3363 | q31_t * pSrcA, |
3190 | q31_t * pSrcA, |
3364 | uint32_t srcALen, |
3191 | uint32_t srcALen, |
3365 | q31_t * pSrcB, |
3192 | q31_t * pSrcB, |
3366 | uint32_t srcBLen, |
3193 | uint32_t srcBLen, |
Line 3369... | Line 3196... | ||
3369 | uint32_t numPoints); |
3196 | uint32_t numPoints); |
3370 | 3197 | ||
3371 | 3198 | ||
3372 | /** |
3199 | /** |
3373 | * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 |
3200 | * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 |
3374 | * @param[in] *pSrcA points to the first input sequence. |
3201 | * @param[in] pSrcA points to the first input sequence. |
3375 | * @param[in] srcALen length of the first input sequence. |
3202 | * @param[in] srcALen length of the first input sequence. |
3376 | * @param[in] *pSrcB points to the second input sequence. |
3203 | * @param[in] pSrcB points to the second input sequence. |
3377 | * @param[in] srcBLen length of the second input sequence. |
3204 | * @param[in] srcBLen length of the second input sequence. |
3378 | * @param[out] *pDst points to the block of output data |
3205 | * @param[out] pDst points to the block of output data |
3379 | * @param[in] firstIndex is the first output sample to start with. |
3206 | * @param[in] firstIndex is the first output sample to start with. |
3380 | * @param[in] numPoints is the number of output points to be computed. |
3207 | * @param[in] numPoints is the number of output points to be computed. |
3381 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3208 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3382 | */ |
3209 | */ |
3383 | - | ||
3384 | arm_status arm_conv_partial_fast_q31( |
3210 | arm_status arm_conv_partial_fast_q31( |
3385 | q31_t * pSrcA, |
3211 | q31_t * pSrcA, |
3386 | uint32_t srcALen, |
3212 | uint32_t srcALen, |
3387 | q31_t * pSrcB, |
3213 | q31_t * pSrcB, |
3388 | uint32_t srcBLen, |
3214 | uint32_t srcBLen, |
Line 3391... | Line 3217... | ||
3391 | uint32_t numPoints); |
3217 | uint32_t numPoints); |
3392 | 3218 | ||
3393 | 3219 | ||
3394 | /** |
3220 | /** |
3395 | * @brief Partial convolution of Q7 sequences |
3221 | * @brief Partial convolution of Q7 sequences |
3396 | * @param[in] *pSrcA points to the first input sequence. |
3222 | * @param[in] pSrcA points to the first input sequence. |
3397 | * @param[in] srcALen length of the first input sequence. |
3223 | * @param[in] srcALen length of the first input sequence. |
3398 | * @param[in] *pSrcB points to the second input sequence. |
3224 | * @param[in] pSrcB points to the second input sequence. |
3399 | * @param[in] srcBLen length of the second input sequence. |
3225 | * @param[in] srcBLen length of the second input sequence. |
3400 | * @param[out] *pDst points to the block of output data |
3226 | * @param[out] pDst points to the block of output data |
3401 | * @param[in] firstIndex is the first output sample to start with. |
3227 | * @param[in] firstIndex is the first output sample to start with. |
3402 | * @param[in] numPoints is the number of output points to be computed. |
3228 | * @param[in] numPoints is the number of output points to be computed. |
3403 | * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
3229 | * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
3404 | * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). |
3230 | * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). |
3405 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3231 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3406 | */ |
3232 | */ |
3407 | - | ||
3408 | arm_status arm_conv_partial_opt_q7( |
3233 | arm_status arm_conv_partial_opt_q7( |
3409 | q7_t * pSrcA, |
3234 | q7_t * pSrcA, |
3410 | uint32_t srcALen, |
3235 | uint32_t srcALen, |
3411 | q7_t * pSrcB, |
3236 | q7_t * pSrcB, |
3412 | uint32_t srcBLen, |
3237 | uint32_t srcBLen, |
Line 3417... | Line 3242... | ||
3417 | q15_t * pScratch2); |
3242 | q15_t * pScratch2); |
3418 | 3243 | ||
3419 | 3244 | ||
3420 | /** |
3245 | /** |
3421 | * @brief Partial convolution of Q7 sequences. |
3246 | * @brief Partial convolution of Q7 sequences. |
3422 | * @param[in] *pSrcA points to the first input sequence. |
3247 | * @param[in] pSrcA points to the first input sequence. |
3423 | * @param[in] srcALen length of the first input sequence. |
3248 | * @param[in] srcALen length of the first input sequence. |
3424 | * @param[in] *pSrcB points to the second input sequence. |
3249 | * @param[in] pSrcB points to the second input sequence. |
3425 | * @param[in] srcBLen length of the second input sequence. |
3250 | * @param[in] srcBLen length of the second input sequence. |
3426 | * @param[out] *pDst points to the block of output data |
3251 | * @param[out] pDst points to the block of output data |
3427 | * @param[in] firstIndex is the first output sample to start with. |
3252 | * @param[in] firstIndex is the first output sample to start with. |
3428 | * @param[in] numPoints is the number of output points to be computed. |
3253 | * @param[in] numPoints is the number of output points to be computed. |
3429 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3254 | * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. |
3430 | */ |
3255 | */ |
3431 | - | ||
3432 | arm_status arm_conv_partial_q7( |
3256 | arm_status arm_conv_partial_q7( |
3433 | q7_t * pSrcA, |
3257 | q7_t * pSrcA, |
3434 | uint32_t srcALen, |
3258 | uint32_t srcALen, |
3435 | q7_t * pSrcB, |
3259 | q7_t * pSrcB, |
3436 | uint32_t srcBLen, |
3260 | uint32_t srcBLen, |
3437 | q7_t * pDst, |
3261 | q7_t * pDst, |
3438 | uint32_t firstIndex, |
3262 | uint32_t firstIndex, |
3439 | uint32_t numPoints); |
3263 | uint32_t numPoints); |
3440 | 3264 | ||
3441 | 3265 | ||
3442 | - | ||
3443 | /** |
3266 | /** |
3444 | * @brief Instance structure for the Q15 FIR decimator. |
3267 | * @brief Instance structure for the Q15 FIR decimator. |
3445 | */ |
3268 | */ |
3446 | - | ||
3447 | typedef struct |
3269 | typedef struct |
3448 | { |
3270 | { |
3449 | uint8_t M; /**< decimation factor. */ |
3271 | uint8_t M; /**< decimation factor. */ |
3450 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
3272 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
3451 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
3273 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
3452 | q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
3274 | q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
3453 | } arm_fir_decimate_instance_q15; |
3275 | } arm_fir_decimate_instance_q15; |
3454 | 3276 | ||
3455 | /** |
3277 | /** |
3456 | * @brief Instance structure for the Q31 FIR decimator. |
3278 | * @brief Instance structure for the Q31 FIR decimator. |
3457 | */ |
3279 | */ |
3458 | - | ||
3459 | typedef struct |
3280 | typedef struct |
3460 | { |
3281 | { |
3461 | uint8_t M; /**< decimation factor. */ |
3282 | uint8_t M; /**< decimation factor. */ |
3462 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
3283 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
3463 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
3284 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
3464 | q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
3285 | q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
3465 | - | ||
3466 | } arm_fir_decimate_instance_q31; |
3286 | } arm_fir_decimate_instance_q31; |
3467 | 3287 | ||
3468 | /** |
3288 | /** |
3469 | * @brief Instance structure for the floating-point FIR decimator. |
3289 | * @brief Instance structure for the floating-point FIR decimator. |
3470 | */ |
3290 | */ |
3471 | - | ||
3472 | typedef struct |
3291 | typedef struct |
3473 | { |
3292 | { |
3474 | uint8_t M; /**< decimation factor. */ |
3293 | uint8_t M; /**< decimation factor. */ |
3475 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
3294 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
3476 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
3295 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
3477 | float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
3296 | float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
3478 | - | ||
3479 | } arm_fir_decimate_instance_f32; |
3297 | } arm_fir_decimate_instance_f32; |
3480 | 3298 | ||
3481 | 3299 | ||
3482 | - | ||
3483 | /** |
3300 | /** |
3484 | * @brief Processing function for the floating-point FIR decimator. |
3301 | * @brief Processing function for the floating-point FIR decimator. |
3485 | * @param[in] *S points to an instance of the floating-point FIR decimator structure. |
3302 | * @param[in] S points to an instance of the floating-point FIR decimator structure. |
3486 | * @param[in] *pSrc points to the block of input data. |
3303 | * @param[in] pSrc points to the block of input data. |
3487 | * @param[out] *pDst points to the block of output data |
3304 | * @param[out] pDst points to the block of output data |
3488 | * @param[in] blockSize number of input samples to process per call. |
3305 | * @param[in] blockSize number of input samples to process per call. |
3489 | * @return none |
- | |
3490 | */ |
3306 | */ |
3491 | - | ||
3492 | void arm_fir_decimate_f32( |
3307 | void arm_fir_decimate_f32( |
3493 | const arm_fir_decimate_instance_f32 * S, |
3308 | const arm_fir_decimate_instance_f32 * S, |
3494 | float32_t * pSrc, |
3309 | float32_t * pSrc, |
3495 | float32_t * pDst, |
3310 | float32_t * pDst, |
3496 | uint32_t blockSize); |
3311 | uint32_t blockSize); |
3497 | 3312 | ||
3498 | 3313 | ||
3499 | /** |
3314 | /** |
3500 | * @brief Initialization function for the floating-point FIR decimator. |
3315 | * @brief Initialization function for the floating-point FIR decimator. |
3501 | * @param[in,out] *S points to an instance of the floating-point FIR decimator structure. |
3316 | * @param[in,out] S points to an instance of the floating-point FIR decimator structure. |
3502 | * @param[in] numTaps number of coefficients in the filter. |
3317 | * @param[in] numTaps number of coefficients in the filter. |
3503 | * @param[in] M decimation factor. |
3318 | * @param[in] M decimation factor. |
3504 | * @param[in] *pCoeffs points to the filter coefficients. |
3319 | * @param[in] pCoeffs points to the filter coefficients. |
3505 | * @param[in] *pState points to the state buffer. |
3320 | * @param[in] pState points to the state buffer. |
3506 | * @param[in] blockSize number of input samples to process per call. |
3321 | * @param[in] blockSize number of input samples to process per call. |
3507 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3322 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3508 | * <code>blockSize</code> is not a multiple of <code>M</code>. |
3323 | * <code>blockSize</code> is not a multiple of <code>M</code>. |
3509 | */ |
3324 | */ |
3510 | - | ||
3511 | arm_status arm_fir_decimate_init_f32( |
3325 | arm_status arm_fir_decimate_init_f32( |
3512 | arm_fir_decimate_instance_f32 * S, |
3326 | arm_fir_decimate_instance_f32 * S, |
3513 | uint16_t numTaps, |
3327 | uint16_t numTaps, |
3514 | uint8_t M, |
3328 | uint8_t M, |
3515 | float32_t * pCoeffs, |
3329 | float32_t * pCoeffs, |
3516 | float32_t * pState, |
3330 | float32_t * pState, |
3517 | uint32_t blockSize); |
3331 | uint32_t blockSize); |
3518 | 3332 | ||
- | 3333 | ||
3519 | /** |
3334 | /** |
3520 | * @brief Processing function for the Q15 FIR decimator. |
3335 | * @brief Processing function for the Q15 FIR decimator. |
3521 | * @param[in] *S points to an instance of the Q15 FIR decimator structure. |
3336 | * @param[in] S points to an instance of the Q15 FIR decimator structure. |
3522 | * @param[in] *pSrc points to the block of input data. |
3337 | * @param[in] pSrc points to the block of input data. |
3523 | * @param[out] *pDst points to the block of output data |
3338 | * @param[out] pDst points to the block of output data |
3524 | * @param[in] blockSize number of input samples to process per call. |
3339 | * @param[in] blockSize number of input samples to process per call. |
3525 | * @return none |
- | |
3526 | */ |
3340 | */ |
3527 | - | ||
3528 | void arm_fir_decimate_q15( |
3341 | void arm_fir_decimate_q15( |
3529 | const arm_fir_decimate_instance_q15 * S, |
3342 | const arm_fir_decimate_instance_q15 * S, |
3530 | q15_t * pSrc, |
3343 | q15_t * pSrc, |
3531 | q15_t * pDst, |
3344 | q15_t * pDst, |
3532 | uint32_t blockSize); |
3345 | uint32_t blockSize); |
3533 | 3346 | ||
- | 3347 | ||
3534 | /** |
3348 | /** |
3535 | * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. |
3349 | * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. |
3536 | * @param[in] *S points to an instance of the Q15 FIR decimator structure. |
3350 | * @param[in] S points to an instance of the Q15 FIR decimator structure. |
3537 | * @param[in] *pSrc points to the block of input data. |
3351 | * @param[in] pSrc points to the block of input data. |
3538 | * @param[out] *pDst points to the block of output data |
3352 | * @param[out] pDst points to the block of output data |
3539 | * @param[in] blockSize number of input samples to process per call. |
3353 | * @param[in] blockSize number of input samples to process per call. |
3540 | * @return none |
- | |
3541 | */ |
3354 | */ |
3542 | - | ||
3543 | void arm_fir_decimate_fast_q15( |
3355 | void arm_fir_decimate_fast_q15( |
3544 | const arm_fir_decimate_instance_q15 * S, |
3356 | const arm_fir_decimate_instance_q15 * S, |
3545 | q15_t * pSrc, |
3357 | q15_t * pSrc, |
3546 | q15_t * pDst, |
3358 | q15_t * pDst, |
3547 | uint32_t blockSize); |
3359 | uint32_t blockSize); |
3548 | 3360 | ||
3549 | 3361 | ||
3550 | - | ||
3551 | /** |
3362 | /** |
3552 | * @brief Initialization function for the Q15 FIR decimator. |
3363 | * @brief Initialization function for the Q15 FIR decimator. |
3553 | * @param[in,out] *S points to an instance of the Q15 FIR decimator structure. |
3364 | * @param[in,out] S points to an instance of the Q15 FIR decimator structure. |
3554 | * @param[in] numTaps number of coefficients in the filter. |
3365 | * @param[in] numTaps number of coefficients in the filter. |
3555 | * @param[in] M decimation factor. |
3366 | * @param[in] M decimation factor. |
3556 | * @param[in] *pCoeffs points to the filter coefficients. |
3367 | * @param[in] pCoeffs points to the filter coefficients. |
3557 | * @param[in] *pState points to the state buffer. |
3368 | * @param[in] pState points to the state buffer. |
3558 | * @param[in] blockSize number of input samples to process per call. |
3369 | * @param[in] blockSize number of input samples to process per call. |
3559 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3370 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3560 | * <code>blockSize</code> is not a multiple of <code>M</code>. |
3371 | * <code>blockSize</code> is not a multiple of <code>M</code>. |
3561 | */ |
3372 | */ |
3562 | - | ||
3563 | arm_status arm_fir_decimate_init_q15( |
3373 | arm_status arm_fir_decimate_init_q15( |
3564 | arm_fir_decimate_instance_q15 * S, |
3374 | arm_fir_decimate_instance_q15 * S, |
3565 | uint16_t numTaps, |
3375 | uint16_t numTaps, |
3566 | uint8_t M, |
3376 | uint8_t M, |
3567 | q15_t * pCoeffs, |
3377 | q15_t * pCoeffs, |
3568 | q15_t * pState, |
3378 | q15_t * pState, |
3569 | uint32_t blockSize); |
3379 | uint32_t blockSize); |
3570 | 3380 | ||
- | 3381 | ||
3571 | /** |
3382 | /** |
3572 | * @brief Processing function for the Q31 FIR decimator. |
3383 | * @brief Processing function for the Q31 FIR decimator. |
3573 | * @param[in] *S points to an instance of the Q31 FIR decimator structure. |
3384 | * @param[in] S points to an instance of the Q31 FIR decimator structure. |
3574 | * @param[in] *pSrc points to the block of input data. |
3385 | * @param[in] pSrc points to the block of input data. |
3575 | * @param[out] *pDst points to the block of output data |
3386 | * @param[out] pDst points to the block of output data |
3576 | * @param[in] blockSize number of input samples to process per call. |
3387 | * @param[in] blockSize number of input samples to process per call. |
3577 | * @return none |
- | |
3578 | */ |
3388 | */ |
3579 | - | ||
3580 | void arm_fir_decimate_q31( |
3389 | void arm_fir_decimate_q31( |
3581 | const arm_fir_decimate_instance_q31 * S, |
3390 | const arm_fir_decimate_instance_q31 * S, |
3582 | q31_t * pSrc, |
3391 | q31_t * pSrc, |
3583 | q31_t * pDst, |
3392 | q31_t * pDst, |
3584 | uint32_t blockSize); |
3393 | uint32_t blockSize); |
3585 | 3394 | ||
3586 | /** |
3395 | /** |
3587 | * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. |
3396 | * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. |
3588 | * @param[in] *S points to an instance of the Q31 FIR decimator structure. |
3397 | * @param[in] S points to an instance of the Q31 FIR decimator structure. |
3589 | * @param[in] *pSrc points to the block of input data. |
3398 | * @param[in] pSrc points to the block of input data. |
3590 | * @param[out] *pDst points to the block of output data |
3399 | * @param[out] pDst points to the block of output data |
3591 | * @param[in] blockSize number of input samples to process per call. |
3400 | * @param[in] blockSize number of input samples to process per call. |
3592 | * @return none |
- | |
3593 | */ |
3401 | */ |
3594 | - | ||
3595 | void arm_fir_decimate_fast_q31( |
3402 | void arm_fir_decimate_fast_q31( |
3596 | arm_fir_decimate_instance_q31 * S, |
3403 | arm_fir_decimate_instance_q31 * S, |
3597 | q31_t * pSrc, |
3404 | q31_t * pSrc, |
3598 | q31_t * pDst, |
3405 | q31_t * pDst, |
3599 | uint32_t blockSize); |
3406 | uint32_t blockSize); |
3600 | 3407 | ||
3601 | 3408 | ||
3602 | /** |
3409 | /** |
3603 | * @brief Initialization function for the Q31 FIR decimator. |
3410 | * @brief Initialization function for the Q31 FIR decimator. |
3604 | * @param[in,out] *S points to an instance of the Q31 FIR decimator structure. |
3411 | * @param[in,out] S points to an instance of the Q31 FIR decimator structure. |
3605 | * @param[in] numTaps number of coefficients in the filter. |
3412 | * @param[in] numTaps number of coefficients in the filter. |
3606 | * @param[in] M decimation factor. |
3413 | * @param[in] M decimation factor. |
3607 | * @param[in] *pCoeffs points to the filter coefficients. |
3414 | * @param[in] pCoeffs points to the filter coefficients. |
3608 | * @param[in] *pState points to the state buffer. |
3415 | * @param[in] pState points to the state buffer. |
3609 | * @param[in] blockSize number of input samples to process per call. |
3416 | * @param[in] blockSize number of input samples to process per call. |
3610 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3417 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3611 | * <code>blockSize</code> is not a multiple of <code>M</code>. |
3418 | * <code>blockSize</code> is not a multiple of <code>M</code>. |
3612 | */ |
3419 | */ |
3613 | - | ||
3614 | arm_status arm_fir_decimate_init_q31( |
3420 | arm_status arm_fir_decimate_init_q31( |
3615 | arm_fir_decimate_instance_q31 * S, |
3421 | arm_fir_decimate_instance_q31 * S, |
3616 | uint16_t numTaps, |
3422 | uint16_t numTaps, |
3617 | uint8_t M, |
3423 | uint8_t M, |
3618 | q31_t * pCoeffs, |
3424 | q31_t * pCoeffs, |
3619 | q31_t * pState, |
3425 | q31_t * pState, |
3620 | uint32_t blockSize); |
3426 | uint32_t blockSize); |
3621 | 3427 | ||
3622 | 3428 | ||
3623 | - | ||
3624 | /** |
3429 | /** |
3625 | * @brief Instance structure for the Q15 FIR interpolator. |
3430 | * @brief Instance structure for the Q15 FIR interpolator. |
3626 | */ |
3431 | */ |
3627 | - | ||
3628 | typedef struct |
3432 | typedef struct |
3629 | { |
3433 | { |
3630 | uint8_t L; /**< upsample factor. */ |
3434 | uint8_t L; /**< upsample factor. */ |
3631 | uint16_t phaseLength; /**< length of each polyphase filter component. */ |
3435 | uint16_t phaseLength; /**< length of each polyphase filter component. */ |
3632 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ |
3436 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ |
Line 3634... | Line 3438... | ||
3634 | } arm_fir_interpolate_instance_q15; |
3438 | } arm_fir_interpolate_instance_q15; |
3635 | 3439 | ||
3636 | /** |
3440 | /** |
3637 | * @brief Instance structure for the Q31 FIR interpolator. |
3441 | * @brief Instance structure for the Q31 FIR interpolator. |
3638 | */ |
3442 | */ |
3639 | - | ||
3640 | typedef struct |
3443 | typedef struct |
3641 | { |
3444 | { |
3642 | uint8_t L; /**< upsample factor. */ |
3445 | uint8_t L; /**< upsample factor. */ |
3643 | uint16_t phaseLength; /**< length of each polyphase filter component. */ |
3446 | uint16_t phaseLength; /**< length of each polyphase filter component. */ |
3644 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ |
3447 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ |
3645 | q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ |
3448 | q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ |
3646 | } arm_fir_interpolate_instance_q31; |
3449 | } arm_fir_interpolate_instance_q31; |
3647 | 3450 | ||
3648 | /** |
3451 | /** |
3649 | * @brief Instance structure for the floating-point FIR interpolator. |
3452 | * @brief Instance structure for the floating-point FIR interpolator. |
3650 | */ |
3453 | */ |
3651 | - | ||
3652 | typedef struct |
3454 | typedef struct |
3653 | { |
3455 | { |
3654 | uint8_t L; /**< upsample factor. */ |
3456 | uint8_t L; /**< upsample factor. */ |
3655 | uint16_t phaseLength; /**< length of each polyphase filter component. */ |
3457 | uint16_t phaseLength; /**< length of each polyphase filter component. */ |
3656 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ |
3458 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ |
3657 | float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ |
3459 | float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ |
3658 | } arm_fir_interpolate_instance_f32; |
3460 | } arm_fir_interpolate_instance_f32; |
3659 | 3461 | ||
3660 | 3462 | ||
3661 | /** |
3463 | /** |
3662 | * @brief Processing function for the Q15 FIR interpolator. |
3464 | * @brief Processing function for the Q15 FIR interpolator. |
3663 | * @param[in] *S points to an instance of the Q15 FIR interpolator structure. |
3465 | * @param[in] S points to an instance of the Q15 FIR interpolator structure. |
3664 | * @param[in] *pSrc points to the block of input data. |
3466 | * @param[in] pSrc points to the block of input data. |
3665 | * @param[out] *pDst points to the block of output data. |
3467 | * @param[out] pDst points to the block of output data. |
3666 | * @param[in] blockSize number of input samples to process per call. |
3468 | * @param[in] blockSize number of input samples to process per call. |
3667 | * @return none. |
- | |
3668 | */ |
3469 | */ |
3669 | - | ||
3670 | void arm_fir_interpolate_q15( |
3470 | void arm_fir_interpolate_q15( |
3671 | const arm_fir_interpolate_instance_q15 * S, |
3471 | const arm_fir_interpolate_instance_q15 * S, |
3672 | q15_t * pSrc, |
3472 | q15_t * pSrc, |
3673 | q15_t * pDst, |
3473 | q15_t * pDst, |
3674 | uint32_t blockSize); |
3474 | uint32_t blockSize); |
3675 | 3475 | ||
3676 | 3476 | ||
3677 | /** |
3477 | /** |
3678 | * @brief Initialization function for the Q15 FIR interpolator. |
3478 | * @brief Initialization function for the Q15 FIR interpolator. |
3679 | * @param[in,out] *S points to an instance of the Q15 FIR interpolator structure. |
3479 | * @param[in,out] S points to an instance of the Q15 FIR interpolator structure. |
3680 | * @param[in] L upsample factor. |
3480 | * @param[in] L upsample factor. |
3681 | * @param[in] numTaps number of filter coefficients in the filter. |
3481 | * @param[in] numTaps number of filter coefficients in the filter. |
3682 | * @param[in] *pCoeffs points to the filter coefficient buffer. |
3482 | * @param[in] pCoeffs points to the filter coefficient buffer. |
3683 | * @param[in] *pState points to the state buffer. |
3483 | * @param[in] pState points to the state buffer. |
3684 | * @param[in] blockSize number of input samples to process per call. |
3484 | * @param[in] blockSize number of input samples to process per call. |
3685 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3485 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3686 | * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. |
3486 | * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. |
3687 | */ |
3487 | */ |
3688 | - | ||
3689 | arm_status arm_fir_interpolate_init_q15( |
3488 | arm_status arm_fir_interpolate_init_q15( |
3690 | arm_fir_interpolate_instance_q15 * S, |
3489 | arm_fir_interpolate_instance_q15 * S, |
3691 | uint8_t L, |
3490 | uint8_t L, |
3692 | uint16_t numTaps, |
3491 | uint16_t numTaps, |
3693 | q15_t * pCoeffs, |
3492 | q15_t * pCoeffs, |
3694 | q15_t * pState, |
3493 | q15_t * pState, |
3695 | uint32_t blockSize); |
3494 | uint32_t blockSize); |
3696 | 3495 | ||
- | 3496 | ||
3697 | /** |
3497 | /** |
3698 | * @brief Processing function for the Q31 FIR interpolator. |
3498 | * @brief Processing function for the Q31 FIR interpolator. |
3699 | * @param[in] *S points to an instance of the Q15 FIR interpolator structure. |
3499 | * @param[in] S points to an instance of the Q15 FIR interpolator structure. |
3700 | * @param[in] *pSrc points to the block of input data. |
3500 | * @param[in] pSrc points to the block of input data. |
3701 | * @param[out] *pDst points to the block of output data. |
3501 | * @param[out] pDst points to the block of output data. |
3702 | * @param[in] blockSize number of input samples to process per call. |
3502 | * @param[in] blockSize number of input samples to process per call. |
3703 | * @return none. |
- | |
3704 | */ |
3503 | */ |
3705 | - | ||
3706 | void arm_fir_interpolate_q31( |
3504 | void arm_fir_interpolate_q31( |
3707 | const arm_fir_interpolate_instance_q31 * S, |
3505 | const arm_fir_interpolate_instance_q31 * S, |
3708 | q31_t * pSrc, |
3506 | q31_t * pSrc, |
3709 | q31_t * pDst, |
3507 | q31_t * pDst, |
3710 | uint32_t blockSize); |
3508 | uint32_t blockSize); |
3711 | 3509 | ||
- | 3510 | ||
3712 | /** |
3511 | /** |
3713 | * @brief Initialization function for the Q31 FIR interpolator. |
3512 | * @brief Initialization function for the Q31 FIR interpolator. |
3714 | * @param[in,out] *S points to an instance of the Q31 FIR interpolator structure. |
3513 | * @param[in,out] S points to an instance of the Q31 FIR interpolator structure. |
3715 | * @param[in] L upsample factor. |
3514 | * @param[in] L upsample factor. |
3716 | * @param[in] numTaps number of filter coefficients in the filter. |
3515 | * @param[in] numTaps number of filter coefficients in the filter. |
3717 | * @param[in] *pCoeffs points to the filter coefficient buffer. |
3516 | * @param[in] pCoeffs points to the filter coefficient buffer. |
3718 | * @param[in] *pState points to the state buffer. |
3517 | * @param[in] pState points to the state buffer. |
3719 | * @param[in] blockSize number of input samples to process per call. |
3518 | * @param[in] blockSize number of input samples to process per call. |
3720 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3519 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3721 | * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. |
3520 | * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. |
3722 | */ |
3521 | */ |
3723 | - | ||
3724 | arm_status arm_fir_interpolate_init_q31( |
3522 | arm_status arm_fir_interpolate_init_q31( |
3725 | arm_fir_interpolate_instance_q31 * S, |
3523 | arm_fir_interpolate_instance_q31 * S, |
3726 | uint8_t L, |
3524 | uint8_t L, |
3727 | uint16_t numTaps, |
3525 | uint16_t numTaps, |
3728 | q31_t * pCoeffs, |
3526 | q31_t * pCoeffs, |
Line 3730... | Line 3528... | ||
3730 | uint32_t blockSize); |
3528 | uint32_t blockSize); |
3731 | 3529 | ||
3732 | 3530 | ||
3733 | /** |
3531 | /** |
3734 | * @brief Processing function for the floating-point FIR interpolator. |
3532 | * @brief Processing function for the floating-point FIR interpolator. |
3735 | * @param[in] *S points to an instance of the floating-point FIR interpolator structure. |
3533 | * @param[in] S points to an instance of the floating-point FIR interpolator structure. |
3736 | * @param[in] *pSrc points to the block of input data. |
3534 | * @param[in] pSrc points to the block of input data. |
3737 | * @param[out] *pDst points to the block of output data. |
3535 | * @param[out] pDst points to the block of output data. |
3738 | * @param[in] blockSize number of input samples to process per call. |
3536 | * @param[in] blockSize number of input samples to process per call. |
3739 | * @return none. |
- | |
3740 | */ |
3537 | */ |
3741 | - | ||
3742 | void arm_fir_interpolate_f32( |
3538 | void arm_fir_interpolate_f32( |
3743 | const arm_fir_interpolate_instance_f32 * S, |
3539 | const arm_fir_interpolate_instance_f32 * S, |
3744 | float32_t * pSrc, |
3540 | float32_t * pSrc, |
3745 | float32_t * pDst, |
3541 | float32_t * pDst, |
3746 | uint32_t blockSize); |
3542 | uint32_t blockSize); |
3747 | 3543 | ||
- | 3544 | ||
3748 | /** |
3545 | /** |
3749 | * @brief Initialization function for the floating-point FIR interpolator. |
3546 | * @brief Initialization function for the floating-point FIR interpolator. |
3750 | * @param[in,out] *S points to an instance of the floating-point FIR interpolator structure. |
3547 | * @param[in,out] S points to an instance of the floating-point FIR interpolator structure. |
3751 | * @param[in] L upsample factor. |
3548 | * @param[in] L upsample factor. |
3752 | * @param[in] numTaps number of filter coefficients in the filter. |
3549 | * @param[in] numTaps number of filter coefficients in the filter. |
3753 | * @param[in] *pCoeffs points to the filter coefficient buffer. |
3550 | * @param[in] pCoeffs points to the filter coefficient buffer. |
3754 | * @param[in] *pState points to the state buffer. |
3551 | * @param[in] pState points to the state buffer. |
3755 | * @param[in] blockSize number of input samples to process per call. |
3552 | * @param[in] blockSize number of input samples to process per call. |
3756 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3553 | * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if |
3757 | * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. |
3554 | * the filter length <code>numTaps</code> is not a multiple of the interpolation factor <code>L</code>. |
3758 | */ |
3555 | */ |
3759 | - | ||
3760 | arm_status arm_fir_interpolate_init_f32( |
3556 | arm_status arm_fir_interpolate_init_f32( |
3761 | arm_fir_interpolate_instance_f32 * S, |
3557 | arm_fir_interpolate_instance_f32 * S, |
3762 | uint8_t L, |
3558 | uint8_t L, |
3763 | uint16_t numTaps, |
3559 | uint16_t numTaps, |
3764 | float32_t * pCoeffs, |
3560 | float32_t * pCoeffs, |
3765 | float32_t * pState, |
3561 | float32_t * pState, |
3766 | uint32_t blockSize); |
3562 | uint32_t blockSize); |
3767 | 3563 | ||
- | 3564 | ||
3768 | /** |
3565 | /** |
3769 | * @brief Instance structure for the high precision Q31 Biquad cascade filter. |
3566 | * @brief Instance structure for the high precision Q31 Biquad cascade filter. |
3770 | */ |
3567 | */ |
3771 | - | ||
3772 | typedef struct |
3568 | typedef struct |
3773 | { |
3569 | { |
3774 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
3570 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
3775 | q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ |
3571 | q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ |
3776 | q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
3572 | q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
3777 | uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ |
3573 | uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ |
3778 | - | ||
3779 | } arm_biquad_cas_df1_32x64_ins_q31; |
3574 | } arm_biquad_cas_df1_32x64_ins_q31; |
3780 | 3575 | ||
3781 | 3576 | ||
3782 | /** |
3577 | /** |
3783 | * @param[in] *S points to an instance of the high precision Q31 Biquad cascade filter structure. |
3578 | * @param[in] S points to an instance of the high precision Q31 Biquad cascade filter structure. |
3784 | * @param[in] *pSrc points to the block of input data. |
3579 | * @param[in] pSrc points to the block of input data. |
3785 | * @param[out] *pDst points to the block of output data |
3580 | * @param[out] pDst points to the block of output data |
3786 | * @param[in] blockSize number of samples to process. |
3581 | * @param[in] blockSize number of samples to process. |
3787 | * @return none. |
- | |
3788 | */ |
3582 | */ |
3789 | - | ||
3790 | void arm_biquad_cas_df1_32x64_q31( |
3583 | void arm_biquad_cas_df1_32x64_q31( |
3791 | const arm_biquad_cas_df1_32x64_ins_q31 * S, |
3584 | const arm_biquad_cas_df1_32x64_ins_q31 * S, |
3792 | q31_t * pSrc, |
3585 | q31_t * pSrc, |
3793 | q31_t * pDst, |
3586 | q31_t * pDst, |
3794 | uint32_t blockSize); |
3587 | uint32_t blockSize); |
3795 | 3588 | ||
3796 | 3589 | ||
3797 | /** |
3590 | /** |
3798 | * @param[in,out] *S points to an instance of the high precision Q31 Biquad cascade filter structure. |
3591 | * @param[in,out] S points to an instance of the high precision Q31 Biquad cascade filter structure. |
3799 | * @param[in] numStages number of 2nd order stages in the filter. |
3592 | * @param[in] numStages number of 2nd order stages in the filter. |
3800 | * @param[in] *pCoeffs points to the filter coefficients. |
3593 | * @param[in] pCoeffs points to the filter coefficients. |
3801 | * @param[in] *pState points to the state buffer. |
3594 | * @param[in] pState points to the state buffer. |
3802 | * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format |
3595 | * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format |
3803 | * @return none |
- | |
3804 | */ |
3596 | */ |
3805 | - | ||
3806 | void arm_biquad_cas_df1_32x64_init_q31( |
3597 | void arm_biquad_cas_df1_32x64_init_q31( |
3807 | arm_biquad_cas_df1_32x64_ins_q31 * S, |
3598 | arm_biquad_cas_df1_32x64_ins_q31 * S, |
3808 | uint8_t numStages, |
3599 | uint8_t numStages, |
3809 | q31_t * pCoeffs, |
3600 | q31_t * pCoeffs, |
3810 | q63_t * pState, |
3601 | q63_t * pState, |
3811 | uint8_t postShift); |
3602 | uint8_t postShift); |
3812 | 3603 | ||
3813 | 3604 | ||
3814 | - | ||
3815 | /** |
3605 | /** |
3816 | * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. |
3606 | * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. |
3817 | */ |
3607 | */ |
3818 | - | ||
3819 | typedef struct |
3608 | typedef struct |
3820 | { |
3609 | { |
3821 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
3610 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
3822 | float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ |
3611 | float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ |
3823 | float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
3612 | float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
3824 | } arm_biquad_cascade_df2T_instance_f32; |
3613 | } arm_biquad_cascade_df2T_instance_f32; |
3825 | 3614 | ||
3826 | - | ||
3827 | - | ||
3828 | /** |
3615 | /** |
3829 | * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. |
3616 | * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. |
3830 | */ |
3617 | */ |
3831 | - | ||
3832 | typedef struct |
3618 | typedef struct |
3833 | { |
3619 | { |
3834 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
3620 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
3835 | float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ |
3621 | float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ |
3836 | float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
3622 | float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
3837 | } arm_biquad_cascade_stereo_df2T_instance_f32; |
3623 | } arm_biquad_cascade_stereo_df2T_instance_f32; |
3838 | 3624 | ||
3839 | - | ||
3840 | - | ||
3841 | /** |
3625 | /** |
3842 | * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. |
3626 | * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. |
3843 | */ |
3627 | */ |
3844 | - | ||
3845 | typedef struct |
3628 | typedef struct |
3846 | { |
3629 | { |
3847 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
3630 | uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ |
3848 | float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ |
3631 | float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ |
3849 | float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
3632 | float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ |
3850 | } arm_biquad_cascade_df2T_instance_f64; |
3633 | } arm_biquad_cascade_df2T_instance_f64; |
3851 | 3634 | ||
3852 | 3635 | ||
3853 | /** |
3636 | /** |
3854 | * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. |
3637 | * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. |
3855 | * @param[in] *S points to an instance of the filter data structure. |
3638 | * @param[in] S points to an instance of the filter data structure. |
3856 | * @param[in] *pSrc points to the block of input data. |
3639 | * @param[in] pSrc points to the block of input data. |
3857 | * @param[out] *pDst points to the block of output data |
3640 | * @param[out] pDst points to the block of output data |
3858 | * @param[in] blockSize number of samples to process. |
3641 | * @param[in] blockSize number of samples to process. |
3859 | * @return none. |
- | |
3860 | */ |
3642 | */ |
3861 | - | ||
3862 | void arm_biquad_cascade_df2T_f32( |
3643 | void arm_biquad_cascade_df2T_f32( |
3863 | const arm_biquad_cascade_df2T_instance_f32 * S, |
3644 | const arm_biquad_cascade_df2T_instance_f32 * S, |
3864 | float32_t * pSrc, |
3645 | float32_t * pSrc, |
3865 | float32_t * pDst, |
3646 | float32_t * pDst, |
3866 | uint32_t blockSize); |
3647 | uint32_t blockSize); |
3867 | 3648 | ||
3868 | 3649 | ||
3869 | /** |
3650 | /** |
3870 | * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels |
3651 | * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels |
3871 | * @param[in] *S points to an instance of the filter data structure. |
3652 | * @param[in] S points to an instance of the filter data structure. |
3872 | * @param[in] *pSrc points to the block of input data. |
3653 | * @param[in] pSrc points to the block of input data. |
3873 | * @param[out] *pDst points to the block of output data |
3654 | * @param[out] pDst points to the block of output data |
3874 | * @param[in] blockSize number of samples to process. |
3655 | * @param[in] blockSize number of samples to process. |
3875 | * @return none. |
- | |
3876 | */ |
3656 | */ |
3877 | - | ||
3878 | void arm_biquad_cascade_stereo_df2T_f32( |
3657 | void arm_biquad_cascade_stereo_df2T_f32( |
3879 | const arm_biquad_cascade_stereo_df2T_instance_f32 * S, |
3658 | const arm_biquad_cascade_stereo_df2T_instance_f32 * S, |
3880 | float32_t * pSrc, |
3659 | float32_t * pSrc, |
3881 | float32_t * pDst, |
3660 | float32_t * pDst, |
3882 | uint32_t blockSize); |
3661 | uint32_t blockSize); |
3883 | 3662 | ||
- | 3663 | ||
3884 | /** |
3664 | /** |
3885 | * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. |
3665 | * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. |
3886 | * @param[in] *S points to an instance of the filter data structure. |
3666 | * @param[in] S points to an instance of the filter data structure. |
3887 | * @param[in] *pSrc points to the block of input data. |
3667 | * @param[in] pSrc points to the block of input data. |
3888 | * @param[out] *pDst points to the block of output data |
3668 | * @param[out] pDst points to the block of output data |
3889 | * @param[in] blockSize number of samples to process. |
3669 | * @param[in] blockSize number of samples to process. |
3890 | * @return none. |
- | |
3891 | */ |
3670 | */ |
3892 | - | ||
3893 | void arm_biquad_cascade_df2T_f64( |
3671 | void arm_biquad_cascade_df2T_f64( |
3894 | const arm_biquad_cascade_df2T_instance_f64 * S, |
3672 | const arm_biquad_cascade_df2T_instance_f64 * S, |
3895 | float64_t * pSrc, |
3673 | float64_t * pSrc, |
3896 | float64_t * pDst, |
3674 | float64_t * pDst, |
3897 | uint32_t blockSize); |
3675 | uint32_t blockSize); |
3898 | 3676 | ||
3899 | 3677 | ||
3900 | /** |
3678 | /** |
3901 | * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. |
3679 | * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. |
3902 | * @param[in,out] *S points to an instance of the filter data structure. |
3680 | * @param[in,out] S points to an instance of the filter data structure. |
3903 | * @param[in] numStages number of 2nd order stages in the filter. |
3681 | * @param[in] numStages number of 2nd order stages in the filter. |
3904 | * @param[in] *pCoeffs points to the filter coefficients. |
3682 | * @param[in] pCoeffs points to the filter coefficients. |
3905 | * @param[in] *pState points to the state buffer. |
3683 | * @param[in] pState points to the state buffer. |
3906 | * @return none |
- | |
3907 | */ |
3684 | */ |
3908 | - | ||
3909 | void arm_biquad_cascade_df2T_init_f32( |
3685 | void arm_biquad_cascade_df2T_init_f32( |
3910 | arm_biquad_cascade_df2T_instance_f32 * S, |
3686 | arm_biquad_cascade_df2T_instance_f32 * S, |
3911 | uint8_t numStages, |
3687 | uint8_t numStages, |
3912 | float32_t * pCoeffs, |
3688 | float32_t * pCoeffs, |
3913 | float32_t * pState); |
3689 | float32_t * pState); |
3914 | 3690 | ||
3915 | 3691 | ||
3916 | /** |
3692 | /** |
3917 | * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. |
3693 | * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. |
3918 | * @param[in,out] *S points to an instance of the filter data structure. |
3694 | * @param[in,out] S points to an instance of the filter data structure. |
3919 | * @param[in] numStages number of 2nd order stages in the filter. |
3695 | * @param[in] numStages number of 2nd order stages in the filter. |
3920 | * @param[in] *pCoeffs points to the filter coefficients. |
3696 | * @param[in] pCoeffs points to the filter coefficients. |
3921 | * @param[in] *pState points to the state buffer. |
3697 | * @param[in] pState points to the state buffer. |
3922 | * @return none |
- | |
3923 | */ |
3698 | */ |
3924 | - | ||
3925 | void arm_biquad_cascade_stereo_df2T_init_f32( |
3699 | void arm_biquad_cascade_stereo_df2T_init_f32( |
3926 | arm_biquad_cascade_stereo_df2T_instance_f32 * S, |
3700 | arm_biquad_cascade_stereo_df2T_instance_f32 * S, |
3927 | uint8_t numStages, |
3701 | uint8_t numStages, |
3928 | float32_t * pCoeffs, |
3702 | float32_t * pCoeffs, |
3929 | float32_t * pState); |
3703 | float32_t * pState); |
3930 | 3704 | ||
3931 | 3705 | ||
3932 | /** |
3706 | /** |
3933 | * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. |
3707 | * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. |
3934 | * @param[in,out] *S points to an instance of the filter data structure. |
3708 | * @param[in,out] S points to an instance of the filter data structure. |
3935 | * @param[in] numStages number of 2nd order stages in the filter. |
3709 | * @param[in] numStages number of 2nd order stages in the filter. |
3936 | * @param[in] *pCoeffs points to the filter coefficients. |
3710 | * @param[in] pCoeffs points to the filter coefficients. |
3937 | * @param[in] *pState points to the state buffer. |
3711 | * @param[in] pState points to the state buffer. |
3938 | * @return none |
- | |
3939 | */ |
3712 | */ |
3940 | - | ||
3941 | void arm_biquad_cascade_df2T_init_f64( |
3713 | void arm_biquad_cascade_df2T_init_f64( |
3942 | arm_biquad_cascade_df2T_instance_f64 * S, |
3714 | arm_biquad_cascade_df2T_instance_f64 * S, |
3943 | uint8_t numStages, |
3715 | uint8_t numStages, |
3944 | float64_t * pCoeffs, |
3716 | float64_t * pCoeffs, |
3945 | float64_t * pState); |
3717 | float64_t * pState); |
3946 | 3718 | ||
3947 | 3719 | ||
3948 | - | ||
3949 | /** |
3720 | /** |
3950 | * @brief Instance structure for the Q15 FIR lattice filter. |
3721 | * @brief Instance structure for the Q15 FIR lattice filter. |
3951 | */ |
3722 | */ |
3952 | - | ||
3953 | typedef struct |
3723 | typedef struct |
3954 | { |
3724 | { |
3955 | uint16_t numStages; /**< number of filter stages. */ |
3725 | uint16_t numStages; /**< number of filter stages. */ |
3956 | q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ |
3726 | q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ |
3957 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ |
3727 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ |
3958 | } arm_fir_lattice_instance_q15; |
3728 | } arm_fir_lattice_instance_q15; |
3959 | 3729 | ||
3960 | /** |
3730 | /** |
3961 | * @brief Instance structure for the Q31 FIR lattice filter. |
3731 | * @brief Instance structure for the Q31 FIR lattice filter. |
3962 | */ |
3732 | */ |
3963 | - | ||
3964 | typedef struct |
3733 | typedef struct |
3965 | { |
3734 | { |
3966 | uint16_t numStages; /**< number of filter stages. */ |
3735 | uint16_t numStages; /**< number of filter stages. */ |
3967 | q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ |
3736 | q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ |
3968 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ |
3737 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ |
3969 | } arm_fir_lattice_instance_q31; |
3738 | } arm_fir_lattice_instance_q31; |
3970 | 3739 | ||
3971 | /** |
3740 | /** |
3972 | * @brief Instance structure for the floating-point FIR lattice filter. |
3741 | * @brief Instance structure for the floating-point FIR lattice filter. |
3973 | */ |
3742 | */ |
3974 | - | ||
3975 | typedef struct |
3743 | typedef struct |
3976 | { |
3744 | { |
3977 | uint16_t numStages; /**< number of filter stages. */ |
3745 | uint16_t numStages; /**< number of filter stages. */ |
3978 | float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ |
3746 | float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ |
3979 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ |
3747 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ |
3980 | } arm_fir_lattice_instance_f32; |
3748 | } arm_fir_lattice_instance_f32; |
3981 | 3749 | ||
- | 3750 | ||
3982 | /** |
3751 | /** |
3983 | * @brief Initialization function for the Q15 FIR lattice filter. |
3752 | * @brief Initialization function for the Q15 FIR lattice filter. |
3984 | * @param[in] *S points to an instance of the Q15 FIR lattice structure. |
3753 | * @param[in] S points to an instance of the Q15 FIR lattice structure. |
3985 | * @param[in] numStages number of filter stages. |
3754 | * @param[in] numStages number of filter stages. |
3986 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. |
3755 | * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. |
3987 | * @param[in] *pState points to the state buffer. The array is of length numStages. |
3756 | * @param[in] pState points to the state buffer. The array is of length numStages. |
3988 | * @return none. |
- | |
3989 | */ |
3757 | */ |
3990 | - | ||
3991 | void arm_fir_lattice_init_q15( |
3758 | void arm_fir_lattice_init_q15( |
3992 | arm_fir_lattice_instance_q15 * S, |
3759 | arm_fir_lattice_instance_q15 * S, |
3993 | uint16_t numStages, |
3760 | uint16_t numStages, |
3994 | q15_t * pCoeffs, |
3761 | q15_t * pCoeffs, |
3995 | q15_t * pState); |
3762 | q15_t * pState); |
3996 | 3763 | ||
3997 | 3764 | ||
3998 | /** |
3765 | /** |
3999 | * @brief Processing function for the Q15 FIR lattice filter. |
3766 | * @brief Processing function for the Q15 FIR lattice filter. |
4000 | * @param[in] *S points to an instance of the Q15 FIR lattice structure. |
3767 | * @param[in] S points to an instance of the Q15 FIR lattice structure. |
4001 | * @param[in] *pSrc points to the block of input data. |
3768 | * @param[in] pSrc points to the block of input data. |
4002 | * @param[out] *pDst points to the block of output data. |
3769 | * @param[out] pDst points to the block of output data. |
4003 | * @param[in] blockSize number of samples to process. |
3770 | * @param[in] blockSize number of samples to process. |
4004 | * @return none. |
- | |
4005 | */ |
3771 | */ |
4006 | void arm_fir_lattice_q15( |
3772 | void arm_fir_lattice_q15( |
4007 | const arm_fir_lattice_instance_q15 * S, |
3773 | const arm_fir_lattice_instance_q15 * S, |
4008 | q15_t * pSrc, |
3774 | q15_t * pSrc, |
4009 | q15_t * pDst, |
3775 | q15_t * pDst, |
4010 | uint32_t blockSize); |
3776 | uint32_t blockSize); |
4011 | 3777 | ||
- | 3778 | ||
4012 | /** |
3779 | /** |
4013 | * @brief Initialization function for the Q31 FIR lattice filter. |
3780 | * @brief Initialization function for the Q31 FIR lattice filter. |
4014 | * @param[in] *S points to an instance of the Q31 FIR lattice structure. |
3781 | * @param[in] S points to an instance of the Q31 FIR lattice structure. |
4015 | * @param[in] numStages number of filter stages. |
3782 | * @param[in] numStages number of filter stages. |
4016 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. |
3783 | * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. |
4017 | * @param[in] *pState points to the state buffer. The array is of length numStages. |
3784 | * @param[in] pState points to the state buffer. The array is of length numStages. |
4018 | * @return none. |
- | |
4019 | */ |
3785 | */ |
4020 | - | ||
4021 | void arm_fir_lattice_init_q31( |
3786 | void arm_fir_lattice_init_q31( |
4022 | arm_fir_lattice_instance_q31 * S, |
3787 | arm_fir_lattice_instance_q31 * S, |
4023 | uint16_t numStages, |
3788 | uint16_t numStages, |
4024 | q31_t * pCoeffs, |
3789 | q31_t * pCoeffs, |
4025 | q31_t * pState); |
3790 | q31_t * pState); |
4026 | 3791 | ||
4027 | 3792 | ||
4028 | /** |
3793 | /** |
4029 | * @brief Processing function for the Q31 FIR lattice filter. |
3794 | * @brief Processing function for the Q31 FIR lattice filter. |
4030 | * @param[in] *S points to an instance of the Q31 FIR lattice structure. |
3795 | * @param[in] S points to an instance of the Q31 FIR lattice structure. |
4031 | * @param[in] *pSrc points to the block of input data. |
3796 | * @param[in] pSrc points to the block of input data. |
4032 | * @param[out] *pDst points to the block of output data |
3797 | * @param[out] pDst points to the block of output data |
4033 | * @param[in] blockSize number of samples to process. |
3798 | * @param[in] blockSize number of samples to process. |
4034 | * @return none. |
- | |
4035 | */ |
3799 | */ |
4036 | - | ||
4037 | void arm_fir_lattice_q31( |
3800 | void arm_fir_lattice_q31( |
4038 | const arm_fir_lattice_instance_q31 * S, |
3801 | const arm_fir_lattice_instance_q31 * S, |
4039 | q31_t * pSrc, |
3802 | q31_t * pSrc, |
4040 | q31_t * pDst, |
3803 | q31_t * pDst, |
4041 | uint32_t blockSize); |
3804 | uint32_t blockSize); |
4042 | 3805 | ||
- | 3806 | ||
4043 | /** |
3807 | /** |
4044 | * @brief Initialization function for the floating-point FIR lattice filter. |
3808 | * @brief Initialization function for the floating-point FIR lattice filter. |
4045 | * @param[in] *S points to an instance of the floating-point FIR lattice structure. |
3809 | * @param[in] S points to an instance of the floating-point FIR lattice structure. |
4046 | * @param[in] numStages number of filter stages. |
3810 | * @param[in] numStages number of filter stages. |
4047 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. |
3811 | * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. |
4048 | * @param[in] *pState points to the state buffer. The array is of length numStages. |
3812 | * @param[in] pState points to the state buffer. The array is of length numStages. |
4049 | * @return none. |
- | |
4050 | */ |
3813 | */ |
4051 | - | ||
4052 | void arm_fir_lattice_init_f32( |
3814 | void arm_fir_lattice_init_f32( |
4053 | arm_fir_lattice_instance_f32 * S, |
3815 | arm_fir_lattice_instance_f32 * S, |
4054 | uint16_t numStages, |
3816 | uint16_t numStages, |
4055 | float32_t * pCoeffs, |
3817 | float32_t * pCoeffs, |
4056 | float32_t * pState); |
3818 | float32_t * pState); |
4057 | 3819 | ||
- | 3820 | ||
4058 | /** |
3821 | /** |
4059 | * @brief Processing function for the floating-point FIR lattice filter. |
3822 | * @brief Processing function for the floating-point FIR lattice filter. |
4060 | * @param[in] *S points to an instance of the floating-point FIR lattice structure. |
3823 | * @param[in] S points to an instance of the floating-point FIR lattice structure. |
4061 | * @param[in] *pSrc points to the block of input data. |
3824 | * @param[in] pSrc points to the block of input data. |
4062 | * @param[out] *pDst points to the block of output data |
3825 | * @param[out] pDst points to the block of output data |
4063 | * @param[in] blockSize number of samples to process. |
3826 | * @param[in] blockSize number of samples to process. |
4064 | * @return none. |
- | |
4065 | */ |
3827 | */ |
4066 | - | ||
4067 | void arm_fir_lattice_f32( |
3828 | void arm_fir_lattice_f32( |
4068 | const arm_fir_lattice_instance_f32 * S, |
3829 | const arm_fir_lattice_instance_f32 * S, |
4069 | float32_t * pSrc, |
3830 | float32_t * pSrc, |
4070 | float32_t * pDst, |
3831 | float32_t * pDst, |
4071 | uint32_t blockSize); |
3832 | uint32_t blockSize); |
4072 | 3833 | ||
- | 3834 | ||
4073 | /** |
3835 | /** |
4074 | * @brief Instance structure for the Q15 IIR lattice filter. |
3836 | * @brief Instance structure for the Q15 IIR lattice filter. |
4075 | */ |
3837 | */ |
4076 | typedef struct |
3838 | typedef struct |
4077 | { |
3839 | { |
4078 | uint16_t numStages; /**< number of stages in the filter. */ |
3840 | uint16_t numStages; /**< number of stages in the filter. */ |
4079 | q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ |
3841 | q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ |
4080 | q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ |
3842 | q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ |
4081 | q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ |
3843 | q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ |
4082 | } arm_iir_lattice_instance_q15; |
3844 | } arm_iir_lattice_instance_q15; |
4083 | 3845 | ||
4084 | /** |
3846 | /** |
4085 | * @brief Instance structure for the Q31 IIR lattice filter. |
3847 | * @brief Instance structure for the Q31 IIR lattice filter. |
4086 | */ |
3848 | */ |
4087 | typedef struct |
3849 | typedef struct |
4088 | { |
3850 | { |
4089 | uint16_t numStages; /**< number of stages in the filter. */ |
3851 | uint16_t numStages; /**< number of stages in the filter. */ |
4090 | q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ |
3852 | q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ |
4091 | q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ |
3853 | q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ |
4092 | q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ |
3854 | q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ |
4093 | } arm_iir_lattice_instance_q31; |
3855 | } arm_iir_lattice_instance_q31; |
4094 | 3856 | ||
4095 | /** |
3857 | /** |
4096 | * @brief Instance structure for the floating-point IIR lattice filter. |
3858 | * @brief Instance structure for the floating-point IIR lattice filter. |
4097 | */ |
3859 | */ |
4098 | typedef struct |
3860 | typedef struct |
4099 | { |
3861 | { |
4100 | uint16_t numStages; /**< number of stages in the filter. */ |
3862 | uint16_t numStages; /**< number of stages in the filter. */ |
4101 | float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ |
3863 | float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ |
4102 | float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ |
3864 | float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ |
4103 | float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ |
3865 | float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ |
4104 | } arm_iir_lattice_instance_f32; |
3866 | } arm_iir_lattice_instance_f32; |
4105 | 3867 | ||
- | 3868 | ||
4106 | /** |
3869 | /** |
4107 | * @brief Processing function for the floating-point IIR lattice filter. |
3870 | * @brief Processing function for the floating-point IIR lattice filter. |
4108 | * @param[in] *S points to an instance of the floating-point IIR lattice structure. |
3871 | * @param[in] S points to an instance of the floating-point IIR lattice structure. |
4109 | * @param[in] *pSrc points to the block of input data. |
3872 | * @param[in] pSrc points to the block of input data. |
4110 | * @param[out] *pDst points to the block of output data. |
3873 | * @param[out] pDst points to the block of output data. |
4111 | * @param[in] blockSize number of samples to process. |
3874 | * @param[in] blockSize number of samples to process. |
4112 | * @return none. |
- | |
4113 | */ |
3875 | */ |
4114 | - | ||
4115 | void arm_iir_lattice_f32( |
3876 | void arm_iir_lattice_f32( |
4116 | const arm_iir_lattice_instance_f32 * S, |
3877 | const arm_iir_lattice_instance_f32 * S, |
4117 | float32_t * pSrc, |
3878 | float32_t * pSrc, |
4118 | float32_t * pDst, |
3879 | float32_t * pDst, |
4119 | uint32_t blockSize); |
3880 | uint32_t blockSize); |
4120 | 3881 | ||
- | 3882 | ||
4121 | /** |
3883 | /** |
4122 | * @brief Initialization function for the floating-point IIR lattice filter. |
3884 | * @brief Initialization function for the floating-point IIR lattice filter. |
4123 | * @param[in] *S points to an instance of the floating-point IIR lattice structure. |
3885 | * @param[in] S points to an instance of the floating-point IIR lattice structure. |
4124 | * @param[in] numStages number of stages in the filter. |
3886 | * @param[in] numStages number of stages in the filter. |
4125 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. |
3887 | * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. |
4126 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. |
3888 | * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. |
4127 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize-1. |
3889 | * @param[in] pState points to the state buffer. The array is of length numStages+blockSize-1. |
4128 | * @param[in] blockSize number of samples to process. |
3890 | * @param[in] blockSize number of samples to process. |
4129 | * @return none. |
- | |
4130 | */ |
3891 | */ |
4131 | - | ||
4132 | void arm_iir_lattice_init_f32( |
3892 | void arm_iir_lattice_init_f32( |
4133 | arm_iir_lattice_instance_f32 * S, |
3893 | arm_iir_lattice_instance_f32 * S, |
4134 | uint16_t numStages, |
3894 | uint16_t numStages, |
4135 | float32_t * pkCoeffs, |
3895 | float32_t * pkCoeffs, |
4136 | float32_t * pvCoeffs, |
3896 | float32_t * pvCoeffs, |
Line 4138... | Line 3898... | ||
4138 | uint32_t blockSize); |
3898 | uint32_t blockSize); |
4139 | 3899 | ||
4140 | 3900 | ||
4141 | /** |
3901 | /** |
4142 | * @brief Processing function for the Q31 IIR lattice filter. |
3902 | * @brief Processing function for the Q31 IIR lattice filter. |
4143 | * @param[in] *S points to an instance of the Q31 IIR lattice structure. |
3903 | * @param[in] S points to an instance of the Q31 IIR lattice structure. |
4144 | * @param[in] *pSrc points to the block of input data. |
3904 | * @param[in] pSrc points to the block of input data. |
4145 | * @param[out] *pDst points to the block of output data. |
3905 | * @param[out] pDst points to the block of output data. |
4146 | * @param[in] blockSize number of samples to process. |
3906 | * @param[in] blockSize number of samples to process. |
4147 | * @return none. |
- | |
4148 | */ |
3907 | */ |
4149 | - | ||
4150 | void arm_iir_lattice_q31( |
3908 | void arm_iir_lattice_q31( |
4151 | const arm_iir_lattice_instance_q31 * S, |
3909 | const arm_iir_lattice_instance_q31 * S, |
4152 | q31_t * pSrc, |
3910 | q31_t * pSrc, |
4153 | q31_t * pDst, |
3911 | q31_t * pDst, |
4154 | uint32_t blockSize); |
3912 | uint32_t blockSize); |
4155 | 3913 | ||
4156 | 3914 | ||
4157 | /** |
3915 | /** |
4158 | * @brief Initialization function for the Q31 IIR lattice filter. |
3916 | * @brief Initialization function for the Q31 IIR lattice filter. |
4159 | * @param[in] *S points to an instance of the Q31 IIR lattice structure. |
3917 | * @param[in] S points to an instance of the Q31 IIR lattice structure. |
4160 | * @param[in] numStages number of stages in the filter. |
3918 | * @param[in] numStages number of stages in the filter. |
4161 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. |
3919 | * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. |
4162 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. |
3920 | * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. |
4163 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize. |
3921 | * @param[in] pState points to the state buffer. The array is of length numStages+blockSize. |
4164 | * @param[in] blockSize number of samples to process. |
3922 | * @param[in] blockSize number of samples to process. |
4165 | * @return none. |
- | |
4166 | */ |
3923 | */ |
4167 | - | ||
4168 | void arm_iir_lattice_init_q31( |
3924 | void arm_iir_lattice_init_q31( |
4169 | arm_iir_lattice_instance_q31 * S, |
3925 | arm_iir_lattice_instance_q31 * S, |
4170 | uint16_t numStages, |
3926 | uint16_t numStages, |
4171 | q31_t * pkCoeffs, |
3927 | q31_t * pkCoeffs, |
4172 | q31_t * pvCoeffs, |
3928 | q31_t * pvCoeffs, |
Line 4174... | Line 3930... | ||
4174 | uint32_t blockSize); |
3930 | uint32_t blockSize); |
4175 | 3931 | ||
4176 | 3932 | ||
4177 | /** |
3933 | /** |
4178 | * @brief Processing function for the Q15 IIR lattice filter. |
3934 | * @brief Processing function for the Q15 IIR lattice filter. |
4179 | * @param[in] *S points to an instance of the Q15 IIR lattice structure. |
3935 | * @param[in] S points to an instance of the Q15 IIR lattice structure. |
4180 | * @param[in] *pSrc points to the block of input data. |
3936 | * @param[in] pSrc points to the block of input data. |
4181 | * @param[out] *pDst points to the block of output data. |
3937 | * @param[out] pDst points to the block of output data. |
4182 | * @param[in] blockSize number of samples to process. |
3938 | * @param[in] blockSize number of samples to process. |
4183 | * @return none. |
- | |
4184 | */ |
3939 | */ |
4185 | - | ||
4186 | void arm_iir_lattice_q15( |
3940 | void arm_iir_lattice_q15( |
4187 | const arm_iir_lattice_instance_q15 * S, |
3941 | const arm_iir_lattice_instance_q15 * S, |
4188 | q15_t * pSrc, |
3942 | q15_t * pSrc, |
4189 | q15_t * pDst, |
3943 | q15_t * pDst, |
4190 | uint32_t blockSize); |
3944 | uint32_t blockSize); |
4191 | 3945 | ||
4192 | 3946 | ||
4193 | /** |
3947 | /** |
4194 | * @brief Initialization function for the Q15 IIR lattice filter. |
3948 | * @brief Initialization function for the Q15 IIR lattice filter. |
4195 | * @param[in] *S points to an instance of the fixed-point Q15 IIR lattice structure. |
3949 | * @param[in] S points to an instance of the fixed-point Q15 IIR lattice structure. |
4196 | * @param[in] numStages number of stages in the filter. |
3950 | * @param[in] numStages number of stages in the filter. |
4197 | * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages. |
3951 | * @param[in] pkCoeffs points to reflection coefficient buffer. The array is of length numStages. |
4198 | * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. |
3952 | * @param[in] pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. |
4199 | * @param[in] *pState points to state buffer. The array is of length numStages+blockSize. |
3953 | * @param[in] pState points to state buffer. The array is of length numStages+blockSize. |
4200 | * @param[in] blockSize number of samples to process per call. |
3954 | * @param[in] blockSize number of samples to process per call. |
4201 | * @return none. |
- | |
4202 | */ |
3955 | */ |
4203 | - | ||
4204 | void arm_iir_lattice_init_q15( |
3956 | void arm_iir_lattice_init_q15( |
4205 | arm_iir_lattice_instance_q15 * S, |
3957 | arm_iir_lattice_instance_q15 * S, |
4206 | uint16_t numStages, |
3958 | uint16_t numStages, |
4207 | q15_t * pkCoeffs, |
3959 | q15_t * pkCoeffs, |
4208 | q15_t * pvCoeffs, |
3960 | q15_t * pvCoeffs, |
4209 | q15_t * pState, |
3961 | q15_t * pState, |
4210 | uint32_t blockSize); |
3962 | uint32_t blockSize); |
4211 | 3963 | ||
- | 3964 | ||
4212 | /** |
3965 | /** |
4213 | * @brief Instance structure for the floating-point LMS filter. |
3966 | * @brief Instance structure for the floating-point LMS filter. |
4214 | */ |
3967 | */ |
4215 | - | ||
4216 | typedef struct |
3968 | typedef struct |
4217 | { |
3969 | { |
4218 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
3970 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4219 | float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
3971 | float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
4220 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
3972 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
4221 | float32_t mu; /**< step size that controls filter coefficient updates. */ |
3973 | float32_t mu; /**< step size that controls filter coefficient updates. */ |
4222 | } arm_lms_instance_f32; |
3974 | } arm_lms_instance_f32; |
4223 | 3975 | ||
- | 3976 | ||
4224 | /** |
3977 | /** |
4225 | * @brief Processing function for floating-point LMS filter. |
3978 | * @brief Processing function for floating-point LMS filter. |
4226 | * @param[in] *S points to an instance of the floating-point LMS filter structure. |
3979 | * @param[in] S points to an instance of the floating-point LMS filter structure. |
4227 | * @param[in] *pSrc points to the block of input data. |
3980 | * @param[in] pSrc points to the block of input data. |
4228 | * @param[in] *pRef points to the block of reference data. |
3981 | * @param[in] pRef points to the block of reference data. |
4229 | * @param[out] *pOut points to the block of output data. |
3982 | * @param[out] pOut points to the block of output data. |
4230 | * @param[out] *pErr points to the block of error data. |
3983 | * @param[out] pErr points to the block of error data. |
4231 | * @param[in] blockSize number of samples to process. |
3984 | * @param[in] blockSize number of samples to process. |
4232 | * @return none. |
- | |
4233 | */ |
3985 | */ |
4234 | - | ||
4235 | void arm_lms_f32( |
3986 | void arm_lms_f32( |
4236 | const arm_lms_instance_f32 * S, |
3987 | const arm_lms_instance_f32 * S, |
4237 | float32_t * pSrc, |
3988 | float32_t * pSrc, |
4238 | float32_t * pRef, |
3989 | float32_t * pRef, |
4239 | float32_t * pOut, |
3990 | float32_t * pOut, |
4240 | float32_t * pErr, |
3991 | float32_t * pErr, |
4241 | uint32_t blockSize); |
3992 | uint32_t blockSize); |
4242 | 3993 | ||
- | 3994 | ||
4243 | /** |
3995 | /** |
4244 | * @brief Initialization function for floating-point LMS filter. |
3996 | * @brief Initialization function for floating-point LMS filter. |
4245 | * @param[in] *S points to an instance of the floating-point LMS filter structure. |
3997 | * @param[in] S points to an instance of the floating-point LMS filter structure. |
4246 | * @param[in] numTaps number of filter coefficients. |
3998 | * @param[in] numTaps number of filter coefficients. |
4247 | * @param[in] *pCoeffs points to the coefficient buffer. |
3999 | * @param[in] pCoeffs points to the coefficient buffer. |
4248 | * @param[in] *pState points to state buffer. |
4000 | * @param[in] pState points to state buffer. |
4249 | * @param[in] mu step size that controls filter coefficient updates. |
4001 | * @param[in] mu step size that controls filter coefficient updates. |
4250 | * @param[in] blockSize number of samples to process. |
4002 | * @param[in] blockSize number of samples to process. |
4251 | * @return none. |
- | |
4252 | */ |
4003 | */ |
4253 | - | ||
4254 | void arm_lms_init_f32( |
4004 | void arm_lms_init_f32( |
4255 | arm_lms_instance_f32 * S, |
4005 | arm_lms_instance_f32 * S, |
4256 | uint16_t numTaps, |
4006 | uint16_t numTaps, |
4257 | float32_t * pCoeffs, |
4007 | float32_t * pCoeffs, |
4258 | float32_t * pState, |
4008 | float32_t * pState, |
4259 | float32_t mu, |
4009 | float32_t mu, |
4260 | uint32_t blockSize); |
4010 | uint32_t blockSize); |
4261 | 4011 | ||
- | 4012 | ||
4262 | /** |
4013 | /** |
4263 | * @brief Instance structure for the Q15 LMS filter. |
4014 | * @brief Instance structure for the Q15 LMS filter. |
4264 | */ |
4015 | */ |
4265 | - | ||
4266 | typedef struct |
4016 | typedef struct |
4267 | { |
4017 | { |
4268 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4018 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4269 | q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
4019 | q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
4270 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
4020 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
Line 4273... | Line 4023... | ||
4273 | } arm_lms_instance_q15; |
4023 | } arm_lms_instance_q15; |
4274 | 4024 | ||
4275 | 4025 | ||
4276 | /** |
4026 | /** |
4277 | * @brief Initialization function for the Q15 LMS filter. |
4027 | * @brief Initialization function for the Q15 LMS filter. |
4278 | * @param[in] *S points to an instance of the Q15 LMS filter structure. |
4028 | * @param[in] S points to an instance of the Q15 LMS filter structure. |
4279 | * @param[in] numTaps number of filter coefficients. |
4029 | * @param[in] numTaps number of filter coefficients. |
4280 | * @param[in] *pCoeffs points to the coefficient buffer. |
4030 | * @param[in] pCoeffs points to the coefficient buffer. |
4281 | * @param[in] *pState points to the state buffer. |
4031 | * @param[in] pState points to the state buffer. |
4282 | * @param[in] mu step size that controls filter coefficient updates. |
4032 | * @param[in] mu step size that controls filter coefficient updates. |
4283 | * @param[in] blockSize number of samples to process. |
4033 | * @param[in] blockSize number of samples to process. |
4284 | * @param[in] postShift bit shift applied to coefficients. |
4034 | * @param[in] postShift bit shift applied to coefficients. |
4285 | * @return none. |
- | |
4286 | */ |
4035 | */ |
4287 | - | ||
4288 | void arm_lms_init_q15( |
4036 | void arm_lms_init_q15( |
4289 | arm_lms_instance_q15 * S, |
4037 | arm_lms_instance_q15 * S, |
4290 | uint16_t numTaps, |
4038 | uint16_t numTaps, |
4291 | q15_t * pCoeffs, |
4039 | q15_t * pCoeffs, |
4292 | q15_t * pState, |
4040 | q15_t * pState, |
4293 | q15_t mu, |
4041 | q15_t mu, |
4294 | uint32_t blockSize, |
4042 | uint32_t blockSize, |
4295 | uint32_t postShift); |
4043 | uint32_t postShift); |
4296 | 4044 | ||
- | 4045 | ||
4297 | /** |
4046 | /** |
4298 | * @brief Processing function for Q15 LMS filter. |
4047 | * @brief Processing function for Q15 LMS filter. |
4299 | * @param[in] *S points to an instance of the Q15 LMS filter structure. |
4048 | * @param[in] S points to an instance of the Q15 LMS filter structure. |
4300 | * @param[in] *pSrc points to the block of input data. |
4049 | * @param[in] pSrc points to the block of input data. |
4301 | * @param[in] *pRef points to the block of reference data. |
4050 | * @param[in] pRef points to the block of reference data. |
4302 | * @param[out] *pOut points to the block of output data. |
4051 | * @param[out] pOut points to the block of output data. |
4303 | * @param[out] *pErr points to the block of error data. |
4052 | * @param[out] pErr points to the block of error data. |
4304 | * @param[in] blockSize number of samples to process. |
4053 | * @param[in] blockSize number of samples to process. |
4305 | * @return none. |
- | |
4306 | */ |
4054 | */ |
4307 | - | ||
4308 | void arm_lms_q15( |
4055 | void arm_lms_q15( |
4309 | const arm_lms_instance_q15 * S, |
4056 | const arm_lms_instance_q15 * S, |
4310 | q15_t * pSrc, |
4057 | q15_t * pSrc, |
4311 | q15_t * pRef, |
4058 | q15_t * pRef, |
4312 | q15_t * pOut, |
4059 | q15_t * pOut, |
Line 4315... | Line 4062... | ||
4315 | 4062 | ||
4316 | 4063 | ||
4317 | /** |
4064 | /** |
4318 | * @brief Instance structure for the Q31 LMS filter. |
4065 | * @brief Instance structure for the Q31 LMS filter. |
4319 | */ |
4066 | */ |
4320 | - | ||
4321 | typedef struct |
4067 | typedef struct |
4322 | { |
4068 | { |
4323 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4069 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4324 | q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
4070 | q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
4325 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
4071 | q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
4326 | q31_t mu; /**< step size that controls filter coefficient updates. */ |
4072 | q31_t mu; /**< step size that controls filter coefficient updates. */ |
4327 | uint32_t postShift; /**< bit shift applied to coefficients. */ |
4073 | uint32_t postShift; /**< bit shift applied to coefficients. */ |
4328 | - | ||
4329 | } arm_lms_instance_q31; |
4074 | } arm_lms_instance_q31; |
4330 | 4075 | ||
- | 4076 | ||
4331 | /** |
4077 | /** |
4332 | * @brief Processing function for Q31 LMS filter. |
4078 | * @brief Processing function for Q31 LMS filter. |
4333 | * @param[in] *S points to an instance of the Q15 LMS filter structure. |
4079 | * @param[in] S points to an instance of the Q15 LMS filter structure. |
4334 | * @param[in] *pSrc points to the block of input data. |
4080 | * @param[in] pSrc points to the block of input data. |
4335 | * @param[in] *pRef points to the block of reference data. |
4081 | * @param[in] pRef points to the block of reference data. |
4336 | * @param[out] *pOut points to the block of output data. |
4082 | * @param[out] pOut points to the block of output data. |
4337 | * @param[out] *pErr points to the block of error data. |
4083 | * @param[out] pErr points to the block of error data. |
4338 | * @param[in] blockSize number of samples to process. |
4084 | * @param[in] blockSize number of samples to process. |
4339 | * @return none. |
- | |
4340 | */ |
4085 | */ |
4341 | - | ||
4342 | void arm_lms_q31( |
4086 | void arm_lms_q31( |
4343 | const arm_lms_instance_q31 * S, |
4087 | const arm_lms_instance_q31 * S, |
4344 | q31_t * pSrc, |
4088 | q31_t * pSrc, |
4345 | q31_t * pRef, |
4089 | q31_t * pRef, |
4346 | q31_t * pOut, |
4090 | q31_t * pOut, |
4347 | q31_t * pErr, |
4091 | q31_t * pErr, |
4348 | uint32_t blockSize); |
4092 | uint32_t blockSize); |
4349 | 4093 | ||
- | 4094 | ||
4350 | /** |
4095 | /** |
4351 | * @brief Initialization function for Q31 LMS filter. |
4096 | * @brief Initialization function for Q31 LMS filter. |
4352 | * @param[in] *S points to an instance of the Q31 LMS filter structure. |
4097 | * @param[in] S points to an instance of the Q31 LMS filter structure. |
4353 | * @param[in] numTaps number of filter coefficients. |
4098 | * @param[in] numTaps number of filter coefficients. |
4354 | * @param[in] *pCoeffs points to coefficient buffer. |
4099 | * @param[in] pCoeffs points to coefficient buffer. |
4355 | * @param[in] *pState points to state buffer. |
4100 | * @param[in] pState points to state buffer. |
4356 | * @param[in] mu step size that controls filter coefficient updates. |
4101 | * @param[in] mu step size that controls filter coefficient updates. |
4357 | * @param[in] blockSize number of samples to process. |
4102 | * @param[in] blockSize number of samples to process. |
4358 | * @param[in] postShift bit shift applied to coefficients. |
4103 | * @param[in] postShift bit shift applied to coefficients. |
4359 | * @return none. |
- | |
4360 | */ |
4104 | */ |
4361 | - | ||
4362 | void arm_lms_init_q31( |
4105 | void arm_lms_init_q31( |
4363 | arm_lms_instance_q31 * S, |
4106 | arm_lms_instance_q31 * S, |
4364 | uint16_t numTaps, |
4107 | uint16_t numTaps, |
4365 | q31_t * pCoeffs, |
4108 | q31_t * pCoeffs, |
4366 | q31_t * pState, |
4109 | q31_t * pState, |
4367 | q31_t mu, |
4110 | q31_t mu, |
4368 | uint32_t blockSize, |
4111 | uint32_t blockSize, |
4369 | uint32_t postShift); |
4112 | uint32_t postShift); |
4370 | 4113 | ||
- | 4114 | ||
4371 | /** |
4115 | /** |
4372 | * @brief Instance structure for the floating-point normalized LMS filter. |
4116 | * @brief Instance structure for the floating-point normalized LMS filter. |
4373 | */ |
4117 | */ |
4374 | - | ||
4375 | typedef struct |
4118 | typedef struct |
4376 | { |
4119 | { |
4377 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4120 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4378 | float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
4121 | float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
4379 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
4122 | float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
4380 | float32_t mu; /**< step size that control filter coefficient updates. */ |
4123 | float32_t mu; /**< step size that control filter coefficient updates. */ |
4381 | float32_t energy; /**< saves previous frame energy. */ |
4124 | float32_t energy; /**< saves previous frame energy. */ |
4382 | float32_t x0; /**< saves previous input sample. */ |
4125 | float32_t x0; /**< saves previous input sample. */ |
4383 | } arm_lms_norm_instance_f32; |
4126 | } arm_lms_norm_instance_f32; |
4384 | 4127 | ||
- | 4128 | ||
4385 | /** |
4129 | /** |
4386 | * @brief Processing function for floating-point normalized LMS filter. |
4130 | * @brief Processing function for floating-point normalized LMS filter. |
4387 | * @param[in] *S points to an instance of the floating-point normalized LMS filter structure. |
4131 | * @param[in] S points to an instance of the floating-point normalized LMS filter structure. |
4388 | * @param[in] *pSrc points to the block of input data. |
4132 | * @param[in] pSrc points to the block of input data. |
4389 | * @param[in] *pRef points to the block of reference data. |
4133 | * @param[in] pRef points to the block of reference data. |
4390 | * @param[out] *pOut points to the block of output data. |
4134 | * @param[out] pOut points to the block of output data. |
4391 | * @param[out] *pErr points to the block of error data. |
4135 | * @param[out] pErr points to the block of error data. |
4392 | * @param[in] blockSize number of samples to process. |
4136 | * @param[in] blockSize number of samples to process. |
4393 | * @return none. |
- | |
4394 | */ |
4137 | */ |
4395 | - | ||
4396 | void arm_lms_norm_f32( |
4138 | void arm_lms_norm_f32( |
4397 | arm_lms_norm_instance_f32 * S, |
4139 | arm_lms_norm_instance_f32 * S, |
4398 | float32_t * pSrc, |
4140 | float32_t * pSrc, |
4399 | float32_t * pRef, |
4141 | float32_t * pRef, |
4400 | float32_t * pOut, |
4142 | float32_t * pOut, |
4401 | float32_t * pErr, |
4143 | float32_t * pErr, |
4402 | uint32_t blockSize); |
4144 | uint32_t blockSize); |
4403 | 4145 | ||
- | 4146 | ||
4404 | /** |
4147 | /** |
4405 | * @brief Initialization function for floating-point normalized LMS filter. |
4148 | * @brief Initialization function for floating-point normalized LMS filter. |
4406 | * @param[in] *S points to an instance of the floating-point LMS filter structure. |
4149 | * @param[in] S points to an instance of the floating-point LMS filter structure. |
4407 | * @param[in] numTaps number of filter coefficients. |
4150 | * @param[in] numTaps number of filter coefficients. |
4408 | * @param[in] *pCoeffs points to coefficient buffer. |
4151 | * @param[in] pCoeffs points to coefficient buffer. |
4409 | * @param[in] *pState points to state buffer. |
4152 | * @param[in] pState points to state buffer. |
4410 | * @param[in] mu step size that controls filter coefficient updates. |
4153 | * @param[in] mu step size that controls filter coefficient updates. |
4411 | * @param[in] blockSize number of samples to process. |
4154 | * @param[in] blockSize number of samples to process. |
4412 | * @return none. |
- | |
4413 | */ |
4155 | */ |
4414 | - | ||
4415 | void arm_lms_norm_init_f32( |
4156 | void arm_lms_norm_init_f32( |
4416 | arm_lms_norm_instance_f32 * S, |
4157 | arm_lms_norm_instance_f32 * S, |
4417 | uint16_t numTaps, |
4158 | uint16_t numTaps, |
4418 | float32_t * pCoeffs, |
4159 | float32_t * pCoeffs, |
4419 | float32_t * pState, |
4160 | float32_t * pState, |
Line 4434... | Line 4175... | ||
4434 | q31_t *recipTable; /**< points to the reciprocal initial value table. */ |
4175 | q31_t *recipTable; /**< points to the reciprocal initial value table. */ |
4435 | q31_t energy; /**< saves previous frame energy. */ |
4176 | q31_t energy; /**< saves previous frame energy. */ |
4436 | q31_t x0; /**< saves previous input sample. */ |
4177 | q31_t x0; /**< saves previous input sample. */ |
4437 | } arm_lms_norm_instance_q31; |
4178 | } arm_lms_norm_instance_q31; |
4438 | 4179 | ||
- | 4180 | ||
4439 | /** |
4181 | /** |
4440 | * @brief Processing function for Q31 normalized LMS filter. |
4182 | * @brief Processing function for Q31 normalized LMS filter. |
4441 | * @param[in] *S points to an instance of the Q31 normalized LMS filter structure. |
4183 | * @param[in] S points to an instance of the Q31 normalized LMS filter structure. |
4442 | * @param[in] *pSrc points to the block of input data. |
4184 | * @param[in] pSrc points to the block of input data. |
4443 | * @param[in] *pRef points to the block of reference data. |
4185 | * @param[in] pRef points to the block of reference data. |
4444 | * @param[out] *pOut points to the block of output data. |
4186 | * @param[out] pOut points to the block of output data. |
4445 | * @param[out] *pErr points to the block of error data. |
4187 | * @param[out] pErr points to the block of error data. |
4446 | * @param[in] blockSize number of samples to process. |
4188 | * @param[in] blockSize number of samples to process. |
4447 | * @return none. |
- | |
4448 | */ |
4189 | */ |
4449 | - | ||
4450 | void arm_lms_norm_q31( |
4190 | void arm_lms_norm_q31( |
4451 | arm_lms_norm_instance_q31 * S, |
4191 | arm_lms_norm_instance_q31 * S, |
4452 | q31_t * pSrc, |
4192 | q31_t * pSrc, |
4453 | q31_t * pRef, |
4193 | q31_t * pRef, |
4454 | q31_t * pOut, |
4194 | q31_t * pOut, |
4455 | q31_t * pErr, |
4195 | q31_t * pErr, |
4456 | uint32_t blockSize); |
4196 | uint32_t blockSize); |
4457 | 4197 | ||
- | 4198 | ||
4458 | /** |
4199 | /** |
4459 | * @brief Initialization function for Q31 normalized LMS filter. |
4200 | * @brief Initialization function for Q31 normalized LMS filter. |
4460 | * @param[in] *S points to an instance of the Q31 normalized LMS filter structure. |
4201 | * @param[in] S points to an instance of the Q31 normalized LMS filter structure. |
4461 | * @param[in] numTaps number of filter coefficients. |
4202 | * @param[in] numTaps number of filter coefficients. |
4462 | * @param[in] *pCoeffs points to coefficient buffer. |
4203 | * @param[in] pCoeffs points to coefficient buffer. |
4463 | * @param[in] *pState points to state buffer. |
4204 | * @param[in] pState points to state buffer. |
4464 | * @param[in] mu step size that controls filter coefficient updates. |
4205 | * @param[in] mu step size that controls filter coefficient updates. |
4465 | * @param[in] blockSize number of samples to process. |
4206 | * @param[in] blockSize number of samples to process. |
4466 | * @param[in] postShift bit shift applied to coefficients. |
4207 | * @param[in] postShift bit shift applied to coefficients. |
4467 | * @return none. |
- | |
4468 | */ |
4208 | */ |
4469 | - | ||
4470 | void arm_lms_norm_init_q31( |
4209 | void arm_lms_norm_init_q31( |
4471 | arm_lms_norm_instance_q31 * S, |
4210 | arm_lms_norm_instance_q31 * S, |
4472 | uint16_t numTaps, |
4211 | uint16_t numTaps, |
4473 | q31_t * pCoeffs, |
4212 | q31_t * pCoeffs, |
4474 | q31_t * pState, |
4213 | q31_t * pState, |
4475 | q31_t mu, |
4214 | q31_t mu, |
4476 | uint32_t blockSize, |
4215 | uint32_t blockSize, |
4477 | uint8_t postShift); |
4216 | uint8_t postShift); |
4478 | 4217 | ||
- | 4218 | ||
4479 | /** |
4219 | /** |
4480 | * @brief Instance structure for the Q15 normalized LMS filter. |
4220 | * @brief Instance structure for the Q15 normalized LMS filter. |
4481 | */ |
4221 | */ |
4482 | - | ||
4483 | typedef struct |
4222 | typedef struct |
4484 | { |
4223 | { |
4485 | uint16_t numTaps; /**< Number of coefficients in the filter. */ |
4224 | uint16_t numTaps; /**< Number of coefficients in the filter. */ |
4486 | q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
4225 | q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ |
4487 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
4226 | q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ |
4488 | q15_t mu; /**< step size that controls filter coefficient updates. */ |
4227 | q15_t mu; /**< step size that controls filter coefficient updates. */ |
4489 | uint8_t postShift; /**< bit shift applied to coefficients. */ |
4228 | uint8_t postShift; /**< bit shift applied to coefficients. */ |
4490 | q15_t *recipTable; /**< Points to the reciprocal initial value table. */ |
4229 | q15_t *recipTable; /**< Points to the reciprocal initial value table. */ |
4491 | q15_t energy; /**< saves previous frame energy. */ |
4230 | q15_t energy; /**< saves previous frame energy. */ |
4492 | q15_t x0; /**< saves previous input sample. */ |
4231 | q15_t x0; /**< saves previous input sample. */ |
4493 | } arm_lms_norm_instance_q15; |
4232 | } arm_lms_norm_instance_q15; |
4494 | 4233 | ||
- | 4234 | ||
4495 | /** |
4235 | /** |
4496 | * @brief Processing function for Q15 normalized LMS filter. |
4236 | * @brief Processing function for Q15 normalized LMS filter. |
4497 | * @param[in] *S points to an instance of the Q15 normalized LMS filter structure. |
4237 | * @param[in] S points to an instance of the Q15 normalized LMS filter structure. |
4498 | * @param[in] *pSrc points to the block of input data. |
4238 | * @param[in] pSrc points to the block of input data. |
4499 | * @param[in] *pRef points to the block of reference data. |
4239 | * @param[in] pRef points to the block of reference data. |
4500 | * @param[out] *pOut points to the block of output data. |
4240 | * @param[out] pOut points to the block of output data. |
4501 | * @param[out] *pErr points to the block of error data. |
4241 | * @param[out] pErr points to the block of error data. |
4502 | * @param[in] blockSize number of samples to process. |
4242 | * @param[in] blockSize number of samples to process. |
4503 | * @return none. |
- | |
4504 | */ |
4243 | */ |
4505 | - | ||
4506 | void arm_lms_norm_q15( |
4244 | void arm_lms_norm_q15( |
4507 | arm_lms_norm_instance_q15 * S, |
4245 | arm_lms_norm_instance_q15 * S, |
4508 | q15_t * pSrc, |
4246 | q15_t * pSrc, |
4509 | q15_t * pRef, |
4247 | q15_t * pRef, |
4510 | q15_t * pOut, |
4248 | q15_t * pOut, |
Line 4512... | Line 4250... | ||
4512 | uint32_t blockSize); |
4250 | uint32_t blockSize); |
4513 | 4251 | ||
4514 | 4252 | ||
4515 | /** |
4253 | /** |
4516 | * @brief Initialization function for Q15 normalized LMS filter. |
4254 | * @brief Initialization function for Q15 normalized LMS filter. |
4517 | * @param[in] *S points to an instance of the Q15 normalized LMS filter structure. |
4255 | * @param[in] S points to an instance of the Q15 normalized LMS filter structure. |
4518 | * @param[in] numTaps number of filter coefficients. |
4256 | * @param[in] numTaps number of filter coefficients. |
4519 | * @param[in] *pCoeffs points to coefficient buffer. |
4257 | * @param[in] pCoeffs points to coefficient buffer. |
4520 | * @param[in] *pState points to state buffer. |
4258 | * @param[in] pState points to state buffer. |
4521 | * @param[in] mu step size that controls filter coefficient updates. |
4259 | * @param[in] mu step size that controls filter coefficient updates. |
4522 | * @param[in] blockSize number of samples to process. |
4260 | * @param[in] blockSize number of samples to process. |
4523 | * @param[in] postShift bit shift applied to coefficients. |
4261 | * @param[in] postShift bit shift applied to coefficients. |
4524 | * @return none. |
- | |
4525 | */ |
4262 | */ |
4526 | - | ||
4527 | void arm_lms_norm_init_q15( |
4263 | void arm_lms_norm_init_q15( |
4528 | arm_lms_norm_instance_q15 * S, |
4264 | arm_lms_norm_instance_q15 * S, |
4529 | uint16_t numTaps, |
4265 | uint16_t numTaps, |
4530 | q15_t * pCoeffs, |
4266 | q15_t * pCoeffs, |
4531 | q15_t * pState, |
4267 | q15_t * pState, |
4532 | q15_t mu, |
4268 | q15_t mu, |
4533 | uint32_t blockSize, |
4269 | uint32_t blockSize, |
4534 | uint8_t postShift); |
4270 | uint8_t postShift); |
4535 | 4271 | ||
- | 4272 | ||
4536 | /** |
4273 | /** |
4537 | * @brief Correlation of floating-point sequences. |
4274 | * @brief Correlation of floating-point sequences. |
4538 | * @param[in] *pSrcA points to the first input sequence. |
4275 | * @param[in] pSrcA points to the first input sequence. |
4539 | * @param[in] srcALen length of the first input sequence. |
4276 | * @param[in] srcALen length of the first input sequence. |
4540 | * @param[in] *pSrcB points to the second input sequence. |
4277 | * @param[in] pSrcB points to the second input sequence. |
4541 | * @param[in] srcBLen length of the second input sequence. |
4278 | * @param[in] srcBLen length of the second input sequence. |
4542 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4279 | * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4543 | * @return none. |
- | |
4544 | */ |
4280 | */ |
4545 | - | ||
4546 | void arm_correlate_f32( |
4281 | void arm_correlate_f32( |
4547 | float32_t * pSrcA, |
4282 | float32_t * pSrcA, |
4548 | uint32_t srcALen, |
4283 | uint32_t srcALen, |
4549 | float32_t * pSrcB, |
4284 | float32_t * pSrcB, |
4550 | uint32_t srcBLen, |
4285 | uint32_t srcBLen, |
4551 | float32_t * pDst); |
4286 | float32_t * pDst); |
4552 | 4287 | ||
4553 | 4288 | ||
4554 | /** |
4289 | /** |
4555 | * @brief Correlation of Q15 sequences |
4290 | * @brief Correlation of Q15 sequences |
4556 | * @param[in] *pSrcA points to the first input sequence. |
4291 | * @param[in] pSrcA points to the first input sequence. |
4557 | * @param[in] srcALen length of the first input sequence. |
4292 | * @param[in] srcALen length of the first input sequence. |
4558 | * @param[in] *pSrcB points to the second input sequence. |
4293 | * @param[in] pSrcB points to the second input sequence. |
4559 | * @param[in] srcBLen length of the second input sequence. |
4294 | * @param[in] srcBLen length of the second input sequence. |
4560 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4295 | * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4561 | * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
4296 | * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
4562 | * @return none. |
- | |
4563 | */ |
4297 | */ |
4564 | void arm_correlate_opt_q15( |
4298 | void arm_correlate_opt_q15( |
4565 | q15_t * pSrcA, |
4299 | q15_t * pSrcA, |
4566 | uint32_t srcALen, |
4300 | uint32_t srcALen, |
4567 | q15_t * pSrcB, |
4301 | q15_t * pSrcB, |
Line 4570... | Line 4304... | ||
4570 | q15_t * pScratch); |
4304 | q15_t * pScratch); |
4571 | 4305 | ||
4572 | 4306 | ||
4573 | /** |
4307 | /** |
4574 | * @brief Correlation of Q15 sequences. |
4308 | * @brief Correlation of Q15 sequences. |
4575 | * @param[in] *pSrcA points to the first input sequence. |
4309 | * @param[in] pSrcA points to the first input sequence. |
4576 | * @param[in] srcALen length of the first input sequence. |
4310 | * @param[in] srcALen length of the first input sequence. |
4577 | * @param[in] *pSrcB points to the second input sequence. |
4311 | * @param[in] pSrcB points to the second input sequence. |
4578 | * @param[in] srcBLen length of the second input sequence. |
4312 | * @param[in] srcBLen length of the second input sequence. |
4579 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4313 | * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4580 | * @return none. |
- | |
4581 | */ |
4314 | */ |
4582 | 4315 | ||
4583 | void arm_correlate_q15( |
4316 | void arm_correlate_q15( |
4584 | q15_t * pSrcA, |
4317 | q15_t * pSrcA, |
4585 | uint32_t srcALen, |
4318 | uint32_t srcALen, |
4586 | q15_t * pSrcB, |
4319 | q15_t * pSrcB, |
4587 | uint32_t srcBLen, |
4320 | uint32_t srcBLen, |
4588 | q15_t * pDst); |
4321 | q15_t * pDst); |
4589 | 4322 | ||
- | 4323 | ||
4590 | /** |
4324 | /** |
4591 | * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. |
4325 | * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. |
4592 | * @param[in] *pSrcA points to the first input sequence. |
4326 | * @param[in] pSrcA points to the first input sequence. |
4593 | * @param[in] srcALen length of the first input sequence. |
4327 | * @param[in] srcALen length of the first input sequence. |
4594 | * @param[in] *pSrcB points to the second input sequence. |
4328 | * @param[in] pSrcB points to the second input sequence. |
4595 | * @param[in] srcBLen length of the second input sequence. |
4329 | * @param[in] srcBLen length of the second input sequence. |
4596 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4330 | * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4597 | * @return none. |
- | |
4598 | */ |
4331 | */ |
4599 | 4332 | ||
4600 | void arm_correlate_fast_q15( |
4333 | void arm_correlate_fast_q15( |
4601 | q15_t * pSrcA, |
4334 | q15_t * pSrcA, |
4602 | uint32_t srcALen, |
4335 | uint32_t srcALen, |
4603 | q15_t * pSrcB, |
4336 | q15_t * pSrcB, |
4604 | uint32_t srcBLen, |
4337 | uint32_t srcBLen, |
4605 | q15_t * pDst); |
4338 | q15_t * pDst); |
4606 | - | ||
4607 | 4339 | ||
4608 | 4340 | ||
4609 | /** |
4341 | /** |
4610 | * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. |
4342 | * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. |
4611 | * @param[in] *pSrcA points to the first input sequence. |
4343 | * @param[in] pSrcA points to the first input sequence. |
4612 | * @param[in] srcALen length of the first input sequence. |
4344 | * @param[in] srcALen length of the first input sequence. |
4613 | * @param[in] *pSrcB points to the second input sequence. |
4345 | * @param[in] pSrcB points to the second input sequence. |
4614 | * @param[in] srcBLen length of the second input sequence. |
4346 | * @param[in] srcBLen length of the second input sequence. |
4615 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4347 | * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4616 | * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
4348 | * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
4617 | * @return none. |
- | |
4618 | */ |
4349 | */ |
4619 | - | ||
4620 | void arm_correlate_fast_opt_q15( |
4350 | void arm_correlate_fast_opt_q15( |
4621 | q15_t * pSrcA, |
4351 | q15_t * pSrcA, |
4622 | uint32_t srcALen, |
4352 | uint32_t srcALen, |
4623 | q15_t * pSrcB, |
4353 | q15_t * pSrcB, |
4624 | uint32_t srcBLen, |
4354 | uint32_t srcBLen, |
4625 | q15_t * pDst, |
4355 | q15_t * pDst, |
4626 | q15_t * pScratch); |
4356 | q15_t * pScratch); |
4627 | 4357 | ||
- | 4358 | ||
4628 | /** |
4359 | /** |
4629 | * @brief Correlation of Q31 sequences. |
4360 | * @brief Correlation of Q31 sequences. |
4630 | * @param[in] *pSrcA points to the first input sequence. |
4361 | * @param[in] pSrcA points to the first input sequence. |
4631 | * @param[in] srcALen length of the first input sequence. |
4362 | * @param[in] srcALen length of the first input sequence. |
4632 | * @param[in] *pSrcB points to the second input sequence. |
4363 | * @param[in] pSrcB points to the second input sequence. |
4633 | * @param[in] srcBLen length of the second input sequence. |
4364 | * @param[in] srcBLen length of the second input sequence. |
4634 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4365 | * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4635 | * @return none. |
- | |
4636 | */ |
4366 | */ |
4637 | - | ||
4638 | void arm_correlate_q31( |
4367 | void arm_correlate_q31( |
4639 | q31_t * pSrcA, |
4368 | q31_t * pSrcA, |
4640 | uint32_t srcALen, |
4369 | uint32_t srcALen, |
4641 | q31_t * pSrcB, |
4370 | q31_t * pSrcB, |
4642 | uint32_t srcBLen, |
4371 | uint32_t srcBLen, |
4643 | q31_t * pDst); |
4372 | q31_t * pDst); |
4644 | 4373 | ||
- | 4374 | ||
4645 | /** |
4375 | /** |
4646 | * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 |
4376 | * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 |
4647 | * @param[in] *pSrcA points to the first input sequence. |
4377 | * @param[in] pSrcA points to the first input sequence. |
4648 | * @param[in] srcALen length of the first input sequence. |
4378 | * @param[in] srcALen length of the first input sequence. |
4649 | * @param[in] *pSrcB points to the second input sequence. |
4379 | * @param[in] pSrcB points to the second input sequence. |
4650 | * @param[in] srcBLen length of the second input sequence. |
4380 | * @param[in] srcBLen length of the second input sequence. |
4651 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4381 | * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4652 | * @return none. |
- | |
4653 | */ |
4382 | */ |
4654 | - | ||
4655 | void arm_correlate_fast_q31( |
4383 | void arm_correlate_fast_q31( |
4656 | q31_t * pSrcA, |
4384 | q31_t * pSrcA, |
4657 | uint32_t srcALen, |
4385 | uint32_t srcALen, |
4658 | q31_t * pSrcB, |
4386 | q31_t * pSrcB, |
4659 | uint32_t srcBLen, |
4387 | uint32_t srcBLen, |
4660 | q31_t * pDst); |
4388 | q31_t * pDst); |
4661 | 4389 | ||
4662 | 4390 | ||
4663 | - | ||
4664 | /** |
4391 | /** |
4665 | * @brief Correlation of Q7 sequences. |
4392 | * @brief Correlation of Q7 sequences. |
4666 | * @param[in] *pSrcA points to the first input sequence. |
4393 | * @param[in] pSrcA points to the first input sequence. |
4667 | * @param[in] srcALen length of the first input sequence. |
4394 | * @param[in] srcALen length of the first input sequence. |
4668 | * @param[in] *pSrcB points to the second input sequence. |
4395 | * @param[in] pSrcB points to the second input sequence. |
4669 | * @param[in] srcBLen length of the second input sequence. |
4396 | * @param[in] srcBLen length of the second input sequence. |
4670 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4397 | * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4671 | * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
4398 | * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. |
4672 | * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). |
4399 | * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). |
4673 | * @return none. |
- | |
4674 | */ |
4400 | */ |
4675 | - | ||
4676 | void arm_correlate_opt_q7( |
4401 | void arm_correlate_opt_q7( |
4677 | q7_t * pSrcA, |
4402 | q7_t * pSrcA, |
4678 | uint32_t srcALen, |
4403 | uint32_t srcALen, |
4679 | q7_t * pSrcB, |
4404 | q7_t * pSrcB, |
4680 | uint32_t srcBLen, |
4405 | uint32_t srcBLen, |
Line 4683... | Line 4408... | ||
4683 | q15_t * pScratch2); |
4408 | q15_t * pScratch2); |
4684 | 4409 | ||
4685 | 4410 | ||
4686 | /** |
4411 | /** |
4687 | * @brief Correlation of Q7 sequences. |
4412 | * @brief Correlation of Q7 sequences. |
4688 | * @param[in] *pSrcA points to the first input sequence. |
4413 | * @param[in] pSrcA points to the first input sequence. |
4689 | * @param[in] srcALen length of the first input sequence. |
4414 | * @param[in] srcALen length of the first input sequence. |
4690 | * @param[in] *pSrcB points to the second input sequence. |
4415 | * @param[in] pSrcB points to the second input sequence. |
4691 | * @param[in] srcBLen length of the second input sequence. |
4416 | * @param[in] srcBLen length of the second input sequence. |
4692 | * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4417 | * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. |
4693 | * @return none. |
- | |
4694 | */ |
4418 | */ |
4695 | - | ||
4696 | void arm_correlate_q7( |
4419 | void arm_correlate_q7( |
4697 | q7_t * pSrcA, |
4420 | q7_t * pSrcA, |
4698 | uint32_t srcALen, |
4421 | uint32_t srcALen, |
4699 | q7_t * pSrcB, |
4422 | q7_t * pSrcB, |
4700 | uint32_t srcBLen, |
4423 | uint32_t srcBLen, |
Line 4715... | Line 4438... | ||
4715 | } arm_fir_sparse_instance_f32; |
4438 | } arm_fir_sparse_instance_f32; |
4716 | 4439 | ||
4717 | /** |
4440 | /** |
4718 | * @brief Instance structure for the Q31 sparse FIR filter. |
4441 | * @brief Instance structure for the Q31 sparse FIR filter. |
4719 | */ |
4442 | */ |
4720 | - | ||
4721 | typedef struct |
4443 | typedef struct |
4722 | { |
4444 | { |
4723 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4445 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4724 | uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ |
4446 | uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ |
4725 | q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ |
4447 | q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ |
Line 4729... | Line 4451... | ||
4729 | } arm_fir_sparse_instance_q31; |
4451 | } arm_fir_sparse_instance_q31; |
4730 | 4452 | ||
4731 | /** |
4453 | /** |
4732 | * @brief Instance structure for the Q15 sparse FIR filter. |
4454 | * @brief Instance structure for the Q15 sparse FIR filter. |
4733 | */ |
4455 | */ |
4734 | - | ||
4735 | typedef struct |
4456 | typedef struct |
4736 | { |
4457 | { |
4737 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4458 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4738 | uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ |
4459 | uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ |
4739 | q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ |
4460 | q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ |
Line 4743... | Line 4464... | ||
4743 | } arm_fir_sparse_instance_q15; |
4464 | } arm_fir_sparse_instance_q15; |
4744 | 4465 | ||
4745 | /** |
4466 | /** |
4746 | * @brief Instance structure for the Q7 sparse FIR filter. |
4467 | * @brief Instance structure for the Q7 sparse FIR filter. |
4747 | */ |
4468 | */ |
4748 | - | ||
4749 | typedef struct |
4469 | typedef struct |
4750 | { |
4470 | { |
4751 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4471 | uint16_t numTaps; /**< number of coefficients in the filter. */ |
4752 | uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ |
4472 | uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ |
4753 | q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ |
4473 | q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ |
4754 | q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
4474 | q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ |
4755 | uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ |
4475 | uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ |
4756 | int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ |
4476 | int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ |
4757 | } arm_fir_sparse_instance_q7; |
4477 | } arm_fir_sparse_instance_q7; |
4758 | 4478 | ||
- | 4479 | ||
4759 | /** |
4480 | /** |
4760 | * @brief Processing function for the floating-point sparse FIR filter. |
4481 | * @brief Processing function for the floating-point sparse FIR filter. |
4761 | * @param[in] *S points to an instance of the floating-point sparse FIR structure. |
4482 | * @param[in] S points to an instance of the floating-point sparse FIR structure. |
4762 | * @param[in] *pSrc points to the block of input data. |
4483 | * @param[in] pSrc points to the block of input data. |
4763 | * @param[out] *pDst points to the block of output data |
4484 | * @param[out] pDst points to the block of output data |
4764 | * @param[in] *pScratchIn points to a temporary buffer of size blockSize. |
4485 | * @param[in] pScratchIn points to a temporary buffer of size blockSize. |
4765 | * @param[in] blockSize number of input samples to process per call. |
4486 | * @param[in] blockSize number of input samples to process per call. |
4766 | * @return none. |
- | |
4767 | */ |
4487 | */ |
4768 | - | ||
4769 | void arm_fir_sparse_f32( |
4488 | void arm_fir_sparse_f32( |
4770 | arm_fir_sparse_instance_f32 * S, |
4489 | arm_fir_sparse_instance_f32 * S, |
4771 | float32_t * pSrc, |
4490 | float32_t * pSrc, |
4772 | float32_t * pDst, |
4491 | float32_t * pDst, |
4773 | float32_t * pScratchIn, |
4492 | float32_t * pScratchIn, |
4774 | uint32_t blockSize); |
4493 | uint32_t blockSize); |
4775 | 4494 | ||
- | 4495 | ||
4776 | /** |
4496 | /** |
4777 | * @brief Initialization function for the floating-point sparse FIR filter. |
4497 | * @brief Initialization function for the floating-point sparse FIR filter. |
4778 | * @param[in,out] *S points to an instance of the floating-point sparse FIR structure. |
4498 | * @param[in,out] S points to an instance of the floating-point sparse FIR structure. |
4779 | * @param[in] numTaps number of nonzero coefficients in the filter. |
4499 | * @param[in] numTaps number of nonzero coefficients in the filter. |
4780 | * @param[in] *pCoeffs points to the array of filter coefficients. |
4500 | * @param[in] pCoeffs points to the array of filter coefficients. |
4781 | * @param[in] *pState points to the state buffer. |
4501 | * @param[in] pState points to the state buffer. |
4782 | * @param[in] *pTapDelay points to the array of offset times. |
4502 | * @param[in] pTapDelay points to the array of offset times. |
4783 | * @param[in] maxDelay maximum offset time supported. |
4503 | * @param[in] maxDelay maximum offset time supported. |
4784 | * @param[in] blockSize number of samples that will be processed per block. |
4504 | * @param[in] blockSize number of samples that will be processed per block. |
4785 | * @return none |
- | |
4786 | */ |
4505 | */ |
4787 | - | ||
4788 | void arm_fir_sparse_init_f32( |
4506 | void arm_fir_sparse_init_f32( |
4789 | arm_fir_sparse_instance_f32 * S, |
4507 | arm_fir_sparse_instance_f32 * S, |
4790 | uint16_t numTaps, |
4508 | uint16_t numTaps, |
4791 | float32_t * pCoeffs, |
4509 | float32_t * pCoeffs, |
4792 | float32_t * pState, |
4510 | float32_t * pState, |
4793 | int32_t * pTapDelay, |
4511 | int32_t * pTapDelay, |
4794 | uint16_t maxDelay, |
4512 | uint16_t maxDelay, |
4795 | uint32_t blockSize); |
4513 | uint32_t blockSize); |
4796 | 4514 | ||
- | 4515 | ||
4797 | /** |
4516 | /** |
4798 | * @brief Processing function for the Q31 sparse FIR filter. |
4517 | * @brief Processing function for the Q31 sparse FIR filter. |
4799 | * @param[in] *S points to an instance of the Q31 sparse FIR structure. |
4518 | * @param[in] S points to an instance of the Q31 sparse FIR structure. |
4800 | * @param[in] *pSrc points to the block of input data. |
4519 | * @param[in] pSrc points to the block of input data. |
4801 | * @param[out] *pDst points to the block of output data |
4520 | * @param[out] pDst points to the block of output data |
4802 | * @param[in] *pScratchIn points to a temporary buffer of size blockSize. |
4521 | * @param[in] pScratchIn points to a temporary buffer of size blockSize. |
4803 | * @param[in] blockSize number of input samples to process per call. |
4522 | * @param[in] blockSize number of input samples to process per call. |
4804 | * @return none. |
- | |
4805 | */ |
4523 | */ |
4806 | - | ||
4807 | void arm_fir_sparse_q31( |
4524 | void arm_fir_sparse_q31( |
4808 | arm_fir_sparse_instance_q31 * S, |
4525 | arm_fir_sparse_instance_q31 * S, |
4809 | q31_t * pSrc, |
4526 | q31_t * pSrc, |
4810 | q31_t * pDst, |
4527 | q31_t * pDst, |
4811 | q31_t * pScratchIn, |
4528 | q31_t * pScratchIn, |
4812 | uint32_t blockSize); |
4529 | uint32_t blockSize); |
4813 | 4530 | ||
- | 4531 | ||
4814 | /** |
4532 | /** |
4815 | * @brief Initialization function for the Q31 sparse FIR filter. |
4533 | * @brief Initialization function for the Q31 sparse FIR filter. |
4816 | * @param[in,out] *S points to an instance of the Q31 sparse FIR structure. |
4534 | * @param[in,out] S points to an instance of the Q31 sparse FIR structure. |
4817 | * @param[in] numTaps number of nonzero coefficients in the filter. |
4535 | * @param[in] numTaps number of nonzero coefficients in the filter. |
4818 | * @param[in] *pCoeffs points to the array of filter coefficients. |
4536 | * @param[in] pCoeffs points to the array of filter coefficients. |
4819 | * @param[in] *pState points to the state buffer. |
4537 | * @param[in] pState points to the state buffer. |
4820 | * @param[in] *pTapDelay points to the array of offset times. |
4538 | * @param[in] pTapDelay points to the array of offset times. |
4821 | * @param[in] maxDelay maximum offset time supported. |
4539 | * @param[in] maxDelay maximum offset time supported. |
4822 | * @param[in] blockSize number of samples that will be processed per block. |
4540 | * @param[in] blockSize number of samples that will be processed per block. |
4823 | * @return none |
- | |
4824 | */ |
4541 | */ |
4825 | - | ||
4826 | void arm_fir_sparse_init_q31( |
4542 | void arm_fir_sparse_init_q31( |
4827 | arm_fir_sparse_instance_q31 * S, |
4543 | arm_fir_sparse_instance_q31 * S, |
4828 | uint16_t numTaps, |
4544 | uint16_t numTaps, |
4829 | q31_t * pCoeffs, |
4545 | q31_t * pCoeffs, |
4830 | q31_t * pState, |
4546 | q31_t * pState, |
4831 | int32_t * pTapDelay, |
4547 | int32_t * pTapDelay, |
4832 | uint16_t maxDelay, |
4548 | uint16_t maxDelay, |
4833 | uint32_t blockSize); |
4549 | uint32_t blockSize); |
4834 | 4550 | ||
- | 4551 | ||
4835 | /** |
4552 | /** |
4836 | * @brief Processing function for the Q15 sparse FIR filter. |
4553 | * @brief Processing function for the Q15 sparse FIR filter. |
4837 | * @param[in] *S points to an instance of the Q15 sparse FIR structure. |
4554 | * @param[in] S points to an instance of the Q15 sparse FIR structure. |
4838 | * @param[in] *pSrc points to the block of input data. |
4555 | * @param[in] pSrc points to the block of input data. |
4839 | * @param[out] *pDst points to the block of output data |
4556 | * @param[out] pDst points to the block of output data |
4840 | * @param[in] *pScratchIn points to a temporary buffer of size blockSize. |
4557 | * @param[in] pScratchIn points to a temporary buffer of size blockSize. |
4841 | * @param[in] *pScratchOut points to a temporary buffer of size blockSize. |
4558 | * @param[in] pScratchOut points to a temporary buffer of size blockSize. |
4842 | * @param[in] blockSize number of input samples to process per call. |
4559 | * @param[in] blockSize number of input samples to process per call. |
4843 | * @return none. |
- | |
4844 | */ |
4560 | */ |
4845 | - | ||
4846 | void arm_fir_sparse_q15( |
4561 | void arm_fir_sparse_q15( |
4847 | arm_fir_sparse_instance_q15 * S, |
4562 | arm_fir_sparse_instance_q15 * S, |
4848 | q15_t * pSrc, |
4563 | q15_t * pSrc, |
4849 | q15_t * pDst, |
4564 | q15_t * pDst, |
4850 | q15_t * pScratchIn, |
4565 | q15_t * pScratchIn, |
Line 4852... | Line 4567... | ||
4852 | uint32_t blockSize); |
4567 | uint32_t blockSize); |
4853 | 4568 | ||
4854 | 4569 | ||
4855 | /** |
4570 | /** |
4856 | * @brief Initialization function for the Q15 sparse FIR filter. |
4571 | * @brief Initialization function for the Q15 sparse FIR filter. |
4857 | * @param[in,out] *S points to an instance of the Q15 sparse FIR structure. |
4572 | * @param[in,out] S points to an instance of the Q15 sparse FIR structure. |
4858 | * @param[in] numTaps number of nonzero coefficients in the filter. |
4573 | * @param[in] numTaps number of nonzero coefficients in the filter. |
4859 | * @param[in] *pCoeffs points to the array of filter coefficients. |
4574 | * @param[in] pCoeffs points to the array of filter coefficients. |
4860 | * @param[in] *pState points to the state buffer. |
4575 | * @param[in] pState points to the state buffer. |
4861 | * @param[in] *pTapDelay points to the array of offset times. |
4576 | * @param[in] pTapDelay points to the array of offset times. |
4862 | * @param[in] maxDelay maximum offset time supported. |
4577 | * @param[in] maxDelay maximum offset time supported. |
4863 | * @param[in] blockSize number of samples that will be processed per block. |
4578 | * @param[in] blockSize number of samples that will be processed per block. |
4864 | * @return none |
- | |
4865 | */ |
4579 | */ |
4866 | - | ||
4867 | void arm_fir_sparse_init_q15( |
4580 | void arm_fir_sparse_init_q15( |
4868 | arm_fir_sparse_instance_q15 * S, |
4581 | arm_fir_sparse_instance_q15 * S, |
4869 | uint16_t numTaps, |
4582 | uint16_t numTaps, |
4870 | q15_t * pCoeffs, |
4583 | q15_t * pCoeffs, |
4871 | q15_t * pState, |
4584 | q15_t * pState, |
4872 | int32_t * pTapDelay, |
4585 | int32_t * pTapDelay, |
4873 | uint16_t maxDelay, |
4586 | uint16_t maxDelay, |
4874 | uint32_t blockSize); |
4587 | uint32_t blockSize); |
4875 | 4588 | ||
- | 4589 | ||
4876 | /** |
4590 | /** |
4877 | * @brief Processing function for the Q7 sparse FIR filter. |
4591 | * @brief Processing function for the Q7 sparse FIR filter. |
4878 | * @param[in] *S points to an instance of the Q7 sparse FIR structure. |
4592 | * @param[in] S points to an instance of the Q7 sparse FIR structure. |
4879 | * @param[in] *pSrc points to the block of input data. |
4593 | * @param[in] pSrc points to the block of input data. |
4880 | * @param[out] *pDst points to the block of output data |
4594 | * @param[out] pDst points to the block of output data |
4881 | * @param[in] *pScratchIn points to a temporary buffer of size blockSize. |
4595 | * @param[in] pScratchIn points to a temporary buffer of size blockSize. |
4882 | * @param[in] *pScratchOut points to a temporary buffer of size blockSize. |
4596 | * @param[in] pScratchOut points to a temporary buffer of size blockSize. |
4883 | * @param[in] blockSize number of input samples to process per call. |
4597 | * @param[in] blockSize number of input samples to process per call. |
4884 | * @return none. |
- | |
4885 | */ |
4598 | */ |
4886 | - | ||
4887 | void arm_fir_sparse_q7( |
4599 | void arm_fir_sparse_q7( |
4888 | arm_fir_sparse_instance_q7 * S, |
4600 | arm_fir_sparse_instance_q7 * S, |
4889 | q7_t * pSrc, |
4601 | q7_t * pSrc, |
4890 | q7_t * pDst, |
4602 | q7_t * pDst, |
4891 | q7_t * pScratchIn, |
4603 | q7_t * pScratchIn, |
4892 | q31_t * pScratchOut, |
4604 | q31_t * pScratchOut, |
4893 | uint32_t blockSize); |
4605 | uint32_t blockSize); |
4894 | 4606 | ||
- | 4607 | ||
4895 | /** |
4608 | /** |
4896 | * @brief Initialization function for the Q7 sparse FIR filter. |
4609 | * @brief Initialization function for the Q7 sparse FIR filter. |
4897 | * @param[in,out] *S points to an instance of the Q7 sparse FIR structure. |
4610 | * @param[in,out] S points to an instance of the Q7 sparse FIR structure. |
4898 | * @param[in] numTaps number of nonzero coefficients in the filter. |
4611 | * @param[in] numTaps number of nonzero coefficients in the filter. |
4899 | * @param[in] *pCoeffs points to the array of filter coefficients. |
4612 | * @param[in] pCoeffs points to the array of filter coefficients. |
4900 | * @param[in] *pState points to the state buffer. |
4613 | * @param[in] pState points to the state buffer. |
4901 | * @param[in] *pTapDelay points to the array of offset times. |
4614 | * @param[in] pTapDelay points to the array of offset times. |
4902 | * @param[in] maxDelay maximum offset time supported. |
4615 | * @param[in] maxDelay maximum offset time supported. |
4903 | * @param[in] blockSize number of samples that will be processed per block. |
4616 | * @param[in] blockSize number of samples that will be processed per block. |
4904 | * @return none |
- | |
4905 | */ |
4617 | */ |
4906 | - | ||
4907 | void arm_fir_sparse_init_q7( |
4618 | void arm_fir_sparse_init_q7( |
4908 | arm_fir_sparse_instance_q7 * S, |
4619 | arm_fir_sparse_instance_q7 * S, |
4909 | uint16_t numTaps, |
4620 | uint16_t numTaps, |
4910 | q7_t * pCoeffs, |
4621 | q7_t * pCoeffs, |
4911 | q7_t * pState, |
4622 | q7_t * pState, |
4912 | int32_t * pTapDelay, |
4623 | int32_t * pTapDelay, |
4913 | uint16_t maxDelay, |
4624 | uint16_t maxDelay, |
4914 | uint32_t blockSize); |
4625 | uint32_t blockSize); |
4915 | 4626 | ||
4916 | 4627 | ||
4917 | /* |
4628 | /** |
4918 | * @brief Floating-point sin_cos function. |
4629 | * @brief Floating-point sin_cos function. |
4919 | * @param[in] theta input value in degrees |
4630 | * @param[in] theta input value in degrees |
4920 | * @param[out] *pSinVal points to the processed sine output. |
4631 | * @param[out] pSinVal points to the processed sine output. |
4921 | * @param[out] *pCosVal points to the processed cos output. |
4632 | * @param[out] pCosVal points to the processed cos output. |
4922 | * @return none. |
- | |
4923 | */ |
4633 | */ |
4924 | - | ||
4925 | void arm_sin_cos_f32( |
4634 | void arm_sin_cos_f32( |
4926 | float32_t theta, |
4635 | float32_t theta, |
4927 | float32_t * pSinVal, |
4636 | float32_t * pSinVal, |
4928 | float32_t * pCcosVal); |
4637 | float32_t * pCosVal); |
4929 | 4638 | ||
- | 4639 | ||
4930 | /* |
4640 | /** |
4931 | * @brief Q31 sin_cos function. |
4641 | * @brief Q31 sin_cos function. |
4932 | * @param[in] theta scaled input value in degrees |
4642 | * @param[in] theta scaled input value in degrees |
4933 | * @param[out] *pSinVal points to the processed sine output. |
4643 | * @param[out] pSinVal points to the processed sine output. |
4934 | * @param[out] *pCosVal points to the processed cosine output. |
4644 | * @param[out] pCosVal points to the processed cosine output. |
4935 | * @return none. |
- | |
4936 | */ |
4645 | */ |
4937 | - | ||
4938 | void arm_sin_cos_q31( |
4646 | void arm_sin_cos_q31( |
4939 | q31_t theta, |
4647 | q31_t theta, |
4940 | q31_t * pSinVal, |
4648 | q31_t * pSinVal, |
4941 | q31_t * pCosVal); |
4649 | q31_t * pCosVal); |
4942 | 4650 | ||
4943 | 4651 | ||
4944 | /** |
4652 | /** |
4945 | * @brief Floating-point complex conjugate. |
4653 | * @brief Floating-point complex conjugate. |
4946 | * @param[in] *pSrc points to the input vector |
4654 | * @param[in] pSrc points to the input vector |
4947 | * @param[out] *pDst points to the output vector |
4655 | * @param[out] pDst points to the output vector |
4948 | * @param[in] numSamples number of complex samples in each vector |
4656 | * @param[in] numSamples number of complex samples in each vector |
4949 | * @return none. |
- | |
4950 | */ |
4657 | */ |
4951 | - | ||
4952 | void arm_cmplx_conj_f32( |
4658 | void arm_cmplx_conj_f32( |
4953 | float32_t * pSrc, |
4659 | float32_t * pSrc, |
4954 | float32_t * pDst, |
4660 | float32_t * pDst, |
4955 | uint32_t numSamples); |
4661 | uint32_t numSamples); |
4956 | 4662 | ||
4957 | /** |
4663 | /** |
4958 | * @brief Q31 complex conjugate. |
4664 | * @brief Q31 complex conjugate. |
4959 | * @param[in] *pSrc points to the input vector |
4665 | * @param[in] pSrc points to the input vector |
4960 | * @param[out] *pDst points to the output vector |
4666 | * @param[out] pDst points to the output vector |
4961 | * @param[in] numSamples number of complex samples in each vector |
4667 | * @param[in] numSamples number of complex samples in each vector |
4962 | * @return none. |
- | |
4963 | */ |
4668 | */ |
4964 | - | ||
4965 | void arm_cmplx_conj_q31( |
4669 | void arm_cmplx_conj_q31( |
4966 | q31_t * pSrc, |
4670 | q31_t * pSrc, |
4967 | q31_t * pDst, |
4671 | q31_t * pDst, |
4968 | uint32_t numSamples); |
4672 | uint32_t numSamples); |
4969 | 4673 | ||
- | 4674 | ||
4970 | /** |
4675 | /** |
4971 | * @brief Q15 complex conjugate. |
4676 | * @brief Q15 complex conjugate. |
4972 | * @param[in] *pSrc points to the input vector |
4677 | * @param[in] pSrc points to the input vector |
4973 | * @param[out] *pDst points to the output vector |
4678 | * @param[out] pDst points to the output vector |
4974 | * @param[in] numSamples number of complex samples in each vector |
4679 | * @param[in] numSamples number of complex samples in each vector |
4975 | * @return none. |
- | |
4976 | */ |
4680 | */ |
4977 | - | ||
4978 | void arm_cmplx_conj_q15( |
4681 | void arm_cmplx_conj_q15( |
4979 | q15_t * pSrc, |
4682 | q15_t * pSrc, |
4980 | q15_t * pDst, |
4683 | q15_t * pDst, |
4981 | uint32_t numSamples); |
4684 | uint32_t numSamples); |
4982 | 4685 | ||
4983 | 4686 | ||
4984 | - | ||
4985 | /** |
4687 | /** |
4986 | * @brief Floating-point complex magnitude squared |
4688 | * @brief Floating-point complex magnitude squared |
4987 | * @param[in] *pSrc points to the complex input vector |
4689 | * @param[in] pSrc points to the complex input vector |
4988 | * @param[out] *pDst points to the real output vector |
4690 | * @param[out] pDst points to the real output vector |
4989 | * @param[in] numSamples number of complex samples in the input vector |
4691 | * @param[in] numSamples number of complex samples in the input vector |
4990 | * @return none. |
- | |
4991 | */ |
4692 | */ |
4992 | - | ||
4993 | void arm_cmplx_mag_squared_f32( |
4693 | void arm_cmplx_mag_squared_f32( |
4994 | float32_t * pSrc, |
4694 | float32_t * pSrc, |
4995 | float32_t * pDst, |
4695 | float32_t * pDst, |
4996 | uint32_t numSamples); |
4696 | uint32_t numSamples); |
4997 | 4697 | ||
- | 4698 | ||
4998 | /** |
4699 | /** |
4999 | * @brief Q31 complex magnitude squared |
4700 | * @brief Q31 complex magnitude squared |
5000 | * @param[in] *pSrc points to the complex input vector |
4701 | * @param[in] pSrc points to the complex input vector |
5001 | * @param[out] *pDst points to the real output vector |
4702 | * @param[out] pDst points to the real output vector |
5002 | * @param[in] numSamples number of complex samples in the input vector |
4703 | * @param[in] numSamples number of complex samples in the input vector |
5003 | * @return none. |
- | |
5004 | */ |
4704 | */ |
5005 | - | ||
5006 | void arm_cmplx_mag_squared_q31( |
4705 | void arm_cmplx_mag_squared_q31( |
5007 | q31_t * pSrc, |
4706 | q31_t * pSrc, |
5008 | q31_t * pDst, |
4707 | q31_t * pDst, |
5009 | uint32_t numSamples); |
4708 | uint32_t numSamples); |
5010 | 4709 | ||
- | 4710 | ||
5011 | /** |
4711 | /** |
5012 | * @brief Q15 complex magnitude squared |
4712 | * @brief Q15 complex magnitude squared |
5013 | * @param[in] *pSrc points to the complex input vector |
4713 | * @param[in] pSrc points to the complex input vector |
5014 | * @param[out] *pDst points to the real output vector |
4714 | * @param[out] pDst points to the real output vector |
5015 | * @param[in] numSamples number of complex samples in the input vector |
4715 | * @param[in] numSamples number of complex samples in the input vector |
5016 | * @return none. |
- | |
5017 | */ |
4716 | */ |
5018 | - | ||
5019 | void arm_cmplx_mag_squared_q15( |
4717 | void arm_cmplx_mag_squared_q15( |
5020 | q15_t * pSrc, |
4718 | q15_t * pSrc, |
5021 | q15_t * pDst, |
4719 | q15_t * pDst, |
5022 | uint32_t numSamples); |
4720 | uint32_t numSamples); |
5023 | 4721 | ||
Line 5088... | Line 4786... | ||
5088 | * @{ |
4786 | * @{ |
5089 | */ |
4787 | */ |
5090 | 4788 | ||
5091 | /** |
4789 | /** |
5092 | * @brief Process function for the floating-point PID Control. |
4790 | * @brief Process function for the floating-point PID Control. |
5093 | * @param[in,out] *S is an instance of the floating-point PID Control structure |
4791 | * @param[in,out] S is an instance of the floating-point PID Control structure |
5094 | * @param[in] in input sample to process |
4792 | * @param[in] in input sample to process |
5095 | * @return out processed output sample. |
4793 | * @return out processed output sample. |
5096 | */ |
4794 | */ |
5097 | - | ||
5098 | - | ||
5099 | static __INLINE float32_t arm_pid_f32( |
4795 | static __INLINE float32_t arm_pid_f32( |
5100 | arm_pid_instance_f32 * S, |
4796 | arm_pid_instance_f32 * S, |
5101 | float32_t in) |
4797 | float32_t in) |
5102 | { |
4798 | { |
5103 | float32_t out; |
4799 | float32_t out; |
Line 5116... | Line 4812... | ||
5116 | 4812 | ||
5117 | } |
4813 | } |
5118 | 4814 | ||
5119 | /** |
4815 | /** |
5120 | * @brief Process function for the Q31 PID Control. |
4816 | * @brief Process function for the Q31 PID Control. |
5121 | * @param[in,out] *S points to an instance of the Q31 PID Control structure |
4817 | * @param[in,out] S points to an instance of the Q31 PID Control structure |
5122 | * @param[in] in input sample to process |
4818 | * @param[in] in input sample to process |
5123 | * @return out processed output sample. |
4819 | * @return out processed output sample. |
5124 | * |
4820 | * |
5125 | * <b>Scaling and Overflow Behavior:</b> |
4821 | * <b>Scaling and Overflow Behavior:</b> |
5126 | * \par |
4822 | * \par |
5127 | * The function is implemented using an internal 64-bit accumulator. |
4823 | * The function is implemented using an internal 64-bit accumulator. |
5128 | * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. |
4824 | * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. |
5129 | * Thus, if the accumulator result overflows it wraps around rather than clip. |
4825 | * Thus, if the accumulator result overflows it wraps around rather than clip. |
5130 | * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. |
4826 | * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. |
5131 | * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. |
4827 | * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. |
5132 | */ |
4828 | */ |
5133 | - | ||
5134 | static __INLINE q31_t arm_pid_q31( |
4829 | static __INLINE q31_t arm_pid_q31( |
5135 | arm_pid_instance_q31 * S, |
4830 | arm_pid_instance_q31 * S, |
5136 | q31_t in) |
4831 | q31_t in) |
5137 | { |
4832 | { |
5138 | q63_t acc; |
4833 | q63_t acc; |
Line 5158... | Line 4853... | ||
5158 | S->state[0] = in; |
4853 | S->state[0] = in; |
5159 | S->state[2] = out; |
4854 | S->state[2] = out; |
5160 | 4855 | ||
5161 | /* return to application */ |
4856 | /* return to application */ |
5162 | return (out); |
4857 | return (out); |
5163 | - | ||
5164 | } |
4858 | } |
5165 | 4859 | ||
- | 4860 | ||
5166 | /** |
4861 | /** |
5167 | * @brief Process function for the Q15 PID Control. |
4862 | * @brief Process function for the Q15 PID Control. |
5168 | * @param[in,out] *S points to an instance of the Q15 PID Control structure |
4863 | * @param[in,out] S points to an instance of the Q15 PID Control structure |
5169 | * @param[in] in input sample to process |
4864 | * @param[in] in input sample to process |
5170 | * @return out processed output sample. |
4865 | * @return out processed output sample. |
5171 | * |
4866 | * |
5172 | * <b>Scaling and Overflow Behavior:</b> |
4867 | * <b>Scaling and Overflow Behavior:</b> |
5173 | * \par |
4868 | * \par |
5174 | * The function is implemented using a 64-bit internal accumulator. |
4869 | * The function is implemented using a 64-bit internal accumulator. |
Line 5176... | Line 4871... | ||
5176 | * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. |
4871 | * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. |
5177 | * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. |
4872 | * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. |
5178 | * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. |
4873 | * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. |
5179 | * Lastly, the accumulator is saturated to yield a result in 1.15 format. |
4874 | * Lastly, the accumulator is saturated to yield a result in 1.15 format. |
5180 | */ |
4875 | */ |
5181 | - | ||
5182 | static __INLINE q15_t arm_pid_q15( |
4876 | static __INLINE q15_t arm_pid_q15( |
5183 | arm_pid_instance_q15 * S, |
4877 | arm_pid_instance_q15 * S, |
5184 | q15_t in) |
4878 | q15_t in) |
5185 | { |
4879 | { |
5186 | q63_t acc; |
4880 | q63_t acc; |
Line 5190... | Line 4884... | ||
5190 | __SIMD32_TYPE *vstate; |
4884 | __SIMD32_TYPE *vstate; |
5191 | 4885 | ||
5192 | /* Implementation of PID controller */ |
4886 | /* Implementation of PID controller */ |
5193 | 4887 | ||
5194 | /* acc = A0 * x[n] */ |
4888 | /* acc = A0 * x[n] */ |
5195 | acc = (q31_t) __SMUAD(S->A0, in); |
4889 | acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in); |
5196 | 4890 | ||
5197 | /* acc += A1 * x[n-1] + A2 * x[n-2] */ |
4891 | /* acc += A1 * x[n-1] + A2 * x[n-2] */ |
5198 | vstate = __SIMD32_CONST(S->state); |
4892 | vstate = __SIMD32_CONST(S->state); |
5199 | acc = __SMLALD(S->A1, (q31_t) *vstate, acc); |
4893 | acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)*vstate, (uint64_t)acc); |
5200 | - | ||
5201 | #else |
4894 | #else |
5202 | /* acc = A0 * x[n] */ |
4895 | /* acc = A0 * x[n] */ |
5203 | acc = ((q31_t) S->A0) * in; |
4896 | acc = ((q31_t) S->A0) * in; |
5204 | 4897 | ||
5205 | /* acc += A1 * x[n-1] + A2 * x[n-2] */ |
4898 | /* acc += A1 * x[n-1] + A2 * x[n-2] */ |
5206 | acc += (q31_t) S->A1 * S->state[0]; |
4899 | acc += (q31_t) S->A1 * S->state[0]; |
5207 | acc += (q31_t) S->A2 * S->state[1]; |
4900 | acc += (q31_t) S->A2 * S->state[1]; |
5208 | - | ||
5209 | #endif |
4901 | #endif |
5210 | 4902 | ||
5211 | /* acc += y[n-1] */ |
4903 | /* acc += y[n-1] */ |
5212 | acc += (q31_t) S->state[2] << 15; |
4904 | acc += (q31_t) S->state[2] << 15; |
5213 | 4905 | ||
Line 5219... | Line 4911... | ||
5219 | S->state[0] = in; |
4911 | S->state[0] = in; |
5220 | S->state[2] = out; |
4912 | S->state[2] = out; |
5221 | 4913 | ||
5222 | /* return to application */ |
4914 | /* return to application */ |
5223 | return (out); |
4915 | return (out); |
5224 | - | ||
5225 | } |
4916 | } |
5226 | 4917 | ||
5227 | /** |
4918 | /** |
5228 | * @} end of PID group |
4919 | * @} end of PID group |
5229 | */ |
4920 | */ |
5230 | 4921 | ||
5231 | 4922 | ||
5232 | /** |
4923 | /** |
5233 | * @brief Floating-point matrix inverse. |
4924 | * @brief Floating-point matrix inverse. |
5234 | * @param[in] *src points to the instance of the input floating-point matrix structure. |
4925 | * @param[in] src points to the instance of the input floating-point matrix structure. |
5235 | * @param[out] *dst points to the instance of the output floating-point matrix structure. |
4926 | * @param[out] dst points to the instance of the output floating-point matrix structure. |
5236 | * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. |
4927 | * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. |
5237 | * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. |
4928 | * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. |
5238 | */ |
4929 | */ |
5239 | - | ||
5240 | arm_status arm_mat_inverse_f32( |
4930 | arm_status arm_mat_inverse_f32( |
5241 | const arm_matrix_instance_f32 * src, |
4931 | const arm_matrix_instance_f32 * src, |
5242 | arm_matrix_instance_f32 * dst); |
4932 | arm_matrix_instance_f32 * dst); |
5243 | 4933 | ||
5244 | 4934 | ||
5245 | /** |
4935 | /** |
5246 | * @brief Floating-point matrix inverse. |
4936 | * @brief Floating-point matrix inverse. |
5247 | * @param[in] *src points to the instance of the input floating-point matrix structure. |
4937 | * @param[in] src points to the instance of the input floating-point matrix structure. |
5248 | * @param[out] *dst points to the instance of the output floating-point matrix structure. |
4938 | * @param[out] dst points to the instance of the output floating-point matrix structure. |
5249 | * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. |
4939 | * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. |
5250 | * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. |
4940 | * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. |
5251 | */ |
4941 | */ |
5252 | - | ||
5253 | arm_status arm_mat_inverse_f64( |
4942 | arm_status arm_mat_inverse_f64( |
5254 | const arm_matrix_instance_f64 * src, |
4943 | const arm_matrix_instance_f64 * src, |
5255 | arm_matrix_instance_f64 * dst); |
4944 | arm_matrix_instance_f64 * dst); |
5256 | 4945 | ||
5257 | 4946 | ||
5258 | 4947 | ||
5259 | /** |
4948 | /** |
5260 | * @ingroup groupController |
4949 | * @ingroup groupController |
5261 | */ |
4950 | */ |
5262 | 4951 | ||
5263 | - | ||
5264 | /** |
4952 | /** |
5265 | * @defgroup clarke Vector Clarke Transform |
4953 | * @defgroup clarke Vector Clarke Transform |
5266 | * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. |
4954 | * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. |
5267 | * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents |
4955 | * Generally the Clarke transform uses three-phase currents <code>Ia, Ib and Ic</code> to calculate currents |
5268 | * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>. |
4956 | * in the two-phase orthogonal stator axis <code>Ialpha</code> and <code>Ibeta</code>. |
Line 5289... | Line 4977... | ||
5289 | */ |
4977 | */ |
5290 | 4978 | ||
5291 | /** |
4979 | /** |
5292 | * |
4980 | * |
5293 | * @brief Floating-point Clarke transform |
4981 | * @brief Floating-point Clarke transform |
5294 | * @param[in] Ia input three-phase coordinate <code>a</code> |
4982 | * @param[in] Ia input three-phase coordinate <code>a</code> |
5295 | * @param[in] Ib input three-phase coordinate <code>b</code> |
4983 | * @param[in] Ib input three-phase coordinate <code>b</code> |
5296 | * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha |
4984 | * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha |
5297 | * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta |
4985 | * @param[out] pIbeta points to output two-phase orthogonal vector axis beta |
5298 | * @return none. |
- | |
5299 | */ |
4986 | */ |
5300 | - | ||
5301 | static __INLINE void arm_clarke_f32( |
4987 | static __INLINE void arm_clarke_f32( |
5302 | float32_t Ia, |
4988 | float32_t Ia, |
5303 | float32_t Ib, |
4989 | float32_t Ib, |
5304 | float32_t * pIalpha, |
4990 | float32_t * pIalpha, |
5305 | float32_t * pIbeta) |
4991 | float32_t * pIbeta) |
5306 | { |
4992 | { |
5307 | /* Calculate pIalpha using the equation, pIalpha = Ia */ |
4993 | /* Calculate pIalpha using the equation, pIalpha = Ia */ |
5308 | *pIalpha = Ia; |
4994 | *pIalpha = Ia; |
5309 | 4995 | ||
5310 | /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ |
4996 | /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ |
5311 | *pIbeta = |
- | |
5312 | ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); |
4997 | *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); |
5313 | - | ||
5314 | } |
4998 | } |
5315 | 4999 | ||
- | 5000 | ||
5316 | /** |
5001 | /** |
5317 | * @brief Clarke transform for Q31 version |
5002 | * @brief Clarke transform for Q31 version |
5318 | * @param[in] Ia input three-phase coordinate <code>a</code> |
5003 | * @param[in] Ia input three-phase coordinate <code>a</code> |
5319 | * @param[in] Ib input three-phase coordinate <code>b</code> |
5004 | * @param[in] Ib input three-phase coordinate <code>b</code> |
5320 | * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha |
5005 | * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha |
5321 | * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta |
5006 | * @param[out] pIbeta points to output two-phase orthogonal vector axis beta |
5322 | * @return none. |
- | |
5323 | * |
5007 | * |
5324 | * <b>Scaling and Overflow Behavior:</b> |
5008 | * <b>Scaling and Overflow Behavior:</b> |
5325 | * \par |
5009 | * \par |
5326 | * The function is implemented using an internal 32-bit accumulator. |
5010 | * The function is implemented using an internal 32-bit accumulator. |
5327 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
5011 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
5328 | * There is saturation on the addition, hence there is no risk of overflow. |
5012 | * There is saturation on the addition, hence there is no risk of overflow. |
5329 | */ |
5013 | */ |
5330 | - | ||
5331 | static __INLINE void arm_clarke_q31( |
5014 | static __INLINE void arm_clarke_q31( |
5332 | q31_t Ia, |
5015 | q31_t Ia, |
5333 | q31_t Ib, |
5016 | q31_t Ib, |
5334 | q31_t * pIalpha, |
5017 | q31_t * pIalpha, |
5335 | q31_t * pIbeta) |
5018 | q31_t * pIbeta) |
Line 5353... | Line 5036... | ||
5353 | * @} end of clarke group |
5036 | * @} end of clarke group |
5354 | */ |
5037 | */ |
5355 | 5038 | ||
5356 | /** |
5039 | /** |
5357 | * @brief Converts the elements of the Q7 vector to Q31 vector. |
5040 | * @brief Converts the elements of the Q7 vector to Q31 vector. |
5358 | * @param[in] *pSrc input pointer |
5041 | * @param[in] pSrc input pointer |
5359 | * @param[out] *pDst output pointer |
5042 | * @param[out] pDst output pointer |
5360 | * @param[in] blockSize number of samples to process |
5043 | * @param[in] blockSize number of samples to process |
5361 | * @return none. |
- | |
5362 | */ |
5044 | */ |
5363 | void arm_q7_to_q31( |
5045 | void arm_q7_to_q31( |
5364 | q7_t * pSrc, |
5046 | q7_t * pSrc, |
5365 | q31_t * pDst, |
5047 | q31_t * pDst, |
5366 | uint32_t blockSize); |
5048 | uint32_t blockSize); |
5367 | 5049 | ||
5368 | 5050 | ||
5369 | 5051 | ||
5370 | - | ||
5371 | /** |
5052 | /** |
5372 | * @ingroup groupController |
5053 | * @ingroup groupController |
5373 | */ |
5054 | */ |
5374 | 5055 | ||
5375 | /** |
5056 | /** |
Line 5393... | Line 5074... | ||
5393 | * @{ |
5074 | * @{ |
5394 | */ |
5075 | */ |
5395 | 5076 | ||
5396 | /** |
5077 | /** |
5397 | * @brief Floating-point Inverse Clarke transform |
5078 | * @brief Floating-point Inverse Clarke transform |
5398 | * @param[in] Ialpha input two-phase orthogonal vector axis alpha |
5079 | * @param[in] Ialpha input two-phase orthogonal vector axis alpha |
5399 | * @param[in] Ibeta input two-phase orthogonal vector axis beta |
5080 | * @param[in] Ibeta input two-phase orthogonal vector axis beta |
5400 | * @param[out] *pIa points to output three-phase coordinate <code>a</code> |
5081 | * @param[out] pIa points to output three-phase coordinate <code>a</code> |
5401 | * @param[out] *pIb points to output three-phase coordinate <code>b</code> |
5082 | * @param[out] pIb points to output three-phase coordinate <code>b</code> |
5402 | * @return none. |
- | |
5403 | */ |
5083 | */ |
5404 | - | ||
5405 | - | ||
5406 | static __INLINE void arm_inv_clarke_f32( |
5084 | static __INLINE void arm_inv_clarke_f32( |
5407 | float32_t Ialpha, |
5085 | float32_t Ialpha, |
5408 | float32_t Ibeta, |
5086 | float32_t Ibeta, |
5409 | float32_t * pIa, |
5087 | float32_t * pIa, |
5410 | float32_t * pIb) |
5088 | float32_t * pIb) |
5411 | { |
5089 | { |
5412 | /* Calculating pIa from Ialpha by equation pIa = Ialpha */ |
5090 | /* Calculating pIa from Ialpha by equation pIa = Ialpha */ |
5413 | *pIa = Ialpha; |
5091 | *pIa = Ialpha; |
5414 | 5092 | ||
5415 | /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ |
5093 | /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ |
5416 | *pIb = -0.5 * Ialpha + (float32_t) 0.8660254039 *Ibeta; |
5094 | *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta; |
5417 | - | ||
5418 | } |
5095 | } |
5419 | 5096 | ||
- | 5097 | ||
5420 | /** |
5098 | /** |
5421 | * @brief Inverse Clarke transform for Q31 version |
5099 | * @brief Inverse Clarke transform for Q31 version |
5422 | * @param[in] Ialpha input two-phase orthogonal vector axis alpha |
5100 | * @param[in] Ialpha input two-phase orthogonal vector axis alpha |
5423 | * @param[in] Ibeta input two-phase orthogonal vector axis beta |
5101 | * @param[in] Ibeta input two-phase orthogonal vector axis beta |
5424 | * @param[out] *pIa points to output three-phase coordinate <code>a</code> |
5102 | * @param[out] pIa points to output three-phase coordinate <code>a</code> |
5425 | * @param[out] *pIb points to output three-phase coordinate <code>b</code> |
5103 | * @param[out] pIb points to output three-phase coordinate <code>b</code> |
5426 | * @return none. |
- | |
5427 | * |
5104 | * |
5428 | * <b>Scaling and Overflow Behavior:</b> |
5105 | * <b>Scaling and Overflow Behavior:</b> |
5429 | * \par |
5106 | * \par |
5430 | * The function is implemented using an internal 32-bit accumulator. |
5107 | * The function is implemented using an internal 32-bit accumulator. |
5431 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
5108 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
5432 | * There is saturation on the subtraction, hence there is no risk of overflow. |
5109 | * There is saturation on the subtraction, hence there is no risk of overflow. |
5433 | */ |
5110 | */ |
5434 | - | ||
5435 | static __INLINE void arm_inv_clarke_q31( |
5111 | static __INLINE void arm_inv_clarke_q31( |
5436 | q31_t Ialpha, |
5112 | q31_t Ialpha, |
5437 | q31_t Ibeta, |
5113 | q31_t Ibeta, |
5438 | q31_t * pIa, |
5114 | q31_t * pIa, |
5439 | q31_t * pIb) |
5115 | q31_t * pIb) |
Line 5449... | Line 5125... | ||
5449 | /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ |
5125 | /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ |
5450 | product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31); |
5126 | product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31); |
5451 | 5127 | ||
5452 | /* pIb is calculated by subtracting the products */ |
5128 | /* pIb is calculated by subtracting the products */ |
5453 | *pIb = __QSUB(product2, product1); |
5129 | *pIb = __QSUB(product2, product1); |
5454 | - | ||
5455 | } |
5130 | } |
5456 | 5131 | ||
5457 | /** |
5132 | /** |
5458 | * @} end of inv_clarke group |
5133 | * @} end of inv_clarke group |
5459 | */ |
5134 | */ |
5460 | 5135 | ||
5461 | /** |
5136 | /** |
5462 | * @brief Converts the elements of the Q7 vector to Q15 vector. |
5137 | * @brief Converts the elements of the Q7 vector to Q15 vector. |
5463 | * @param[in] *pSrc input pointer |
5138 | * @param[in] pSrc input pointer |
5464 | * @param[out] *pDst output pointer |
5139 | * @param[out] pDst output pointer |
5465 | * @param[in] blockSize number of samples to process |
5140 | * @param[in] blockSize number of samples to process |
5466 | * @return none. |
- | |
5467 | */ |
5141 | */ |
5468 | void arm_q7_to_q15( |
5142 | void arm_q7_to_q15( |
5469 | q7_t * pSrc, |
5143 | q7_t * pSrc, |
5470 | q15_t * pDst, |
5144 | q15_t * pDst, |
5471 | uint32_t blockSize); |
5145 | uint32_t blockSize); |
Line 5505... | Line 5179... | ||
5505 | * @{ |
5179 | * @{ |
5506 | */ |
5180 | */ |
5507 | 5181 | ||
5508 | /** |
5182 | /** |
5509 | * @brief Floating-point Park transform |
5183 | * @brief Floating-point Park transform |
5510 | * @param[in] Ialpha input two-phase vector coordinate alpha |
5184 | * @param[in] Ialpha input two-phase vector coordinate alpha |
5511 | * @param[in] Ibeta input two-phase vector coordinate beta |
5185 | * @param[in] Ibeta input two-phase vector coordinate beta |
5512 | * @param[out] *pId points to output rotor reference frame d |
5186 | * @param[out] pId points to output rotor reference frame d |
5513 | * @param[out] *pIq points to output rotor reference frame q |
5187 | * @param[out] pIq points to output rotor reference frame q |
5514 | * @param[in] sinVal sine value of rotation angle theta |
5188 | * @param[in] sinVal sine value of rotation angle theta |
5515 | * @param[in] cosVal cosine value of rotation angle theta |
5189 | * @param[in] cosVal cosine value of rotation angle theta |
5516 | * @return none. |
- | |
5517 | * |
5190 | * |
5518 | * The function implements the forward Park transform. |
5191 | * The function implements the forward Park transform. |
5519 | * |
5192 | * |
5520 | */ |
5193 | */ |
5521 | - | ||
5522 | static __INLINE void arm_park_f32( |
5194 | static __INLINE void arm_park_f32( |
5523 | float32_t Ialpha, |
5195 | float32_t Ialpha, |
5524 | float32_t Ibeta, |
5196 | float32_t Ibeta, |
5525 | float32_t * pId, |
5197 | float32_t * pId, |
5526 | float32_t * pIq, |
5198 | float32_t * pIq, |
Line 5530... | Line 5202... | ||
5530 | /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ |
5202 | /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ |
5531 | *pId = Ialpha * cosVal + Ibeta * sinVal; |
5203 | *pId = Ialpha * cosVal + Ibeta * sinVal; |
5532 | 5204 | ||
5533 | /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ |
5205 | /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ |
5534 | *pIq = -Ialpha * sinVal + Ibeta * cosVal; |
5206 | *pIq = -Ialpha * sinVal + Ibeta * cosVal; |
5535 | - | ||
5536 | } |
5207 | } |
5537 | 5208 | ||
- | 5209 | ||
5538 | /** |
5210 | /** |
5539 | * @brief Park transform for Q31 version |
5211 | * @brief Park transform for Q31 version |
5540 | * @param[in] Ialpha input two-phase vector coordinate alpha |
5212 | * @param[in] Ialpha input two-phase vector coordinate alpha |
5541 | * @param[in] Ibeta input two-phase vector coordinate beta |
5213 | * @param[in] Ibeta input two-phase vector coordinate beta |
5542 | * @param[out] *pId points to output rotor reference frame d |
5214 | * @param[out] pId points to output rotor reference frame d |
5543 | * @param[out] *pIq points to output rotor reference frame q |
5215 | * @param[out] pIq points to output rotor reference frame q |
5544 | * @param[in] sinVal sine value of rotation angle theta |
5216 | * @param[in] sinVal sine value of rotation angle theta |
5545 | * @param[in] cosVal cosine value of rotation angle theta |
5217 | * @param[in] cosVal cosine value of rotation angle theta |
5546 | * @return none. |
- | |
5547 | * |
5218 | * |
5548 | * <b>Scaling and Overflow Behavior:</b> |
5219 | * <b>Scaling and Overflow Behavior:</b> |
5549 | * \par |
5220 | * \par |
5550 | * The function is implemented using an internal 32-bit accumulator. |
5221 | * The function is implemented using an internal 32-bit accumulator. |
5551 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
5222 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
5552 | * There is saturation on the addition and subtraction, hence there is no risk of overflow. |
5223 | * There is saturation on the addition and subtraction, hence there is no risk of overflow. |
5553 | */ |
5224 | */ |
5554 | - | ||
5555 | - | ||
5556 | static __INLINE void arm_park_q31( |
5225 | static __INLINE void arm_park_q31( |
5557 | q31_t Ialpha, |
5226 | q31_t Ialpha, |
5558 | q31_t Ibeta, |
5227 | q31_t Ibeta, |
5559 | q31_t * pId, |
5228 | q31_t * pId, |
5560 | q31_t * pIq, |
5229 | q31_t * pIq, |
Line 5588... | Line 5257... | ||
5588 | * @} end of park group |
5257 | * @} end of park group |
5589 | */ |
5258 | */ |
5590 | 5259 | ||
5591 | /** |
5260 | /** |
5592 | * @brief Converts the elements of the Q7 vector to floating-point vector. |
5261 | * @brief Converts the elements of the Q7 vector to floating-point vector. |
5593 | * @param[in] *pSrc is input pointer |
5262 | * @param[in] pSrc is input pointer |
5594 | * @param[out] *pDst is output pointer |
5263 | * @param[out] pDst is output pointer |
5595 | * @param[in] blockSize is the number of samples to process |
5264 | * @param[in] blockSize is the number of samples to process |
5596 | * @return none. |
- | |
5597 | */ |
5265 | */ |
5598 | void arm_q7_to_float( |
5266 | void arm_q7_to_float( |
5599 | q7_t * pSrc, |
5267 | q7_t * pSrc, |
5600 | float32_t * pDst, |
5268 | float32_t * pDst, |
5601 | uint32_t blockSize); |
5269 | uint32_t blockSize); |
Line 5627... | Line 5295... | ||
5627 | * @{ |
5295 | * @{ |
5628 | */ |
5296 | */ |
5629 | 5297 | ||
5630 | /** |
5298 | /** |
5631 | * @brief Floating-point Inverse Park transform |
5299 | * @brief Floating-point Inverse Park transform |
5632 | * @param[in] Id input coordinate of rotor reference frame d |
5300 | * @param[in] Id input coordinate of rotor reference frame d |
5633 | * @param[in] Iq input coordinate of rotor reference frame q |
5301 | * @param[in] Iq input coordinate of rotor reference frame q |
5634 | * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha |
5302 | * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha |
5635 | * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta |
5303 | * @param[out] pIbeta points to output two-phase orthogonal vector axis beta |
5636 | * @param[in] sinVal sine value of rotation angle theta |
5304 | * @param[in] sinVal sine value of rotation angle theta |
5637 | * @param[in] cosVal cosine value of rotation angle theta |
5305 | * @param[in] cosVal cosine value of rotation angle theta |
5638 | * @return none. |
- | |
5639 | */ |
5306 | */ |
5640 | - | ||
5641 | static __INLINE void arm_inv_park_f32( |
5307 | static __INLINE void arm_inv_park_f32( |
5642 | float32_t Id, |
5308 | float32_t Id, |
5643 | float32_t Iq, |
5309 | float32_t Iq, |
5644 | float32_t * pIalpha, |
5310 | float32_t * pIalpha, |
5645 | float32_t * pIbeta, |
5311 | float32_t * pIbeta, |
Line 5649... | Line 5315... | ||
5649 | /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ |
5315 | /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ |
5650 | *pIalpha = Id * cosVal - Iq * sinVal; |
5316 | *pIalpha = Id * cosVal - Iq * sinVal; |
5651 | 5317 | ||
5652 | /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ |
5318 | /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ |
5653 | *pIbeta = Id * sinVal + Iq * cosVal; |
5319 | *pIbeta = Id * sinVal + Iq * cosVal; |
5654 | - | ||
5655 | } |
5320 | } |
5656 | 5321 | ||
5657 | 5322 | ||
5658 | /** |
5323 | /** |
5659 | * @brief Inverse Park transform for Q31 version |
5324 | * @brief Inverse Park transform for Q31 version |
5660 | * @param[in] Id input coordinate of rotor reference frame d |
5325 | * @param[in] Id input coordinate of rotor reference frame d |
5661 | * @param[in] Iq input coordinate of rotor reference frame q |
5326 | * @param[in] Iq input coordinate of rotor reference frame q |
5662 | * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha |
5327 | * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha |
5663 | * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta |
5328 | * @param[out] pIbeta points to output two-phase orthogonal vector axis beta |
5664 | * @param[in] sinVal sine value of rotation angle theta |
5329 | * @param[in] sinVal sine value of rotation angle theta |
5665 | * @param[in] cosVal cosine value of rotation angle theta |
5330 | * @param[in] cosVal cosine value of rotation angle theta |
5666 | * @return none. |
- | |
5667 | * |
5331 | * |
5668 | * <b>Scaling and Overflow Behavior:</b> |
5332 | * <b>Scaling and Overflow Behavior:</b> |
5669 | * \par |
5333 | * \par |
5670 | * The function is implemented using an internal 32-bit accumulator. |
5334 | * The function is implemented using an internal 32-bit accumulator. |
5671 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
5335 | * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. |
5672 | * There is saturation on the addition, hence there is no risk of overflow. |
5336 | * There is saturation on the addition, hence there is no risk of overflow. |
5673 | */ |
5337 | */ |
5674 | - | ||
5675 | - | ||
5676 | static __INLINE void arm_inv_park_q31( |
5338 | static __INLINE void arm_inv_park_q31( |
5677 | q31_t Id, |
5339 | q31_t Id, |
5678 | q31_t Iq, |
5340 | q31_t Iq, |
5679 | q31_t * pIalpha, |
5341 | q31_t * pIalpha, |
5680 | q31_t * pIbeta, |
5342 | q31_t * pIbeta, |
Line 5700... | Line 5362... | ||
5700 | /* Calculate pIalpha by using the two intermediate products 1 and 2 */ |
5362 | /* Calculate pIalpha by using the two intermediate products 1 and 2 */ |
5701 | *pIalpha = __QSUB(product1, product2); |
5363 | *pIalpha = __QSUB(product1, product2); |
5702 | 5364 | ||
5703 | /* Calculate pIbeta by using the two intermediate products 3 and 4 */ |
5365 | /* Calculate pIbeta by using the two intermediate products 3 and 4 */ |
5704 | *pIbeta = __QADD(product4, product3); |
5366 | *pIbeta = __QADD(product4, product3); |
5705 | - | ||
5706 | } |
5367 | } |
5707 | 5368 | ||
5708 | /** |
5369 | /** |
5709 | * @} end of Inverse park group |
5370 | * @} end of Inverse park group |
5710 | */ |
5371 | */ |
5711 | 5372 | ||
5712 | 5373 | ||
5713 | /** |
5374 | /** |
5714 | * @brief Converts the elements of the Q31 vector to floating-point vector. |
5375 | * @brief Converts the elements of the Q31 vector to floating-point vector. |
5715 | * @param[in] *pSrc is input pointer |
5376 | * @param[in] pSrc is input pointer |
5716 | * @param[out] *pDst is output pointer |
5377 | * @param[out] pDst is output pointer |
5717 | * @param[in] blockSize is the number of samples to process |
5378 | * @param[in] blockSize is the number of samples to process |
5718 | * @return none. |
- | |
5719 | */ |
5379 | */ |
5720 | void arm_q31_to_float( |
5380 | void arm_q31_to_float( |
5721 | q31_t * pSrc, |
5381 | q31_t * pSrc, |
5722 | float32_t * pDst, |
5382 | float32_t * pDst, |
5723 | uint32_t blockSize); |
5383 | uint32_t blockSize); |
Line 5763... | Line 5423... | ||
5763 | * @{ |
5423 | * @{ |
5764 | */ |
5424 | */ |
5765 | 5425 | ||
5766 | /** |
5426 | /** |
5767 | * @brief Process function for the floating-point Linear Interpolation Function. |
5427 | * @brief Process function for the floating-point Linear Interpolation Function. |
5768 | * @param[in,out] *S is an instance of the floating-point Linear Interpolation structure |
5428 | * @param[in,out] S is an instance of the floating-point Linear Interpolation structure |
5769 | * @param[in] x input sample to process |
5429 | * @param[in] x input sample to process |
5770 | * @return y processed output sample. |
5430 | * @return y processed output sample. |
5771 | * |
5431 | * |
5772 | */ |
5432 | */ |
5773 | - | ||
5774 | static __INLINE float32_t arm_linear_interp_f32( |
5433 | static __INLINE float32_t arm_linear_interp_f32( |
5775 | arm_linear_interp_instance_f32 * S, |
5434 | arm_linear_interp_instance_f32 * S, |
5776 | float32_t x) |
5435 | float32_t x) |
5777 | { |
5436 | { |
5778 | - | ||
5779 | float32_t y; |
5437 | float32_t y; |
5780 | float32_t x0, x1; /* Nearest input values */ |
5438 | float32_t x0, x1; /* Nearest input values */ |
5781 | float32_t y0, y1; /* Nearest output values */ |
5439 | float32_t y0, y1; /* Nearest output values */ |
5782 | float32_t xSpacing = S->xSpacing; /* spacing between input values */ |
5440 | float32_t xSpacing = S->xSpacing; /* spacing between input values */ |
5783 | int32_t i; /* Index variable */ |
5441 | int32_t i; /* Index variable */ |
Line 5797... | Line 5455... | ||
5797 | y = pYData[S->nValues - 1]; |
5455 | y = pYData[S->nValues - 1]; |
5798 | } |
5456 | } |
5799 | else |
5457 | else |
5800 | { |
5458 | { |
5801 | /* Calculation of nearest input values */ |
5459 | /* Calculation of nearest input values */ |
5802 | x0 = S->x1 + i * xSpacing; |
5460 | x0 = S->x1 + i * xSpacing; |
5803 | x1 = S->x1 + (i + 1) * xSpacing; |
5461 | x1 = S->x1 + (i + 1) * xSpacing; |
5804 | 5462 | ||
5805 | /* Read of nearest output values */ |
5463 | /* Read of nearest output values */ |
5806 | y0 = pYData[i]; |
5464 | y0 = pYData[i]; |
5807 | y1 = pYData[i + 1]; |
5465 | y1 = pYData[i + 1]; |
Line 5813... | Line 5471... | ||
5813 | 5471 | ||
5814 | /* returns output value */ |
5472 | /* returns output value */ |
5815 | return (y); |
5473 | return (y); |
5816 | } |
5474 | } |
5817 | 5475 | ||
- | 5476 | ||
5818 | /** |
5477 | /** |
5819 | * |
5478 | * |
5820 | * @brief Process function for the Q31 Linear Interpolation Function. |
5479 | * @brief Process function for the Q31 Linear Interpolation Function. |
5821 | * @param[in] *pYData pointer to Q31 Linear Interpolation table |
5480 | * @param[in] pYData pointer to Q31 Linear Interpolation table |
5822 | * @param[in] x input sample to process |
5481 | * @param[in] x input sample to process |
5823 | * @param[in] nValues number of table values |
5482 | * @param[in] nValues number of table values |
5824 | * @return y processed output sample. |
5483 | * @return y processed output sample. |
5825 | * |
5484 | * |
5826 | * \par |
5485 | * \par |
5827 | * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. |
5486 | * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. |
5828 | * This function can support maximum of table size 2^12. |
5487 | * This function can support maximum of table size 2^12. |
5829 | * |
5488 | * |
5830 | */ |
5489 | */ |
5831 | - | ||
5832 | - | ||
5833 | static __INLINE q31_t arm_linear_interp_q31( |
5490 | static __INLINE q31_t arm_linear_interp_q31( |
5834 | q31_t * pYData, |
5491 | q31_t * pYData, |
5835 | q31_t x, |
5492 | q31_t x, |
5836 | uint32_t nValues) |
5493 | uint32_t nValues) |
5837 | { |
5494 | { |
Line 5841... | Line 5498... | ||
5841 | int32_t index; /* Index to read nearest output values */ |
5498 | int32_t index; /* Index to read nearest output values */ |
5842 | 5499 | ||
5843 | /* Input is in 12.20 format */ |
5500 | /* Input is in 12.20 format */ |
5844 | /* 12 bits for the table index */ |
5501 | /* 12 bits for the table index */ |
5845 | /* Index value calculation */ |
5502 | /* Index value calculation */ |
5846 | index = ((x & 0xFFF00000) >> 20); |
5503 | index = ((x & (q31_t)0xFFF00000) >> 20); |
5847 | 5504 | ||
5848 | if(index >= (int32_t)(nValues - 1)) |
5505 | if(index >= (int32_t)(nValues - 1)) |
5849 | { |
5506 | { |
5850 | return (pYData[nValues - 1]); |
5507 | return (pYData[nValues - 1]); |
5851 | } |
5508 | } |
Line 5853... | Line 5510... | ||
5853 | { |
5510 | { |
5854 | return (pYData[0]); |
5511 | return (pYData[0]); |
5855 | } |
5512 | } |
5856 | else |
5513 | else |
5857 | { |
5514 | { |
5858 | - | ||
5859 | /* 20 bits for the fractional part */ |
5515 | /* 20 bits for the fractional part */ |
5860 | /* shift left by 11 to keep fract in 1.31 format */ |
5516 | /* shift left by 11 to keep fract in 1.31 format */ |
5861 | fract = (x & 0x000FFFFF) << 11; |
5517 | fract = (x & 0x000FFFFF) << 11; |
5862 | 5518 | ||
5863 | /* Read two nearest output values from the index in 1.31(q31) format */ |
5519 | /* Read two nearest output values from the index in 1.31(q31) format */ |
5864 | y0 = pYData[index]; |
5520 | y0 = pYData[index]; |
5865 | y1 = pYData[index + 1u]; |
5521 | y1 = pYData[index + 1]; |
5866 | 5522 | ||
5867 | /* Calculation of y0 * (1-fract) and y is in 2.30 format */ |
5523 | /* Calculation of y0 * (1-fract) and y is in 2.30 format */ |
5868 | y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); |
5524 | y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); |
5869 | 5525 | ||
5870 | /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ |
5526 | /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ |
5871 | y += ((q31_t) (((q63_t) y1 * fract) >> 32)); |
5527 | y += ((q31_t) (((q63_t) y1 * fract) >> 32)); |
5872 | 5528 | ||
5873 | /* Convert y to 1.31 format */ |
5529 | /* Convert y to 1.31 format */ |
5874 | return (y << 1u); |
5530 | return (y << 1u); |
5875 | - | ||
5876 | } |
5531 | } |
5877 | - | ||
5878 | } |
5532 | } |
5879 | 5533 | ||
- | 5534 | ||
5880 | /** |
5535 | /** |
5881 | * |
5536 | * |
5882 | * @brief Process function for the Q15 Linear Interpolation Function. |
5537 | * @brief Process function for the Q15 Linear Interpolation Function. |
5883 | * @param[in] *pYData pointer to Q15 Linear Interpolation table |
5538 | * @param[in] pYData pointer to Q15 Linear Interpolation table |
5884 | * @param[in] x input sample to process |
5539 | * @param[in] x input sample to process |
5885 | * @param[in] nValues number of table values |
5540 | * @param[in] nValues number of table values |
5886 | * @return y processed output sample. |
5541 | * @return y processed output sample. |
5887 | * |
5542 | * |
5888 | * \par |
5543 | * \par |
5889 | * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. |
5544 | * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. |
5890 | * This function can support maximum of table size 2^12. |
5545 | * This function can support maximum of table size 2^12. |
5891 | * |
5546 | * |
5892 | */ |
5547 | */ |
5893 | - | ||
5894 | - | ||
5895 | static __INLINE q15_t arm_linear_interp_q15( |
5548 | static __INLINE q15_t arm_linear_interp_q15( |
5896 | q15_t * pYData, |
5549 | q15_t * pYData, |
5897 | q31_t x, |
5550 | q31_t x, |
5898 | uint32_t nValues) |
5551 | uint32_t nValues) |
5899 | { |
5552 | { |
Line 5903... | Line 5556... | ||
5903 | int32_t index; /* Index to read nearest output values */ |
5556 | int32_t index; /* Index to read nearest output values */ |
5904 | 5557 | ||
5905 | /* Input is in 12.20 format */ |
5558 | /* Input is in 12.20 format */ |
5906 | /* 12 bits for the table index */ |
5559 | /* 12 bits for the table index */ |
5907 | /* Index value calculation */ |
5560 | /* Index value calculation */ |
5908 | index = ((x & 0xFFF00000) >> 20u); |
5561 | index = ((x & (int32_t)0xFFF00000) >> 20); |
5909 | 5562 | ||
5910 | if(index >= (int32_t)(nValues - 1)) |
5563 | if(index >= (int32_t)(nValues - 1)) |
5911 | { |
5564 | { |
5912 | return (pYData[nValues - 1]); |
5565 | return (pYData[nValues - 1]); |
5913 | } |
5566 | } |
Line 5921... | Line 5574... | ||
5921 | /* fract is in 12.20 format */ |
5574 | /* fract is in 12.20 format */ |
5922 | fract = (x & 0x000FFFFF); |
5575 | fract = (x & 0x000FFFFF); |
5923 | 5576 | ||
5924 | /* Read two nearest output values from the index */ |
5577 | /* Read two nearest output values from the index */ |
5925 | y0 = pYData[index]; |
5578 | y0 = pYData[index]; |
5926 | y1 = pYData[index + 1u]; |
5579 | y1 = pYData[index + 1]; |
5927 | 5580 | ||
5928 | /* Calculation of y0 * (1-fract) and y is in 13.35 format */ |
5581 | /* Calculation of y0 * (1-fract) and y is in 13.35 format */ |
5929 | y = ((q63_t) y0 * (0xFFFFF - fract)); |
5582 | y = ((q63_t) y0 * (0xFFFFF - fract)); |
5930 | 5583 | ||
5931 | /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ |
5584 | /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ |
5932 | y += ((q63_t) y1 * (fract)); |
5585 | y += ((q63_t) y1 * (fract)); |
5933 | 5586 | ||
5934 | /* convert y to 1.15 format */ |
5587 | /* convert y to 1.15 format */ |
5935 | return (y >> 20); |
5588 | return (q15_t) (y >> 20); |
5936 | } |
5589 | } |
5937 | - | ||
5938 | - | ||
5939 | } |
5590 | } |
5940 | 5591 | ||
- | 5592 | ||
5941 | /** |
5593 | /** |
5942 | * |
5594 | * |
5943 | * @brief Process function for the Q7 Linear Interpolation Function. |
5595 | * @brief Process function for the Q7 Linear Interpolation Function. |
5944 | * @param[in] *pYData pointer to Q7 Linear Interpolation table |
5596 | * @param[in] pYData pointer to Q7 Linear Interpolation table |
5945 | * @param[in] x input sample to process |
5597 | * @param[in] x input sample to process |
5946 | * @param[in] nValues number of table values |
5598 | * @param[in] nValues number of table values |
5947 | * @return y processed output sample. |
5599 | * @return y processed output sample. |
5948 | * |
5600 | * |
5949 | * \par |
5601 | * \par |
5950 | * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. |
5602 | * Input sample <code>x</code> is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. |
5951 | * This function can support maximum of table size 2^12. |
5603 | * This function can support maximum of table size 2^12. |
5952 | */ |
5604 | */ |
5953 | - | ||
5954 | - | ||
5955 | static __INLINE q7_t arm_linear_interp_q7( |
5605 | static __INLINE q7_t arm_linear_interp_q7( |
5956 | q7_t * pYData, |
5606 | q7_t * pYData, |
5957 | q31_t x, |
5607 | q31_t x, |
5958 | uint32_t nValues) |
5608 | uint32_t nValues) |
5959 | { |
5609 | { |
Line 5969... | Line 5619... | ||
5969 | { |
5619 | { |
5970 | return (pYData[0]); |
5620 | return (pYData[0]); |
5971 | } |
5621 | } |
5972 | index = (x >> 20) & 0xfff; |
5622 | index = (x >> 20) & 0xfff; |
5973 | 5623 | ||
5974 | - | ||
5975 | if(index >= (nValues - 1)) |
5624 | if(index >= (nValues - 1)) |
5976 | { |
5625 | { |
5977 | return (pYData[nValues - 1]); |
5626 | return (pYData[nValues - 1]); |
5978 | } |
5627 | } |
5979 | else |
5628 | else |
5980 | { |
5629 | { |
5981 | - | ||
5982 | /* 20 bits for the fractional part */ |
5630 | /* 20 bits for the fractional part */ |
5983 | /* fract is in 12.20 format */ |
5631 | /* fract is in 12.20 format */ |
5984 | fract = (x & 0x000FFFFF); |
5632 | fract = (x & 0x000FFFFF); |
5985 | 5633 | ||
5986 | /* Read two nearest output values from the index and are in 1.7(q7) format */ |
5634 | /* Read two nearest output values from the index and are in 1.7(q7) format */ |
5987 | y0 = pYData[index]; |
5635 | y0 = pYData[index]; |
5988 | y1 = pYData[index + 1u]; |
5636 | y1 = pYData[index + 1]; |
5989 | 5637 | ||
5990 | /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ |
5638 | /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ |
5991 | y = ((y0 * (0xFFFFF - fract))); |
5639 | y = ((y0 * (0xFFFFF - fract))); |
5992 | 5640 | ||
5993 | /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ |
5641 | /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ |
5994 | y += (y1 * fract); |
5642 | y += (y1 * fract); |
5995 | 5643 | ||
5996 | /* convert y to 1.7(q7) format */ |
5644 | /* convert y to 1.7(q7) format */ |
5997 | return (y >> 20u); |
5645 | return (q7_t) (y >> 20); |
5998 | - | ||
5999 | } |
5646 | } |
6000 | - | ||
6001 | } |
5647 | } |
- | 5648 | ||
6002 | /** |
5649 | /** |
6003 | * @} end of LinearInterpolate group |
5650 | * @} end of LinearInterpolate group |
6004 | */ |
5651 | */ |
6005 | 5652 | ||
6006 | /** |
5653 | /** |
6007 | * @brief Fast approximation to the trigonometric sine function for floating-point data. |
5654 | * @brief Fast approximation to the trigonometric sine function for floating-point data. |
6008 | * @param[in] x input value in radians. |
5655 | * @param[in] x input value in radians. |
6009 | * @return sin(x). |
5656 | * @return sin(x). |
6010 | */ |
5657 | */ |
6011 | - | ||
6012 | float32_t arm_sin_f32( |
5658 | float32_t arm_sin_f32( |
6013 | float32_t x); |
5659 | float32_t x); |
6014 | 5660 | ||
- | 5661 | ||
6015 | /** |
5662 | /** |
6016 | * @brief Fast approximation to the trigonometric sine function for Q31 data. |
5663 | * @brief Fast approximation to the trigonometric sine function for Q31 data. |
6017 | * @param[in] x Scaled input value in radians. |
5664 | * @param[in] x Scaled input value in radians. |
6018 | * @return sin(x). |
5665 | * @return sin(x). |
6019 | */ |
5666 | */ |
6020 | - | ||
6021 | q31_t arm_sin_q31( |
5667 | q31_t arm_sin_q31( |
6022 | q31_t x); |
5668 | q31_t x); |
6023 | 5669 | ||
- | 5670 | ||
6024 | /** |
5671 | /** |
6025 | * @brief Fast approximation to the trigonometric sine function for Q15 data. |
5672 | * @brief Fast approximation to the trigonometric sine function for Q15 data. |
6026 | * @param[in] x Scaled input value in radians. |
5673 | * @param[in] x Scaled input value in radians. |
6027 | * @return sin(x). |
5674 | * @return sin(x). |
6028 | */ |
5675 | */ |
6029 | - | ||
6030 | q15_t arm_sin_q15( |
5676 | q15_t arm_sin_q15( |
6031 | q15_t x); |
5677 | q15_t x); |
6032 | 5678 | ||
- | 5679 | ||
6033 | /** |
5680 | /** |
6034 | * @brief Fast approximation to the trigonometric cosine function for floating-point data. |
5681 | * @brief Fast approximation to the trigonometric cosine function for floating-point data. |
6035 | * @param[in] x input value in radians. |
5682 | * @param[in] x input value in radians. |
6036 | * @return cos(x). |
5683 | * @return cos(x). |
6037 | */ |
5684 | */ |
6038 | - | ||
6039 | float32_t arm_cos_f32( |
5685 | float32_t arm_cos_f32( |
6040 | float32_t x); |
5686 | float32_t x); |
6041 | 5687 | ||
- | 5688 | ||
6042 | /** |
5689 | /** |
6043 | * @brief Fast approximation to the trigonometric cosine function for Q31 data. |
5690 | * @brief Fast approximation to the trigonometric cosine function for Q31 data. |
6044 | * @param[in] x Scaled input value in radians. |
5691 | * @param[in] x Scaled input value in radians. |
6045 | * @return cos(x). |
5692 | * @return cos(x). |
6046 | */ |
5693 | */ |
6047 | - | ||
6048 | q31_t arm_cos_q31( |
5694 | q31_t arm_cos_q31( |
6049 | q31_t x); |
5695 | q31_t x); |
6050 | 5696 | ||
- | 5697 | ||
6051 | /** |
5698 | /** |
6052 | * @brief Fast approximation to the trigonometric cosine function for Q15 data. |
5699 | * @brief Fast approximation to the trigonometric cosine function for Q15 data. |
6053 | * @param[in] x Scaled input value in radians. |
5700 | * @param[in] x Scaled input value in radians. |
6054 | * @return cos(x). |
5701 | * @return cos(x). |
6055 | */ |
5702 | */ |
6056 | - | ||
6057 | q15_t arm_cos_q15( |
5703 | q15_t arm_cos_q15( |
6058 | q15_t x); |
5704 | q15_t x); |
6059 | 5705 | ||
6060 | 5706 | ||
6061 | /** |
5707 | /** |
Line 6089... | Line 5735... | ||
6089 | * @{ |
5735 | * @{ |
6090 | */ |
5736 | */ |
6091 | 5737 | ||
6092 | /** |
5738 | /** |
6093 | * @brief Floating-point square root function. |
5739 | * @brief Floating-point square root function. |
6094 | * @param[in] in input value. |
5740 | * @param[in] in input value. |
6095 | * @param[out] *pOut square root of input value. |
5741 | * @param[out] pOut square root of input value. |
6096 | * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if |
5742 | * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if |
6097 | * <code>in</code> is negative value and returns zero output for negative values. |
5743 | * <code>in</code> is negative value and returns zero output for negative values. |
6098 | */ |
5744 | */ |
6099 | - | ||
6100 | static __INLINE arm_status arm_sqrt_f32( |
5745 | static __INLINE arm_status arm_sqrt_f32( |
6101 | float32_t in, |
5746 | float32_t in, |
6102 | float32_t * pOut) |
5747 | float32_t * pOut) |
6103 | { |
5748 | { |
6104 | if(in >= 0.0f) |
5749 | if(in >= 0.0f) |
6105 | { |
5750 | { |
6106 | 5751 | ||
6107 | // #if __FPU_USED |
- | |
6108 | #if (__FPU_USED == 1) && defined ( __CC_ARM ) |
5752 | #if (__FPU_USED == 1) && defined ( __CC_ARM ) |
6109 | *pOut = __sqrtf(in); |
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)); |
|
6110 | #else |
5760 | #else |
6111 | *pOut = sqrtf(in); |
5761 | *pOut = sqrtf(in); |
6112 | #endif |
5762 | #endif |
6113 | 5763 | ||
6114 | return (ARM_MATH_SUCCESS); |
5764 | return (ARM_MATH_SUCCESS); |
Line 6116... | Line 5766... | ||
6116 | else |
5766 | else |
6117 | { |
5767 | { |
6118 | *pOut = 0.0f; |
5768 | *pOut = 0.0f; |
6119 | return (ARM_MATH_ARGUMENT_ERROR); |
5769 | return (ARM_MATH_ARGUMENT_ERROR); |
6120 | } |
5770 | } |
6121 | - | ||
6122 | } |
5771 | } |
6123 | 5772 | ||
6124 | 5773 | ||
6125 | /** |
5774 | /** |
6126 | * @brief Q31 square root function. |
5775 | * @brief Q31 square root function. |
6127 | * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. |
5776 | * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. |
6128 | * @param[out] *pOut square root of input value. |
5777 | * @param[out] pOut square root of input value. |
6129 | * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if |
5778 | * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if |
6130 | * <code>in</code> is negative value and returns zero output for negative values. |
5779 | * <code>in</code> is negative value and returns zero output for negative values. |
6131 | */ |
5780 | */ |
6132 | arm_status arm_sqrt_q31( |
5781 | arm_status arm_sqrt_q31( |
6133 | q31_t in, |
5782 | q31_t in, |
6134 | q31_t * pOut); |
5783 | q31_t * pOut); |
6135 | 5784 | ||
- | 5785 | ||
6136 | /** |
5786 | /** |
6137 | * @brief Q15 square root function. |
5787 | * @brief Q15 square root function. |
6138 | * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. |
5788 | * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. |
6139 | * @param[out] *pOut square root of input value. |
5789 | * @param[out] pOut square root of input value. |
6140 | * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if |
5790 | * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if |
6141 | * <code>in</code> is negative value and returns zero output for negative values. |
5791 | * <code>in</code> is negative value and returns zero output for negative values. |
6142 | */ |
5792 | */ |
6143 | arm_status arm_sqrt_q15( |
5793 | arm_status arm_sqrt_q15( |
6144 | q15_t in, |
5794 | q15_t in, |
Line 6147... | Line 5797... | ||
6147 | /** |
5797 | /** |
6148 | * @} end of SQRT group |
5798 | * @} end of SQRT group |
6149 | */ |
5799 | */ |
6150 | 5800 | ||
6151 | 5801 | ||
6152 | - | ||
6153 | - | ||
6154 | - | ||
6155 | - | ||
6156 | /** |
5802 | /** |
6157 | * @brief floating-point Circular write function. |
5803 | * @brief floating-point Circular write function. |
6158 | */ |
5804 | */ |
6159 | - | ||
6160 | static __INLINE void arm_circularWrite_f32( |
5805 | static __INLINE void arm_circularWrite_f32( |
6161 | int32_t * circBuffer, |
5806 | int32_t * circBuffer, |
6162 | int32_t L, |
5807 | int32_t L, |
6163 | uint16_t * writeOffset, |
5808 | uint16_t * writeOffset, |
6164 | int32_t bufferInc, |
5809 | int32_t bufferInc, |
Line 6192... | Line 5837... | ||
6192 | /* Decrement the loop counter */ |
5837 | /* Decrement the loop counter */ |
6193 | i--; |
5838 | i--; |
6194 | } |
5839 | } |
6195 | 5840 | ||
6196 | /* Update the index pointer */ |
5841 | /* Update the index pointer */ |
6197 | *writeOffset = wOffset; |
5842 | *writeOffset = (uint16_t)wOffset; |
6198 | } |
5843 | } |
6199 | 5844 | ||
6200 | 5845 | ||
6201 | 5846 | ||
6202 | /** |
5847 | /** |
Line 6251... | Line 5896... | ||
6251 | 5896 | ||
6252 | /* Update the index pointer */ |
5897 | /* Update the index pointer */ |
6253 | *readOffset = rOffset; |
5898 | *readOffset = rOffset; |
6254 | } |
5899 | } |
6255 | 5900 | ||
- | 5901 | ||
6256 | /** |
5902 | /** |
6257 | * @brief Q15 Circular write function. |
5903 | * @brief Q15 Circular write function. |
6258 | */ |
5904 | */ |
6259 | - | ||
6260 | static __INLINE void arm_circularWrite_q15( |
5905 | static __INLINE void arm_circularWrite_q15( |
6261 | q15_t * circBuffer, |
5906 | q15_t * circBuffer, |
6262 | int32_t L, |
5907 | int32_t L, |
6263 | uint16_t * writeOffset, |
5908 | uint16_t * writeOffset, |
6264 | int32_t bufferInc, |
5909 | int32_t bufferInc, |
Line 6292... | Line 5937... | ||
6292 | /* Decrement the loop counter */ |
5937 | /* Decrement the loop counter */ |
6293 | i--; |
5938 | i--; |
6294 | } |
5939 | } |
6295 | 5940 | ||
6296 | /* Update the index pointer */ |
5941 | /* Update the index pointer */ |
6297 | *writeOffset = wOffset; |
5942 | *writeOffset = (uint16_t)wOffset; |
6298 | } |
5943 | } |
6299 | 5944 | ||
6300 | 5945 | ||
6301 | - | ||
6302 | /** |
5946 | /** |
6303 | * @brief Q15 Circular Read function. |
5947 | * @brief Q15 Circular Read function. |
6304 | */ |
5948 | */ |
6305 | static __INLINE void arm_circularRead_q15( |
5949 | static __INLINE void arm_circularRead_q15( |
6306 | q15_t * circBuffer, |
5950 | q15_t * circBuffer, |
Line 6356... | Line 6000... | ||
6356 | 6000 | ||
6357 | 6001 | ||
6358 | /** |
6002 | /** |
6359 | * @brief Q7 Circular write function. |
6003 | * @brief Q7 Circular write function. |
6360 | */ |
6004 | */ |
6361 | - | ||
6362 | static __INLINE void arm_circularWrite_q7( |
6005 | static __INLINE void arm_circularWrite_q7( |
6363 | q7_t * circBuffer, |
6006 | q7_t * circBuffer, |
6364 | int32_t L, |
6007 | int32_t L, |
6365 | uint16_t * writeOffset, |
6008 | uint16_t * writeOffset, |
6366 | int32_t bufferInc, |
6009 | int32_t bufferInc, |
Line 6394... | Line 6037... | ||
6394 | /* Decrement the loop counter */ |
6037 | /* Decrement the loop counter */ |
6395 | i--; |
6038 | i--; |
6396 | } |
6039 | } |
6397 | 6040 | ||
6398 | /* Update the index pointer */ |
6041 | /* Update the index pointer */ |
6399 | *writeOffset = wOffset; |
6042 | *writeOffset = (uint16_t)wOffset; |
6400 | } |
6043 | } |
6401 | 6044 | ||
6402 | 6045 | ||
6403 | - | ||
6404 | /** |
6046 | /** |
6405 | * @brief Q7 Circular Read function. |
6047 | * @brief Q7 Circular Read function. |
6406 | */ |
6048 | */ |
6407 | static __INLINE void arm_circularRead_q7( |
6049 | static __INLINE void arm_circularRead_q7( |
6408 | q7_t * circBuffer, |
6050 | q7_t * circBuffer, |
Line 6457... | Line 6099... | ||
6457 | } |
6099 | } |
6458 | 6100 | ||
6459 | 6101 | ||
6460 | /** |
6102 | /** |
6461 | * @brief Sum of the squares of the elements of a Q31 vector. |
6103 | * @brief Sum of the squares of the elements of a Q31 vector. |
6462 | * @param[in] *pSrc is input pointer |
6104 | * @param[in] pSrc is input pointer |
6463 | * @param[in] blockSize is the number of samples to process |
6105 | * @param[in] blockSize is the number of samples to process |
6464 | * @param[out] *pResult is output value. |
6106 | * @param[out] pResult is output value. |
6465 | * @return none. |
- | |
6466 | */ |
6107 | */ |
6467 | - | ||
6468 | void arm_power_q31( |
6108 | void arm_power_q31( |
6469 | q31_t * pSrc, |
6109 | q31_t * pSrc, |
6470 | uint32_t blockSize, |
6110 | uint32_t blockSize, |
6471 | q63_t * pResult); |
6111 | q63_t * pResult); |
6472 | 6112 | ||
- | 6113 | ||
6473 | /** |
6114 | /** |
6474 | * @brief Sum of the squares of the elements of a floating-point vector. |
6115 | * @brief Sum of the squares of the elements of a floating-point vector. |
6475 | * @param[in] *pSrc is input pointer |
6116 | * @param[in] pSrc is input pointer |
6476 | * @param[in] blockSize is the number of samples to process |
6117 | * @param[in] blockSize is the number of samples to process |
6477 | * @param[out] *pResult is output value. |
6118 | * @param[out] pResult is output value. |
6478 | * @return none. |
- | |
6479 | */ |
6119 | */ |
6480 | - | ||
6481 | void arm_power_f32( |
6120 | void arm_power_f32( |
6482 | float32_t * pSrc, |
6121 | float32_t * pSrc, |
6483 | uint32_t blockSize, |
6122 | uint32_t blockSize, |
6484 | float32_t * pResult); |
6123 | float32_t * pResult); |
6485 | 6124 | ||
- | 6125 | ||
6486 | /** |
6126 | /** |
6487 | * @brief Sum of the squares of the elements of a Q15 vector. |
6127 | * @brief Sum of the squares of the elements of a Q15 vector. |
6488 | * @param[in] *pSrc is input pointer |
6128 | * @param[in] pSrc is input pointer |
6489 | * @param[in] blockSize is the number of samples to process |
6129 | * @param[in] blockSize is the number of samples to process |
6490 | * @param[out] *pResult is output value. |
6130 | * @param[out] pResult is output value. |
6491 | * @return none. |
- | |
6492 | */ |
6131 | */ |
6493 | - | ||
6494 | void arm_power_q15( |
6132 | void arm_power_q15( |
6495 | q15_t * pSrc, |
6133 | q15_t * pSrc, |
6496 | uint32_t blockSize, |
6134 | uint32_t blockSize, |
6497 | q63_t * pResult); |
6135 | q63_t * pResult); |
6498 | 6136 | ||
- | 6137 | ||
6499 | /** |
6138 | /** |
6500 | * @brief Sum of the squares of the elements of a Q7 vector. |
6139 | * @brief Sum of the squares of the elements of a Q7 vector. |
6501 | * @param[in] *pSrc is input pointer |
6140 | * @param[in] pSrc is input pointer |
6502 | * @param[in] blockSize is the number of samples to process |
6141 | * @param[in] blockSize is the number of samples to process |
6503 | * @param[out] *pResult is output value. |
6142 | * @param[out] pResult is output value. |
6504 | * @return none. |
- | |
6505 | */ |
6143 | */ |
6506 | - | ||
6507 | void arm_power_q7( |
6144 | void arm_power_q7( |
6508 | q7_t * pSrc, |
6145 | q7_t * pSrc, |
6509 | uint32_t blockSize, |
6146 | uint32_t blockSize, |
6510 | q31_t * pResult); |
6147 | q31_t * pResult); |
6511 | 6148 | ||
- | 6149 | ||
6512 | /** |
6150 | /** |
6513 | * @brief Mean value of a Q7 vector. |
6151 | * @brief Mean value of a Q7 vector. |
6514 | * @param[in] *pSrc is input pointer |
6152 | * @param[in] pSrc is input pointer |
6515 | * @param[in] blockSize is the number of samples to process |
6153 | * @param[in] blockSize is the number of samples to process |
6516 | * @param[out] *pResult is output value. |
6154 | * @param[out] pResult is output value. |
6517 | * @return none. |
- | |
6518 | */ |
6155 | */ |
6519 | - | ||
6520 | void arm_mean_q7( |
6156 | void arm_mean_q7( |
6521 | q7_t * pSrc, |
6157 | q7_t * pSrc, |
6522 | uint32_t blockSize, |
6158 | uint32_t blockSize, |
6523 | q7_t * pResult); |
6159 | q7_t * pResult); |
6524 | 6160 | ||
- | 6161 | ||
6525 | /** |
6162 | /** |
6526 | * @brief Mean value of a Q15 vector. |
6163 | * @brief Mean value of a Q15 vector. |
6527 | * @param[in] *pSrc is input pointer |
6164 | * @param[in] pSrc is input pointer |
6528 | * @param[in] blockSize is the number of samples to process |
6165 | * @param[in] blockSize is the number of samples to process |
6529 | * @param[out] *pResult is output value. |
6166 | * @param[out] pResult is output value. |
6530 | * @return none. |
- | |
6531 | */ |
6167 | */ |
6532 | void arm_mean_q15( |
6168 | void arm_mean_q15( |
6533 | q15_t * pSrc, |
6169 | q15_t * pSrc, |
6534 | uint32_t blockSize, |
6170 | uint32_t blockSize, |
6535 | q15_t * pResult); |
6171 | q15_t * pResult); |
6536 | 6172 | ||
- | 6173 | ||
6537 | /** |
6174 | /** |
6538 | * @brief Mean value of a Q31 vector. |
6175 | * @brief Mean value of a Q31 vector. |
6539 | * @param[in] *pSrc is input pointer |
6176 | * @param[in] pSrc is input pointer |
6540 | * @param[in] blockSize is the number of samples to process |
6177 | * @param[in] blockSize is the number of samples to process |
6541 | * @param[out] *pResult is output value. |
6178 | * @param[out] pResult is output value. |
6542 | * @return none. |
- | |
6543 | */ |
6179 | */ |
6544 | void arm_mean_q31( |
6180 | void arm_mean_q31( |
6545 | q31_t * pSrc, |
6181 | q31_t * pSrc, |
6546 | uint32_t blockSize, |
6182 | uint32_t blockSize, |
6547 | q31_t * pResult); |
6183 | q31_t * pResult); |
6548 | 6184 | ||
- | 6185 | ||
6549 | /** |
6186 | /** |
6550 | * @brief Mean value of a floating-point vector. |
6187 | * @brief Mean value of a floating-point vector. |
6551 | * @param[in] *pSrc is input pointer |
6188 | * @param[in] pSrc is input pointer |
6552 | * @param[in] blockSize is the number of samples to process |
6189 | * @param[in] blockSize is the number of samples to process |
6553 | * @param[out] *pResult is output value. |
6190 | * @param[out] pResult is output value. |
6554 | * @return none. |
- | |
6555 | */ |
6191 | */ |
6556 | void arm_mean_f32( |
6192 | void arm_mean_f32( |
6557 | float32_t * pSrc, |
6193 | float32_t * pSrc, |
6558 | uint32_t blockSize, |
6194 | uint32_t blockSize, |
6559 | float32_t * pResult); |
6195 | float32_t * pResult); |
6560 | 6196 | ||
- | 6197 | ||
6561 | /** |
6198 | /** |
6562 | * @brief Variance of the elements of a floating-point vector. |
6199 | * @brief Variance of the elements of a floating-point vector. |
6563 | * @param[in] *pSrc is input pointer |
6200 | * @param[in] pSrc is input pointer |
6564 | * @param[in] blockSize is the number of samples to process |
6201 | * @param[in] blockSize is the number of samples to process |
6565 | * @param[out] *pResult is output value. |
6202 | * @param[out] pResult is output value. |
6566 | * @return none. |
- | |
6567 | */ |
6203 | */ |
6568 | - | ||
6569 | void arm_var_f32( |
6204 | void arm_var_f32( |
6570 | float32_t * pSrc, |
6205 | float32_t * pSrc, |
6571 | uint32_t blockSize, |
6206 | uint32_t blockSize, |
6572 | float32_t * pResult); |
6207 | float32_t * pResult); |
6573 | 6208 | ||
- | 6209 | ||
6574 | /** |
6210 | /** |
6575 | * @brief Variance of the elements of a Q31 vector. |
6211 | * @brief Variance of the elements of a Q31 vector. |
6576 | * @param[in] *pSrc is input pointer |
6212 | * @param[in] pSrc is input pointer |
6577 | * @param[in] blockSize is the number of samples to process |
6213 | * @param[in] blockSize is the number of samples to process |
6578 | * @param[out] *pResult is output value. |
6214 | * @param[out] pResult is output value. |
6579 | * @return none. |
- | |
6580 | */ |
6215 | */ |
6581 | - | ||
6582 | void arm_var_q31( |
6216 | void arm_var_q31( |
6583 | q31_t * pSrc, |
6217 | q31_t * pSrc, |
6584 | uint32_t blockSize, |
6218 | uint32_t blockSize, |
6585 | q31_t * pResult); |
6219 | q31_t * pResult); |
6586 | 6220 | ||
- | 6221 | ||
6587 | /** |
6222 | /** |
6588 | * @brief Variance of the elements of a Q15 vector. |
6223 | * @brief Variance of the elements of a Q15 vector. |
6589 | * @param[in] *pSrc is input pointer |
6224 | * @param[in] pSrc is input pointer |
6590 | * @param[in] blockSize is the number of samples to process |
6225 | * @param[in] blockSize is the number of samples to process |
6591 | * @param[out] *pResult is output value. |
6226 | * @param[out] pResult is output value. |
6592 | * @return none. |
- | |
6593 | */ |
6227 | */ |
6594 | - | ||
6595 | void arm_var_q15( |
6228 | void arm_var_q15( |
6596 | q15_t * pSrc, |
6229 | q15_t * pSrc, |
6597 | uint32_t blockSize, |
6230 | uint32_t blockSize, |
6598 | q15_t * pResult); |
6231 | q15_t * pResult); |
6599 | 6232 | ||
- | 6233 | ||
6600 | /** |
6234 | /** |
6601 | * @brief Root Mean Square of the elements of a floating-point vector. |
6235 | * @brief Root Mean Square of the elements of a floating-point vector. |
6602 | * @param[in] *pSrc is input pointer |
6236 | * @param[in] pSrc is input pointer |
6603 | * @param[in] blockSize is the number of samples to process |
6237 | * @param[in] blockSize is the number of samples to process |
6604 | * @param[out] *pResult is output value. |
6238 | * @param[out] pResult is output value. |
6605 | * @return none. |
- | |
6606 | */ |
6239 | */ |
6607 | - | ||
6608 | void arm_rms_f32( |
6240 | void arm_rms_f32( |
6609 | float32_t * pSrc, |
6241 | float32_t * pSrc, |
6610 | uint32_t blockSize, |
6242 | uint32_t blockSize, |
6611 | float32_t * pResult); |
6243 | float32_t * pResult); |
6612 | 6244 | ||
- | 6245 | ||
6613 | /** |
6246 | /** |
6614 | * @brief Root Mean Square of the elements of a Q31 vector. |
6247 | * @brief Root Mean Square of the elements of a Q31 vector. |
6615 | * @param[in] *pSrc is input pointer |
6248 | * @param[in] pSrc is input pointer |
6616 | * @param[in] blockSize is the number of samples to process |
6249 | * @param[in] blockSize is the number of samples to process |
6617 | * @param[out] *pResult is output value. |
6250 | * @param[out] pResult is output value. |
6618 | * @return none. |
- | |
6619 | */ |
6251 | */ |
6620 | - | ||
6621 | void arm_rms_q31( |
6252 | void arm_rms_q31( |
6622 | q31_t * pSrc, |
6253 | q31_t * pSrc, |
6623 | uint32_t blockSize, |
6254 | uint32_t blockSize, |
6624 | q31_t * pResult); |
6255 | q31_t * pResult); |
6625 | 6256 | ||
- | 6257 | ||
6626 | /** |
6258 | /** |
6627 | * @brief Root Mean Square of the elements of a Q15 vector. |
6259 | * @brief Root Mean Square of the elements of a Q15 vector. |
6628 | * @param[in] *pSrc is input pointer |
6260 | * @param[in] pSrc is input pointer |
6629 | * @param[in] blockSize is the number of samples to process |
6261 | * @param[in] blockSize is the number of samples to process |
6630 | * @param[out] *pResult is output value. |
6262 | * @param[out] pResult is output value. |
6631 | * @return none. |
- | |
6632 | */ |
6263 | */ |
6633 | - | ||
6634 | void arm_rms_q15( |
6264 | void arm_rms_q15( |
6635 | q15_t * pSrc, |
6265 | q15_t * pSrc, |
6636 | uint32_t blockSize, |
6266 | uint32_t blockSize, |
6637 | q15_t * pResult); |
6267 | q15_t * pResult); |
6638 | 6268 | ||
- | 6269 | ||
6639 | /** |
6270 | /** |
6640 | * @brief Standard deviation of the elements of a floating-point vector. |
6271 | * @brief Standard deviation of the elements of a floating-point vector. |
6641 | * @param[in] *pSrc is input pointer |
6272 | * @param[in] pSrc is input pointer |
6642 | * @param[in] blockSize is the number of samples to process |
6273 | * @param[in] blockSize is the number of samples to process |
6643 | * @param[out] *pResult is output value. |
6274 | * @param[out] pResult is output value. |
6644 | * @return none. |
- | |
6645 | */ |
6275 | */ |
6646 | - | ||
6647 | void arm_std_f32( |
6276 | void arm_std_f32( |
6648 | float32_t * pSrc, |
6277 | float32_t * pSrc, |
6649 | uint32_t blockSize, |
6278 | uint32_t blockSize, |
6650 | float32_t * pResult); |
6279 | float32_t * pResult); |
6651 | 6280 | ||
- | 6281 | ||
6652 | /** |
6282 | /** |
6653 | * @brief Standard deviation of the elements of a Q31 vector. |
6283 | * @brief Standard deviation of the elements of a Q31 vector. |
6654 | * @param[in] *pSrc is input pointer |
6284 | * @param[in] pSrc is input pointer |
6655 | * @param[in] blockSize is the number of samples to process |
6285 | * @param[in] blockSize is the number of samples to process |
6656 | * @param[out] *pResult is output value. |
6286 | * @param[out] pResult is output value. |
6657 | * @return none. |
- | |
6658 | */ |
6287 | */ |
6659 | - | ||
6660 | void arm_std_q31( |
6288 | void arm_std_q31( |
6661 | q31_t * pSrc, |
6289 | q31_t * pSrc, |
6662 | uint32_t blockSize, |
6290 | uint32_t blockSize, |
6663 | q31_t * pResult); |
6291 | q31_t * pResult); |
6664 | 6292 | ||
- | 6293 | ||
6665 | /** |
6294 | /** |
6666 | * @brief Standard deviation of the elements of a Q15 vector. |
6295 | * @brief Standard deviation of the elements of a Q15 vector. |
6667 | * @param[in] *pSrc is input pointer |
6296 | * @param[in] pSrc is input pointer |
6668 | * @param[in] blockSize is the number of samples to process |
6297 | * @param[in] blockSize is the number of samples to process |
6669 | * @param[out] *pResult is output value. |
6298 | * @param[out] pResult is output value. |
6670 | * @return none. |
- | |
6671 | */ |
6299 | */ |
6672 | - | ||
6673 | void arm_std_q15( |
6300 | void arm_std_q15( |
6674 | q15_t * pSrc, |
6301 | q15_t * pSrc, |
6675 | uint32_t blockSize, |
6302 | uint32_t blockSize, |
6676 | q15_t * pResult); |
6303 | q15_t * pResult); |
6677 | 6304 | ||
- | 6305 | ||
6678 | /** |
6306 | /** |
6679 | * @brief Floating-point complex magnitude |
6307 | * @brief Floating-point complex magnitude |
6680 | * @param[in] *pSrc points to the complex input vector |
6308 | * @param[in] pSrc points to the complex input vector |
6681 | * @param[out] *pDst points to the real output vector |
6309 | * @param[out] pDst points to the real output vector |
6682 | * @param[in] numSamples number of complex samples in the input vector |
6310 | * @param[in] numSamples number of complex samples in the input vector |
6683 | * @return none. |
- | |
6684 | */ |
6311 | */ |
6685 | - | ||
6686 | void arm_cmplx_mag_f32( |
6312 | void arm_cmplx_mag_f32( |
6687 | float32_t * pSrc, |
6313 | float32_t * pSrc, |
6688 | float32_t * pDst, |
6314 | float32_t * pDst, |
6689 | uint32_t numSamples); |
6315 | uint32_t numSamples); |
6690 | 6316 | ||
- | 6317 | ||
6691 | /** |
6318 | /** |
6692 | * @brief Q31 complex magnitude |
6319 | * @brief Q31 complex magnitude |
6693 | * @param[in] *pSrc points to the complex input vector |
6320 | * @param[in] pSrc points to the complex input vector |
6694 | * @param[out] *pDst points to the real output vector |
6321 | * @param[out] pDst points to the real output vector |
6695 | * @param[in] numSamples number of complex samples in the input vector |
6322 | * @param[in] numSamples number of complex samples in the input vector |
6696 | * @return none. |
- | |
6697 | */ |
6323 | */ |
6698 | - | ||
6699 | void arm_cmplx_mag_q31( |
6324 | void arm_cmplx_mag_q31( |
6700 | q31_t * pSrc, |
6325 | q31_t * pSrc, |
6701 | q31_t * pDst, |
6326 | q31_t * pDst, |
6702 | uint32_t numSamples); |
6327 | uint32_t numSamples); |
6703 | 6328 | ||
- | 6329 | ||
6704 | /** |
6330 | /** |
6705 | * @brief Q15 complex magnitude |
6331 | * @brief Q15 complex magnitude |
6706 | * @param[in] *pSrc points to the complex input vector |
6332 | * @param[in] pSrc points to the complex input vector |
6707 | * @param[out] *pDst points to the real output vector |
6333 | * @param[out] pDst points to the real output vector |
6708 | * @param[in] numSamples number of complex samples in the input vector |
6334 | * @param[in] numSamples number of complex samples in the input vector |
6709 | * @return none. |
- | |
6710 | */ |
6335 | */ |
6711 | - | ||
6712 | void arm_cmplx_mag_q15( |
6336 | void arm_cmplx_mag_q15( |
6713 | q15_t * pSrc, |
6337 | q15_t * pSrc, |
6714 | q15_t * pDst, |
6338 | q15_t * pDst, |
6715 | uint32_t numSamples); |
6339 | uint32_t numSamples); |
6716 | 6340 | ||
- | 6341 | ||
6717 | /** |
6342 | /** |
6718 | * @brief Q15 complex dot product |
6343 | * @brief Q15 complex dot product |
6719 | * @param[in] *pSrcA points to the first input vector |
6344 | * @param[in] pSrcA points to the first input vector |
6720 | * @param[in] *pSrcB points to the second input vector |
6345 | * @param[in] pSrcB points to the second input vector |
6721 | * @param[in] numSamples number of complex samples in each vector |
6346 | * @param[in] numSamples number of complex samples in each vector |
6722 | * @param[out] *realResult real part of the result returned here |
6347 | * @param[out] realResult real part of the result returned here |
6723 | * @param[out] *imagResult imaginary part of the result returned here |
6348 | * @param[out] imagResult imaginary part of the result returned here |
6724 | * @return none. |
- | |
6725 | */ |
6349 | */ |
6726 | - | ||
6727 | void arm_cmplx_dot_prod_q15( |
6350 | void arm_cmplx_dot_prod_q15( |
6728 | q15_t * pSrcA, |
6351 | q15_t * pSrcA, |
6729 | q15_t * pSrcB, |
6352 | q15_t * pSrcB, |
6730 | uint32_t numSamples, |
6353 | uint32_t numSamples, |
6731 | q31_t * realResult, |
6354 | q31_t * realResult, |
6732 | q31_t * imagResult); |
6355 | q31_t * imagResult); |
6733 | 6356 | ||
- | 6357 | ||
6734 | /** |
6358 | /** |
6735 | * @brief Q31 complex dot product |
6359 | * @brief Q31 complex dot product |
6736 | * @param[in] *pSrcA points to the first input vector |
6360 | * @param[in] pSrcA points to the first input vector |
6737 | * @param[in] *pSrcB points to the second input vector |
6361 | * @param[in] pSrcB points to the second input vector |
6738 | * @param[in] numSamples number of complex samples in each vector |
6362 | * @param[in] numSamples number of complex samples in each vector |
6739 | * @param[out] *realResult real part of the result returned here |
6363 | * @param[out] realResult real part of the result returned here |
6740 | * @param[out] *imagResult imaginary part of the result returned here |
6364 | * @param[out] imagResult imaginary part of the result returned here |
6741 | * @return none. |
- | |
6742 | */ |
6365 | */ |
6743 | - | ||
6744 | void arm_cmplx_dot_prod_q31( |
6366 | void arm_cmplx_dot_prod_q31( |
6745 | q31_t * pSrcA, |
6367 | q31_t * pSrcA, |
6746 | q31_t * pSrcB, |
6368 | q31_t * pSrcB, |
6747 | uint32_t numSamples, |
6369 | uint32_t numSamples, |
6748 | q63_t * realResult, |
6370 | q63_t * realResult, |
6749 | q63_t * imagResult); |
6371 | q63_t * imagResult); |
6750 | 6372 | ||
- | 6373 | ||
6751 | /** |
6374 | /** |
6752 | * @brief Floating-point complex dot product |
6375 | * @brief Floating-point complex dot product |
6753 | * @param[in] *pSrcA points to the first input vector |
6376 | * @param[in] pSrcA points to the first input vector |
6754 | * @param[in] *pSrcB points to the second input vector |
6377 | * @param[in] pSrcB points to the second input vector |
6755 | * @param[in] numSamples number of complex samples in each vector |
6378 | * @param[in] numSamples number of complex samples in each vector |
6756 | * @param[out] *realResult real part of the result returned here |
6379 | * @param[out] realResult real part of the result returned here |
6757 | * @param[out] *imagResult imaginary part of the result returned here |
6380 | * @param[out] imagResult imaginary part of the result returned here |
6758 | * @return none. |
- | |
6759 | */ |
6381 | */ |
6760 | - | ||
6761 | void arm_cmplx_dot_prod_f32( |
6382 | void arm_cmplx_dot_prod_f32( |
6762 | float32_t * pSrcA, |
6383 | float32_t * pSrcA, |
6763 | float32_t * pSrcB, |
6384 | float32_t * pSrcB, |
6764 | uint32_t numSamples, |
6385 | uint32_t numSamples, |
6765 | float32_t * realResult, |
6386 | float32_t * realResult, |
6766 | float32_t * imagResult); |
6387 | float32_t * imagResult); |
6767 | 6388 | ||
- | 6389 | ||
6768 | /** |
6390 | /** |
6769 | * @brief Q15 complex-by-real multiplication |
6391 | * @brief Q15 complex-by-real multiplication |
6770 | * @param[in] *pSrcCmplx points to the complex input vector |
6392 | * @param[in] pSrcCmplx points to the complex input vector |
6771 | * @param[in] *pSrcReal points to the real input vector |
6393 | * @param[in] pSrcReal points to the real input vector |
6772 | * @param[out] *pCmplxDst points to the complex output vector |
6394 | * @param[out] pCmplxDst points to the complex output vector |
6773 | * @param[in] numSamples number of samples in each vector |
6395 | * @param[in] numSamples number of samples in each vector |
6774 | * @return none. |
- | |
6775 | */ |
6396 | */ |
6776 | - | ||
6777 | void arm_cmplx_mult_real_q15( |
6397 | void arm_cmplx_mult_real_q15( |
6778 | q15_t * pSrcCmplx, |
6398 | q15_t * pSrcCmplx, |
6779 | q15_t * pSrcReal, |
6399 | q15_t * pSrcReal, |
6780 | q15_t * pCmplxDst, |
6400 | q15_t * pCmplxDst, |
6781 | uint32_t numSamples); |
6401 | uint32_t numSamples); |
6782 | 6402 | ||
- | 6403 | ||
6783 | /** |
6404 | /** |
6784 | * @brief Q31 complex-by-real multiplication |
6405 | * @brief Q31 complex-by-real multiplication |
6785 | * @param[in] *pSrcCmplx points to the complex input vector |
6406 | * @param[in] pSrcCmplx points to the complex input vector |
6786 | * @param[in] *pSrcReal points to the real input vector |
6407 | * @param[in] pSrcReal points to the real input vector |
6787 | * @param[out] *pCmplxDst points to the complex output vector |
6408 | * @param[out] pCmplxDst points to the complex output vector |
6788 | * @param[in] numSamples number of samples in each vector |
6409 | * @param[in] numSamples number of samples in each vector |
6789 | * @return none. |
- | |
6790 | */ |
6410 | */ |
6791 | - | ||
6792 | void arm_cmplx_mult_real_q31( |
6411 | void arm_cmplx_mult_real_q31( |
6793 | q31_t * pSrcCmplx, |
6412 | q31_t * pSrcCmplx, |
6794 | q31_t * pSrcReal, |
6413 | q31_t * pSrcReal, |
6795 | q31_t * pCmplxDst, |
6414 | q31_t * pCmplxDst, |
6796 | uint32_t numSamples); |
6415 | uint32_t numSamples); |
6797 | 6416 | ||
- | 6417 | ||
6798 | /** |
6418 | /** |
6799 | * @brief Floating-point complex-by-real multiplication |
6419 | * @brief Floating-point complex-by-real multiplication |
6800 | * @param[in] *pSrcCmplx points to the complex input vector |
6420 | * @param[in] pSrcCmplx points to the complex input vector |
6801 | * @param[in] *pSrcReal points to the real input vector |
6421 | * @param[in] pSrcReal points to the real input vector |
6802 | * @param[out] *pCmplxDst points to the complex output vector |
6422 | * @param[out] pCmplxDst points to the complex output vector |
6803 | * @param[in] numSamples number of samples in each vector |
6423 | * @param[in] numSamples number of samples in each vector |
6804 | * @return none. |
- | |
6805 | */ |
6424 | */ |
6806 | - | ||
6807 | void arm_cmplx_mult_real_f32( |
6425 | void arm_cmplx_mult_real_f32( |
6808 | float32_t * pSrcCmplx, |
6426 | float32_t * pSrcCmplx, |
6809 | float32_t * pSrcReal, |
6427 | float32_t * pSrcReal, |
6810 | float32_t * pCmplxDst, |
6428 | float32_t * pCmplxDst, |
6811 | uint32_t numSamples); |
6429 | uint32_t numSamples); |
6812 | 6430 | ||
- | 6431 | ||
6813 | /** |
6432 | /** |
6814 | * @brief Minimum value of a Q7 vector. |
6433 | * @brief Minimum value of a Q7 vector. |
6815 | * @param[in] *pSrc is input pointer |
6434 | * @param[in] pSrc is input pointer |
6816 | * @param[in] blockSize is the number of samples to process |
6435 | * @param[in] blockSize is the number of samples to process |
6817 | * @param[out] *result is output pointer |
6436 | * @param[out] result is output pointer |
6818 | * @param[in] index is the array index of the minimum value in the input buffer. |
6437 | * @param[in] index is the array index of the minimum value in the input buffer. |
6819 | * @return none. |
- | |
6820 | */ |
6438 | */ |
6821 | - | ||
6822 | void arm_min_q7( |
6439 | void arm_min_q7( |
6823 | q7_t * pSrc, |
6440 | q7_t * pSrc, |
6824 | uint32_t blockSize, |
6441 | uint32_t blockSize, |
6825 | q7_t * result, |
6442 | q7_t * result, |
6826 | uint32_t * index); |
6443 | uint32_t * index); |
6827 | 6444 | ||
- | 6445 | ||
6828 | /** |
6446 | /** |
6829 | * @brief Minimum value of a Q15 vector. |
6447 | * @brief Minimum value of a Q15 vector. |
6830 | * @param[in] *pSrc is input pointer |
6448 | * @param[in] pSrc is input pointer |
6831 | * @param[in] blockSize is the number of samples to process |
6449 | * @param[in] blockSize is the number of samples to process |
6832 | * @param[out] *pResult is output pointer |
6450 | * @param[out] pResult is output pointer |
6833 | * @param[in] *pIndex is the array index of the minimum value in the input buffer. |
6451 | * @param[in] pIndex is the array index of the minimum value in the input buffer. |
6834 | * @return none. |
- | |
6835 | */ |
6452 | */ |
6836 | - | ||
6837 | void arm_min_q15( |
6453 | void arm_min_q15( |
6838 | q15_t * pSrc, |
6454 | q15_t * pSrc, |
6839 | uint32_t blockSize, |
6455 | uint32_t blockSize, |
6840 | q15_t * pResult, |
6456 | q15_t * pResult, |
6841 | uint32_t * pIndex); |
6457 | uint32_t * pIndex); |
6842 | 6458 | ||
- | 6459 | ||
6843 | /** |
6460 | /** |
6844 | * @brief Minimum value of a Q31 vector. |
6461 | * @brief Minimum value of a Q31 vector. |
6845 | * @param[in] *pSrc is input pointer |
6462 | * @param[in] pSrc is input pointer |
6846 | * @param[in] blockSize is the number of samples to process |
6463 | * @param[in] blockSize is the number of samples to process |
6847 | * @param[out] *pResult is output pointer |
6464 | * @param[out] pResult is output pointer |
6848 | * @param[out] *pIndex is the array index of the minimum value in the input buffer. |
6465 | * @param[out] pIndex is the array index of the minimum value in the input buffer. |
6849 | * @return none. |
- | |
6850 | */ |
6466 | */ |
6851 | void arm_min_q31( |
6467 | void arm_min_q31( |
6852 | q31_t * pSrc, |
6468 | q31_t * pSrc, |
6853 | uint32_t blockSize, |
6469 | uint32_t blockSize, |
6854 | q31_t * pResult, |
6470 | q31_t * pResult, |
6855 | uint32_t * pIndex); |
6471 | uint32_t * pIndex); |
6856 | 6472 | ||
- | 6473 | ||
6857 | /** |
6474 | /** |
6858 | * @brief Minimum value of a floating-point vector. |
6475 | * @brief Minimum value of a floating-point vector. |
6859 | * @param[in] *pSrc is input pointer |
6476 | * @param[in] pSrc is input pointer |
6860 | * @param[in] blockSize is the number of samples to process |
6477 | * @param[in] blockSize is the number of samples to process |
6861 | * @param[out] *pResult is output pointer |
6478 | * @param[out] pResult is output pointer |
6862 | * @param[out] *pIndex is the array index of the minimum value in the input buffer. |
6479 | * @param[out] pIndex is the array index of the minimum value in the input buffer. |
6863 | * @return none. |
- | |
6864 | */ |
6480 | */ |
6865 | - | ||
6866 | void arm_min_f32( |
6481 | void arm_min_f32( |
6867 | float32_t * pSrc, |
6482 | float32_t * pSrc, |
6868 | uint32_t blockSize, |
6483 | uint32_t blockSize, |
6869 | float32_t * pResult, |
6484 | float32_t * pResult, |
6870 | uint32_t * pIndex); |
6485 | uint32_t * pIndex); |
6871 | 6486 | ||
- | 6487 | ||
6872 | /** |
6488 | /** |
6873 | * @brief Maximum value of a Q7 vector. |
6489 | * @brief Maximum value of a Q7 vector. |
6874 | * @param[in] *pSrc points to the input buffer |
6490 | * @param[in] pSrc points to the input buffer |
6875 | * @param[in] blockSize length of the input vector |
6491 | * @param[in] blockSize length of the input vector |
6876 | * @param[out] *pResult maximum value returned here |
6492 | * @param[out] pResult maximum value returned here |
6877 | * @param[out] *pIndex index of maximum value returned here |
6493 | * @param[out] pIndex index of maximum value returned here |
6878 | * @return none. |
- | |
6879 | */ |
6494 | */ |
6880 | - | ||
6881 | void arm_max_q7( |
6495 | void arm_max_q7( |
6882 | q7_t * pSrc, |
6496 | q7_t * pSrc, |
6883 | uint32_t blockSize, |
6497 | uint32_t blockSize, |
6884 | q7_t * pResult, |
6498 | q7_t * pResult, |
6885 | uint32_t * pIndex); |
6499 | uint32_t * pIndex); |
6886 | 6500 | ||
- | 6501 | ||
6887 | /** |
6502 | /** |
6888 | * @brief Maximum value of a Q15 vector. |
6503 | * @brief Maximum value of a Q15 vector. |
6889 | * @param[in] *pSrc points to the input buffer |
6504 | * @param[in] pSrc points to the input buffer |
6890 | * @param[in] blockSize length of the input vector |
6505 | * @param[in] blockSize length of the input vector |
6891 | * @param[out] *pResult maximum value returned here |
6506 | * @param[out] pResult maximum value returned here |
6892 | * @param[out] *pIndex index of maximum value returned here |
6507 | * @param[out] pIndex index of maximum value returned here |
6893 | * @return none. |
- | |
6894 | */ |
6508 | */ |
6895 | - | ||
6896 | void arm_max_q15( |
6509 | void arm_max_q15( |
6897 | q15_t * pSrc, |
6510 | q15_t * pSrc, |
6898 | uint32_t blockSize, |
6511 | uint32_t blockSize, |
6899 | q15_t * pResult, |
6512 | q15_t * pResult, |
6900 | uint32_t * pIndex); |
6513 | uint32_t * pIndex); |
6901 | 6514 | ||
- | 6515 | ||
6902 | /** |
6516 | /** |
6903 | * @brief Maximum value of a Q31 vector. |
6517 | * @brief Maximum value of a Q31 vector. |
6904 | * @param[in] *pSrc points to the input buffer |
6518 | * @param[in] pSrc points to the input buffer |
6905 | * @param[in] blockSize length of the input vector |
6519 | * @param[in] blockSize length of the input vector |
6906 | * @param[out] *pResult maximum value returned here |
6520 | * @param[out] pResult maximum value returned here |
6907 | * @param[out] *pIndex index of maximum value returned here |
6521 | * @param[out] pIndex index of maximum value returned here |
6908 | * @return none. |
- | |
6909 | */ |
6522 | */ |
6910 | - | ||
6911 | void arm_max_q31( |
6523 | void arm_max_q31( |
6912 | q31_t * pSrc, |
6524 | q31_t * pSrc, |
6913 | uint32_t blockSize, |
6525 | uint32_t blockSize, |
6914 | q31_t * pResult, |
6526 | q31_t * pResult, |
6915 | uint32_t * pIndex); |
6527 | uint32_t * pIndex); |
6916 | 6528 | ||
- | 6529 | ||
6917 | /** |
6530 | /** |
6918 | * @brief Maximum value of a floating-point vector. |
6531 | * @brief Maximum value of a floating-point vector. |
6919 | * @param[in] *pSrc points to the input buffer |
6532 | * @param[in] pSrc points to the input buffer |
6920 | * @param[in] blockSize length of the input vector |
6533 | * @param[in] blockSize length of the input vector |
6921 | * @param[out] *pResult maximum value returned here |
6534 | * @param[out] pResult maximum value returned here |
6922 | * @param[out] *pIndex index of maximum value returned here |
6535 | * @param[out] pIndex index of maximum value returned here |
6923 | * @return none. |
- | |
6924 | */ |
6536 | */ |
6925 | - | ||
6926 | void arm_max_f32( |
6537 | void arm_max_f32( |
6927 | float32_t * pSrc, |
6538 | float32_t * pSrc, |
6928 | uint32_t blockSize, |
6539 | uint32_t blockSize, |
6929 | float32_t * pResult, |
6540 | float32_t * pResult, |
6930 | uint32_t * pIndex); |
6541 | uint32_t * pIndex); |
6931 | 6542 | ||
- | 6543 | ||
6932 | /** |
6544 | /** |
6933 | * @brief Q15 complex-by-complex multiplication |
6545 | * @brief Q15 complex-by-complex multiplication |
6934 | * @param[in] *pSrcA points to the first input vector |
6546 | * @param[in] pSrcA points to the first input vector |
6935 | * @param[in] *pSrcB points to the second input vector |
6547 | * @param[in] pSrcB points to the second input vector |
6936 | * @param[out] *pDst points to the output vector |
6548 | * @param[out] pDst points to the output vector |
6937 | * @param[in] numSamples number of complex samples in each vector |
6549 | * @param[in] numSamples number of complex samples in each vector |
6938 | * @return none. |
- | |
6939 | */ |
6550 | */ |
6940 | - | ||
6941 | void arm_cmplx_mult_cmplx_q15( |
6551 | void arm_cmplx_mult_cmplx_q15( |
6942 | q15_t * pSrcA, |
6552 | q15_t * pSrcA, |
6943 | q15_t * pSrcB, |
6553 | q15_t * pSrcB, |
6944 | q15_t * pDst, |
6554 | q15_t * pDst, |
6945 | uint32_t numSamples); |
6555 | uint32_t numSamples); |
6946 | 6556 | ||
- | 6557 | ||
6947 | /** |
6558 | /** |
6948 | * @brief Q31 complex-by-complex multiplication |
6559 | * @brief Q31 complex-by-complex multiplication |
6949 | * @param[in] *pSrcA points to the first input vector |
6560 | * @param[in] pSrcA points to the first input vector |
6950 | * @param[in] *pSrcB points to the second input vector |
6561 | * @param[in] pSrcB points to the second input vector |
6951 | * @param[out] *pDst points to the output vector |
6562 | * @param[out] pDst points to the output vector |
6952 | * @param[in] numSamples number of complex samples in each vector |
6563 | * @param[in] numSamples number of complex samples in each vector |
6953 | * @return none. |
- | |
6954 | */ |
6564 | */ |
6955 | - | ||
6956 | void arm_cmplx_mult_cmplx_q31( |
6565 | void arm_cmplx_mult_cmplx_q31( |
6957 | q31_t * pSrcA, |
6566 | q31_t * pSrcA, |
6958 | q31_t * pSrcB, |
6567 | q31_t * pSrcB, |
6959 | q31_t * pDst, |
6568 | q31_t * pDst, |
6960 | uint32_t numSamples); |
6569 | uint32_t numSamples); |
6961 | 6570 | ||
- | 6571 | ||
6962 | /** |
6572 | /** |
6963 | * @brief Floating-point complex-by-complex multiplication |
6573 | * @brief Floating-point complex-by-complex multiplication |
6964 | * @param[in] *pSrcA points to the first input vector |
6574 | * @param[in] pSrcA points to the first input vector |
6965 | * @param[in] *pSrcB points to the second input vector |
6575 | * @param[in] pSrcB points to the second input vector |
6966 | * @param[out] *pDst points to the output vector |
6576 | * @param[out] pDst points to the output vector |
6967 | * @param[in] numSamples number of complex samples in each vector |
6577 | * @param[in] numSamples number of complex samples in each vector |
6968 | * @return none. |
- | |
6969 | */ |
6578 | */ |
6970 | - | ||
6971 | void arm_cmplx_mult_cmplx_f32( |
6579 | void arm_cmplx_mult_cmplx_f32( |
6972 | float32_t * pSrcA, |
6580 | float32_t * pSrcA, |
6973 | float32_t * pSrcB, |
6581 | float32_t * pSrcB, |
6974 | float32_t * pDst, |
6582 | float32_t * pDst, |
6975 | uint32_t numSamples); |
6583 | uint32_t numSamples); |
6976 | 6584 | ||
- | 6585 | ||
6977 | /** |
6586 | /** |
6978 | * @brief Converts the elements of the floating-point vector to Q31 vector. |
6587 | * @brief Converts the elements of the floating-point vector to Q31 vector. |
6979 | * @param[in] *pSrc points to the floating-point input vector |
6588 | * @param[in] pSrc points to the floating-point input vector |
6980 | * @param[out] *pDst points to the Q31 output vector |
6589 | * @param[out] pDst points to the Q31 output vector |
6981 | * @param[in] blockSize length of the input vector |
6590 | * @param[in] blockSize length of the input vector |
6982 | * @return none. |
- | |
6983 | */ |
6591 | */ |
6984 | void arm_float_to_q31( |
6592 | void arm_float_to_q31( |
6985 | float32_t * pSrc, |
6593 | float32_t * pSrc, |
6986 | q31_t * pDst, |
6594 | q31_t * pDst, |
6987 | uint32_t blockSize); |
6595 | uint32_t blockSize); |
6988 | 6596 | ||
- | 6597 | ||
6989 | /** |
6598 | /** |
6990 | * @brief Converts the elements of the floating-point vector to Q15 vector. |
6599 | * @brief Converts the elements of the floating-point vector to Q15 vector. |
6991 | * @param[in] *pSrc points to the floating-point input vector |
6600 | * @param[in] pSrc points to the floating-point input vector |
6992 | * @param[out] *pDst points to the Q15 output vector |
6601 | * @param[out] pDst points to the Q15 output vector |
6993 | * @param[in] blockSize length of the input vector |
6602 | * @param[in] blockSize length of the input vector |
6994 | * @return none |
- | |
6995 | */ |
6603 | */ |
6996 | void arm_float_to_q15( |
6604 | void arm_float_to_q15( |
6997 | float32_t * pSrc, |
6605 | float32_t * pSrc, |
6998 | q15_t * pDst, |
6606 | q15_t * pDst, |
6999 | uint32_t blockSize); |
6607 | uint32_t blockSize); |
7000 | 6608 | ||
- | 6609 | ||
7001 | /** |
6610 | /** |
7002 | * @brief Converts the elements of the floating-point vector to Q7 vector. |
6611 | * @brief Converts the elements of the floating-point vector to Q7 vector. |
7003 | * @param[in] *pSrc points to the floating-point input vector |
6612 | * @param[in] pSrc points to the floating-point input vector |
7004 | * @param[out] *pDst points to the Q7 output vector |
6613 | * @param[out] pDst points to the Q7 output vector |
7005 | * @param[in] blockSize length of the input vector |
6614 | * @param[in] blockSize length of the input vector |
7006 | * @return none |
- | |
7007 | */ |
6615 | */ |
7008 | void arm_float_to_q7( |
6616 | void arm_float_to_q7( |
7009 | float32_t * pSrc, |
6617 | float32_t * pSrc, |
7010 | q7_t * pDst, |
6618 | q7_t * pDst, |
7011 | uint32_t blockSize); |
6619 | uint32_t blockSize); |
7012 | 6620 | ||
7013 | 6621 | ||
7014 | /** |
6622 | /** |
7015 | * @brief Converts the elements of the Q31 vector to Q15 vector. |
6623 | * @brief Converts the elements of the Q31 vector to Q15 vector. |
7016 | * @param[in] *pSrc is input pointer |
6624 | * @param[in] pSrc is input pointer |
7017 | * @param[out] *pDst is output pointer |
6625 | * @param[out] pDst is output pointer |
7018 | * @param[in] blockSize is the number of samples to process |
6626 | * @param[in] blockSize is the number of samples to process |
7019 | * @return none. |
- | |
7020 | */ |
6627 | */ |
7021 | void arm_q31_to_q15( |
6628 | void arm_q31_to_q15( |
7022 | q31_t * pSrc, |
6629 | q31_t * pSrc, |
7023 | q15_t * pDst, |
6630 | q15_t * pDst, |
7024 | uint32_t blockSize); |
6631 | uint32_t blockSize); |
7025 | 6632 | ||
- | 6633 | ||
7026 | /** |
6634 | /** |
7027 | * @brief Converts the elements of the Q31 vector to Q7 vector. |
6635 | * @brief Converts the elements of the Q31 vector to Q7 vector. |
7028 | * @param[in] *pSrc is input pointer |
6636 | * @param[in] pSrc is input pointer |
7029 | * @param[out] *pDst is output pointer |
6637 | * @param[out] pDst is output pointer |
7030 | * @param[in] blockSize is the number of samples to process |
6638 | * @param[in] blockSize is the number of samples to process |
7031 | * @return none. |
- | |
7032 | */ |
6639 | */ |
7033 | void arm_q31_to_q7( |
6640 | void arm_q31_to_q7( |
7034 | q31_t * pSrc, |
6641 | q31_t * pSrc, |
7035 | q7_t * pDst, |
6642 | q7_t * pDst, |
7036 | uint32_t blockSize); |
6643 | uint32_t blockSize); |
7037 | 6644 | ||
- | 6645 | ||
7038 | /** |
6646 | /** |
7039 | * @brief Converts the elements of the Q15 vector to floating-point vector. |
6647 | * @brief Converts the elements of the Q15 vector to floating-point vector. |
7040 | * @param[in] *pSrc is input pointer |
6648 | * @param[in] pSrc is input pointer |
7041 | * @param[out] *pDst is output pointer |
6649 | * @param[out] pDst is output pointer |
7042 | * @param[in] blockSize is the number of samples to process |
6650 | * @param[in] blockSize is the number of samples to process |
7043 | * @return none. |
- | |
7044 | */ |
6651 | */ |
7045 | void arm_q15_to_float( |
6652 | void arm_q15_to_float( |
7046 | q15_t * pSrc, |
6653 | q15_t * pSrc, |
7047 | float32_t * pDst, |
6654 | float32_t * pDst, |
7048 | uint32_t blockSize); |
6655 | uint32_t blockSize); |
7049 | 6656 | ||
7050 | 6657 | ||
7051 | /** |
6658 | /** |
7052 | * @brief Converts the elements of the Q15 vector to Q31 vector. |
6659 | * @brief Converts the elements of the Q15 vector to Q31 vector. |
7053 | * @param[in] *pSrc is input pointer |
6660 | * @param[in] pSrc is input pointer |
7054 | * @param[out] *pDst is output pointer |
6661 | * @param[out] pDst is output pointer |
7055 | * @param[in] blockSize is the number of samples to process |
6662 | * @param[in] blockSize is the number of samples to process |
7056 | * @return none. |
- | |
7057 | */ |
6663 | */ |
7058 | void arm_q15_to_q31( |
6664 | void arm_q15_to_q31( |
7059 | q15_t * pSrc, |
6665 | q15_t * pSrc, |
7060 | q31_t * pDst, |
6666 | q31_t * pDst, |
7061 | uint32_t blockSize); |
6667 | uint32_t blockSize); |
7062 | 6668 | ||
7063 | 6669 | ||
7064 | /** |
6670 | /** |
7065 | * @brief Converts the elements of the Q15 vector to Q7 vector. |
6671 | * @brief Converts the elements of the Q15 vector to Q7 vector. |
7066 | * @param[in] *pSrc is input pointer |
6672 | * @param[in] pSrc is input pointer |
7067 | * @param[out] *pDst is output pointer |
6673 | * @param[out] pDst is output pointer |
7068 | * @param[in] blockSize is the number of samples to process |
6674 | * @param[in] blockSize is the number of samples to process |
7069 | * @return none. |
- | |
7070 | */ |
6675 | */ |
7071 | void arm_q15_to_q7( |
6676 | void arm_q15_to_q7( |
7072 | q15_t * pSrc, |
6677 | q15_t * pSrc, |
7073 | q7_t * pDst, |
6678 | q7_t * pDst, |
7074 | uint32_t blockSize); |
6679 | uint32_t blockSize); |
Line 7133... | Line 6738... | ||
7133 | /** |
6738 | /** |
7134 | * @addtogroup BilinearInterpolate |
6739 | * @addtogroup BilinearInterpolate |
7135 | * @{ |
6740 | * @{ |
7136 | */ |
6741 | */ |
7137 | 6742 | ||
- | 6743 | ||
7138 | /** |
6744 | /** |
7139 | * |
6745 | * |
7140 | * @brief Floating-point bilinear interpolation. |
6746 | * @brief Floating-point bilinear interpolation. |
7141 | * @param[in,out] *S points to an instance of the interpolation structure. |
6747 | * @param[in,out] S points to an instance of the interpolation structure. |
7142 | * @param[in] X interpolation coordinate. |
6748 | * @param[in] X interpolation coordinate. |
7143 | * @param[in] Y interpolation coordinate. |
6749 | * @param[in] Y interpolation coordinate. |
7144 | * @return out interpolated value. |
6750 | * @return out interpolated value. |
7145 | */ |
6751 | */ |
7146 | - | ||
7147 | - | ||
7148 | static __INLINE float32_t arm_bilinear_interp_f32( |
6752 | static __INLINE float32_t arm_bilinear_interp_f32( |
7149 | const arm_bilinear_interp_instance_f32 * S, |
6753 | const arm_bilinear_interp_instance_f32 * S, |
7150 | float32_t X, |
6754 | float32_t X, |
7151 | float32_t Y) |
6755 | float32_t Y) |
7152 | { |
6756 | { |
Line 7160... | Line 6764... | ||
7160 | xIndex = (int32_t) X; |
6764 | xIndex = (int32_t) X; |
7161 | yIndex = (int32_t) Y; |
6765 | yIndex = (int32_t) Y; |
7162 | 6766 | ||
7163 | /* Care taken for table outside boundary */ |
6767 | /* Care taken for table outside boundary */ |
7164 | /* Returns zero output when values are outside table boundary */ |
6768 | /* Returns zero output when values are outside table boundary */ |
7165 | if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 |
6769 | if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1)) |
7166 | || yIndex > (S->numCols - 1)) |
- | |
7167 | { |
6770 | { |
7168 | return (0); |
6771 | return (0); |
7169 | } |
6772 | } |
7170 | 6773 | ||
7171 | /* Calculation of index for two nearest points in X-direction */ |
6774 | /* Calculation of index for two nearest points in X-direction */ |
Line 7199... | Line 6802... | ||
7199 | /* Calculation of bi-linear interpolated output */ |
6802 | /* Calculation of bi-linear interpolated output */ |
7200 | out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; |
6803 | out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; |
7201 | 6804 | ||
7202 | /* return to application */ |
6805 | /* return to application */ |
7203 | return (out); |
6806 | return (out); |
7204 | - | ||
7205 | } |
6807 | } |
7206 | 6808 | ||
- | 6809 | ||
7207 | /** |
6810 | /** |
7208 | * |
6811 | * |
7209 | * @brief Q31 bilinear interpolation. |
6812 | * @brief Q31 bilinear interpolation. |
7210 | * @param[in,out] *S points to an instance of the interpolation structure. |
6813 | * @param[in,out] S points to an instance of the interpolation structure. |
7211 | * @param[in] X interpolation coordinate in 12.20 format. |
6814 | * @param[in] X interpolation coordinate in 12.20 format. |
7212 | * @param[in] Y interpolation coordinate in 12.20 format. |
6815 | * @param[in] Y interpolation coordinate in 12.20 format. |
7213 | * @return out interpolated value. |
6816 | * @return out interpolated value. |
7214 | */ |
6817 | */ |
7215 | - | ||
7216 | static __INLINE q31_t arm_bilinear_interp_q31( |
6818 | static __INLINE q31_t arm_bilinear_interp_q31( |
7217 | arm_bilinear_interp_instance_q31 * S, |
6819 | arm_bilinear_interp_instance_q31 * S, |
7218 | q31_t X, |
6820 | q31_t X, |
7219 | q31_t Y) |
6821 | q31_t Y) |
7220 | { |
6822 | { |
Line 7224... | Line 6826... | ||
7224 | q31_t x1, x2, y1, y2; /* Nearest output values */ |
6826 | q31_t x1, x2, y1, y2; /* Nearest output values */ |
7225 | int32_t rI, cI; /* Row and column indices */ |
6827 | int32_t rI, cI; /* Row and column indices */ |
7226 | q31_t *pYData = S->pData; /* pointer to output table values */ |
6828 | q31_t *pYData = S->pData; /* pointer to output table values */ |
7227 | uint32_t nCols = S->numCols; /* num of rows */ |
6829 | uint32_t nCols = S->numCols; /* num of rows */ |
7228 | 6830 | ||
7229 | - | ||
7230 | /* Input is in 12.20 format */ |
6831 | /* Input is in 12.20 format */ |
7231 | /* 12 bits for the table index */ |
6832 | /* 12 bits for the table index */ |
7232 | /* Index value calculation */ |
6833 | /* Index value calculation */ |
7233 | rI = ((X & 0xFFF00000) >> 20u); |
6834 | rI = ((X & (q31_t)0xFFF00000) >> 20); |
7234 | 6835 | ||
7235 | /* Input is in 12.20 format */ |
6836 | /* Input is in 12.20 format */ |
7236 | /* 12 bits for the table index */ |
6837 | /* 12 bits for the table index */ |
7237 | /* Index value calculation */ |
6838 | /* Index value calculation */ |
7238 | cI = ((Y & 0xFFF00000) >> 20u); |
6839 | cI = ((Y & (q31_t)0xFFF00000) >> 20); |
7239 | 6840 | ||
7240 | /* Care taken for table outside boundary */ |
6841 | /* Care taken for table outside boundary */ |
7241 | /* Returns zero output when values are outside table boundary */ |
6842 | /* Returns zero output when values are outside table boundary */ |
7242 | if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) |
6843 | if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) |
7243 | { |
6844 | { |
Line 7247... | Line 6848... | ||
7247 | /* 20 bits for the fractional part */ |
6848 | /* 20 bits for the fractional part */ |
7248 | /* shift left xfract by 11 to keep 1.31 format */ |
6849 | /* shift left xfract by 11 to keep 1.31 format */ |
7249 | xfract = (X & 0x000FFFFF) << 11u; |
6850 | xfract = (X & 0x000FFFFF) << 11u; |
7250 | 6851 | ||
7251 | /* Read two nearest output values from the index */ |
6852 | /* Read two nearest output values from the index */ |
7252 | x1 = pYData[(rI) + nCols * (cI)]; |
6853 | x1 = pYData[(rI) + (int32_t)nCols * (cI) ]; |
7253 | x2 = pYData[(rI) + nCols * (cI) + 1u]; |
6854 | x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1]; |
7254 | 6855 | ||
7255 | /* 20 bits for the fractional part */ |
6856 | /* 20 bits for the fractional part */ |
7256 | /* shift left yfract by 11 to keep 1.31 format */ |
6857 | /* shift left yfract by 11 to keep 1.31 format */ |
7257 | yfract = (Y & 0x000FFFFF) << 11u; |
6858 | yfract = (Y & 0x000FFFFF) << 11u; |
7258 | 6859 | ||
7259 | /* Read two nearest output values from the index */ |
6860 | /* Read two nearest output values from the index */ |
7260 | y1 = pYData[(rI) + nCols * (cI + 1)]; |
6861 | y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ]; |
7261 | y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; |
6862 | y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1]; |
7262 | 6863 | ||
7263 | /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ |
6864 | /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ |
7264 | out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); |
6865 | out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); |
7265 | acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); |
6866 | acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); |
7266 | 6867 | ||
7267 | /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ |
6868 | /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ |
7268 | out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); |
6869 | out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); |
7269 | acc += ((q31_t) ((q63_t) out * (xfract) >> 32)); |
6870 | acc += ((q31_t) ((q63_t) out * (xfract) >> 32)); |
Line 7275... | Line 6876... | ||
7275 | /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ |
6876 | /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ |
7276 | out = ((q31_t) ((q63_t) y2 * (xfract) >> 32)); |
6877 | out = ((q31_t) ((q63_t) y2 * (xfract) >> 32)); |
7277 | acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); |
6878 | acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); |
7278 | 6879 | ||
7279 | /* Convert acc to 1.31(q31) format */ |
6880 | /* Convert acc to 1.31(q31) format */ |
7280 | return (acc << 2u); |
6881 | return ((q31_t)(acc << 2)); |
7281 | - | ||
7282 | } |
6882 | } |
7283 | 6883 | ||
- | 6884 | ||
7284 | /** |
6885 | /** |
7285 | * @brief Q15 bilinear interpolation. |
6886 | * @brief Q15 bilinear interpolation. |
7286 | * @param[in,out] *S points to an instance of the interpolation structure. |
6887 | * @param[in,out] S points to an instance of the interpolation structure. |
7287 | * @param[in] X interpolation coordinate in 12.20 format. |
6888 | * @param[in] X interpolation coordinate in 12.20 format. |
7288 | * @param[in] Y interpolation coordinate in 12.20 format. |
6889 | * @param[in] Y interpolation coordinate in 12.20 format. |
7289 | * @return out interpolated value. |
6890 | * @return out interpolated value. |
7290 | */ |
6891 | */ |
7291 | - | ||
7292 | static __INLINE q15_t arm_bilinear_interp_q15( |
6892 | static __INLINE q15_t arm_bilinear_interp_q15( |
7293 | arm_bilinear_interp_instance_q15 * S, |
6893 | arm_bilinear_interp_instance_q15 * S, |
7294 | q31_t X, |
6894 | q31_t X, |
7295 | q31_t Y) |
6895 | q31_t Y) |
7296 | { |
6896 | { |
Line 7303... | Line 6903... | ||
7303 | uint32_t nCols = S->numCols; /* num of rows */ |
6903 | uint32_t nCols = S->numCols; /* num of rows */ |
7304 | 6904 | ||
7305 | /* Input is in 12.20 format */ |
6905 | /* Input is in 12.20 format */ |
7306 | /* 12 bits for the table index */ |
6906 | /* 12 bits for the table index */ |
7307 | /* Index value calculation */ |
6907 | /* Index value calculation */ |
7308 | rI = ((X & 0xFFF00000) >> 20); |
6908 | rI = ((X & (q31_t)0xFFF00000) >> 20); |
7309 | 6909 | ||
7310 | /* Input is in 12.20 format */ |
6910 | /* Input is in 12.20 format */ |
7311 | /* 12 bits for the table index */ |
6911 | /* 12 bits for the table index */ |
7312 | /* Index value calculation */ |
6912 | /* Index value calculation */ |
7313 | cI = ((Y & 0xFFF00000) >> 20); |
6913 | cI = ((Y & (q31_t)0xFFF00000) >> 20); |
7314 | 6914 | ||
7315 | /* Care taken for table outside boundary */ |
6915 | /* Care taken for table outside boundary */ |
7316 | /* Returns zero output when values are outside table boundary */ |
6916 | /* Returns zero output when values are outside table boundary */ |
7317 | if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) |
6917 | if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) |
7318 | { |
6918 | { |
Line 7322... | Line 6922... | ||
7322 | /* 20 bits for the fractional part */ |
6922 | /* 20 bits for the fractional part */ |
7323 | /* xfract should be in 12.20 format */ |
6923 | /* xfract should be in 12.20 format */ |
7324 | xfract = (X & 0x000FFFFF); |
6924 | xfract = (X & 0x000FFFFF); |
7325 | 6925 | ||
7326 | /* Read two nearest output values from the index */ |
6926 | /* Read two nearest output values from the index */ |
7327 | x1 = pYData[(rI) + nCols * (cI)]; |
6927 | x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; |
7328 | x2 = pYData[(rI) + nCols * (cI) + 1u]; |
6928 | x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; |
7329 | - | ||
7330 | 6929 | ||
7331 | /* 20 bits for the fractional part */ |
6930 | /* 20 bits for the fractional part */ |
7332 | /* yfract should be in 12.20 format */ |
6931 | /* yfract should be in 12.20 format */ |
7333 | yfract = (Y & 0x000FFFFF); |
6932 | yfract = (Y & 0x000FFFFF); |
7334 | 6933 | ||
7335 | /* Read two nearest output values from the index */ |
6934 | /* Read two nearest output values from the index */ |
7336 | y1 = pYData[(rI) + nCols * (cI + 1)]; |
6935 | y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; |
7337 | y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; |
6936 | y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; |
7338 | 6937 | ||
7339 | /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ |
6938 | /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ |
7340 | 6939 | ||
7341 | /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ |
6940 | /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ |
7342 | /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ |
6941 | /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ |
Line 7355... | Line 6954... | ||
7355 | out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u); |
6954 | out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u); |
7356 | acc += ((q63_t) out * (yfract)); |
6955 | acc += ((q63_t) out * (yfract)); |
7357 | 6956 | ||
7358 | /* acc is in 13.51 format and down shift acc by 36 times */ |
6957 | /* acc is in 13.51 format and down shift acc by 36 times */ |
7359 | /* Convert out to 1.15 format */ |
6958 | /* Convert out to 1.15 format */ |
7360 | return (acc >> 36); |
6959 | return ((q15_t)(acc >> 36)); |
7361 | - | ||
7362 | } |
6960 | } |
7363 | 6961 | ||
- | 6962 | ||
7364 | /** |
6963 | /** |
7365 | * @brief Q7 bilinear interpolation. |
6964 | * @brief Q7 bilinear interpolation. |
7366 | * @param[in,out] *S points to an instance of the interpolation structure. |
6965 | * @param[in,out] S points to an instance of the interpolation structure. |
7367 | * @param[in] X interpolation coordinate in 12.20 format. |
6966 | * @param[in] X interpolation coordinate in 12.20 format. |
7368 | * @param[in] Y interpolation coordinate in 12.20 format. |
6967 | * @param[in] Y interpolation coordinate in 12.20 format. |
7369 | * @return out interpolated value. |
6968 | * @return out interpolated value. |
7370 | */ |
6969 | */ |
7371 | - | ||
7372 | static __INLINE q7_t arm_bilinear_interp_q7( |
6970 | static __INLINE q7_t arm_bilinear_interp_q7( |
7373 | arm_bilinear_interp_instance_q7 * S, |
6971 | arm_bilinear_interp_instance_q7 * S, |
7374 | q31_t X, |
6972 | q31_t X, |
7375 | q31_t Y) |
6973 | q31_t Y) |
7376 | { |
6974 | { |
Line 7383... | Line 6981... | ||
7383 | uint32_t nCols = S->numCols; /* num of rows */ |
6981 | uint32_t nCols = S->numCols; /* num of rows */ |
7384 | 6982 | ||
7385 | /* Input is in 12.20 format */ |
6983 | /* Input is in 12.20 format */ |
7386 | /* 12 bits for the table index */ |
6984 | /* 12 bits for the table index */ |
7387 | /* Index value calculation */ |
6985 | /* Index value calculation */ |
7388 | rI = ((X & 0xFFF00000) >> 20); |
6986 | rI = ((X & (q31_t)0xFFF00000) >> 20); |
7389 | 6987 | ||
7390 | /* Input is in 12.20 format */ |
6988 | /* Input is in 12.20 format */ |
7391 | /* 12 bits for the table index */ |
6989 | /* 12 bits for the table index */ |
7392 | /* Index value calculation */ |
6990 | /* Index value calculation */ |
7393 | cI = ((Y & 0xFFF00000) >> 20); |
6991 | cI = ((Y & (q31_t)0xFFF00000) >> 20); |
7394 | 6992 | ||
7395 | /* Care taken for table outside boundary */ |
6993 | /* Care taken for table outside boundary */ |
7396 | /* Returns zero output when values are outside table boundary */ |
6994 | /* Returns zero output when values are outside table boundary */ |
7397 | if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) |
6995 | if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) |
7398 | { |
6996 | { |
7399 | return (0); |
6997 | return (0); |
7400 | } |
6998 | } |
7401 | 6999 | ||
7402 | /* 20 bits for the fractional part */ |
7000 | /* 20 bits for the fractional part */ |
7403 | /* xfract should be in 12.20 format */ |
7001 | /* xfract should be in 12.20 format */ |
7404 | xfract = (X & 0x000FFFFF); |
7002 | xfract = (X & (q31_t)0x000FFFFF); |
7405 | 7003 | ||
7406 | /* Read two nearest output values from the index */ |
7004 | /* Read two nearest output values from the index */ |
7407 | x1 = pYData[(rI) + nCols * (cI)]; |
7005 | x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; |
7408 | x2 = pYData[(rI) + nCols * (cI) + 1u]; |
7006 | x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; |
7409 | - | ||
7410 | 7007 | ||
7411 | /* 20 bits for the fractional part */ |
7008 | /* 20 bits for the fractional part */ |
7412 | /* yfract should be in 12.20 format */ |
7009 | /* yfract should be in 12.20 format */ |
7413 | yfract = (Y & 0x000FFFFF); |
7010 | yfract = (Y & (q31_t)0x000FFFFF); |
7414 | 7011 | ||
7415 | /* Read two nearest output values from the index */ |
7012 | /* Read two nearest output values from the index */ |
7416 | y1 = pYData[(rI) + nCols * (cI + 1)]; |
7013 | y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; |
7417 | y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; |
7014 | y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; |
7418 | 7015 | ||
7419 | /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ |
7016 | /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ |
7420 | out = ((x1 * (0xFFFFF - xfract))); |
7017 | out = ((x1 * (0xFFFFF - xfract))); |
7421 | acc = (((q63_t) out * (0xFFFFF - yfract))); |
7018 | acc = (((q63_t) out * (0xFFFFF - yfract))); |
7422 | 7019 | ||
Line 7431... | Line 7028... | ||
7431 | /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ |
7028 | /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ |
7432 | out = ((y2 * (yfract))); |
7029 | out = ((y2 * (yfract))); |
7433 | acc += (((q63_t) out * (xfract))); |
7030 | acc += (((q63_t) out * (xfract))); |
7434 | 7031 | ||
7435 | /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ |
7032 | /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ |
7436 | return (acc >> 40); |
7033 | return ((q7_t)(acc >> 40)); |
7437 | - | ||
7438 | } |
7034 | } |
7439 | 7035 | ||
7440 | /** |
7036 | /** |
7441 | * @} end of BilinearInterpolate group |
7037 | * @} end of BilinearInterpolate group |
7442 | */ |
7038 | */ |
7443 | - | ||
7444 | 7039 | ||
- | 7040 | ||
7445 | //SMMLAR |
7041 | /* SMMLAR */ |
7446 | #define multAcc_32x32_keep32_R(a, x, y) \ |
7042 | #define multAcc_32x32_keep32_R(a, x, y) \ |
7447 | a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) |
7043 | a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) |
7448 | 7044 | ||
7449 | //SMMLSR |
7045 | /* SMMLSR */ |
7450 | #define multSub_32x32_keep32_R(a, x, y) \ |
7046 | #define multSub_32x32_keep32_R(a, x, y) \ |
7451 | a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) |
7047 | a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) |
7452 | 7048 | ||
7453 | //SMMULR |
7049 | /* SMMULR */ |
7454 | #define mult_32x32_keep32_R(a, x, y) \ |
7050 | #define mult_32x32_keep32_R(a, x, y) \ |
7455 | a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) |
7051 | a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) |
7456 | 7052 | ||
7457 | //SMMLA |
7053 | /* SMMLA */ |
7458 | #define multAcc_32x32_keep32(a, x, y) \ |
7054 | #define multAcc_32x32_keep32(a, x, y) \ |
7459 | a += (q31_t) (((q63_t) x * y) >> 32) |
7055 | a += (q31_t) (((q63_t) x * y) >> 32) |
7460 | 7056 | ||
7461 | //SMMLS |
7057 | /* SMMLS */ |
7462 | #define multSub_32x32_keep32(a, x, y) \ |
7058 | #define multSub_32x32_keep32(a, x, y) \ |
7463 | a -= (q31_t) (((q63_t) x * y) >> 32) |
7059 | a -= (q31_t) (((q63_t) x * y) >> 32) |
7464 | 7060 | ||
7465 | //SMMUL |
7061 | /* SMMUL */ |
7466 | #define mult_32x32_keep32(a, x, y) \ |
7062 | #define mult_32x32_keep32(a, x, y) \ |
7467 | a = (q31_t) (((q63_t) x * y ) >> 32) |
7063 | a = (q31_t) (((q63_t) x * y ) >> 32) |
7468 | 7064 | ||
7469 | 7065 | ||
7470 | #if defined ( __CC_ARM ) //Keil |
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 |
|
7471 | 7075 | ||
7472 | //Enter low optimization region - place directly above function definition |
- | |
7473 | #ifdef ARM_MATH_CM4 |
- | |
7474 | #define LOW_OPTIMIZATION_ENTER \ |
- | |
7475 | _Pragma ("push") \ |
- | |
7476 | _Pragma ("O1") |
- | |
7477 | #else |
- | |
7478 | #define LOW_OPTIMIZATION_ENTER |
- | |
7479 | #endif |
- | |
7480 | - | ||
7481 | //Exit low optimization region - place directly after end of function definition |
7076 | /* Exit low optimization region - place directly after end of function definition */ |
7482 | #ifdef ARM_MATH_CM4 |
7077 | #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) |
7483 | #define LOW_OPTIMIZATION_EXIT \ |
7078 | #define LOW_OPTIMIZATION_EXIT \ |
7484 | _Pragma ("pop") |
7079 | _Pragma ("pop") |
7485 | #else |
7080 | #else |
7486 | #define LOW_OPTIMIZATION_EXIT |
7081 | #define LOW_OPTIMIZATION_EXIT |
7487 | #endif |
7082 | #endif |
7488 | 7083 | ||
7489 | //Enter low optimization region - place directly above function definition |
7084 | /* Enter low optimization region - place directly above function definition */ |
7490 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
7085 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
7491 | 7086 | ||
7492 | //Exit low optimization region - place directly after end of function definition |
7087 | /* Exit low optimization region - place directly after end of function definition */ |
7493 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
7088 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
7494 | 7089 | ||
7495 | #elif defined(__ICCARM__) //IAR |
7090 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) |
7496 | - | ||
7497 | //Enter low optimization region - place directly above function definition |
- | |
7498 | #ifdef ARM_MATH_CM4 |
- | |
7499 | #define LOW_OPTIMIZATION_ENTER \ |
7091 | #define LOW_OPTIMIZATION_ENTER |
7500 | _Pragma ("optimize=low") |
- | |
7501 | #else |
- | |
7502 | #define LOW_OPTIMIZATION_ENTER |
- | |
7503 | #endif |
- | |
7504 | - | ||
7505 | //Exit low optimization region - place directly after end of function definition |
- | |
7506 | #define LOW_OPTIMIZATION_EXIT |
7092 | #define LOW_OPTIMIZATION_EXIT |
7507 | - | ||
7508 | //Enter low optimization region - place directly above function definition |
- | |
7509 | #ifdef ARM_MATH_CM4 |
- | |
7510 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \ |
7093 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
7511 | _Pragma ("optimize=low") |
- | |
7512 | #else |
- | |
7513 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
- | |
7514 | #endif |
- | |
7515 | - | ||
7516 | //Exit low optimization region - place directly after end of function definition |
- | |
7517 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
7094 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
7518 | 7095 | ||
7519 | #elif defined(__GNUC__) |
7096 | #elif defined(__GNUC__) |
7520 | - | ||
7521 | #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") )) |
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 |
|
7522 | 7110 | ||
- | 7111 | /* Exit low optimization region - place directly after end of function definition */ |
|
7523 | #define LOW_OPTIMIZATION_EXIT |
7112 | #define LOW_OPTIMIZATION_EXIT |
7524 | 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 |
|
7525 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
7119 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
- | 7120 | #endif |
|
7526 | 7121 | ||
- | 7122 | /* Exit low optimization region - place directly after end of function definition */ |
|
7527 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
7123 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
7528 | 7124 | ||
7529 | #elif defined(__CSMC__) // Cosmic |
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 |
|
7530 | 7130 | ||
7531 | #define LOW_OPTIMIZATION_ENTER |
- | |
7532 | #define LOW_OPTIMIZATION_EXIT |
- | |
7533 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
- | |
7534 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
- | |
7535 | - | ||
7536 | #elif defined(__TASKING__) // TASKING |
7131 | #elif defined(__TASKING__) |
7537 | - | ||
7538 | #define LOW_OPTIMIZATION_ENTER |
7132 | #define LOW_OPTIMIZATION_ENTER |
7539 | #define LOW_OPTIMIZATION_EXIT |
7133 | #define LOW_OPTIMIZATION_EXIT |
7540 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
7134 | #define IAR_ONLY_LOW_OPTIMIZATION_ENTER |
7541 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
7135 | #define IAR_ONLY_LOW_OPTIMIZATION_EXIT |
7542 | 7136 | ||
7543 | #endif |
7137 | #endif |
7544 | 7138 | ||
7545 | 7139 | ||
7546 | #ifdef __cplusplus |
7140 | #ifdef __cplusplus |
7547 | } |
7141 | } |
7548 | #endif |
7142 | #endif |
7549 | 7143 | ||
7550 | 7144 | ||
- | 7145 | #if defined ( __GNUC__ ) |
|
- | 7146 | #pragma GCC diagnostic pop |
|
- | 7147 | #endif |
|
- | 7148 | ||
7551 | #endif /* _ARM_MATH_H */ |
7149 | #endif /* _ARM_MATH_H */ |
7552 | 7150 | ||
7553 | /** |
7151 | /** |
7554 | * |
7152 | * |
7555 | * End of file. |
7153 | * End of file. |