This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Complex numbers in F28069

I just bought the Piccolo controlSTICK, and this is probably a very silly question, but I'll ask it anyhow: How do I define 32 bit floating complex numbers? I'm implementing the Goertzel algorithm, and am in the need for complex valued coefficients.

Thanks!

  • c_ 64 said:

    I just bought the Piccolo controlSTICK, and this is probably a very silly question, but I'll ask it anyhow: How do I define 32 bit floating complex numbers? I'm implementing the Goertzel algorithm, and am in the need for complex valued coefficients.

    Thanks!

    The c2000 compiler does not have a native complex number type.  You could typedef this yourself as two floating point numbers.   I've moved this to the compiler forum in case the experts here have some other suggestions.

    -Lori

  • For this algorithm you may also just assume the data is in a particular format/order.  For example if you have an array they may be in real, imaginary, real, imaginary.... order or all the reals may be first and all the imaginary may be in the 2nd half of the array.  This is how we coded up the complex FFT for the FPU.

    Regards

    Lori

  • Hi,

    Thanks for the reply. No wonder that I didn't figure out how to define complex numbers ; ) I guess until new information comes along, I'll define the real and imaginary parts separate (coming from a Matlab environment, I'm used to not have to think about most things ; ) )