[Numpy-discussion] 2D Fourier Transform with 1D functions

Goo Creations goocreations at gmail.com
Tue May 24 09:53:34 EDT 2011


Thank you very much Stéfan!!



2011/5/24 Stéfan van der Walt <stefan at sun.ac.za>

> Hi Chris
>
> On Tue, May 24, 2011 at 9:29 AM, Goo Creations <goocreations at gmail.com>
> wrote:
> > At this point I'm stuck, since I'm not sure how to do the row based
> > transform on ownRes.
> > Is there anyone out there who knows how to do this?
>
> NumPy's FFT supports an "axis" argument, so you can do
>
> In [29]: own = np.array([[1+0j, 2+0j], [3+0j, 4+0j]])
>
> In [30]: fft_step1 = np.fft.fft(own, axis=0)
>
> In [31]: fft_step2 = np.fft.fft(fft_step1, axis=1)
>
> In [32]: fft_step2
> Out[32]:
> array([[ 10.+0.j,  -2.+0.j],
>       [ -4.+0.j,   0.+0.j]])
>
> In [33]: np.fft.fft2(own)
> Out[33]:
> array([[ 10.+0.j,  -2.+0.j],
>       [ -4.+0.j,   0.+0.j]])
>
> Cheers
> Stéfan
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110524/84f3fd67/attachment.html>


More information about the NumPy-Discussion mailing list