简体   繁体   English

CMSIS DSP库中的复杂点积

[英]Complex Dot Product in CMSIS DSP LIBRARY

Recently I've been checking out the CMSIS DSP complex math functions library and I've seen something I cannot fully comprehend, thus my first post on SO. 最近我一直在检查CMSIS DSP复杂的数学函数库,我看到了一些我无法完全理解的东西,因此我在SO上的第一篇文章。

What I'm unable to grasp is how the he11 can the complex dot product function yeild a proper result? 我无法理解的是复杂的点积函数如何能够产生正确的结果? The function may be found here: Complex Dot Product 该功能可在此处找到: 复杂点产品

As far as I'm concerned the part 至于我关心的部分

for(n=0; n<numSamples; n++) {  
   realResult += pSrcA[(2*n)+0]*pSrcB[(2*n)+0] - pSrcA[(2*n)+1]*pSrcB[(2*n)+1];  
   imagResult += pSrcA[(2*n)+0]*pSrcB[(2*n)+1] + pSrcA[(2*n)+1]*pSrcB[(2*n)+0];  
}  

is A-okay, but how's that: 是的,但是怎么样:

/* CReal = A[0]* B[0] + A[2]* B[2] + A[4]* B[4] + .....+ A[numSamples-2]* B[numSamples-2] */
real_sum += (*pSrcA++) * (*pSrcB++);
/* CImag = A[1]* B[1] + A[3]* B[3] + A[5]* B[5] + .....+ A[numSamples-1]* B[numSamples-1] */
imag_sum += (*pSrcA++) * (*pSrcB++);

supposed to work, since it misses the product of real*imag parts of the samples? 应该工作,因为它错过了样品的真实*成像部分的产物?

It might - and most probably is - a really dumb question, but somehow I simply cannot see it working. 它可能 - 而且很可能是 - 一个非常愚蠢的问题,但不知怎的,我根本看不到它的工作原理。

That looks simply wrong, and the implementation doesn't match the description. 这看起来很简单,并且实现与描述不符。

Suppose we have z = x + i*y and w = u + i*v with x, y, u, v real. 假设我们有z = x + i*yw = u + i*vx, y, u, v real。 Then 然后

z*w = (x + i*y)*(u + i*v) = (x*u - y*v) + i*(x*v + y*u)

and

z*conjugate(w) = (x + i*y)*(u - i*v) = (x*u + y*v) + i*(y*u - x*v)

So with the loop 所以循环

while(blkCnt > 0u)
{
  /* CReal = A[0]* B[0] + A[2]* B[2] + A[4]* B[4] + .....+ A[numSamples-2]* B[numSamples-2] */
  real_sum += (*pSrcA++) * (*pSrcB++);
  /* CImag = A[1]* B[1] + A[3]* B[3] + A[5]* B[5] + .....+ A[numSamples-1]* B[numSamples-1] */
  imag_sum += (*pSrcA++) * (*pSrcB++);
  /* Decrement the loop counter */
  blkCnt--;
}

you will get real_sum + imag_sum = Real part of hermitian inner product finally. 你会得到real_sum + imag_sum = Real part of hermitian inner product最后real_sum + imag_sum = Real part of hermitian inner product

Neither real_sum nor imag_sum is in any simple way related to the real/imaginary part of the inner product nor the bilinear product. real_sumimag_sum都没有以任何简单的方式与内部产品的实部/虚部或双线性产品相关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM