bug in rfft with EDP 2.7.1?

classic Classic list List threaded Threaded
2 messages Options
RJS
Reply | Threaded
Open this post in threaded view
|

bug in rfft with EDP 2.7.1?

RJS
Has anyone seen this issue with rfftn in Enthought numpy? It does a
full complex fft instead of the real fft.
I did later install the UCI 1.6.1 version of numpy
(http://www.lfd.uci.edu/~gohlke/pythonlibs/), and with them
everything seems to be working correctly.


Enthought Python Distribution -- http://www.enthought.com

Python 2.7.1 |EPD 7.0-2 (32-bit)| (r271:86832, Dec  2 2010, 10:35:02)
[MSC v.150
0 32 bit (Intel)]

In [1]: from numpy.fft import rfft, rfftn

In [2]: import numpy as np

In [3]: np.version.version
Out[3]: '1.5.1'

In [4]: # create a simple array of 2 ensembles with 2 channels and 8 samples

In [5]: ary = np.ones((2, 2, 8))

In [6]: ary
Out[6]:
array([[[ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.],
         [ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.]],

        [[ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.],
         [ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.]]])

In [7]: # test rfft on one block

In [8]: ary[0][0]
Out[8]: array([ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.])

In [10]: rfft(ary[0][0])
Out[10]: array([ 8.+0.j,  0.+0.j,  0.+0.j,  0.+0.j,  0.+0.j])

In [11]: # note: result has 5 elements; redundant elements are left out


Ray


Ray Schumacher
Programmer/Consultant
PO Box 182, Pine Valley, CA 91962
(858)248-7232
http://rjs.org/ 
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

rfftn.txt (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: bug in rfft with EDP 2.7.1?

Robert Kern
On Mon, Sep 19, 2011 at 1:01 PM, RJS <[hidden email]> wrote:
> Has anyone seen this issue with rfftn in Enthought numpy? It does a full
> complex fft instead of the real fft.
> I did later install the UCI 1.6.1 version of numpy
> (http://www.lfd.uci.edu/~gohlke/pythonlibs/), and with them everything seems
> to be working correctly.

It also works in the 1.6.1 version of numpy in EPD 7.1, at least on OS X.

[~]
|9> ary = np.ones([2,2,8])

[~]
|10> np.fft.rfftn(ary, axes=(-1,))
array([[[ 8.+0.j,  0.+0.j,  0.-0.j,  0.+0.j,  0.+0.j],
        [ 8.+0.j,  0.+0.j,  0.-0.j,  0.+0.j,  0.+0.j]],

       [[ 8.+0.j,  0.+0.j,  0.-0.j,  0.+0.j,  0.+0.j],
        [ 8.+0.j,  0.+0.j,  0.-0.j,  0.+0.j,  0.+0.j]]])

--
Robert Kern
Enthought
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev