[SciPy-user] sine transformation weirdness

Lubos Vrbka lists@vrbka....
Thu Jul 31 09:43:22 CDT 2008

hi guys,

while using the sine transformation from sandbox
i encountered some confusion with respect to the constants involved in 
the transformation process. to test it, i tried to do discrete sine 
transformation of
f(r) = exp(-r)
analytically, the result is
f(k) = sqrt(2/pi) * k/(1+k^2)

for the discrete transformation i used dr=0.1, 1000 points, dk = 
pi/(npoints*dr) since the dst uses effectively the double number of 
sampling points. you can see the result in the attached file (hopefully 
it gets it through). the blue line is the analytical result (without the 
sqrt(2/pi) factor), green is the numerical discrete sine transform and 
the red line is f(k,numerical)/f(k,analytical) ratio. in case the figure 
doesn't make it through, the red line looks like one half of reverted 
parabola. for r=0, its value is ~10. it reaches 0 at the distance 
corresponding to the last sampling point.

apparently, there is some non-constant factor present here - i just 
don't know what factor it might be. it has to come from the FFT used 
inside the DST routine... i'd be very glad for any hint in this respect.

thanks in advance! with best regards,

Lubos _@_"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fst_exp_r.png
Type: image/png
Size: 14188 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20080731/6eafc5e1/attachment.png 

More information about the SciPy-user mailing list