Wenn die nacheilende Dimension eines Arrays x
ungerade ist, hat die Transformation y = irfftn(rfftn(x))
nicht die gleiche Form wie das Eingabearray. Ist das Absicht? Und wenn ja, was ist die Motivation? Beispielcode ist unten.Warum ist irfftn (rfftn (x)) nicht gleich x?
import numpy as np
shapes = [(10, 10), (11, 11), (10, 11), (11, 10)]
for shape in shapes:
x = np.random.uniform(0, 1, shape)
y = np.fft.irfftn(np.fft.rfftn(x))
if x.shape != y.shape:
print("expected shape %s but got %s" % (shape, y.shape))
# Output
# expected shape (11, 11) but got (11, 10)
# expected shape (10, 11) but got (10, 10)