statistics_functions.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977
  1. /******************************************************************************
  2. * @file statistics_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 _STATISTICS_FUNCTIONS_H_
  26. #define _STATISTICS_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. #include "dsp/basic_math_functions.h"
  32. #include "dsp/fast_math_functions.h"
  33. #ifdef __cplusplus
  34. extern "C"
  35. {
  36. #endif
  37. /**
  38. * @defgroup groupStats Statistics Functions
  39. */
  40. /**
  41. * @brief Computation of the LogSumExp
  42. *
  43. * In probabilistic computations, the dynamic of the probability values can be very
  44. * wide because they come from gaussian functions.
  45. * To avoid underflow and overflow issues, the values are represented by their log.
  46. * In this representation, multiplying the original exp values is easy : their logs are added.
  47. * But adding the original exp values is requiring some special handling and it is the
  48. * goal of the LogSumExp function.
  49. *
  50. * If the values are x1...xn, the function is computing:
  51. *
  52. * ln(exp(x1) + ... + exp(xn)) and the computation is done in such a way that
  53. * rounding issues are minimised.
  54. *
  55. * The max xm of the values is extracted and the function is computing:
  56. * xm + ln(exp(x1 - xm) + ... + exp(xn - xm))
  57. *
  58. * @param[in] *in Pointer to an array of input values.
  59. * @param[in] blockSize Number of samples in the input array.
  60. * @return LogSumExp
  61. *
  62. */
  63. float32_t arm_logsumexp_f32(const float32_t *in, uint32_t blockSize);
  64. /**
  65. * @brief Dot product with log arithmetic
  66. *
  67. * Vectors are containing the log of the samples
  68. *
  69. * @param[in] pSrcA points to the first input vector
  70. * @param[in] pSrcB points to the second input vector
  71. * @param[in] blockSize number of samples in each vector
  72. * @param[in] pTmpBuffer temporary buffer of length blockSize
  73. * @return The log of the dot product .
  74. *
  75. */
  76. float32_t arm_logsumexp_dot_prod_f32(const float32_t * pSrcA,
  77. const float32_t * pSrcB,
  78. uint32_t blockSize,
  79. float32_t *pTmpBuffer);
  80. /**
  81. * @brief Entropy
  82. *
  83. * @param[in] pSrcA Array of input values.
  84. * @param[in] blockSize Number of samples in the input array.
  85. * @return Entropy -Sum(p ln p)
  86. *
  87. */
  88. float32_t arm_entropy_f32(const float32_t * pSrcA,uint32_t blockSize);
  89. /**
  90. * @brief Entropy
  91. *
  92. * @param[in] pSrcA Array of input values.
  93. * @param[in] blockSize Number of samples in the input array.
  94. * @return Entropy -Sum(p ln p)
  95. *
  96. */
  97. float64_t arm_entropy_f64(const float64_t * pSrcA, uint32_t blockSize);
  98. /**
  99. * @brief Kullback-Leibler
  100. *
  101. * @param[in] pSrcA Pointer to an array of input values for probability distribution A.
  102. * @param[in] pSrcB Pointer to an array of input values for probability distribution B.
  103. * @param[in] blockSize Number of samples in the input array.
  104. * @return Kullback-Leibler Divergence D(A || B)
  105. *
  106. */
  107. float32_t arm_kullback_leibler_f32(const float32_t * pSrcA
  108. ,const float32_t * pSrcB
  109. ,uint32_t blockSize);
  110. /**
  111. * @brief Kullback-Leibler
  112. *
  113. * @param[in] pSrcA Pointer to an array of input values for probability distribution A.
  114. * @param[in] pSrcB Pointer to an array of input values for probability distribution B.
  115. * @param[in] blockSize Number of samples in the input array.
  116. * @return Kullback-Leibler Divergence D(A || B)
  117. *
  118. */
  119. float64_t arm_kullback_leibler_f64(const float64_t * pSrcA,
  120. const float64_t * pSrcB,
  121. uint32_t blockSize);
  122. /**
  123. * @brief Sum of the squares of the elements of a Q31 vector.
  124. * @param[in] pSrc is input pointer
  125. * @param[in] blockSize is the number of samples to process
  126. * @param[out] pResult is output value.
  127. */
  128. void arm_power_q31(
  129. const q31_t * pSrc,
  130. uint32_t blockSize,
  131. q63_t * pResult);
  132. /**
  133. * @brief Sum of the squares of the elements of a floating-point vector.
  134. * @param[in] pSrc is input pointer
  135. * @param[in] blockSize is the number of samples to process
  136. * @param[out] pResult is output value.
  137. */
  138. void arm_power_f32(
  139. const float32_t * pSrc,
  140. uint32_t blockSize,
  141. float32_t * pResult);
  142. /**
  143. * @brief Sum of the squares of the elements of a floating-point vector.
  144. * @param[in] pSrc is input pointer
  145. * @param[in] blockSize is the number of samples to process
  146. * @param[out] pResult is output value.
  147. */
  148. void arm_power_f64(
  149. const float64_t * pSrc,
  150. uint32_t blockSize,
  151. float64_t * pResult);
  152. /**
  153. * @brief Sum of the squares of the elements of a Q15 vector.
  154. * @param[in] pSrc is input pointer
  155. * @param[in] blockSize is the number of samples to process
  156. * @param[out] pResult is output value.
  157. */
  158. void arm_power_q15(
  159. const q15_t * pSrc,
  160. uint32_t blockSize,
  161. q63_t * pResult);
  162. /**
  163. * @brief Sum of the squares of the elements of a Q7 vector.
  164. * @param[in] pSrc is input pointer
  165. * @param[in] blockSize is the number of samples to process
  166. * @param[out] pResult is output value.
  167. */
  168. void arm_power_q7(
  169. const q7_t * pSrc,
  170. uint32_t blockSize,
  171. q31_t * pResult);
  172. /**
  173. * @brief Mean value of a Q7 vector.
  174. * @param[in] pSrc is input pointer
  175. * @param[in] blockSize is the number of samples to process
  176. * @param[out] pResult is output value.
  177. */
  178. void arm_mean_q7(
  179. const q7_t * pSrc,
  180. uint32_t blockSize,
  181. q7_t * pResult);
  182. /**
  183. * @brief Mean value of a Q15 vector.
  184. * @param[in] pSrc is input pointer
  185. * @param[in] blockSize is the number of samples to process
  186. * @param[out] pResult is output value.
  187. */
  188. void arm_mean_q15(
  189. const q15_t * pSrc,
  190. uint32_t blockSize,
  191. q15_t * pResult);
  192. /**
  193. * @brief Mean value of a Q31 vector.
  194. * @param[in] pSrc is input pointer
  195. * @param[in] blockSize is the number of samples to process
  196. * @param[out] pResult is output value.
  197. */
  198. void arm_mean_q31(
  199. const q31_t * pSrc,
  200. uint32_t blockSize,
  201. q31_t * pResult);
  202. /**
  203. * @brief Mean value of a floating-point vector.
  204. * @param[in] pSrc is input pointer
  205. * @param[in] blockSize is the number of samples to process
  206. * @param[out] pResult is output value.
  207. */
  208. void arm_mean_f32(
  209. const float32_t * pSrc,
  210. uint32_t blockSize,
  211. float32_t * pResult);
  212. /**
  213. * @brief Mean value of a floating-point vector.
  214. * @param[in] pSrc is input pointer
  215. * @param[in] blockSize is the number of samples to process
  216. * @param[out] pResult is output value.
  217. */
  218. void arm_mean_f64(
  219. const float64_t * pSrc,
  220. uint32_t blockSize,
  221. float64_t * pResult);
  222. /**
  223. * @brief Variance of the elements of a floating-point vector.
  224. * @param[in] pSrc is input pointer
  225. * @param[in] blockSize is the number of samples to process
  226. * @param[out] pResult is output value.
  227. */
  228. void arm_var_f32(
  229. const float32_t * pSrc,
  230. uint32_t blockSize,
  231. float32_t * pResult);
  232. /**
  233. * @brief Variance of the elements of a floating-point vector.
  234. * @param[in] pSrc is input pointer
  235. * @param[in] blockSize is the number of samples to process
  236. * @param[out] pResult is output value.
  237. */
  238. void arm_var_f64(
  239. const float64_t * pSrc,
  240. uint32_t blockSize,
  241. float64_t * pResult);
  242. /**
  243. * @brief Variance of the elements of a Q31 vector.
  244. * @param[in] pSrc is input pointer
  245. * @param[in] blockSize is the number of samples to process
  246. * @param[out] pResult is output value.
  247. */
  248. void arm_var_q31(
  249. const q31_t * pSrc,
  250. uint32_t blockSize,
  251. q31_t * pResult);
  252. /**
  253. * @brief Variance of the elements of a Q15 vector.
  254. * @param[in] pSrc is input pointer
  255. * @param[in] blockSize is the number of samples to process
  256. * @param[out] pResult is output value.
  257. */
  258. void arm_var_q15(
  259. const q15_t * pSrc,
  260. uint32_t blockSize,
  261. q15_t * pResult);
  262. /**
  263. * @brief Root Mean Square of the elements of a floating-point vector.
  264. * @param[in] pSrc is input pointer
  265. * @param[in] blockSize is the number of samples to process
  266. * @param[out] pResult is output value.
  267. */
  268. void arm_rms_f32(
  269. const float32_t * pSrc,
  270. uint32_t blockSize,
  271. float32_t * pResult);
  272. /**
  273. * @brief Root Mean Square of the elements of a Q31 vector.
  274. * @param[in] pSrc is input pointer
  275. * @param[in] blockSize is the number of samples to process
  276. * @param[out] pResult is output value.
  277. */
  278. void arm_rms_q31(
  279. const q31_t * pSrc,
  280. uint32_t blockSize,
  281. q31_t * pResult);
  282. /**
  283. * @brief Root Mean Square of the elements of a Q15 vector.
  284. * @param[in] pSrc is input pointer
  285. * @param[in] blockSize is the number of samples to process
  286. * @param[out] pResult is output value.
  287. */
  288. void arm_rms_q15(
  289. const q15_t * pSrc,
  290. uint32_t blockSize,
  291. q15_t * pResult);
  292. /**
  293. * @brief Standard deviation of the elements of a floating-point vector.
  294. * @param[in] pSrc is input pointer
  295. * @param[in] blockSize is the number of samples to process
  296. * @param[out] pResult is output value.
  297. */
  298. void arm_std_f32(
  299. const float32_t * pSrc,
  300. uint32_t blockSize,
  301. float32_t * pResult);
  302. /**
  303. * @brief Standard deviation of the elements of a floating-point vector.
  304. * @param[in] pSrc is input pointer
  305. * @param[in] blockSize is the number of samples to process
  306. * @param[out] pResult is output value.
  307. */
  308. void arm_std_f64(
  309. const float64_t * pSrc,
  310. uint32_t blockSize,
  311. float64_t * pResult);
  312. /**
  313. * @brief Standard deviation of the elements of a Q31 vector.
  314. * @param[in] pSrc is input pointer
  315. * @param[in] blockSize is the number of samples to process
  316. * @param[out] pResult is output value.
  317. */
  318. void arm_std_q31(
  319. const q31_t * pSrc,
  320. uint32_t blockSize,
  321. q31_t * pResult);
  322. /**
  323. * @brief Standard deviation of the elements of a Q15 vector.
  324. * @param[in] pSrc is input pointer
  325. * @param[in] blockSize is the number of samples to process
  326. * @param[out] pResult is output value.
  327. */
  328. void arm_std_q15(
  329. const q15_t * pSrc,
  330. uint32_t blockSize,
  331. q15_t * pResult);
  332. /**
  333. * @brief Minimum value of a Q7 vector.
  334. * @param[in] pSrc is input pointer
  335. * @param[in] blockSize is the number of samples to process
  336. * @param[out] result is output pointer
  337. * @param[in] index is the array index of the minimum value in the input buffer.
  338. */
  339. void arm_min_q7(
  340. const q7_t * pSrc,
  341. uint32_t blockSize,
  342. q7_t * result,
  343. uint32_t * index);
  344. /**
  345. * @brief Minimum value of absolute values of a Q7 vector.
  346. * @param[in] pSrc is input pointer
  347. * @param[in] blockSize is the number of samples to process
  348. * @param[out] result is output pointer
  349. * @param[in] index is the array index of the minimum value in the input buffer.
  350. */
  351. void arm_absmin_q7(
  352. const q7_t * pSrc,
  353. uint32_t blockSize,
  354. q7_t * result,
  355. uint32_t * index);
  356. /**
  357. * @brief Minimum value of absolute values of a Q7 vector.
  358. * @param[in] pSrc is input pointer
  359. * @param[in] blockSize is the number of samples to process
  360. * @param[out] result is output pointer
  361. */
  362. void arm_absmin_no_idx_q7(
  363. const q7_t * pSrc,
  364. uint32_t blockSize,
  365. q7_t * result);
  366. /**
  367. * @brief Minimum value of a Q15 vector.
  368. * @param[in] pSrc is input pointer
  369. * @param[in] blockSize is the number of samples to process
  370. * @param[out] pResult is output pointer
  371. * @param[in] pIndex is the array index of the minimum value in the input buffer.
  372. */
  373. void arm_min_q15(
  374. const q15_t * pSrc,
  375. uint32_t blockSize,
  376. q15_t * pResult,
  377. uint32_t * pIndex);
  378. /**
  379. * @brief Minimum value of absolute values of a Q15 vector.
  380. * @param[in] pSrc is input pointer
  381. * @param[in] blockSize is the number of samples to process
  382. * @param[out] pResult is output pointer
  383. * @param[in] pIndex is the array index of the minimum value in the input buffer.
  384. */
  385. void arm_absmin_q15(
  386. const q15_t * pSrc,
  387. uint32_t blockSize,
  388. q15_t * pResult,
  389. uint32_t * pIndex);
  390. /**
  391. * @brief Minimum value of absolute values of a Q15 vector.
  392. * @param[in] pSrc is input pointer
  393. * @param[in] blockSize is the number of samples to process
  394. * @param[out] pResult is output pointer
  395. */
  396. void arm_absmin_no_idx_q15(
  397. const q15_t * pSrc,
  398. uint32_t blockSize,
  399. q15_t * pResult);
  400. /**
  401. * @brief Minimum value of a Q31 vector.
  402. * @param[in] pSrc is input pointer
  403. * @param[in] blockSize is the number of samples to process
  404. * @param[out] pResult is output pointer
  405. * @param[out] pIndex is the array index of the minimum value in the input buffer.
  406. */
  407. void arm_min_q31(
  408. const q31_t * pSrc,
  409. uint32_t blockSize,
  410. q31_t * pResult,
  411. uint32_t * pIndex);
  412. /**
  413. * @brief Minimum value of absolute values of a Q31 vector.
  414. * @param[in] pSrc is input pointer
  415. * @param[in] blockSize is the number of samples to process
  416. * @param[out] pResult is output pointer
  417. * @param[out] pIndex is the array index of the minimum value in the input buffer.
  418. */
  419. void arm_absmin_q31(
  420. const q31_t * pSrc,
  421. uint32_t blockSize,
  422. q31_t * pResult,
  423. uint32_t * pIndex);
  424. /**
  425. * @brief Minimum value of absolute values of a Q31 vector.
  426. * @param[in] pSrc is input pointer
  427. * @param[in] blockSize is the number of samples to process
  428. * @param[out] pResult is output pointer
  429. */
  430. void arm_absmin_no_idx_q31(
  431. const q31_t * pSrc,
  432. uint32_t blockSize,
  433. q31_t * pResult);
  434. /**
  435. * @brief Minimum value of a floating-point vector.
  436. * @param[in] pSrc is input pointer
  437. * @param[in] blockSize is the number of samples to process
  438. * @param[out] pResult is output pointer
  439. * @param[out] pIndex is the array index of the minimum value in the input buffer.
  440. */
  441. void arm_min_f32(
  442. const float32_t * pSrc,
  443. uint32_t blockSize,
  444. float32_t * pResult,
  445. uint32_t * pIndex);
  446. /**
  447. * @brief Minimum value of absolute values of a floating-point vector.
  448. * @param[in] pSrc is input pointer
  449. * @param[in] blockSize is the number of samples to process
  450. * @param[out] pResult is output pointer
  451. * @param[out] pIndex is the array index of the minimum value in the input buffer.
  452. */
  453. void arm_absmin_f32(
  454. const float32_t * pSrc,
  455. uint32_t blockSize,
  456. float32_t * pResult,
  457. uint32_t * pIndex);
  458. /**
  459. * @brief Minimum value of absolute values of a floating-point vector.
  460. * @param[in] pSrc is input pointer
  461. * @param[in] blockSize is the number of samples to process
  462. * @param[out] pResult is output pointer
  463. */
  464. void arm_absmin_no_idx_f32(
  465. const float32_t * pSrc,
  466. uint32_t blockSize,
  467. float32_t * pResult);
  468. /**
  469. * @brief Minimum value of a floating-point vector.
  470. * @param[in] pSrc is input pointer
  471. * @param[in] blockSize is the number of samples to process
  472. * @param[out] pResult is output pointer
  473. * @param[out] pIndex is the array index of the minimum value in the input buffer.
  474. */
  475. void arm_min_f64(
  476. const float64_t * pSrc,
  477. uint32_t blockSize,
  478. float64_t * pResult,
  479. uint32_t * pIndex);
  480. /**
  481. * @brief Minimum value of absolute values of a floating-point vector.
  482. * @param[in] pSrc is input pointer
  483. * @param[in] blockSize is the number of samples to process
  484. * @param[out] pResult is output pointer
  485. * @param[out] pIndex is the array index of the minimum value in the input buffer.
  486. */
  487. void arm_absmin_f64(
  488. const float64_t * pSrc,
  489. uint32_t blockSize,
  490. float64_t * pResult,
  491. uint32_t * pIndex);
  492. /**
  493. * @brief Minimum value of absolute values of a floating-point vector.
  494. * @param[in] pSrc is input pointer
  495. * @param[in] blockSize is the number of samples to process
  496. * @param[out] pResult is output pointer
  497. */
  498. void arm_absmin_no_idx_f64(
  499. const float64_t * pSrc,
  500. uint32_t blockSize,
  501. float64_t * pResult);
  502. /**
  503. * @brief Maximum value of a Q7 vector.
  504. * @param[in] pSrc points to the input buffer
  505. * @param[in] blockSize length of the input vector
  506. * @param[out] pResult maximum value returned here
  507. * @param[out] pIndex index of maximum value returned here
  508. */
  509. void arm_max_q7(
  510. const q7_t * pSrc,
  511. uint32_t blockSize,
  512. q7_t * pResult,
  513. uint32_t * pIndex);
  514. /**
  515. * @brief Maximum value of absolute values of a Q7 vector.
  516. * @param[in] pSrc points to the input buffer
  517. * @param[in] blockSize length of the input vector
  518. * @param[out] pResult maximum value returned here
  519. * @param[out] pIndex index of maximum value returned here
  520. */
  521. void arm_absmax_q7(
  522. const q7_t * pSrc,
  523. uint32_t blockSize,
  524. q7_t * pResult,
  525. uint32_t * pIndex);
  526. /**
  527. * @brief Maximum value of absolute values of a Q7 vector.
  528. * @param[in] pSrc points to the input buffer
  529. * @param[in] blockSize length of the input vector
  530. * @param[out] pResult maximum value returned here
  531. */
  532. void arm_absmax_no_idx_q7(
  533. const q7_t * pSrc,
  534. uint32_t blockSize,
  535. q7_t * pResult);
  536. /**
  537. * @brief Maximum value of a Q15 vector.
  538. * @param[in] pSrc points to the input buffer
  539. * @param[in] blockSize length of the input vector
  540. * @param[out] pResult maximum value returned here
  541. * @param[out] pIndex index of maximum value returned here
  542. */
  543. void arm_max_q15(
  544. const q15_t * pSrc,
  545. uint32_t blockSize,
  546. q15_t * pResult,
  547. uint32_t * pIndex);
  548. /**
  549. * @brief Maximum value of absolute values of a Q15 vector.
  550. * @param[in] pSrc points to the input buffer
  551. * @param[in] blockSize length of the input vector
  552. * @param[out] pResult maximum value returned here
  553. * @param[out] pIndex index of maximum value returned here
  554. */
  555. void arm_absmax_q15(
  556. const q15_t * pSrc,
  557. uint32_t blockSize,
  558. q15_t * pResult,
  559. uint32_t * pIndex);
  560. /**
  561. * @brief Maximum value of absolute values of a Q15 vector.
  562. * @param[in] pSrc points to the input buffer
  563. * @param[in] blockSize length of the input vector
  564. * @param[out] pResult maximum value returned here
  565. */
  566. void arm_absmax_no_idx_q15(
  567. const q15_t * pSrc,
  568. uint32_t blockSize,
  569. q15_t * pResult);
  570. /**
  571. * @brief Maximum value of a Q31 vector.
  572. * @param[in] pSrc points to the input buffer
  573. * @param[in] blockSize length of the input vector
  574. * @param[out] pResult maximum value returned here
  575. * @param[out] pIndex index of maximum value returned here
  576. */
  577. void arm_max_q31(
  578. const q31_t * pSrc,
  579. uint32_t blockSize,
  580. q31_t * pResult,
  581. uint32_t * pIndex);
  582. /**
  583. * @brief Maximum value of absolute values of a Q31 vector.
  584. * @param[in] pSrc points to the input buffer
  585. * @param[in] blockSize length of the input vector
  586. * @param[out] pResult maximum value returned here
  587. * @param[out] pIndex index of maximum value returned here
  588. */
  589. void arm_absmax_q31(
  590. const q31_t * pSrc,
  591. uint32_t blockSize,
  592. q31_t * pResult,
  593. uint32_t * pIndex);
  594. /**
  595. * @brief Maximum value of absolute values of a Q31 vector.
  596. * @param[in] pSrc points to the input buffer
  597. * @param[in] blockSize length of the input vector
  598. * @param[out] pResult maximum value returned here
  599. */
  600. void arm_absmax_no_idx_q31(
  601. const q31_t * pSrc,
  602. uint32_t blockSize,
  603. q31_t * pResult);
  604. /**
  605. * @brief Maximum value of a floating-point vector.
  606. * @param[in] pSrc points to the input buffer
  607. * @param[in] blockSize length of the input vector
  608. * @param[out] pResult maximum value returned here
  609. * @param[out] pIndex index of maximum value returned here
  610. */
  611. void arm_max_f32(
  612. const float32_t * pSrc,
  613. uint32_t blockSize,
  614. float32_t * pResult,
  615. uint32_t * pIndex);
  616. /**
  617. * @brief Maximum value of absolute values of a floating-point vector.
  618. * @param[in] pSrc points to the input buffer
  619. * @param[in] blockSize length of the input vector
  620. * @param[out] pResult maximum value returned here
  621. * @param[out] pIndex index of maximum value returned here
  622. */
  623. void arm_absmax_f32(
  624. const float32_t * pSrc,
  625. uint32_t blockSize,
  626. float32_t * pResult,
  627. uint32_t * pIndex);
  628. /**
  629. * @brief Maximum value of absolute values of a floating-point vector.
  630. * @param[in] pSrc points to the input buffer
  631. * @param[in] blockSize length of the input vector
  632. * @param[out] pResult maximum value returned here
  633. */
  634. void arm_absmax_no_idx_f32(
  635. const float32_t * pSrc,
  636. uint32_t blockSize,
  637. float32_t * pResult);
  638. /**
  639. * @brief Maximum value of a floating-point vector.
  640. * @param[in] pSrc points to the input buffer
  641. * @param[in] blockSize length of the input vector
  642. * @param[out] pResult maximum value returned here
  643. * @param[out] pIndex index of maximum value returned here
  644. */
  645. void arm_max_f64(
  646. const float64_t * pSrc,
  647. uint32_t blockSize,
  648. float64_t * pResult,
  649. uint32_t * pIndex);
  650. /**
  651. * @brief Maximum value of absolute values of a floating-point vector.
  652. * @param[in] pSrc points to the input buffer
  653. * @param[in] blockSize length of the input vector
  654. * @param[out] pResult maximum value returned here
  655. * @param[out] pIndex index of maximum value returned here
  656. */
  657. void arm_absmax_f64(
  658. const float64_t * pSrc,
  659. uint32_t blockSize,
  660. float64_t * pResult,
  661. uint32_t * pIndex);
  662. /**
  663. * @brief Maximum value of absolute values of a floating-point vector.
  664. * @param[in] pSrc points to the input buffer
  665. * @param[in] blockSize length of the input vector
  666. * @param[out] pResult maximum value returned here
  667. */
  668. void arm_absmax_no_idx_f64(
  669. const float64_t * pSrc,
  670. uint32_t blockSize,
  671. float64_t * pResult);
  672. /**
  673. @brief Maximum value of a floating-point vector.
  674. @param[in] pSrc points to the input vector
  675. @param[in] blockSize number of samples in input vector
  676. @param[out] pResult maximum value returned here
  677. @return none
  678. */
  679. void arm_max_no_idx_f32(
  680. const float32_t *pSrc,
  681. uint32_t blockSize,
  682. float32_t *pResult);
  683. /**
  684. @brief Minimum value of a floating-point vector.
  685. @param[in] pSrc points to the input vector
  686. @param[in] blockSize number of samples in input vector
  687. @param[out] pResult minimum value returned here
  688. @return none
  689. */
  690. void arm_min_no_idx_f32(
  691. const float32_t *pSrc,
  692. uint32_t blockSize,
  693. float32_t *pResult);
  694. /**
  695. @brief Maximum value of a floating-point vector.
  696. @param[in] pSrc points to the input vector
  697. @param[in] blockSize number of samples in input vector
  698. @param[out] pResult maximum value returned here
  699. @return none
  700. */
  701. void arm_max_no_idx_f64(
  702. const float64_t *pSrc,
  703. uint32_t blockSize,
  704. float64_t *pResult);
  705. /**
  706. @brief Maximum value of a q31 vector.
  707. @param[in] pSrc points to the input vector
  708. @param[in] blockSize number of samples in input vector
  709. @param[out] pResult maximum value returned here
  710. @return none
  711. */
  712. void arm_max_no_idx_q31(
  713. const q31_t *pSrc,
  714. uint32_t blockSize,
  715. q31_t *pResult);
  716. /**
  717. @brief Maximum value of a q15 vector.
  718. @param[in] pSrc points to the input vector
  719. @param[in] blockSize number of samples in input vector
  720. @param[out] pResult maximum value returned here
  721. @return none
  722. */
  723. void arm_max_no_idx_q15(
  724. const q15_t *pSrc,
  725. uint32_t blockSize,
  726. q15_t *pResult);
  727. /**
  728. @brief Maximum value of a q7 vector.
  729. @param[in] pSrc points to the input vector
  730. @param[in] blockSize number of samples in input vector
  731. @param[out] pResult maximum value returned here
  732. @return none
  733. */
  734. void arm_max_no_idx_q7(
  735. const q7_t *pSrc,
  736. uint32_t blockSize,
  737. q7_t *pResult);
  738. /**
  739. @brief Minimum value of a floating-point vector.
  740. @param[in] pSrc points to the input vector
  741. @param[in] blockSize number of samples in input vector
  742. @param[out] pResult minimum value returned here
  743. @return none
  744. */
  745. void arm_min_no_idx_f64(
  746. const float64_t *pSrc,
  747. uint32_t blockSize,
  748. float64_t *pResult);
  749. /**
  750. @brief Minimum value of a q31 vector.
  751. @param[in] pSrc points to the input vector
  752. @param[in] blockSize number of samples in input vector
  753. @param[out] pResult minimum value returned here
  754. @return none
  755. */
  756. void arm_min_no_idx_q31(
  757. const q31_t *pSrc,
  758. uint32_t blockSize,
  759. q31_t *pResult);
  760. /**
  761. @brief Minimum value of a q15 vector.
  762. @param[in] pSrc points to the input vector
  763. @param[in] blockSize number of samples in input vector
  764. @param[out] pResult minimum value returned here
  765. @return none
  766. */
  767. void arm_min_no_idx_q15(
  768. const q15_t *pSrc,
  769. uint32_t blockSize,
  770. q15_t *pResult);
  771. /**
  772. @brief Minimum value of a q7 vector.
  773. @param[in] pSrc points to the input vector
  774. @param[in] blockSize number of samples in input vector
  775. @param[out] pResult minimum value returned here
  776. @return none
  777. */
  778. void arm_min_no_idx_q7(
  779. const q7_t *pSrc,
  780. uint32_t blockSize,
  781. q7_t *pResult);
  782. /**
  783. @brief Mean square error between two Q7 vectors.
  784. @param[in] pSrcA points to the first input vector
  785. @param[in] pSrcB points to the second input vector
  786. @param[in] blockSize number of samples in input vector
  787. @param[out] pResult mean square error
  788. @return none
  789. */
  790. void arm_mse_q7(
  791. const q7_t * pSrcA,
  792. const q7_t * pSrcB,
  793. uint32_t blockSize,
  794. q7_t * pResult);
  795. /**
  796. @brief Mean square error between two Q15 vectors.
  797. @param[in] pSrcA points to the first input vector
  798. @param[in] pSrcB points to the second input vector
  799. @param[in] blockSize number of samples in input vector
  800. @param[out] pResult mean square error
  801. @return none
  802. */
  803. void arm_mse_q15(
  804. const q15_t * pSrcA,
  805. const q15_t * pSrcB,
  806. uint32_t blockSize,
  807. q15_t * pResult);
  808. /**
  809. @brief Mean square error between two Q31 vectors.
  810. @param[in] pSrcA points to the first input vector
  811. @param[in] pSrcB points to the second input vector
  812. @param[in] blockSize number of samples in input vector
  813. @param[out] pResult mean square error
  814. @return none
  815. */
  816. void arm_mse_q31(
  817. const q31_t * pSrcA,
  818. const q31_t * pSrcB,
  819. uint32_t blockSize,
  820. q31_t * pResult);
  821. /**
  822. @brief Mean square error between two single precision float vectors.
  823. @param[in] pSrcA points to the first input vector
  824. @param[in] pSrcB points to the second input vector
  825. @param[in] blockSize number of samples in input vector
  826. @param[out] pResult mean square error
  827. @return none
  828. */
  829. void arm_mse_f32(
  830. const float32_t * pSrcA,
  831. const float32_t * pSrcB,
  832. uint32_t blockSize,
  833. float32_t * pResult);
  834. /**
  835. @brief Mean square error between two double precision float vectors.
  836. @param[in] pSrcA points to the first input vector
  837. @param[in] pSrcB points to the second input vector
  838. @param[in] blockSize number of samples in input vector
  839. @param[out] pResult mean square error
  840. @return none
  841. */
  842. void arm_mse_f64(
  843. const float64_t * pSrcA,
  844. const float64_t * pSrcB,
  845. uint32_t blockSize,
  846. float64_t * pResult);
  847. #ifdef __cplusplus
  848. }
  849. #endif
  850. #endif /* ifndef _STATISTICS_FUNCTIONS_H_ */