bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gsl] Discrete Hankel Transform - unexpected behaviour


From: Luca Fascione
Subject: Re: [Bug-gsl] Discrete Hankel Transform - unexpected behaviour
Date: Fri, 22 Aug 2008 10:54:31 +1200
User-agent: Thunderbird 2.0.0.14 (X11/20080421)

Brian,
thanks for your reply.
Essentially my findings are that there is a normalization factor in the dht code:

gsl-1.11/dht/dht.c:220: f_out[m] = sum * 2.0 * r*r;

where r = t->xmax / t->j[t->size+1]; (same file, line 193)

When this line 220 is changed to be

f_out[m] = sum * 2.0 / t->j[t->size+1];

(which is essentially loosing the square and the dependency on xmax), the transform of the transform equals the input (up the the precision of the representation) for all xmax and sampleCount values.

I am a mathematician, but I was not trained in signal processing nor computational analysis. It seems to me there could be a vague relationship between this finding and the use of normalizing the DFT with 1 / sqrt(nSamples) both ways, instead of 1/nSamples only on the way back. This would indeed account for my changing the r*r into r, but there is still a multiplication by xmax that I think is unaccounted for.

Any help or further pointers you can spare would be highly appreciated (oh, I have Jungman's notes from 1999, but I have not quite had the time to read and understand the whole derivation of theorem 11.12, which seems to be the basis for this particular algorithm)

Thank you very much for your time
Luca

Brian Gough wrote:
At Wed, 20 Aug 2008 16:15:55 +1200,
Luca Fascione wrote:
I'm using your dht code to transform some data I need to convolve.
In trying to understand how many samples of my function I needed I conducted the following experiment: - I generated a dht class with fixed maximum value and various sample counts (128, 256, 512, 1024, 2048)
 - I transformed and plotted the various datasets

I was very surprised when I realized the transformed dataset doesn't seem to converge to a defined target value,
but keeps lowering in magnitude instead.

I'm not familiar with the Hankel transform myself, but have you
checked that the values agree with the definition and that the inverse
returns the original function (within a constant factor)?  I imagine
that the normalisation factor varies with the number of sample points.


--
Luca Fascione
Software Engineer - Weta Digital
Phone:  +64  4 380 9864 (x4744)
Mobile: +64 21 0764 862



reply via email to

[Prev in Thread] Current Thread [Next in Thread]