When I ran scipy.ftpack.ft(y), one of the returned values had the following numbers:
1.54991569e+03-9.96587885e+03j
I understand that "e+03" means the third power of 10, but
-9.96587885e+03j
What are '-' and 'j' in ?
python mathematics
This is a complex number, in the form of a+bj, where j is an imaginary unit. 1.54991569e+03-9.96587885e+03j
is a complex number with a real part of 1.54991569e+03
and an empty part of -9.96587885e+03
.
The imaginary units used in high school mathematics in Japan are often written in i, but in some fields, j is used. Python is supposed to treat literal in the form of a+bj as complex numbers.
https://docs.python.org/ja/3/library/stdtypes.html#typesnumeric
If you add 'j'
or 'J'
to the numeric literal, you can give an imaginary number (a complex number with zero real parts) and add an integer or floating point number to it to obtain a complex number with real and imaginary parts.
The scipy.ftpack.ft
document also states that this function returns ndarray as a complex number element.
https://docs.scipy.org/doc/scipy/reference/generated/scipy.fftpack.fft.html
Returns z:complex ndarray
© 2024 OneMinuteCode. All rights reserved.