basic_math_functions.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880
  1. /******************************************************************************
  2. * @file basic_math_functions.h
  3. * @brief Public header file for CMSIS DSP Library
  4. * @version V1.10.0
  5. * @date 08 July 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 multiplication.
  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_mult_f64(
  94. const float64_t * pSrcA,
  95. const float64_t * pSrcB,
  96. float64_t * pDst,
  97. uint32_t blockSize);
  98. /**
  99. * @brief Floating-point 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_f32(
  106. const float32_t * pSrcA,
  107. const float32_t * pSrcB,
  108. float32_t * pDst,
  109. uint32_t blockSize);
  110. /**
  111. * @brief Floating-point 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_f64(
  118. const float64_t * pSrcA,
  119. const float64_t * pSrcB,
  120. float64_t * pDst,
  121. uint32_t blockSize);
  122. /**
  123. * @brief Q7 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_q7(
  130. const q7_t * pSrcA,
  131. const q7_t * pSrcB,
  132. q7_t * pDst,
  133. uint32_t blockSize);
  134. /**
  135. * @brief Q15 vector addition.
  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_add_q15(
  142. const q15_t * pSrcA,
  143. const q15_t * pSrcB,
  144. q15_t * pDst,
  145. uint32_t blockSize);
  146. /**
  147. * @brief Q31 vector addition.
  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_add_q31(
  154. const q31_t * pSrcA,
  155. const q31_t * pSrcB,
  156. q31_t * pDst,
  157. uint32_t blockSize);
  158. /**
  159. * @brief Floating-point 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_f32(
  166. const float32_t * pSrcA,
  167. const float32_t * pSrcB,
  168. float32_t * pDst,
  169. uint32_t blockSize);
  170. /**
  171. * @brief Floating-point 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_f64(
  178. const float64_t * pSrcA,
  179. const float64_t * pSrcB,
  180. float64_t * pDst,
  181. uint32_t blockSize);
  182. /**
  183. * @brief Q7 vector subtraction.
  184. * @param[in] pSrcA points to the first input vector
  185. * @param[in] pSrcB points to the second input vector
  186. * @param[out] pDst points to the output vector
  187. * @param[in] blockSize number of samples in each vector
  188. */
  189. void arm_sub_q7(
  190. const q7_t * pSrcA,
  191. const q7_t * pSrcB,
  192. q7_t * pDst,
  193. uint32_t blockSize);
  194. /**
  195. * @brief Q15 vector subtraction.
  196. * @param[in] pSrcA points to the first input vector
  197. * @param[in] pSrcB points to the second input vector
  198. * @param[out] pDst points to the output vector
  199. * @param[in] blockSize number of samples in each vector
  200. */
  201. void arm_sub_q15(
  202. const q15_t * pSrcA,
  203. const q15_t * pSrcB,
  204. q15_t * pDst,
  205. uint32_t blockSize);
  206. /**
  207. * @brief Q31 vector subtraction.
  208. * @param[in] pSrcA points to the first input vector
  209. * @param[in] pSrcB points to the second input vector
  210. * @param[out] pDst points to the output vector
  211. * @param[in] blockSize number of samples in each vector
  212. */
  213. void arm_sub_q31(
  214. const q31_t * pSrcA,
  215. const q31_t * pSrcB,
  216. q31_t * pDst,
  217. uint32_t blockSize);
  218. /**
  219. * @brief Multiplies a floating-point vector by a scalar.
  220. * @param[in] pSrc points to the input vector
  221. * @param[in] scale scale factor to be applied
  222. * @param[out] pDst points to the output vector
  223. * @param[in] blockSize number of samples in the vector
  224. */
  225. void arm_scale_f32(
  226. const float32_t * pSrc,
  227. float32_t scale,
  228. float32_t * pDst,
  229. uint32_t blockSize);
  230. /**
  231. * @brief Multiplies a floating-point vector by a scalar.
  232. * @param[in] pSrc points to the input vector
  233. * @param[in] scale scale factor to be applied
  234. * @param[out] pDst points to the output vector
  235. * @param[in] blockSize number of samples in the vector
  236. */
  237. void arm_scale_f64(
  238. const float64_t * pSrc,
  239. float64_t scale,
  240. float64_t * pDst,
  241. uint32_t blockSize);
  242. /**
  243. * @brief Multiplies a Q7 vector by a scalar.
  244. * @param[in] pSrc points to the input vector
  245. * @param[in] scaleFract fractional portion of the scale value
  246. * @param[in] shift number of bits to shift the result by
  247. * @param[out] pDst points to the output vector
  248. * @param[in] blockSize number of samples in the vector
  249. */
  250. void arm_scale_q7(
  251. const q7_t * pSrc,
  252. q7_t scaleFract,
  253. int8_t shift,
  254. q7_t * pDst,
  255. uint32_t blockSize);
  256. /**
  257. * @brief Multiplies a Q15 vector by a scalar.
  258. * @param[in] pSrc points to the input vector
  259. * @param[in] scaleFract fractional portion of the scale value
  260. * @param[in] shift number of bits to shift the result by
  261. * @param[out] pDst points to the output vector
  262. * @param[in] blockSize number of samples in the vector
  263. */
  264. void arm_scale_q15(
  265. const q15_t * pSrc,
  266. q15_t scaleFract,
  267. int8_t shift,
  268. q15_t * pDst,
  269. uint32_t blockSize);
  270. /**
  271. * @brief Multiplies a Q31 vector by a scalar.
  272. * @param[in] pSrc points to the input vector
  273. * @param[in] scaleFract fractional portion of the scale value
  274. * @param[in] shift number of bits to shift the result by
  275. * @param[out] pDst points to the output vector
  276. * @param[in] blockSize number of samples in the vector
  277. */
  278. void arm_scale_q31(
  279. const q31_t * pSrc,
  280. q31_t scaleFract,
  281. int8_t shift,
  282. q31_t * pDst,
  283. uint32_t blockSize);
  284. /**
  285. * @brief Q7 vector absolute value.
  286. * @param[in] pSrc points to the input buffer
  287. * @param[out] pDst points to the output buffer
  288. * @param[in] blockSize number of samples in each vector
  289. */
  290. void arm_abs_q7(
  291. const q7_t * pSrc,
  292. q7_t * pDst,
  293. uint32_t blockSize);
  294. /**
  295. * @brief Floating-point vector absolute value.
  296. * @param[in] pSrc points to the input buffer
  297. * @param[out] pDst points to the output buffer
  298. * @param[in] blockSize number of samples in each vector
  299. */
  300. void arm_abs_f32(
  301. const float32_t * pSrc,
  302. float32_t * pDst,
  303. uint32_t blockSize);
  304. /**
  305. * @brief Floating-point vector absolute value.
  306. * @param[in] pSrc points to the input buffer
  307. * @param[out] pDst points to the output buffer
  308. * @param[in] blockSize number of samples in each vector
  309. */
  310. void arm_abs_f64(
  311. const float64_t * pSrc,
  312. float64_t * pDst,
  313. uint32_t blockSize);
  314. /**
  315. * @brief Q15 vector absolute value.
  316. * @param[in] pSrc points to the input buffer
  317. * @param[out] pDst points to the output buffer
  318. * @param[in] blockSize number of samples in each vector
  319. */
  320. void arm_abs_q15(
  321. const q15_t * pSrc,
  322. q15_t * pDst,
  323. uint32_t blockSize);
  324. /**
  325. * @brief Q31 vector absolute value.
  326. * @param[in] pSrc points to the input buffer
  327. * @param[out] pDst points to the output buffer
  328. * @param[in] blockSize number of samples in each vector
  329. */
  330. void arm_abs_q31(
  331. const q31_t * pSrc,
  332. q31_t * pDst,
  333. uint32_t blockSize);
  334. /**
  335. * @brief Dot product of floating-point vectors.
  336. * @param[in] pSrcA points to the first input vector
  337. * @param[in] pSrcB points to the second input vector
  338. * @param[in] blockSize number of samples in each vector
  339. * @param[out] result output result returned here
  340. */
  341. void arm_dot_prod_f32(
  342. const float32_t * pSrcA,
  343. const float32_t * pSrcB,
  344. uint32_t blockSize,
  345. float32_t * result);
  346. /**
  347. * @brief Dot product of floating-point vectors.
  348. * @param[in] pSrcA points to the first input vector
  349. * @param[in] pSrcB points to the second input vector
  350. * @param[in] blockSize number of samples in each vector
  351. * @param[out] result output result returned here
  352. */
  353. void arm_dot_prod_f64(
  354. const float64_t * pSrcA,
  355. const float64_t * pSrcB,
  356. uint32_t blockSize,
  357. float64_t * result);
  358. /**
  359. * @brief Dot product of Q7 vectors.
  360. * @param[in] pSrcA points to the first input vector
  361. * @param[in] pSrcB points to the second input vector
  362. * @param[in] blockSize number of samples in each vector
  363. * @param[out] result output result returned here
  364. */
  365. void arm_dot_prod_q7(
  366. const q7_t * pSrcA,
  367. const q7_t * pSrcB,
  368. uint32_t blockSize,
  369. q31_t * result);
  370. /**
  371. * @brief Dot product of Q15 vectors.
  372. * @param[in] pSrcA points to the first input vector
  373. * @param[in] pSrcB points to the second input vector
  374. * @param[in] blockSize number of samples in each vector
  375. * @param[out] result output result returned here
  376. */
  377. void arm_dot_prod_q15(
  378. const q15_t * pSrcA,
  379. const q15_t * pSrcB,
  380. uint32_t blockSize,
  381. q63_t * result);
  382. /**
  383. * @brief Dot product of Q31 vectors.
  384. * @param[in] pSrcA points to the first input vector
  385. * @param[in] pSrcB points to the second input vector
  386. * @param[in] blockSize number of samples in each vector
  387. * @param[out] result output result returned here
  388. */
  389. void arm_dot_prod_q31(
  390. const q31_t * pSrcA,
  391. const q31_t * pSrcB,
  392. uint32_t blockSize,
  393. q63_t * result);
  394. /**
  395. * @brief Shifts the elements of a Q7 vector a specified number of bits.
  396. * @param[in] pSrc points to the input vector
  397. * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
  398. * @param[out] pDst points to the output vector
  399. * @param[in] blockSize number of samples in the vector
  400. */
  401. void arm_shift_q7(
  402. const q7_t * pSrc,
  403. int8_t shiftBits,
  404. q7_t * pDst,
  405. uint32_t blockSize);
  406. /**
  407. * @brief Shifts the elements of a Q15 vector a specified number of bits.
  408. * @param[in] pSrc points to the input vector
  409. * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
  410. * @param[out] pDst points to the output vector
  411. * @param[in] blockSize number of samples in the vector
  412. */
  413. void arm_shift_q15(
  414. const q15_t * pSrc,
  415. int8_t shiftBits,
  416. q15_t * pDst,
  417. uint32_t blockSize);
  418. /**
  419. * @brief Shifts the elements of a Q31 vector a specified number of bits.
  420. * @param[in] pSrc points to the input vector
  421. * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right.
  422. * @param[out] pDst points to the output vector
  423. * @param[in] blockSize number of samples in the vector
  424. */
  425. void arm_shift_q31(
  426. const q31_t * pSrc,
  427. int8_t shiftBits,
  428. q31_t * pDst,
  429. uint32_t blockSize);
  430. /**
  431. * @brief Adds a constant offset to a floating-point vector.
  432. * @param[in] pSrc points to the input vector
  433. * @param[in] offset is the offset to be added
  434. * @param[out] pDst points to the output vector
  435. * @param[in] blockSize number of samples in the vector
  436. */
  437. void arm_offset_f64(
  438. const float64_t * pSrc,
  439. float64_t offset,
  440. float64_t * pDst,
  441. uint32_t blockSize);
  442. /**
  443. * @brief Adds a constant offset to a floating-point vector.
  444. * @param[in] pSrc points to the input vector
  445. * @param[in] offset is the offset to be added
  446. * @param[out] pDst points to the output vector
  447. * @param[in] blockSize number of samples in the vector
  448. */
  449. void arm_offset_f32(
  450. const float32_t * pSrc,
  451. float32_t offset,
  452. float32_t * pDst,
  453. uint32_t blockSize);
  454. /**
  455. * @brief Adds a constant offset to a Q7 vector.
  456. * @param[in] pSrc points to the input vector
  457. * @param[in] offset is the offset to be added
  458. * @param[out] pDst points to the output vector
  459. * @param[in] blockSize number of samples in the vector
  460. */
  461. void arm_offset_q7(
  462. const q7_t * pSrc,
  463. q7_t offset,
  464. q7_t * pDst,
  465. uint32_t blockSize);
  466. /**
  467. * @brief Adds a constant offset to a Q15 vector.
  468. * @param[in] pSrc points to the input vector
  469. * @param[in] offset is the offset to be added
  470. * @param[out] pDst points to the output vector
  471. * @param[in] blockSize number of samples in the vector
  472. */
  473. void arm_offset_q15(
  474. const q15_t * pSrc,
  475. q15_t offset,
  476. q15_t * pDst,
  477. uint32_t blockSize);
  478. /**
  479. * @brief Adds a constant offset to a Q31 vector.
  480. * @param[in] pSrc points to the input vector
  481. * @param[in] offset is the offset to be added
  482. * @param[out] pDst points to the output vector
  483. * @param[in] blockSize number of samples in the vector
  484. */
  485. void arm_offset_q31(
  486. const q31_t * pSrc,
  487. q31_t offset,
  488. q31_t * pDst,
  489. uint32_t blockSize);
  490. /**
  491. * @brief Negates the elements of a floating-point vector.
  492. * @param[in] pSrc points to the input vector
  493. * @param[out] pDst points to the output vector
  494. * @param[in] blockSize number of samples in the vector
  495. */
  496. void arm_negate_f32(
  497. const float32_t * pSrc,
  498. float32_t * pDst,
  499. uint32_t blockSize);
  500. /**
  501. * @brief Negates the elements of a floating-point vector.
  502. * @param[in] pSrc points to the input vector
  503. * @param[out] pDst points to the output vector
  504. * @param[in] blockSize number of samples in the vector
  505. */
  506. void arm_negate_f64(
  507. const float64_t * pSrc,
  508. float64_t * pDst,
  509. uint32_t blockSize);
  510. /**
  511. * @brief Negates the elements of a Q7 vector.
  512. * @param[in] pSrc points to the input vector
  513. * @param[out] pDst points to the output vector
  514. * @param[in] blockSize number of samples in the vector
  515. */
  516. void arm_negate_q7(
  517. const q7_t * pSrc,
  518. q7_t * pDst,
  519. uint32_t blockSize);
  520. /**
  521. * @brief Negates the elements of a Q15 vector.
  522. * @param[in] pSrc points to the input vector
  523. * @param[out] pDst points to the output vector
  524. * @param[in] blockSize number of samples in the vector
  525. */
  526. void arm_negate_q15(
  527. const q15_t * pSrc,
  528. q15_t * pDst,
  529. uint32_t blockSize);
  530. /**
  531. * @brief Negates the elements of a Q31 vector.
  532. * @param[in] pSrc points to the input vector
  533. * @param[out] pDst points to the output vector
  534. * @param[in] blockSize number of samples in the vector
  535. */
  536. void arm_negate_q31(
  537. const q31_t * pSrc,
  538. q31_t * pDst,
  539. uint32_t blockSize);
  540. /**
  541. * @brief Compute the logical bitwise AND of two fixed-point vectors.
  542. * @param[in] pSrcA points to input vector A
  543. * @param[in] pSrcB points to input vector B
  544. * @param[out] pDst points to output vector
  545. * @param[in] blockSize number of samples in each vector
  546. * @return none
  547. */
  548. void arm_and_u16(
  549. const uint16_t * pSrcA,
  550. const uint16_t * pSrcB,
  551. uint16_t * pDst,
  552. uint32_t blockSize);
  553. /**
  554. * @brief Compute the logical bitwise AND of two fixed-point vectors.
  555. * @param[in] pSrcA points to input vector A
  556. * @param[in] pSrcB points to input vector B
  557. * @param[out] pDst points to output vector
  558. * @param[in] blockSize number of samples in each vector
  559. * @return none
  560. */
  561. void arm_and_u32(
  562. const uint32_t * pSrcA,
  563. const uint32_t * pSrcB,
  564. uint32_t * pDst,
  565. uint32_t blockSize);
  566. /**
  567. * @brief Compute the logical bitwise AND of two fixed-point vectors.
  568. * @param[in] pSrcA points to input vector A
  569. * @param[in] pSrcB points to input vector B
  570. * @param[out] pDst points to output vector
  571. * @param[in] blockSize number of samples in each vector
  572. * @return none
  573. */
  574. void arm_and_u8(
  575. const uint8_t * pSrcA,
  576. const uint8_t * pSrcB,
  577. uint8_t * pDst,
  578. uint32_t blockSize);
  579. /**
  580. * @brief Compute the logical bitwise OR of two fixed-point vectors.
  581. * @param[in] pSrcA points to input vector A
  582. * @param[in] pSrcB points to input vector B
  583. * @param[out] pDst points to output vector
  584. * @param[in] blockSize number of samples in each vector
  585. * @return none
  586. */
  587. void arm_or_u16(
  588. const uint16_t * pSrcA,
  589. const uint16_t * pSrcB,
  590. uint16_t * pDst,
  591. uint32_t blockSize);
  592. /**
  593. * @brief Compute the logical bitwise OR of two fixed-point vectors.
  594. * @param[in] pSrcA points to input vector A
  595. * @param[in] pSrcB points to input vector B
  596. * @param[out] pDst points to output vector
  597. * @param[in] blockSize number of samples in each vector
  598. * @return none
  599. */
  600. void arm_or_u32(
  601. const uint32_t * pSrcA,
  602. const uint32_t * pSrcB,
  603. uint32_t * pDst,
  604. uint32_t blockSize);
  605. /**
  606. * @brief Compute the logical bitwise OR of two fixed-point vectors.
  607. * @param[in] pSrcA points to input vector A
  608. * @param[in] pSrcB points to input vector B
  609. * @param[out] pDst points to output vector
  610. * @param[in] blockSize number of samples in each vector
  611. * @return none
  612. */
  613. void arm_or_u8(
  614. const uint8_t * pSrcA,
  615. const uint8_t * pSrcB,
  616. uint8_t * pDst,
  617. uint32_t blockSize);
  618. /**
  619. * @brief Compute the logical bitwise NOT of a fixed-point vector.
  620. * @param[in] pSrc points to input vector
  621. * @param[out] pDst points to output vector
  622. * @param[in] blockSize number of samples in each vector
  623. * @return none
  624. */
  625. void arm_not_u16(
  626. const uint16_t * pSrc,
  627. uint16_t * pDst,
  628. uint32_t blockSize);
  629. /**
  630. * @brief Compute the logical bitwise NOT of a fixed-point vector.
  631. * @param[in] pSrc points to input vector
  632. * @param[out] pDst points to output vector
  633. * @param[in] blockSize number of samples in each vector
  634. * @return none
  635. */
  636. void arm_not_u32(
  637. const uint32_t * pSrc,
  638. uint32_t * pDst,
  639. uint32_t blockSize);
  640. /**
  641. * @brief Compute the logical bitwise NOT of a fixed-point vector.
  642. * @param[in] pSrc points to input vector
  643. * @param[out] pDst points to output vector
  644. * @param[in] blockSize number of samples in each vector
  645. * @return none
  646. */
  647. void arm_not_u8(
  648. const uint8_t * pSrc,
  649. uint8_t * pDst,
  650. uint32_t blockSize);
  651. /**
  652. * @brief Compute the logical bitwise XOR of two fixed-point vectors.
  653. * @param[in] pSrcA points to input vector A
  654. * @param[in] pSrcB points to input vector B
  655. * @param[out] pDst points to output vector
  656. * @param[in] blockSize number of samples in each vector
  657. * @return none
  658. */
  659. void arm_xor_u16(
  660. const uint16_t * pSrcA,
  661. const uint16_t * pSrcB,
  662. uint16_t * pDst,
  663. uint32_t blockSize);
  664. /**
  665. * @brief Compute the logical bitwise XOR of two fixed-point vectors.
  666. * @param[in] pSrcA points to input vector A
  667. * @param[in] pSrcB points to input vector B
  668. * @param[out] pDst points to output vector
  669. * @param[in] blockSize number of samples in each vector
  670. * @return none
  671. */
  672. void arm_xor_u32(
  673. const uint32_t * pSrcA,
  674. const uint32_t * pSrcB,
  675. uint32_t * pDst,
  676. uint32_t blockSize);
  677. /**
  678. * @brief Compute the logical bitwise XOR of two fixed-point vectors.
  679. * @param[in] pSrcA points to input vector A
  680. * @param[in] pSrcB points to input vector B
  681. * @param[out] pDst points to output vector
  682. * @param[in] blockSize number of samples in each vector
  683. * @return none
  684. */
  685. void arm_xor_u8(
  686. const uint8_t * pSrcA,
  687. const uint8_t * pSrcB,
  688. uint8_t * pDst,
  689. uint32_t blockSize);
  690. /**
  691. @brief Elementwise floating-point clipping
  692. @param[in] pSrc points to input values
  693. @param[out] pDst points to output clipped values
  694. @param[in] low lower bound
  695. @param[in] high higher bound
  696. @param[in] numSamples number of samples to clip
  697. @return none
  698. */
  699. void arm_clip_f32(const float32_t * pSrc,
  700. float32_t * pDst,
  701. float32_t low,
  702. float32_t high,
  703. uint32_t numSamples);
  704. /**
  705. @brief Elementwise fixed-point clipping
  706. @param[in] pSrc points to input values
  707. @param[out] pDst points to output clipped values
  708. @param[in] low lower bound
  709. @param[in] high higher bound
  710. @param[in] numSamples number of samples to clip
  711. @return none
  712. */
  713. void arm_clip_q31(const q31_t * pSrc,
  714. q31_t * pDst,
  715. q31_t low,
  716. q31_t high,
  717. uint32_t numSamples);
  718. /**
  719. @brief Elementwise fixed-point clipping
  720. @param[in] pSrc points to input values
  721. @param[out] pDst points to output clipped values
  722. @param[in] low lower bound
  723. @param[in] high higher bound
  724. @param[in] numSamples number of samples to clip
  725. @return none
  726. */
  727. void arm_clip_q15(const q15_t * pSrc,
  728. q15_t * pDst,
  729. q15_t low,
  730. q15_t high,
  731. uint32_t numSamples);
  732. /**
  733. @brief Elementwise fixed-point clipping
  734. @param[in] pSrc points to input values
  735. @param[out] pDst points to output clipped values
  736. @param[in] low lower bound
  737. @param[in] high higher bound
  738. @param[in] numSamples number of samples to clip
  739. @return none
  740. */
  741. void arm_clip_q7(const q7_t * pSrc,
  742. q7_t * pDst,
  743. q7_t low,
  744. q7_t high,
  745. uint32_t numSamples);
  746. #ifdef __cplusplus
  747. }
  748. #endif
  749. #endif /* ifndef _BASIC_MATH_FUNCTIONS_H_ */