complex_math_functions_f16.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /******************************************************************************
  2. * @file complex_math_functions_f16.h
  3. * @brief Public header file for NMSIS DSP Library
  4. * @version V1.10.0
  5. * @date 08 July 2021
  6. * Target Processor: RISC-V Cores
  7. ******************************************************************************/
  8. /*
  9. * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved.
  10. * Copyright (c) 2019 Nuclei Limited. All rights reserved.
  11. *
  12. * SPDX-License-Identifier: Apache-2.0
  13. *
  14. * Licensed under the Apache License, Version 2.0 (the License); you may
  15. * not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at
  17. *
  18. * www.apache.org/licenses/LICENSE-2.0
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  22. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. */
  26. #ifndef COMPLEX_MATH_FUNCTIONS_F16_H_
  27. #define COMPLEX_MATH_FUNCTIONS_F16_H_
  28. #include "riscv_math_types_f16.h"
  29. #include "riscv_math_memory.h"
  30. #include "dsp/none.h"
  31. #include "dsp/utils.h"
  32. #include "dsp/fast_math_functions_f16.h"
  33. #ifdef __cplusplus
  34. extern "C"
  35. {
  36. #endif
  37. #if defined(RISCV_FLOAT16_SUPPORTED)
  38. /**
  39. * @brief Floating-point complex conjugate.
  40. * @param[in] pSrc points to the input vector
  41. * @param[out] pDst points to the output vector
  42. * @param[in] numSamples number of complex samples in each vector
  43. */
  44. void riscv_cmplx_conj_f16(
  45. const float16_t * pSrc,
  46. float16_t * pDst,
  47. uint32_t numSamples);
  48. /**
  49. * @brief Floating-point complex magnitude squared
  50. * @param[in] pSrc points to the complex input vector
  51. * @param[out] pDst points to the real output vector
  52. * @param[in] numSamples number of complex samples in the input vector
  53. */
  54. void riscv_cmplx_mag_squared_f16(
  55. const float16_t * pSrc,
  56. float16_t * pDst,
  57. uint32_t numSamples);
  58. /**
  59. * @brief Floating-point complex magnitude
  60. * @param[in] pSrc points to the complex input vector
  61. * @param[out] pDst points to the real output vector
  62. * @param[in] numSamples number of complex samples in the input vector
  63. */
  64. void riscv_cmplx_mag_f16(
  65. const float16_t * pSrc,
  66. float16_t * pDst,
  67. uint32_t numSamples);
  68. /**
  69. * @brief Floating-point complex dot product
  70. * @param[in] pSrcA points to the first input vector
  71. * @param[in] pSrcB points to the second input vector
  72. * @param[in] numSamples number of complex samples in each vector
  73. * @param[out] realResult real part of the result returned here
  74. * @param[out] imagResult imaginary part of the result returned here
  75. */
  76. void riscv_cmplx_dot_prod_f16(
  77. const float16_t * pSrcA,
  78. const float16_t * pSrcB,
  79. uint32_t numSamples,
  80. float16_t * realResult,
  81. float16_t * imagResult);
  82. /**
  83. * @brief Floating-point complex-by-real multiplication
  84. * @param[in] pSrcCmplx points to the complex input vector
  85. * @param[in] pSrcReal points to the real input vector
  86. * @param[out] pCmplxDst points to the complex output vector
  87. * @param[in] numSamples number of samples in each vector
  88. */
  89. void riscv_cmplx_mult_real_f16(
  90. const float16_t * pSrcCmplx,
  91. const float16_t * pSrcReal,
  92. float16_t * pCmplxDst,
  93. uint32_t numSamples);
  94. /**
  95. * @brief Floating-point complex-by-complex multiplication
  96. * @param[in] pSrcA points to the first input vector
  97. * @param[in] pSrcB points to the second input vector
  98. * @param[out] pDst points to the output vector
  99. * @param[in] numSamples number of complex samples in each vector
  100. */
  101. void riscv_cmplx_mult_cmplx_f16(
  102. const float16_t * pSrcA,
  103. const float16_t * pSrcB,
  104. float16_t * pDst,
  105. uint32_t numSamples);
  106. #endif /*defined(RISCV_FLOAT16_SUPPORTED)*/
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110. #endif /* ifndef _COMPLEX_MATH_FUNCTIONS_F16_H_ */