2

Is there a way to compute for the complex conjugate, given an array with complex elements?

I have an array consisting of imaginary elements using fast Fourier transform (fft.fft) and would like to return a list with the complex conjugate of each element.

I was thinking of extracting the imaginary bits by using nparray.imag, but it creates a list without "j" to denote imaginary.

Any help will be appreciated.

  • Is there no `conjugate()` method as there is for `complex`? – Ignacio Vazquez-Abrams Nov 10 '17 at 17:38
  • There is. `np.conjugate(a)` where `a` is an array does work. – Pierre de Buyl Nov 10 '17 at 17:39
  • How did you get stuck? A simple browser search on "numpy complex conjugate" brought several direct hits on the first page. Please read and follow the posting guidelines in the help documentation. [on topic](http://stackoverflow.com/help/on-topic) and [how to ask](http://stackoverflow.com/help/how-to-ask) apply here. – Prune Nov 10 '17 at 17:54

1 Answers1

1

If you have a numpy array of complex numbers, arr, you can use:

arr.conj()

to create an array consisting of the conjugates of arr. You can also use arr.conjugate(), which is a synonym.

Tom Karzes
  • 22,815
  • 2
  • 22
  • 41