Home »
Public Forums »
archive »
NUFT code... not working
NUFT code... not working [message #35628] |
Sun, 29 June 2003 08:00 |
the_cacc
Messages: 104 Registered: October 2001
|
Senior Member |
|
|
Yo,
I've been trying to implement the NUFT as discussed previously here
( http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&a mp;threadm=4a097d6a.0304062309.49c72f6d%40posting.google.com &rnum=3&prev=/groups%3Fsourceid%3Dnavclient%26q%3Dfo urier%2Btransform%2Bnonuniform)
I've got some code but it don't seem to work! It's only short & I was
hoping someone might be able to look & see what's going wrong. I've
listed it below.
Thanks,
Ciao.
;--------------------------------------------------
PRO sim_nuft
; Program to do non-uniform FT.
;
;-
; Resolution.
p=64
; Create object.
x = FLTARR(p)
x[1*p/10:9*p/10] = 1.0
x[4*p/10:6*p/10] = 0.5
; Indices for where we have x values.
ix = FINDGEN(p)
; Indices for where we want k values.
ik = ix + 0.5
; Resample using FFT & interpolation.
k = FFT(x)
k_interp = INTERPOLATE(k,ik,CUBIC=-.5)
; Resample directly.
k_direct = COMPLEXARR(p)
j = COMPLEX(0,-2 * !PI)
FOR i = 0,p-1 DO BEGIN
G = ik[i] * ix / p
k_direct[i] = TOTAL(x * EXP(j * G))
ENDFOR
;
; Problem:
; k_interp is the interpolated k-values
; k_direct is the directly nuft'd values
;
; They should be the same, or at least similar
; but they are very different.
;
stop
END
;--------------------------------------------------
|
|
|
Current Time: Wed Oct 08 13:05:26 PDT 2025
Total time taken to generate the page: 0.00470 seconds