00001 /* ---------------------------------------------------------------------- 00002 * Copyright (C) 2011 ARM Limited. All rights reserved. 00003 * 00004 * $Date: 15. December 2011 00005 * $Revision: V2.0.0 00006 * 00007 * Project: Cortex-R DSP Library 00008 * Title: arm_cmplx_conj_f32.c 00009 * 00010 * Description: Floating-point complex conjugate. 00011 * 00012 * Target Processor: Cortex-R4/R5 00013 * 00014 * Version 1.0.0 2011/03/08 00015 * Alpha release. 00016 * 00017 * Version 1.0.1 2011/09/30 00018 * Beta release. 00019 * 00020 * Version 2.0.0 2011/12/15 00021 * Final release. 00022 * 00023 * ---------------------------------------------------------------------------- */ 00024 #include "arm_math.h" 00025 00066 void arm_cmplx_conj_f32( 00067 float32_t * pSrc, 00068 float32_t * pDst, 00069 uint32_t numSamples) 00070 { 00071 uint32_t blkCnt; /* loop counter */ 00072 float32_t inR1, inR2, inR3, inR4; 00073 float32_t inI1, inI2, inI3, inI4; 00074 00075 /*loop Unrolling */ 00076 blkCnt = numSamples >> 2u; 00077 00078 /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 00079 ** a second loop below computes the remaining 1 to 3 samples. */ 00080 while(blkCnt > 0u) 00081 { 00082 /* C[0]+jC[1] = A[0]+ j (-1) A[1] */ 00083 /* Calculate Complex Conjugate and then store the results in the destination buffer. */ 00084 /* read real input samples */ 00085 inR1 = pSrc[0]; 00086 /* store real samples to destination */ 00087 pDst[0] = inR1; 00088 inR2 = pSrc[2]; 00089 pDst[2] = inR2; 00090 inR3 = pSrc[4]; 00091 pDst[4] = inR3; 00092 inR4 = pSrc[6]; 00093 pDst[6] = inR4; 00094 00095 /* read imaginary input samples */ 00096 inI1 = pSrc[1]; 00097 inI2 = pSrc[3]; 00098 00099 /* conjugate input */ 00100 inI1 = -inI1; 00101 00102 /* read imaginary input samples */ 00103 inI3 = pSrc[5]; 00104 00105 /* conjugate input */ 00106 inI2 = -inI2; 00107 00108 /* read imaginary input samples */ 00109 inI4 = pSrc[7]; 00110 00111 /* conjugate input */ 00112 inI3 = -inI3; 00113 00114 /* store imaginary samples to destination */ 00115 pDst[1] = inI1; 00116 pDst[3] = inI2; 00117 00118 /* conjugate input */ 00119 inI4 = -inI4; 00120 00121 /* store imaginary samples to destination */ 00122 pDst[5] = inI3; 00123 00124 /* increment source pointer by 8 to process next sampels */ 00125 pSrc += 8u; 00126 00127 /* store imaginary sample to destination */ 00128 pDst[7] = inI4; 00129 00130 /* increment destination pointer by 8 to store next samples */ 00131 pDst += 8u; 00132 00133 /* Decrement the loop counter */ 00134 blkCnt--; 00135 } 00136 00137 /* If the numSamples is not a multiple of 4, compute any remaining output samples here. 00138 ** No loop unrolling is used. */ 00139 blkCnt = numSamples % 0x4u; 00140 00141 while(blkCnt > 0u) 00142 { 00143 /* C[0]+jC[1] = A[0]+ j (-1) A[1] */ 00144 /* Calculate Complex Conjugate and then store the results in the destination buffer. */ 00145 *pDst++ = *pSrc++; 00146 *pDst++ = -*pSrc++; 00147 00148 /* Decrement the loop counter */ 00149 blkCnt--; 00150 } 00151 } 00152