[Numpy-discussion] Python objects in Numpy: compatibility issues with methods and functions

2008-09-17 Thread Felix Richter
Hi all, for my calculations, I need multi-precision arithmetics. For this, I use the wonderful Python-only mpmath (http://code.google.com/p/mpmath/) and store and handle my data in Numpy arrays. I thus have Numpy arrays with dtype=object holding mpmath objects. Now, some of the array operation

Re: [Numpy-discussion] FFT usage / consistency

2008-07-30 Thread Felix Richter
Thanks for all your comments. It's definitely time to read a good book now. My original problem is a convolution of two complex functions given as samples over quite different intervals with different n. The imaginary part of one of these functions is Lorentz-shaped. I thought it might be good

Re: [Numpy-discussion] FFT usage / consistency

2008-07-29 Thread Felix Richter
> I quickly copy-pasted and ran your code; it looks to me like the results > you calculated analytically oscillate too fast to be represented > discretely. Did you try to transform different, simpler signals? (e.g. a > Gaussian?) Yes, I run into the same problem. Since the oscillation frequency

Re: [Numpy-discussion] FFT usage / consistency

2008-07-29 Thread Felix Richter
> Do your answers differ from the theory by a constant factor, or are > they completely unrelated? No, it's more complicated. Below you'll find my most recent, more stripped down code. - I don't know how to scale in a way that works for any n. - I don't know how to get the oscillations to match.

Re: [Numpy-discussion] FFT usage / consistency

2008-07-29 Thread Felix Richter
I learned a few things in the meantime: In my installation, NumPy uses fftpack_lite while SciPy uses FFTW3. There are more test cases in SciPy which all pass. So I am confirmed my problem is a pure usage problem. One thing I was confused about is the fact that even if I calculate the function o

Re: [Numpy-discussion] FFT usage / consistency

2008-07-28 Thread Felix Richter
I have to correct myself. The function test_fft1() still does not work, it just looked good in the plots, but at a closer look, Re(IFFT) is close to zero and is far from matching the exact IFT. So it seems FFT(IFFT(f)) == IFFT(FFT(f)) == 1 (if done right ;-), but I just cannot reproduce the exa

Re: [Numpy-discussion] FFT usage / consistency

2008-07-28 Thread Felix Richter
Hi all, Stefan, thank you very much for your quick answer. This was an obvious silly mistake. Now the first function does what it should. Still, me and my colleagues can't make any sense of what happens in the second example. The re-transformed function is identical to the original one, but the

[Numpy-discussion] FFT usage / consistency

2008-07-25 Thread Felix Richter
Hi all, I found myself busy today trying to understand what went wrong in my FFT code. I wrote a minimal example/testing code to check the FFT output against an analytic result and also tried to reverse the transformation to get the original function back. Most curiously, the results depend on