basic_math_functions.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  1. /******************************************************************************
  2. * @file basic_math_functions.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 _BASIC_MATH_FUNCTIONS_H_
  26. #define _BASIC_MATH_FUNCTIONS_H_
  27. #include "arm_math_types.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. /**
  36. * @defgroup groupMath Basic Math Functions
  37. */
  38. /**
  39. * @brief Q7 vector multiplication.
  40. * @param[in] pSrcA points to the first input vector
  41. * @param[in] pSrcB points to the second input vector
  42. * @param[out] pDst points to the output vector
  43. * @param[in] blockSize number of samples in each vector
  44. */
  45. void arm_mult_q7(
  46. const q7_t * pSrcA,
  47. const q7_t * pSrcB,
  48. q7_t * pDst,
  49. uint32_t blockSize);
  50. /**
  51. * @brief Q15 vector multiplication.
  52. * @param[in] pSrcA points to the first input vector
  53. * @param[in] pSrcB points to the second input vector
  54. * @param[out] pDst points to the output vector
  55. * @param[in] blockSize number of samples in each vector
  56. */
  57. void arm_mult_q15(
  58. const q15_t * pSrcA,
  59. const q15_t * pSrcB,
  60. q15_t * pDst,
  61. uint32_t blockSize);
  62. /**
  63. * @brief Q31 vector multiplication.
  64. * @param[in] pSrcA points to the first input vector
  65. * @param[in] pSrcB points to the second input vector
  66. * @param[out] pDst points to the output vector
  67. * @param[in] blockSize number of samples in each vector
  68. */
  69. void arm_mult_q31(
  70. const q31_t * pSrcA,
  71. const q31_t * pSrcB,
  72. q31_t * pDst,
  73. uint32_t blockSize);
  74. /**
  75. * @brief Floating-point vector multiplication.
  76. * @param[in] pSrcA points to the first input vector
  77. * @param[in] pSrcB points to the second input vector
  78. * @param[out] pDst points to the output vector
  79. * @param[in] blockSize number of samples in each vector
  80. */
  81. void arm_mult_f32(
  82. const float32_t * pSrcA,
  83. const float32_t * pSrcB,
  84. float32_t * pDst,
  85. uint32_t blockSize);
  86. /**
  87. * @brief Floating-point vector addition.
  88. * @param[in] pSrcA points to the first input vector
  89. * @param[in] pSrcB points to the second input vector
  90. * @param[out] pDst points to the output vector
  91. * @param[in] blockSize number of samples in each vector
  92. */
  93. void arm_add_f32(
  94. const float32_t * pSrcA,
  95. const float32_t * pSrcB,
  96. float32_t * pDst,
  97. uint32_t blockSize);
  98. /**
  99. * @brief Q7 vector addition.
  100. * @param[in] pSrcA points to the first input vector
  101. * @param[in] pSrcB points to the second input vector
  102. * @param[out] pDst points to the output vector
  103. * @param[in] blockSize number of samples in each vector
  104. */
  105. void arm_add_q7(
  106. const q7_t * pSrcA,
  107. const q7_t * pSrcB,
  108. q7_t * pDst,
  109. uint32_t blockSize);
  110. /**
  111. * @brief Q15 vector addition.
  112. * @param[in] pSrcA points to the first input vector
  113. * @param[in] pSrcB points to the second input vector
  114. * @param[out] pDst points to the output vector
  115. * @param[in] blockSize number of samples in each vector
  116. */
  117. void arm_add_q15(
  118. const q15_t * pSrcA,
  119. const q15_t * pSrcB,
  120. q15_t * pDst,
  121. uint32_t blockSize);
  122. /**
  123. * @brief Q31 vector addition.
  124. * @param[in] pSrcA points to the first input vector
  125. * @param[in] pSrcB points to the second input vector
  126. * @param[out] pDst points to the output vector
  127. * @param[in] blockSize number of samples in each vector
  128. */
  129. void arm_add_q31(
  130. const q31_t * pSrcA,
  131. const q31_t * pSrcB,
  132. q31_t * pDst,
  133. uint32_t blockSize);
  134. /**
  135. * @brief Floating-point vector subtraction.
  136. * @param[in] pSrcA points to the first input vector
  137. * @param[in] pSrcB points to the second input vector
  138. * @param[out] pDst points to the output vector
  139. * @param[in] blockSize number of samples in each vector
  140. */
  141. void arm_sub_f32(
  142. const float32_t * pSrcA,
  143. const float32_t * pSrcB,
  144. float32_t * pDst,
  145. uint32_t blockSize);
  146. /**
  147. * @brief Q7 vector subtraction.
  148. * @param[in] pSrcA points to the first input vector
  149. * @param[in] pSrcB points to the second input vector
  150. * @param[out] pDst points to the output vector
  151. * @param[in] blockSize number of samples in each vector
  152. */
  153. void arm_sub_q7(
  154. const q7_t * pSrcA,
  155. const q7_t * pSrcB,
  156. q7_t * pDst,
  157. uint32_t blockSize);
  158. /**
  159. * @brief Q15 vector subtraction.
  160. * @param[in] pSrcA points to the first input vector
  161. * @param[in] pSrcB points to the second input vector
  162. * @param[out] pDst points to the output vector
  163. * @param[in] blockSize number of samples in each vector
  164. */
  165. void arm_sub_q15(
  166. const q15_t * pSrcA,
  167. const q15_t * pSrcB,
  168. q15_t * pDst,
  169. uint32_t blockSize);
  170. /**
  171. * @brief Q31 vector subtraction.
  172. * @param[in] pSrcA points to the first input vector
  173. * @param[in] pSrcB points to the second input vector
  174. * @param[out] pDst points to the output vector
  175. * @param[in] blockSize number of samples in each vector
  176. */
  177. void arm_sub_q31(
  178. const q31_t * pSrcA,
  179. const q31_t * pSrcB,
  180. q31_t * pDst,
  181. uint32_t blockSize);
  182. /**
  183. * @brief Multiplies a floating-point vector by a scalar.
  184. * @param[in] pSrc points to the input vector
  185. * @param[in] scale scale factor to be applied
  186. * @param[out] pDst points to the output vector
  187. * @param[in] blockSize number of samples in the vector
  188. */
  189. void arm_scale_f32(
  190. const float32_t * pSrc,
  191. float32_t scale,
  192. float32_t * pDst,
  193. uint32_t blockSize);
  194. /**
  195. * @brief Multiplies a Q7 vector by a scalar.
  196. * @param[in] pSrc points to the input vector
  197. * @param[in] scaleFract fractional portion of the scale value
  198. * @param[in] shift number of bits to shift the result by
  199. * @param[out] pDst points to the output vector
  200. * @param[in] blockSize number of samples in the vector
  201. */
  202. void arm_scale_q7(
  203. const q7_t * pSrc,
  204. q7_t scaleFract,
  205. int8_t shift,
  206. q7_t * pDst,
  207. uint32_t blockSize);
  208. /**
  209. * @brief Multiplies a Q15 vector by a scalar.
  210. * @param[in] pSrc points to the input vector
  211. * @param[in] scaleFract fractional portion of the scale value
  212. * @param[in] shift number of bits to shift the result by
  213. * @param[out] pDst points to the output vector
  214. * @param[in] blockSize number of samples in the vector
  215. */
  216. void arm_scale_q15(
  217. const q15_t * pSrc,
  218. q15_t scaleFract,
  219. int8_t shift,
  220. q15_t * pDst,
  221. uint32_t blockSize);
  222. /**
  223. * @brief Multiplies a Q31 vector by a scalar.
  224. * @param[in] pSrc points to the input vector
  225. * @param[in] scaleFract fractional portion of the scale value
  226. * @param[in] shift number of bits to shift the result by
  227. * @param[out] pDst points to the output vector
  228. * @param[in] blockSize number of samples in the vector
  229. */
  230. void arm_scale_q31(
  231. const q31_t * pSrc,
  232. q31_t scaleFract,
  233. int8_t shift,
  234. q31_t * pDst,
  235. uint32_t blockSize);
  236. /**
  237. * @brief Q7 vector absolute value.
  238. * @param[in] pSrc points to the input buffer
  239. * @param[out] pDst points to the output buffer
  240. * @param[in] blockSize number of samples in each vector
  241. */
  242. void arm_abs_q7(
  243. const q7_t * pSrc,
  244. q7_t * pDst,
  245. uint32_t blockSize);
  246. /**
  247. * @brief Floating-point vector absolute value.
  248. * @param[in] pSrc points to the input buffer
  249. * @param[out] pDst points to the output buffer
  250. * @param[in] blockSize number of samples in each vector
  251. */
  252. void arm_abs_f32(
  253. const float32_t * pSrc,
  254. float32_t * pDst,
  255. uint32_t blockSize);
  256. /**
  257. * @brief Q15 vector absolute value.
  258. * @param[in] pSrc points to the input buffer
  259. * @param[out] pDst points to the output buffer
  260. * @param[in] blockSize number of samples in each vector
  261. */
  262. void arm_abs_q15(
  263. const q15_t * pSrc,
  264. q15_t * pDst,
  265. uint32_t blockSize);
  266. /**
  267. * @brief Q31 vector absolute value.
  268. * @param[in] pSrc points to the input buffer
  269. * @param[out] pDst points to the output buffer
  270. * @param[in] blockSize number of samples in each vector
  271. */
  272. void arm_abs_q31(
  273. const q31_t * pSrc,
  274. q31_t * pDst,
  275. uint32_t blockSize);
  276. /**
  277. * @brief Dot product of floating-point vectors.
  278. * @param[in] pSrcA points to the first input vector
  279. * @param[in] pSrcB points to the second input vector
  280. * @param[in] blockSize number of samples in each vector
  281. * @param[out] result output result returned here
  282. */
  283. void arm_dot_prod_f32(
  284. const float32_t * pSrcA,
  285. const float32_t * pSrcB,
  286. uint32_t blockSize,
  287. float32_t * result);
  288. /**
  289. * @brief Dot product of Q7 vectors.
  290. * @param[in] pSrcA points to the first input vector
  291. * @param[in] pSrcB points to the second input vector
  292. * @param[in] blockSize number of samples in each vector
  293. * @param[out] result output result returned here
  294. */
  295. void arm_dot_prod_q7(
  296. const q7_t * pSrcA,
  297. const q7_t * pSrcB,
  298. uint32_t blockSize,
  299. q31_t * result);
  300. /**
  301. * @brief Dot product of Q15 vectors.
  302. * @param[in] pSrcA points to the first input vector
  303. * @param[in] pSrcB points to the second input vector
  304. * @param[in] blockSize number of samples in each vector
  305. * @param[out] result output result returned here
  306. */
  307. void arm_dot_prod_q15(
  308. const q15_t * pSrcA,
  309. const q15_t * pSrcB,
  310. uint32_t blockSize,
  311. q63_t * result);
  312. /**
  313. * @brief Dot product of Q31 vectors.
  314. * @param[in] pSrcA points to the first input vector
  315. * @param[in] pSrcB points to the second input vector
  316. * @param[in] blockSize number of samples in each vector
  317. * @param[out] result output result returned here
  318. */
  319. void arm_dot_prod_q31(
  320. const q31_t * pSrcA,
  321. const q31_t * pSrcB,
  322. uint32_t blockSize,
  323. q63_t * result);
  324. /**
  325. * @brief Shifts the elements of a Q7 vector a specified number of bits.
  326. * @param[in] pSrc points to the input vector
  327. * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
  328. * @param[out] pDst points to the output vector
  329. * @param[in] blockSize number of samples in the vector
  330. */
  331. void arm_shift_q7(
  332. const q7_t * pSrc,
  333. int8_t shiftBits,
  334. q7_t * pDst,
  335. uint32_t blockSize);
  336. /**
  337. * @brief Shifts the elements of a Q15 vector a specified number of bits.
  338. * @param[in] pSrc points to the input vector
  339. * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
  340. * @param[out] pDst points to the output vector
  341. * @param[in] blockSize number of samples in the vector
  342. */
  343. void arm_shift_q15(
  344. const q15_t * pSrc,
  345. int8_t shiftBits,
  346. q15_t * pDst,
  347. uint32_t blockSize);
  348. /**
  349. * @brief Shifts the elements of a Q31 vector a specified number of bits.
  350. * @param[in] pSrc points to the input vector
  351. * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
  352. * @param[out] pDst points to the output vector
  353. * @param[in] blockSize number of samples in the vector
  354. */
  355. void arm_shift_q31(
  356. const q31_t * pSrc,
  357. int8_t shiftBits,
  358. q31_t * pDst,
  359. uint32_t blockSize);
  360. /**
  361. * @brief Adds a constant offset to a floating-point vector.
  362. * @param[in] pSrc points to the input vector
  363. * @param[in] offset is the offset to be added
  364. * @param[out] pDst points to the output vector
  365. * @param[in] blockSize number of samples in the vector
  366. */
  367. void arm_offset_f32(
  368. const float32_t * pSrc,
  369. float32_t offset,
  370. float32_t * pDst,
  371. uint32_t blockSize);
  372. /**
  373. * @brief Adds a constant offset to a Q7 vector.
  374. * @param[in] pSrc points to the input vector
  375. * @param[in] offset is the offset to be added
  376. * @param[out] pDst points to the output vector
  377. * @param[in] blockSize number of samples in the vector
  378. */
  379. void arm_offset_q7(
  380. const q7_t * pSrc,
  381. q7_t offset,
  382. q7_t * pDst,
  383. uint32_t blockSize);
  384. /**
  385. * @brief Adds a constant offset to a Q15 vector.
  386. * @param[in] pSrc points to the input vector
  387. * @param[in] offset is the offset to be added
  388. * @param[out] pDst points to the output vector
  389. * @param[in] blockSize number of samples in the vector
  390. */
  391. void arm_offset_q15(
  392. const q15_t * pSrc,
  393. q15_t offset,
  394. q15_t * pDst,
  395. uint32_t blockSize);
  396. /**
  397. * @brief Adds a constant offset to a Q31 vector.
  398. * @param[in] pSrc points to the input vector
  399. * @param[in] offset is the offset to be added
  400. * @param[out] pDst points to the output vector
  401. * @param[in] blockSize number of samples in the vector
  402. */
  403. void arm_offset_q31(
  404. const q31_t * pSrc,
  405. q31_t offset,
  406. q31_t * pDst,
  407. uint32_t blockSize);
  408. /**
  409. * @brief Negates the elements of a floating-point vector.
  410. * @param[in] pSrc points to the input vector
  411. * @param[out] pDst points to the output vector
  412. * @param[in] blockSize number of samples in the vector
  413. */
  414. void arm_negate_f32(
  415. const float32_t * pSrc,
  416. float32_t * pDst,
  417. uint32_t blockSize);
  418. /**
  419. * @brief Negates the elements of a Q7 vector.
  420. * @param[in] pSrc points to the input vector
  421. * @param[out] pDst points to the output vector
  422. * @param[in] blockSize number of samples in the vector
  423. */
  424. void arm_negate_q7(
  425. const q7_t * pSrc,
  426. q7_t * pDst,
  427. uint32_t blockSize);
  428. /**
  429. * @brief Negates the elements of a Q15 vector.
  430. * @param[in] pSrc points to the input vector
  431. * @param[out] pDst points to the output vector
  432. * @param[in] blockSize number of samples in the vector
  433. */
  434. void arm_negate_q15(
  435. const q15_t * pSrc,
  436. q15_t * pDst,
  437. uint32_t blockSize);
  438. /**
  439. * @brief Negates the elements of a Q31 vector.
  440. * @param[in] pSrc points to the input vector
  441. * @param[out] pDst points to the output vector
  442. * @param[in] blockSize number of samples in the vector
  443. */
  444. void arm_negate_q31(
  445. const q31_t * pSrc,
  446. q31_t * pDst,
  447. uint32_t blockSize);
  448. /**
  449. * @brief Compute the logical bitwise AND of two fixed-point vectors.
  450. * @param[in] pSrcA points to input vector A
  451. * @param[in] pSrcB points to input vector B
  452. * @param[out] pDst points to output vector
  453. * @param[in] blockSize number of samples in each vector
  454. * @return none
  455. */
  456. void arm_and_u16(
  457. const uint16_t * pSrcA,
  458. const uint16_t * pSrcB,
  459. uint16_t * pDst,
  460. uint32_t blockSize);
  461. /**
  462. * @brief Compute the logical bitwise AND of two fixed-point vectors.
  463. * @param[in] pSrcA points to input vector A
  464. * @param[in] pSrcB points to input vector B
  465. * @param[out] pDst points to output vector
  466. * @param[in] blockSize number of samples in each vector
  467. * @return none
  468. */
  469. void arm_and_u32(
  470. const uint32_t * pSrcA,
  471. const uint32_t * pSrcB,
  472. uint32_t * pDst,
  473. uint32_t blockSize);
  474. /**
  475. * @brief Compute the logical bitwise AND of two fixed-point vectors.
  476. * @param[in] pSrcA points to input vector A
  477. * @param[in] pSrcB points to input vector B
  478. * @param[out] pDst points to output vector
  479. * @param[in] blockSize number of samples in each vector
  480. * @return none
  481. */
  482. void arm_and_u8(
  483. const uint8_t * pSrcA,
  484. const uint8_t * pSrcB,
  485. uint8_t * pDst,
  486. uint32_t blockSize);
  487. /**
  488. * @brief Compute the logical bitwise OR of two fixed-point vectors.
  489. * @param[in] pSrcA points to input vector A
  490. * @param[in] pSrcB points to input vector B
  491. * @param[out] pDst points to output vector
  492. * @param[in] blockSize number of samples in each vector
  493. * @return none
  494. */
  495. void arm_or_u16(
  496. const uint16_t * pSrcA,
  497. const uint16_t * pSrcB,
  498. uint16_t * pDst,
  499. uint32_t blockSize);
  500. /**
  501. * @brief Compute the logical bitwise OR of two fixed-point vectors.
  502. * @param[in] pSrcA points to input vector A
  503. * @param[in] pSrcB points to input vector B
  504. * @param[out] pDst points to output vector
  505. * @param[in] blockSize number of samples in each vector
  506. * @return none
  507. */
  508. void arm_or_u32(
  509. const uint32_t * pSrcA,
  510. const uint32_t * pSrcB,
  511. uint32_t * pDst,
  512. uint32_t blockSize);
  513. /**
  514. * @brief Compute the logical bitwise OR of two fixed-point vectors.
  515. * @param[in] pSrcA points to input vector A
  516. * @param[in] pSrcB points to input vector B
  517. * @param[out] pDst points to output vector
  518. * @param[in] blockSize number of samples in each vector
  519. * @return none
  520. */
  521. void arm_or_u8(
  522. const uint8_t * pSrcA,
  523. const uint8_t * pSrcB,
  524. uint8_t * pDst,
  525. uint32_t blockSize);
  526. /**
  527. * @brief Compute the logical bitwise NOT of a fixed-point vector.
  528. * @param[in] pSrc points to input vector
  529. * @param[out] pDst points to output vector
  530. * @param[in] blockSize number of samples in each vector
  531. * @return none
  532. */
  533. void arm_not_u16(
  534. const uint16_t * pSrc,
  535. uint16_t * pDst,
  536. uint32_t blockSize);
  537. /**
  538. * @brief Compute the logical bitwise NOT of a fixed-point vector.
  539. * @param[in] pSrc points to input vector
  540. * @param[out] pDst points to output vector
  541. * @param[in] blockSize number of samples in each vector
  542. * @return none
  543. */
  544. void arm_not_u32(
  545. const uint32_t * pSrc,
  546. uint32_t * pDst,
  547. uint32_t blockSize);
  548. /**
  549. * @brief Compute the logical bitwise NOT of a fixed-point vector.
  550. * @param[in] pSrc points to input vector
  551. * @param[out] pDst points to output vector
  552. * @param[in] blockSize number of samples in each vector
  553. * @return none
  554. */
  555. void arm_not_u8(
  556. const uint8_t * pSrc,
  557. uint8_t * pDst,
  558. uint32_t blockSize);
  559. /**
  560. * @brief Compute the logical bitwise XOR of two fixed-point vectors.
  561. * @param[in] pSrcA points to input vector A
  562. * @param[in] pSrcB points to input vector B
  563. * @param[out] pDst points to output vector
  564. * @param[in] blockSize number of samples in each vector
  565. * @return none
  566. */
  567. void arm_xor_u16(
  568. const uint16_t * pSrcA,
  569. const uint16_t * pSrcB,
  570. uint16_t * pDst,
  571. uint32_t blockSize);
  572. /**
  573. * @brief Compute the logical bitwise XOR of two fixed-point vectors.
  574. * @param[in] pSrcA points to input vector A
  575. * @param[in] pSrcB points to input vector B
  576. * @param[out] pDst points to output vector
  577. * @param[in] blockSize number of samples in each vector
  578. * @return none
  579. */
  580. void arm_xor_u32(
  581. const uint32_t * pSrcA,
  582. const uint32_t * pSrcB,
  583. uint32_t * pDst,
  584. uint32_t blockSize);
  585. /**
  586. * @brief Compute the logical bitwise XOR of two fixed-point vectors.
  587. * @param[in] pSrcA points to input vector A
  588. * @param[in] pSrcB points to input vector B
  589. * @param[out] pDst points to output vector
  590. * @param[in] blockSize number of samples in each vector
  591. * @return none
  592. */
  593. void arm_xor_u8(
  594. const uint8_t * pSrcA,
  595. const uint8_t * pSrcB,
  596. uint8_t * pDst,
  597. uint32_t blockSize);
  598. /**
  599. @brief Elementwise floating-point clipping
  600. @param[in] pSrc points to input values
  601. @param[out] pDst points to output clipped values
  602. @param[in] low lower bound
  603. @param[in] high higher bound
  604. @param[in] numSamples number of samples to clip
  605. @return none
  606. */
  607. void arm_clip_f32(const float32_t * pSrc,
  608. float32_t * pDst,
  609. float32_t low,
  610. float32_t high,
  611. uint32_t numSamples);
  612. /**
  613. @brief Elementwise fixed-point clipping
  614. @param[in] pSrc points to input values
  615. @param[out] pDst points to output clipped values
  616. @param[in] low lower bound
  617. @param[in] high higher bound
  618. @param[in] numSamples number of samples to clip
  619. @return none
  620. */
  621. void arm_clip_q31(const q31_t * pSrc,
  622. q31_t * pDst,
  623. q31_t low,
  624. q31_t high,
  625. uint32_t numSamples);
  626. /**
  627. @brief Elementwise fixed-point clipping
  628. @param[in] pSrc points to input values
  629. @param[out] pDst points to output clipped values
  630. @param[in] low lower bound
  631. @param[in] high higher bound
  632. @param[in] numSamples number of samples to clip
  633. @return none
  634. */
  635. void arm_clip_q15(const q15_t * pSrc,
  636. q15_t * pDst,
  637. q15_t low,
  638. q15_t high,
  639. uint32_t numSamples);
  640. /**
  641. @brief Elementwise fixed-point clipping
  642. @param[in] pSrc points to input values
  643. @param[out] pDst points to output clipped values
  644. @param[in] low lower bound
  645. @param[in] high higher bound
  646. @param[in] numSamples number of samples to clip
  647. @return none
  648. */
  649. void arm_clip_q7(const q7_t * pSrc,
  650. q7_t * pDst,
  651. q7_t low,
  652. q7_t high,
  653. uint32_t numSamples);
  654. #ifdef __cplusplus
  655. }
  656. #endif
  657. #endif /* ifndef _BASIC_MATH_FUNCTIONS_H_ */