[Numpy-discussion] numpy.fft.irfftn fails apparently unexpectedly

Henry Gomersall heng@cantab....
Tue Feb 7 03:19:18 CST 2012


On Tue, 2012-02-07 at 09:15 +0000, Henry Gomersall wrote:
> 
> On Tue, 2012-02-07 at 01:04 +0100, Torgil Svensson wrote:
> > irfftn is an optimization for real input and does not take complex
> > input. You have to use numpy.fft.ifftn instead:
> > 
> hmmm, that doesn't sound right to me (though there could be some non
> obvious DFT magic that I'm missing). Indeed,
> 
> np.irfftn(np.rfftn(a)) ~= a  # The interim array is complex 

Actually, further to this, the issue arose when I was testing some fftw
wrappers I wrote against the output from numpy.fft. The outputs match
very closely (as expected!) except for that case when numpy.fft raises
an exception, so numpy.fft is generally behaving as I expected.

Cheers,
Henry



More information about the NumPy-Discussion mailing list