配列x
の末尾のディメンションが奇数の場合、変換y = irfftn(rfftn(x))
は入力配列と同じ形状ではありません。これは設計によるものですか?そしてもしそうなら、動機は何ですか?コードの例を以下に示します。あなたは二番目のパラメータを渡す必要がirfftn(rfftn(x))が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)