| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453 |
- /******************************************************************************
- * @file support_functions.h
- * @brief Public header file for CMSIS DSP Library
- * @version V1.10.0
- * @date 08 July 2021
- * Target Processor: Cortex-M and Cortex-A cores
- ******************************************************************************/
- /*
- * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the License); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- #ifndef _SUPPORT_FUNCTIONS_H_
- #define _SUPPORT_FUNCTIONS_H_
- #include "arm_math_types.h"
- #include "arm_math_memory.h"
- #include "dsp/none.h"
- #include "dsp/utils.h"
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- /**
- * @defgroup groupSupport Support Functions
- */
- /**
- * @brief Converts the elements of the floating-point vector to Q31 vector.
- * @param[in] pSrc points to the floating-point input vector
- * @param[out] pDst points to the Q31 output vector
- * @param[in] blockSize length of the input vector
- */
- void arm_float_to_q31(
- const float32_t * pSrc,
- q31_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Converts the elements of the floating-point vector to Q15 vector.
- * @param[in] pSrc points to the floating-point input vector
- * @param[out] pDst points to the Q15 output vector
- * @param[in] blockSize length of the input vector
- */
- void arm_float_to_q15(
- const float32_t * pSrc,
- q15_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Converts the elements of the floating-point vector to Q7 vector.
- * @param[in] pSrc points to the floating-point input vector
- * @param[out] pDst points to the Q7 output vector
- * @param[in] blockSize length of the input vector
- */
- void arm_float_to_q7(
- const float32_t * pSrc,
- q7_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Converts the elements of the Q31 vector to floating-point vector.
- * @param[in] pSrc is input pointer
- * @param[out] pDst is output pointer
- * @param[in] blockSize is the number of samples to process
- */
- void arm_q31_to_float(
- const q31_t * pSrc,
- float32_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Converts the elements of the Q31 vector to Q15 vector.
- * @param[in] pSrc is input pointer
- * @param[out] pDst is output pointer
- * @param[in] blockSize is the number of samples to process
- */
- void arm_q31_to_q15(
- const q31_t * pSrc,
- q15_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Converts the elements of the Q31 vector to Q7 vector.
- * @param[in] pSrc is input pointer
- * @param[out] pDst is output pointer
- * @param[in] blockSize is the number of samples to process
- */
- void arm_q31_to_q7(
- const q31_t * pSrc,
- q7_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Converts the elements of the Q15 vector to floating-point vector.
- * @param[in] pSrc is input pointer
- * @param[out] pDst is output pointer
- * @param[in] blockSize is the number of samples to process
- */
- void arm_q15_to_float(
- const q15_t * pSrc,
- float32_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Converts the elements of the Q15 vector to Q31 vector.
- * @param[in] pSrc is input pointer
- * @param[out] pDst is output pointer
- * @param[in] blockSize is the number of samples to process
- */
- void arm_q15_to_q31(
- const q15_t * pSrc,
- q31_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Converts the elements of the Q15 vector to Q7 vector.
- * @param[in] pSrc is input pointer
- * @param[out] pDst is output pointer
- * @param[in] blockSize is the number of samples to process
- */
- void arm_q15_to_q7(
- const q15_t * pSrc,
- q7_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Converts the elements of the Q7 vector to floating-point vector.
- * @param[in] pSrc is input pointer
- * @param[out] pDst is output pointer
- * @param[in] blockSize is the number of samples to process
- */
- void arm_q7_to_float(
- const q7_t * pSrc,
- float32_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Converts the elements of the Q7 vector to Q31 vector.
- * @param[in] pSrc input pointer
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_q7_to_q31(
- const q7_t * pSrc,
- q31_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Converts the elements of the Q7 vector to Q15 vector.
- * @param[in] pSrc input pointer
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_q7_to_q15(
- const q7_t * pSrc,
- q15_t * pDst,
- uint32_t blockSize);
-
- /**
- * @brief Struct for specifying sorting algorithm
- */
- typedef enum
- {
- ARM_SORT_BITONIC = 0,
- /**< Bitonic sort */
- ARM_SORT_BUBBLE = 1,
- /**< Bubble sort */
- ARM_SORT_HEAP = 2,
- /**< Heap sort */
- ARM_SORT_INSERTION = 3,
- /**< Insertion sort */
- ARM_SORT_QUICK = 4,
- /**< Quick sort */
- ARM_SORT_SELECTION = 5
- /**< Selection sort */
- } arm_sort_alg;
- /**
- * @brief Struct for specifying sorting algorithm
- */
- typedef enum
- {
- ARM_SORT_DESCENDING = 0,
- /**< Descending order (9 to 0) */
- ARM_SORT_ASCENDING = 1
- /**< Ascending order (0 to 9) */
- } arm_sort_dir;
- /**
- * @brief Instance structure for the sorting algorithms.
- */
- typedef struct
- {
- arm_sort_alg alg; /**< Sorting algorithm selected */
- arm_sort_dir dir; /**< Sorting order (direction) */
- } arm_sort_instance_f32;
- /**
- * @param[in] S points to an instance of the sorting structure.
- * @param[in] pSrc points to the block of input data.
- * @param[out] pDst points to the block of output data.
- * @param[in] blockSize number of samples to process.
- */
- void arm_sort_f32(
- const arm_sort_instance_f32 * S,
- float32_t * pSrc,
- float32_t * pDst,
- uint32_t blockSize);
- /**
- * @param[in,out] S points to an instance of the sorting structure.
- * @param[in] alg Selected algorithm.
- * @param[in] dir Sorting order.
- */
- void arm_sort_init_f32(
- arm_sort_instance_f32 * S,
- arm_sort_alg alg,
- arm_sort_dir dir);
- /**
- * @brief Instance structure for the sorting algorithms.
- */
- typedef struct
- {
- arm_sort_dir dir; /**< Sorting order (direction) */
- float32_t * buffer; /**< Working buffer */
- } arm_merge_sort_instance_f32;
- /**
- * @param[in] S points to an instance of the sorting structure.
- * @param[in,out] pSrc points to the block of input data.
- * @param[out] pDst points to the block of output data
- * @param[in] blockSize number of samples to process.
- */
- void arm_merge_sort_f32(
- const arm_merge_sort_instance_f32 * S,
- float32_t *pSrc,
- float32_t *pDst,
- uint32_t blockSize);
- /**
- * @param[in,out] S points to an instance of the sorting structure.
- * @param[in] dir Sorting order.
- * @param[in] buffer Working buffer.
- */
- void arm_merge_sort_init_f32(
- arm_merge_sort_instance_f32 * S,
- arm_sort_dir dir,
- float32_t * buffer);
-
-
- /**
- * @brief Copies the elements of a floating-point vector.
- * @param[in] pSrc input pointer
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_copy_f32(
- const float32_t * pSrc,
- float32_t * pDst,
- uint32_t blockSize);
-
-
- /**
- * @brief Copies the elements of a floating-point vector.
- * @param[in] pSrc input pointer
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_copy_f64(
- const float64_t * pSrc,
- float64_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Copies the elements of a Q7 vector.
- * @param[in] pSrc input pointer
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_copy_q7(
- const q7_t * pSrc,
- q7_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Copies the elements of a Q15 vector.
- * @param[in] pSrc input pointer
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_copy_q15(
- const q15_t * pSrc,
- q15_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Copies the elements of a Q31 vector.
- * @param[in] pSrc input pointer
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_copy_q31(
- const q31_t * pSrc,
- q31_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Fills a constant value into a floating-point vector.
- * @param[in] value input value to be filled
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_fill_f32(
- float32_t value,
- float32_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Fills a constant value into a floating-point vector.
- * @param[in] value input value to be filled
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_fill_f64(
- float64_t value,
- float64_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Fills a constant value into a Q7 vector.
- * @param[in] value input value to be filled
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_fill_q7(
- q7_t value,
- q7_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Fills a constant value into a Q15 vector.
- * @param[in] value input value to be filled
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_fill_q15(
- q15_t value,
- q15_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Fills a constant value into a Q31 vector.
- * @param[in] value input value to be filled
- * @param[out] pDst output pointer
- * @param[in] blockSize number of samples to process
- */
- void arm_fill_q31(
- q31_t value,
- q31_t * pDst,
- uint32_t blockSize);
- /**
- * @brief Weighted sum
- *
- *
- * @param[in] *in Array of input values.
- * @param[in] *weigths Weights
- * @param[in] blockSize Number of samples in the input array.
- * @return Weighted sum
- *
- */
- float32_t arm_weighted_sum_f32(const float32_t *in
- , const float32_t *weigths
- , uint32_t blockSize);
- /**
- * @brief Barycenter
- *
- *
- * @param[in] in List of vectors
- * @param[in] weights Weights of the vectors
- * @param[out] out Barycenter
- * @param[in] nbVectors Number of vectors
- * @param[in] vecDim Dimension of space (vector dimension)
- * @return None
- *
- */
- void arm_barycenter_f32(const float32_t *in
- , const float32_t *weights
- , float32_t *out
- , uint32_t nbVectors
- , uint32_t vecDim);
- #ifdef __cplusplus
- }
- #endif
- #endif /* ifndef _SUPPORT_FUNCTIONS_H_ */
|