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
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
> 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
> 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.
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
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
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
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