1 /* ----------------------------------------------------------------------
2 * Copyright (C) 2010 ARM Limited. All rights reserved.
7 * Project: CMSIS DSP Library
8 * Title: arm_cmplx_conj_f32.c
10 * Description: Floating-point complex conjugate.
12 * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
14 * Version 1.0.10 2011/7/15
15 * Big Endian support added and Merged M0 and M3/M4 Source code.
17 * Version 1.0.3 2010/11/29
18 * Re-organized the CMSIS folders and updated documentation.
20 * Version 1.0.2 2010/11/11
21 * Documentation updated.
23 * Version 1.0.1 2010/10/05
24 * Production release and review comments incorporated.
26 * Version 1.0.0 2010/09/20
27 * Production release and review comments incorporated.
28 * ---------------------------------------------------------------------------- */
33 * @ingroup groupCmplxMath
37 * @defgroup cmplx_conj Complex Conjugate
39 * Conjugates the elements of a complex data vector.
41 * The <code>pSrc</code> points to the source data and
42 * <code>pDst</code> points to the where the result should be written.
43 * <code>numSamples</code> specifies the number of complex samples
44 * and the data in each array is stored in an interleaved fashion
45 * (real, imag, real, imag, ...).
46 * Each array has a total of <code>2*numSamples</code> values.
47 * The underlying algorithm is used:
50 * for(n=0; n<numSamples; n++) {
51 * pDst[(2*n)+0)] = pSrc[(2*n)+0]; // real part
52 * pDst[(2*n)+1)] = -pSrc[(2*n)+1]; // imag part
56 * There are separate functions for floating-point, Q15, and Q31 data types.
60 * @addtogroup cmplx_conj
65 * @brief Floating-point complex conjugate.
66 * @param *pSrc points to the input vector
67 * @param *pDst points to the output vector
68 * @param numSamples number of complex samples in each vector
72 void arm_cmplx_conj_f32(
80 /* Run the below code for Cortex-M4 and Cortex-M3 */
81 uint32_t blkCnt; /* loop counter */
84 blkCnt = numSamples >> 2u;
86 /* First part of the processing with loop unrolling. Compute 4 outputs at a time.
87 ** a second loop below computes the remaining 1 to 3 samples. */
90 /* C[0]+jC[1] = A[0]+ j (-1) A[1] */
91 /* Calculate Complex Conjugate and then store the results in the destination buffer. */
101 /* Decrement the loop counter */
105 /* If the numSamples is not a multiple of 4, compute any remaining output samples here.
106 ** No loop unrolling is used. */
107 blkCnt = numSamples % 0x4u;
111 /* C[0]+jC[1] = A[0]+ j (-1) A[1] */
112 /* Calculate Complex Conjugate and then store the results in the destination buffer. */
116 /* Decrement the loop counter */
122 /* Run the below code for Cortex-M0 */
124 while(numSamples > 0u)
126 /* realOut + j (imagOut) = realIn + j (-1) imagIn */
127 /* Calculate Complex Conjugate and then store the results in the destination buffer. */
131 /* Decrement the loop counter */
135 #endif /* #ifndef ARM_MATH_CM0 */
140 * @} end of cmplx_conj group