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 #include "arm_math.h"
00025
00050 void arm_cmplx_mult_real_q31(
00051 q31_t * pSrcCmplx,
00052 q31_t * pSrcReal,
00053 q31_t * pCmplxDst,
00054 uint32_t numSamples)
00055 {
00056 q31_t in;
00057 uint32_t blkCnt;
00058 q31_t inA1, inA2, inA3, inA4;
00059 q31_t inB1, inB2;
00060 q31_t out1, out2, out3, out4;
00061
00062
00063 blkCnt = numSamples >> 2u;
00064
00065
00066
00067 while(blkCnt > 0u)
00068 {
00069
00070
00071
00072 inA1 = pSrcCmplx[0];
00073
00074 inB1 = pSrcReal[0];
00075
00076 inA2 = pSrcCmplx[1];
00077
00078
00079 out1 = ((q63_t) inA1 * inB1) >> 32;
00080 inA3 = pSrcCmplx[2];
00081 out2 = ((q63_t) inA2 * inB1) >> 32;
00082 inB2 = pSrcReal[1];
00083 inA4 = pSrcCmplx[3];
00084 out3 = ((q63_t) inA3 * inB2) >> 32;
00085 out4 = ((q63_t) inA4 * inB2) >> 32;
00086
00087
00088 #if CCS
00089
00090 out1 = __SSATA(out1, 0, 31);
00091 out2 = __SSATA(out2, 0, 31);
00092 out3 = __SSATA(out3, 0, 31);
00093 out4 = __SSATA(out4, 0, 31);
00094
00095 #else
00096
00097 out1 = __SSAT(out1, 31);
00098 out2 = __SSAT(out2, 31);
00099 out3 = __SSAT(out3, 31);
00100 out4 = __SSAT(out4, 31);
00101
00102 #endif // #ifdef CCS
00103
00104 inA1 = pSrcCmplx[4];
00105
00106
00107
00108 out1 = out1 << 1;
00109 inB1 = pSrcReal[2];
00110 out2 = out2 << 1;
00111 pCmplxDst[0] = out1;
00112 out3 = out3 << 1;
00113 pCmplxDst[1] = out2;
00114 out4 = out4 << 1;
00115
00116 pCmplxDst[2] = out3;
00117 pCmplxDst[3] = out4;
00118
00119 inA2 = pSrcCmplx[5];
00120 out1 = ((q63_t) inA1 * inB1) >> 32;
00121 inA3 = pSrcCmplx[6];
00122 out2 = ((q63_t) inA2 * inB1) >> 32;
00123 inB2 = pSrcReal[3];
00124 inA4 = pSrcCmplx[7];
00125
00126 out3 = ((q63_t) inA3 * inB2) >> 32;
00127 out4 = ((q63_t) inA4 * inB2) >> 32;
00128
00129 #if CCS
00130
00131 out1 = __SSATA(out1, 0, 31);
00132 out2 = __SSATA(out2, 0, 31);
00133 out3 = __SSATA(out3, 0, 31);
00134 out4 = __SSATA(out4, 0, 31);
00135
00136 #else
00137
00138 out1 = __SSAT(out1, 31);
00139 out2 = __SSAT(out2, 31);
00140 out3 = __SSAT(out3, 31);
00141 out4 = __SSAT(out4, 31);
00142
00143 #endif // #ifdef CCS
00144
00145 out1 = out1 << 1;
00146 out2 = out2 << 1;
00147 pCmplxDst[4] = out1;
00148 out3 = out3 << 1;
00149 pCmplxDst[5] = out2;
00150 out4 = out4 << 1;
00151
00152 pCmplxDst[6] = out3;
00153 pSrcCmplx += 8u;
00154 pCmplxDst[7] = out4;
00155
00156 pSrcReal += 4u;
00157 pCmplxDst += 8u;
00158
00159
00160 blkCnt--;
00161 }
00162
00163
00164
00165 blkCnt = numSamples % 0x4u;
00166
00167 while(blkCnt > 0u)
00168 {
00169
00170
00171 in = *pSrcReal++;
00172
00173 *pCmplxDst++ = (q31_t) clip_q63_to_q31(((q63_t) * pSrcCmplx++ * in) >> 31);
00174 *pCmplxDst++ = (q31_t) clip_q63_to_q31(((q63_t) * pSrcCmplx++ * in) >> 31);
00175
00176
00177 blkCnt--;
00178 }
00179 }
00180