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

Home » Public Forums » archive » Imposing inverse fft to be real
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
Imposing inverse fft to be real [message #82875] Mon, 21 January 2013 15:41
collinritzinger is currently offline  collinritzinger
Messages: 3
Registered: January 2010
Junior Member
The issue: I am creating complex arrays with the same amplitude but randomizing the phases, then using inverse FFT.

This is easy, however I would like to impose that they are conjugate symmetric, i.e. Hermitian. The original array ("dn" and its fft "org" as defined below) are real valued and hence will return mostly (i.e. withing floating point precision) real valued FFT results. However, the randomized phase array ("rr", as defined below) should have the conjugate symmetry imposed on it in order to insure that the resulting inverse FFT will have negligible imaginary components. This seems like it would be straight forward....

dn=readfits('array.fits.gz')

org=fft(dn,/double,/center) ; take the fft, center frequencies around origin

imbx=imaginary(org)
rebx=real_part(org)

phi=atan(imbx,rebx,/phase)
phaserand=dblarr(512,512,512)
amp=abs(org)

i_index=phi(sort(randomu(seed,[512,512,512]))) ; sorted random phases....
phaserand[*,*,*]=i_index ; sorted randomized phases
rr=complex(amp*cos(phaserand),amp*sin(phaserand),/double)

for i=0,255 do begin ;impose conjugate symmetry for real result
for j=0,255 do begin
for k=0,255 do begin

rr[511-i,511-j,511-k]=conj(rr[i,j,k])

endfor
endfor
endfor

inverse_rr=fft(rr,/inverse,/double,/center)

I've tried this using the center option, shifting the arrays...etc etc. But no matter what I try, the inverse of rr has non-negligible imaginary values :(

Any ideas on this? Thanks! :)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Imposing inverse fft to be real
Next Topic: Re: LSODE status=-1

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

Current Time: Wed Oct 08 13:51:55 PDT 2025

Total time taken to generate the page: 0.00704 seconds