Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Hi all, Having read through all of the FFT posts that google groups keeps, I am no closer to understanding why I am unable to transform a spectrum into an interferogram using IDL. All of the data files, procedures, and pictures of this are at http://tulip.atm.ox.ac.uk/~rhskelto/fft-help/ Given two files: 1) 'spec.dat' contains 512 points of complex spectral data 2) 'igm.dat' contains 512 points of complex interferogram data that was derived from 'spec.dat' using a prime factor FFT written in C. This is the correct interferogram as far as I am concerned. The plot Read in the data: IDL> spec = dcomplexarr(512) IDL> read_cmplx, 'spec.dat', spec IDL> igm = dcomplexarr(512) IDL> read_cmplx, 'igm.dat', igm Plot the expected result: IDL> plot, igm IDL> write_jpeg,'igm.jpg',tvrd() Do the Fourier Transform in IDL (based on Paul van Delst's examples): IDL> spec2 = temporary( [ spec, reverse( spec[ 1: n_elements(spec) - 2 ] ) ] ) IDL> idl_igm = fft(temporary(spec2), /double, /inverse) IDL> idl_igm = shift(idl_igm, -1 * (n_elements(spec)-1)) Plot the IDL result: IDL> plot, idl_igm IDL> write_jpeg, 'idl_igm.jpg', tvrd() The result 'idl_igm' contains twice the number of points (minus 2) because of the required reflection about the Nyquist frequency. Moreover, the result appears to be modulated (almost like a frequency chirp)? I recall having a similar problem with a 2pi phase-wrapping in MathCad a number of years ago that gave similar results but I cannot remember how to fix it. I also cannot seem to reproduce the AIRS interferograms shown on Paul's site... My question is, how do I get the desired result (i.e. 'igm.jpg') in IDL? Cheers, Randall IDL Version 5.3, Linux RH 7.1
Randall Skelton wrote: > > To be perfectly honest, I'm not exactly sure why this works (yet). If > anyone has any insight, I'd love to hear it! Otherwise, I'm off to the > engineering library... Bracewell's book is an oldie but a goodie. So is Bell's Introductory Fourier Transform Spectroscopy. paulv -- Paul van Delst Religious and cultural CIMSS @ NOAA/NCEP purity is a fundamentalist Ph: (301)763-8000 x7274 fantasy Fax:(301)763-8545 V.S.Naipaul
Randall Skelton wrote: > Hi all, > > Having read through all of the FFT posts that google groups keeps, I am no > closer to understanding why I am unable to transform a spectrum into an > interferogram using IDL. All of the data files, procedures, and pictures > of this are at http://tulip.atm.ox.ac.uk/~rhskelto/fft-help/ > > Given two files: > > 1) 'spec.dat' contains 512 points of complex spectral data > > 2) 'igm.dat' contains 512 points of complex interferogram data that was > derived from 'spec.dat' using a prime factor FFT written in C. This is > the correct interferogram as far as I am concerned. The plot complex-valued interferrogram? hmmmmm to shed a little light on it [1], in interferometry, the interferrogram is the autocorrelation function of the electric field vector. The power spectrum is the fft of the autocorrelation function. (this is a well known theorem, and if I only had a brain, I'd remember the name of it) Note the real value-ed-ness of "autocorrelation" and "power". The interferrogram is an even function, the power spectrum is real-valued. Of course, you can certainly have a spectrum that corresponds to a time series, But that is just a fourier transform pair, nothing tricky there. Cheers, bob [1] chortle chortle, i slay myself There was a good book that I used to use. I don't think this is it: Author Steel, W. H. (William Howard), 1920- Title Interferometry W.H. Steel Publisher Cambridge [Cambridgeshire] ; New York : Cambridge University Press, 1983. Edition 2nd ed and of course I insist you read Brigham's fft books if you haven't already.
Robert Stockwell wrote: > > Randall Skelton wrote: > >> Hi all, >> >> Having read through all of the FFT posts that google groups keeps, I am no >> closer to understanding why I am unable to transform a spectrum into an >> interferogram using IDL. All of the data files, procedures, and pictures >> of this are at http://tulip.atm.ox.ac.uk/~rhskelto/fft-help/ >> >> Given two files: >> >> 1) 'spec.dat' contains 512 points of complex spectral data >> >> 2) 'igm.dat' contains 512 points of complex interferogram data that was >> derived from 'spec.dat' using a prime factor FFT written in C. This is >> the correct interferogram as far as I am concerned. The plot > > complex-valued interferrogram? > > hmmmmm > > to shed a little light on it [1], in interferometry, the interferrogram is > the autocorrelation function of the electric field vector. > The power spectrum is the fft of the autocorrelation function. > (this is a well known theorem, and if I only had a brain, I'd remember > the name of it) > Note the real value-ed-ness of "autocorrelation" and "power". > The interferrogram is an even function, the power spectrum is real-valued. But one doesn't always want the power spectrum. Usually (in my field at least) one wants the complex valued spectrum where the imaginary component is known and happily zero. (Don't know if Randall wants that tho') paulv -- Paul van Delst Religious and cultural CIMSS @ NOAA/NCEP purity is a fundamentalist Ph: (301)763-8000 x7274 fantasy Fax:(301)763-8545 V.S.Naipaul
Paul van Delst wrote: > But one doesn't always want the power spectrum. Usually (in my field at least) one wants the > complex valued spectrum where the imaginary component is known and happily zero. (Don't know if > Randall wants that tho') > paulv isn't that the same thing? ( real eq complex with imag=0) If the interferrogram is indeed the autocorrelation function, then the power spectrum is all you have, you cannot deduce any phase info. Having said that, it is conceivable that one can create a complex interferrogram (for instance, combining two different channels etc), but in the "usual" (i.e. that I am familiar with), an interferrogram is an scalar autocorrelation function. Cheers, bob
Robert Stockwell wrote: > > Paul van Delst wrote: > >> But one doesn't always want the power spectrum. Usually (in my field at least) one wants the >> complex valued spectrum where the imaginary component is known and happily zero. (Don't know if >> Randall wants that tho') > >> paulv > > isn't that the same thing? ( real eq complex with imag=0) > If the interferrogram is indeed the autocorrelation function, > then the power spectrum is all you have, you cannot deduce > any phase info. First off, I think I slipped up on the terminology. When I saw "power spectrum" I thought |spectrum|^2, but you are correct in that the autocorrelation function of the electric field is the interferogram. What would be the flux density (power spectrum in your terminology) is what I usually call "the spectrum". So I thought you meant the square of what I call the spectrum and....well you see where I screwed up. Ehem. > Having said that, it is conceivable that one can create a > complex interferrogram (for instance, combining two different > channels etc), but in the "usual" (i.e. that I am familiar with), > an interferrogram is an scalar autocorrelation function. However -- and I'm sure you know all this -- in practice, when you compute the flux density spectrum from the interferogram, you are not guaranteed to get a spectrum where the imaginary part is zero. If the interferogram is perfectly symmetric, sure. In practice, however, IFGs are typically asymmetric and this causes the imaginary part to be non-zero. Assuming the IFG measurement is relatively quick (what you're observing hasn't changed) the IFG asymmetry is due to not knowing where the zero path difference (ZPD) occurs (or the lag of the autocorrelation is zero). By calculating the phase "error" it's possible to determine the correct ZPD and obtain a spectrum with zero (or close to numerical precision). That's also a reason why, in my examples that Randall mentioned, I'm doing all the spectrum folding and what not - I simulate double-sided interferograms rather than single-sided ones. Then any gross asymmetry is relatively easy to correct for. So, with apologies for the ramble, you're absolutely correct - I was just thinking of situations with interferometers which I've had to deal with, phase correcting the spectra and all. paulv -- Paul van Delst Religious and cultural CIMSS @ NOAA/NCEP purity is a fundamentalist Ph: (301)763-8000 x7274 fantasy Fax:(301)763-8545 V.S.Naipaul
On Sat, 6 Apr 2002, Robert Stockwell wrote: > complex-valued interferrogram? Indeed you are correct. The interferogram is a mathematically real quantity-- it is the observable in any interferometer I've ever worked on which makes it real by definition (I think...). > to shed a little light on it [1], in interferometry, the > interferrogram is the autocorrelation function of the electric field > vector. The power spectrum is the fft of the autocorrelation function. > (this is a well known theorem, and if I only had a brain, I'd remember > the name of it) Note the real value-ed-ness of "autocorrelation" and > "power". The interferrogram is an even function, the power spectrum is > real-valued. Do you mean the Wiener-Khinchine-Einstein theorems? These basically state that the autocorrelation function of the source (aka interferogram) must be Fourier-transformed to retrieve the desired spectrum. In most cases, interferometers do not truly measure an even (symmetric) interferogram. At the level I am trying to deal with, experimental, instrumental and computational limitations all introduce asymmetries. Thus, complete reconstruction of the spectrum requires a complex FFT. So, the spectrum is mathematically complex while the interferogram is mathematically real. Thanks to both Paul and you for your replies to my original post... To put it mildly, last week wasn't one of my better weeks and, as it turns out, I was doing something completely illogical. For perspective, I am constructing an instrument model for an optical interferometer that accounts for the known instrumental effects. I am therefore generally already working in the Fourier (interferogram) domain. For one reason or another, when it came to Fourier transforming my modulation function into a spectral instrument lineshape function, I proceeded to use Paul's "fft_to_interferogram" routine instead of "fft_to_spectrum." From that point onwards, everything went down hill and I started thinking about 'interferograms' when I should have been thinking 'spectra.' In a monumental moment of horror (Friday evening at 6:30 PM) I realized my rather silly error... sigh. I then proceeded to take the entire weekend off and enjoy the unseasonably nice British weather with my wife ;) With luck, this will be a better week. Thanks again for your comments! Cheers, Randall
Paul van Delst wrote: > Robert Stockwell wrote: > > However -- and I'm sure you know all this -- in practice, when you compute the flux density > spectrum from the interferogram, you are not guaranteed to get a spectrum where the imaginary > part is zero. If the interferogram is perfectly symmetric, sure. In practice, however, IFGs are > typically asymmetric and this causes the imaginary part to be non-zero. Ah yes, of course you are correct. For the benefit of any other readers (since Paul already knows this), this non asymmetric interferogram is the typical case for real measurements. That is to say, instead of sampling (ideally) at -2,-1,0,1,2 etc, you get an offset such as samples at -1.8,-0.8,0.2,1.2 etc. So you in fact sample a symmetric function asymmetrically. One way of handling this is to record the interferogram on both sides of the ZPD (for a short region) and calculate the spectrum from this "short interferogram", calculate the phase function of the complex valued spectrum, and then calculate the necessary time domain kernel to perform this "phase correction". Often, this kernel is combined with filter functions to get the desired spectrum. I forget what the original question was, but is that what the point was, how to recover the original symmetric interferrogram from the "unphase corrected" spectrum? Anyways, this thread reminded me of the good old days of running the Michelson Interferometer measuring the night sky in the infra red, and desperately trying to phase correct an un-phase-correctable instrument (and accepting that we'll have to keep running double sided interferograms), while drinking copious amounts of beer. Ah to be a grad student again. sigh... -bob > Assuming the IFG > measurement is relatively quick (what you're observing hasn't changed) the IFG asymmetry is due > to not knowing where the zero path difference (ZPD) occurs (or the lag of the autocorrelation > is zero). By calculating the phase "error" it's possible to determine the correct ZPD and > obtain a spectrum with zero (or close to numerical precision). > > That's also a reason why, in my examples that Randall mentioned, I'm doing all the spectrum > folding and what not - I simulate double-sided interferograms rather than single-sided ones. > Then any gross asymmetry is relatively easy to correct for. > > So, with apologies for the ramble, you're absolutely correct - I was just thinking of > situations with interferometers which I've had to deal with, phase correcting the spectra and > all. > > paulv > >