Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "arm_math.h"
00028
00051 void arm_cmplx_mult_cmplx_q15(
00052 q15_t * pSrcA,
00053 q15_t * pSrcB,
00054 q15_t * pDst,
00055 uint32_t numSamples)
00056 {
00057 q15_t a, b, c, d;
00058 uint32_t blkCnt;
00059
00060
00061 blkCnt = numSamples >> 2u;
00062
00063
00064
00065 while(blkCnt > 0u)
00066 {
00067
00068
00069 a = *pSrcA++;
00070 b = *pSrcA++;
00071 c = *pSrcB++;
00072 d = *pSrcB++;
00073
00074
00075 *pDst++ =
00076 (q15_t) (q31_t) (((q31_t) a * c) >> 17) - (((q31_t) b * d) >> 17);
00077
00078 *pDst++ =
00079 (q15_t) (q31_t) (((q31_t) a * d) >> 17) + (((q31_t) b * c) >> 17);
00080
00081 a = *pSrcA++;
00082 b = *pSrcA++;
00083 c = *pSrcB++;
00084 d = *pSrcB++;
00085
00086
00087 *pDst++ =
00088 (q15_t) (q31_t) (((q31_t) a * c) >> 17) - (((q31_t) b * d) >> 17);
00089
00090 *pDst++ =
00091 (q15_t) (q31_t) (((q31_t) a * d) >> 17) + (((q31_t) b * c) >> 17);
00092
00093 a = *pSrcA++;
00094 b = *pSrcA++;
00095 c = *pSrcB++;
00096 d = *pSrcB++;
00097
00098
00099 *pDst++ =
00100 (q15_t) (q31_t) (((q31_t) a * c) >> 17) - (((q31_t) b * d) >> 17);
00101
00102 *pDst++ =
00103 (q15_t) (q31_t) (((q31_t) a * d) >> 17) + (((q31_t) b * c) >> 17);
00104
00105 a = *pSrcA++;
00106 b = *pSrcA++;
00107 c = *pSrcB++;
00108 d = *pSrcB++;
00109
00110
00111 *pDst++ =
00112 (q15_t) (q31_t) (((q31_t) a * c) >> 17) - (((q31_t) b * d) >> 17);
00113
00114 *pDst++ =
00115 (q15_t) (q31_t) (((q31_t) a * d) >> 17) + (((q31_t) b * c) >> 17);
00116
00117
00118 blkCnt--;
00119 }
00120
00121
00122
00123 blkCnt = numSamples % 0x4u;
00124
00125 while(blkCnt > 0u)
00126 {
00127
00128
00129 a = *pSrcA++;
00130 b = *pSrcA++;
00131 c = *pSrcB++;
00132 d = *pSrcB++;
00133
00134
00135 *pDst++ =
00136 (q15_t) (q31_t) (((q31_t) a * c) >> 17) - (((q31_t) b * d) >> 17);
00137
00138 *pDst++ =
00139 (q15_t) (q31_t) (((q31_t) a * d) >> 17) + (((q31_t) b * c) >> 17);
00140
00141
00142 blkCnt--;
00143 }
00144 }
00145