transform_functions_f16.h 6.1 KB

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