comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: problems with FFT cross spectra and other floating point operations
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: problems with FFT cross spectra and other floating point operations [message #638] Thu, 17 December 1992 09:46
hatay is currently offline  hatay
Messages: 11
Registered: June 1992
Junior Member
In article <1992Dec17.030946.4899@news.media.mit.edu> steve@media.mit.edu (Steve Mann) writes:
.
.
.
>
> I also noticed that when I subtract the DC from an image, and then do
> an FFT, the element af(0,0) is not always zero. In fact, as the image
> gets bigger, I get values further and further from zero. For a 256 by 265
> image, the DC spike in the Fourier domain is so high that I can't see
> anything else in shade_surf,abs(af) or tvscl,abs(af).
>
> I wrote this little script which shows the accumulation of excess DC:
> ------------------------------------------------------------ --------------
> ; when I set N=91 or less, I get zero as expected.
> ; when I set N=92 or more, I get a non-zero DC value in fft.
>
> N = 100; size of square array
> q=findgen(N)#findgen(N); create some arbitrary square array
> ;Subtract the DC component
> w=float(q)-norm(q,/one)/float((size(q))(1))/float((size(q))( 2))
> wf = fft(w,1); Fourier transform of w
> print,wf(0,0); The DC component should be zero now.
> ;I dont know why it is not zero.


I was under the impression that the FFT routines in IDL and WAVE
are basically one-dimensional-complex FFT routines. Please, forward me
info if this is wrong.

I have played with one-d arrays of size 100-500 on IDL. here is the script:

IdlMaster> N=100
IdlMaster> q = findgen(N)
IdlMaster> w = q-total(q)/float(N)
IdlMaster> wf=fft(w,1)
IdlMaster> print,wf(0,0)
( 0.00000, 0.00000)
IdlMaster> print,total(w),total(q)
0.00000 4950.00

IdlMaster> N=500
IdlMaster> q = findgen(N)
IdlMaster> w = q-total(q)/float(N)
IdlMaster> wf=fft(w,1)
IdlMaster> print,wf(0,0)
( 0.00000, 0.00000)
IdlMaster> print,total(w),total(q)
0.00000 124750.

--
Ferhat F. Hatay || Disclamer: |||||||||||||||||
Aerospace Engineering Sciences || I speak for myself unless ||
University of Colorado, Boulder || otherwise indicated. ||
e-mail: hatay@spot.colorado.edu |||||||||||||||||||||||||||||||
Re: problems with FFT cross spectra and other floating point operations [message #639 is a reply to message #638] Thu, 17 December 1992 09:33 Go to previous message
hatay is currently offline  hatay
Messages: 11
Registered: June 1992
Junior Member
In article <1992Dec17.030946.4899@news.media.mit.edu> steve@media.mit.edu (Steve Mann) writes:
.
.
.
>
> I also noticed that when I subtract the DC from an image, and then do
> an FFT, the element af(0,0) is not always zero. In fact, as the image
> gets bigger, I get values further and further from zero. For a 256 by 265
> image, the DC spike in the Fourier domain is so high that I can't see
> anything else in shade_surf,abs(af) or tvscl,abs(af).
>
> I wrote this little script which shows the accumulation of excess DC:
> ------------------------------------------------------------ --------------
> ; when I set N=91 or less, I get zero as expected.
> ; when I set N=92 or more, I get a non-zero DC value in fft.
>
> N = 100; size of square array
> q=findgen(N)#findgen(N); create some arbitrary square array
> ;Subtract the DC component
> w=float(q)-norm(q,/one)/float((size(q))(1))/float((size(q))( 2))
> wf = fft(w,1); Fourier transform of w
> print,wf(0,0); The DC component should be zero now.
> ;I dont know why it is not zero.


I was under the impression that the FFT routines in IDL and WAVE
are basically one-dimensional-complex FFT routines. Please, forward me
info if this is wrong.

I have played with one-d arrays of size 100-500 on IDL. here is the script:

IdlMaster> N=100
IdlMaster> q = findgen(N)
IdlMaster> w = q-total(q)/float(N)
IdlMaster> wf=fft(w,1)
IdlMaster> print,wf(0,0)
( 0.00000, 0.00000)
IdlMaster> print,total(w),total(q)
0.00000 4950.00

IdlMaster> N=500
IdlMaster> q = findgen(N)
IdlMaster> w = q-total(q)/float(N)
IdlMaster> wf=fft(w,1)
IdlMaster> print,wf(0,0)
( 0.00000, 0.00000)
IdlMaster> print,total(w),total(q)
0.00000 124750.

--
Ferhat F. Hatay || Disclamer: |||||||||||||||||
Aerospace Engineering Sciences || I speak for myself unless ||
University of Colorado, Boulder || otherwise indicated. ||
e-mail: hatay@spot.colorado.edu |||||||||||||||||||||||||||||||
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 3D-text on PS
Next Topic: Re: Postscript dump to a Laserwriter

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:23:30 PDT 2025

Total time taken to generate the page: 0.00623 seconds