I have a list, when I transform it by np.fft.rfft and bring it back by np.fft.irfft it does not work for ex(2) but work with ex(1). What should I do to make it work with ex(2)?
ex(1):
import NumPy as np
z=[[1,2,34,45],[1,2,5,6],[7,8,9,10]]
x1=np.fft.rfft(z)
x2=np.fft.irfft(x1)
print(x2)
print(z)
out:
[[ 1. 2. 34. 45.]
[ 1. 2. 5. 6.]
[ 7. 8. 9. 10.]]
[[1, 2, 34, 45], [1, 2, 5, 6], [7, 8, 9, 10]]
ex(2):
import NumPy as np
z1=[[5,8,6],[45,6,3],[847,5847,6]]
x3=np.fft.rfft(z1)
x4=np.fft.irfft(x3)
print(x4)
print(z1)
out:
[[ 8.5 10.5 ]
[ 47.25 6.75]
[2310.25 4389.75]]
[[5, 8, 6], [45, 6, 3], [847, 5847, 6]]
Please help.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…