transform_functions_f16.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /******************************************************************************
  2. * @file transform_functions_f16.h
  3. * @brief Public header file for CMSIS DSP Library
  4. * @version V1.9.0
  5. * @date 23 April 2021
  6. * Target Processor: Cortex-M and Cortex-A cores
  7. ******************************************************************************/
  8. /*
  9. * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved.
  10. *
  11. * SPDX-License-Identifier: Apache-2.0
  12. *
  13. * Licensed under the Apache License, Version 2.0 (the License); you may
  14. * not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at
  16. *
  17. * www.apache.org/licenses/LICENSE-2.0
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  21. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. */
  25. #ifndef _TRANSFORM_FUNCTIONS_F16_H_
  26. #define _TRANSFORM_FUNCTIONS_F16_H_
  27. #include "arm_math_types_f16.h"
  28. #include "arm_math_memory.h"
  29. #include "dsp/none.h"
  30. #include "dsp/utils.h"
  31. #ifdef __cplusplus
  32. extern "C"
  33. {
  34. #endif
  35. #if defined(ARM_FLOAT16_SUPPORTED)
  36. /**
  37. * @brief Instance structure for the floating-point CFFT/CIFFT function.
  38. */
  39. typedef struct
  40. {
  41. uint16_t fftLen; /**< length of the FFT. */
  42. uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
  43. uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
  44. const float16_t *pTwiddle; /**< points to the Twiddle factor table. */
  45. const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  46. uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
  47. uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
  48. float16_t onebyfftLen; /**< value of 1/fftLen. */
  49. } arm_cfft_radix2_instance_f16;
  50. /**
  51. * @brief Instance structure for the floating-point CFFT/CIFFT function.
  52. */
  53. typedef struct
  54. {
  55. uint16_t fftLen; /**< length of the FFT. */
  56. uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
  57. uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
  58. const float16_t *pTwiddle; /**< points to the Twiddle factor table. */
  59. const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  60. uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
  61. uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
  62. float16_t onebyfftLen; /**< value of 1/fftLen. */
  63. } arm_cfft_radix4_instance_f16;
  64. /**
  65. * @brief Instance structure for the floating-point CFFT/CIFFT function.
  66. */
  67. typedef struct
  68. {
  69. uint16_t fftLen; /**< length of the FFT. */
  70. const float16_t *pTwiddle; /**< points to the Twiddle factor table. */
  71. const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  72. uint16_t bitRevLength; /**< bit reversal table length. */
  73. #if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE)
  74. const uint32_t *rearranged_twiddle_tab_stride1_arr; /**< Per stage reordered twiddle pointer (offset 1) */ \
  75. const uint32_t *rearranged_twiddle_tab_stride2_arr; /**< Per stage reordered twiddle pointer (offset 2) */ \
  76. const uint32_t *rearranged_twiddle_tab_stride3_arr; /**< Per stage reordered twiddle pointer (offset 3) */ \
  77. const float16_t *rearranged_twiddle_stride1; /**< reordered twiddle offset 1 storage */ \
  78. const float16_t *rearranged_twiddle_stride2; /**< reordered twiddle offset 2 storage */ \
  79. const float16_t *rearranged_twiddle_stride3;
  80. #endif
  81. } arm_cfft_instance_f16;
  82. arm_status arm_cfft_init_f16(
  83. arm_cfft_instance_f16 * S,
  84. uint16_t fftLen);
  85. void arm_cfft_f16(
  86. const arm_cfft_instance_f16 * S,
  87. float16_t * p1,
  88. uint8_t ifftFlag,
  89. uint8_t bitReverseFlag);
  90. /**
  91. * @brief Instance structure for the floating-point RFFT/RIFFT function.
  92. */
  93. typedef struct
  94. {
  95. arm_cfft_instance_f16 Sint; /**< Internal CFFT structure. */
  96. uint16_t fftLenRFFT; /**< length of the real sequence */
  97. const float16_t * pTwiddleRFFT; /**< Twiddle factors real stage */
  98. } arm_rfft_fast_instance_f16 ;
  99. arm_status arm_rfft_fast_init_f16 (
  100. arm_rfft_fast_instance_f16 * S,
  101. uint16_t fftLen);
  102. void arm_rfft_fast_f16(
  103. const arm_rfft_fast_instance_f16 * S,
  104. float16_t * p, float16_t * pOut,
  105. uint8_t ifftFlag);
  106. /* Deprecated */
  107. arm_status arm_cfft_radix4_init_f16(
  108. arm_cfft_radix4_instance_f16 * S,
  109. uint16_t fftLen,
  110. uint8_t ifftFlag,
  111. uint8_t bitReverseFlag);
  112. /* Deprecated */
  113. void arm_cfft_radix4_f16(
  114. const arm_cfft_radix4_instance_f16 * S,
  115. float16_t * pSrc);
  116. /* Deprecated */
  117. arm_status arm_cfft_radix2_init_f16(
  118. arm_cfft_radix2_instance_f16 * S,
  119. uint16_t fftLen,
  120. uint8_t ifftFlag,
  121. uint8_t bitReverseFlag);
  122. /* Deprecated */
  123. void arm_cfft_radix2_f16(
  124. const arm_cfft_radix2_instance_f16 * S,
  125. float16_t * pSrc);
  126. #endif /* defined(ARM_FLOAT16_SUPPORTED)*/
  127. #ifdef __cplusplus
  128. }
  129. #endif
  130. #endif /* ifndef _TRANSFORM_FUNCTIONS_F16_H_ */