This is in response to Scott's remarks about zero padding and windows. The basic point is that you *always* have fourier truncation effects if you are using a finite k range. If you Fourier transform a pure sine wave over a finite range you will get side lobes that go like |sin(x)/x|. This is true whether you zero pad or not. You won't be able to resolve the side lobe structure if you don't zero-pad however. All you will see is a single point. A useful way to think about it is to view the discrete FFT as a sampled version of the continuous transform (side lobes and all) where the r-space sampling is controlled by size N of the zero padded array (and dk). Hhe zero padding doesn't change the window distortions, it just allows you to see them better. You can of course mitigate the side lobes by applying a k-window to taper the amplitude down to zero at the cutoff, but at the expense of broadening the central part of the peaks. There also is a common myth that if you choose the cutoff to be where chi is zero anyway, that you don't get fourier truncation effects. This is not true. Even if chi (Amplitude*sin(phase)) is zero at a particular k value the amplitude may not be. Imagine a thought experiment in which you shift the phase of chi by a Pi/2, so a node becomes an antinode. Mathematically this is the same as multiplying the complex chi A exp(i phi) by exp(i Pi/2). Since the fourier transform is linear, the filtered (transformed, r-windowed, and inverse transformed) data are just shifted in phase by Pi/2. The fourier filtering distortions are precisely the same when you cut at a node or an antinode. I'll try to dig up some simulations I did many moons ago and post them. grant On Tue, 8 Jun 2004 ifeffit-request@millenia.cars.aps.anl.gov wrote:
Send Ifeffit mailing list submissions to ifeffit@millenia.cars.aps.anl.gov
To subscribe or unsubscribe via the World Wide Web, visit http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit or, via email, send a message with subject or body 'help' to ifeffit-request@millenia.cars.aps.anl.gov
You can reach the person managing the list at ifeffit-owner@millenia.cars.aps.anl.gov
When replying, please edit your Subject line so it is more specific than "Re: Contents of Ifeffit digest..."
Today's Topics:
1. more fun with FFTs (Grant Bunker) 2. E0 correction in EXAFS fitting (Wojciech Gawelda) 3. Re: more fun with FFTs (Scott Calvin) 4. beginning with ARTEMIS (doug pease)
----------------------------------------------------------------------
Message: 1 Date: Tue, 8 Jun 2004 12:34:58 -0500 (CDT) From: Grant Bunker
Subject: [Ifeffit] more fun with FFTs To: ifeffit@millenia.cars.aps.anl.gov Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII Just to amplify Matt's remarks - the purpose of padding with zeros is to deliver a finer grid in r-space. There is a relationship between the r-space grid dr, the k-space grid dk, and the number of points in the array (N): N dk dR = Pi. So, for a k-space grid of .05/A and 2048 points, you get an r-grid spacing of .0307 A. This gives pretty good sampling of the fourier transform. If you only use say 256 points in your array (i.e. you don't pad with zeroes) the r-space sampling is .245 A, which is too coarse to be useful.
You might ask whether zero padding botches up the data. It can be shown (I worked it out once) that zero padding is exactly equivalent to an interpolation of the unpadded data witha specific interpolation kernel (a sinc function or something as I recall). What happens is that as you pad with more zeros into a longer array, the sampling in r-space increases, and ultimately the curve looks just like what you would get with a continuous fourier transform (with cutoff effects from the finite k-space window).
grant
On Tue, 8 Jun 2004 ifeffit-request@millenia.cars.aps.anl.gov wrote:
Send Ifeffit mailing list submissions to ifeffit@millenia.cars.aps.anl.gov
To subscribe or unsubscribe via the World Wide Web, visit http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit or, via email, send a message with subject or body 'help' to ifeffit-request@millenia.cars.aps.anl.gov
You can reach the person managing the list at ifeffit-owner@millenia.cars.aps.anl.gov
When replying, please edit your Subject line so it is more specific than "Re: Contents of Ifeffit digest..."
Today's Topics:
1. Re: FFT in Ifeffit (Matt Newville)
----------------------------------------------------------------------
Message: 1 Date: Mon, 7 Jun 2004 22:55:28 -0500 (CDT) From: Matt Newville
Subject: Re: [Ifeffit] FFT in Ifeffit To: XAFS Analysis using Ifeffit Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII Hi Scott,
All Fourier transforms in Ifeffit use arrays of length 2048, padding with zeros as needed.
In earlier versions of Feffit, doing repeated FTs in the fitting loop was noticeably slow. This is probably one of the reasons fitting in R-space was uncommon. Anyway, using arrays of length N_fft = 1024, 512, or 256 definitely helped speed things up.
In principle, one could use N_fft ~= N_idp, but it turns out that if you use too few FT points, you can easily get into a real 'false, local, minima'. So Feffit used 1024,512,or 256 for fits, and then go back to 2048 to write out the data. Strictly speaking, the FFT doesn't need to use an array size that is a power of 2, but it turns out to make a very noticeable difference with the FFT routines used.
With Ifeffit, several "anti-optimizations" were made that make the fits slightly slower but be more straightforward and simple (relatively speaking, anyway!). The use of double precision and N_fft=2048 being the main examples. Part of the reason for sticking with 2048 is that you want to be able to view the data at any point in the process so 'pretty output' is always needed. Also, I doubt many people will be trying to run artemis on a 386 or a microVAX.
--Matt
As I was working on my talk for the EXAFS workshop, I came across a rather technical question: how does Ifeffit choose the number of points for the Fourier transforms? As I recall, FEFFIT used an algorithm which required an integer power of 2, so its default behavior was to use the smallest integer power of 2 greater than the number of points in the chi(k) data, and then pad the rest with 0's. This default behavior could also be over-ridden if desired.
It doesn't look to me like Ifeffit is handling that in the same way--is it always using a very large number of points and padding with 0's, or is it using an algorithm that doesn't require the integer power of 2, or is it interpolating the chi(k) on to a grid of the appropriate size first, or...?
I appreciate any info you can give me on this.
--Scott Calvin Sarah Lawrence College _______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
------------------------------
_______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
End of Ifeffit Digest, Vol 16, Issue 7 **************************************
------------------------------
Message: 2 Date: Tue, 8 Jun 2004 20:04:25 +0200 From: "Wojciech Gawelda"
Subject: [Ifeffit] E0 correction in EXAFS fitting To: Cc: ifeffit@millenia.cars.aps.anl.gov Message-ID: Content-Type: text/plain; charset="iso-8859-1"
Dear Bruce and other mailing list users,
I have a very basic question concerning the choice of E0 in EXAFS data analysis. Recently I have been working on Ru solvated complex. I dont go into too many details but I can say its a pretty large molecule in aqueous solution with 3 ligands containing 6 N atoms and 30 C atoms in D3 symmetry. Now, we have measured the L3 edge XANES and EXAFS of this molecule and I have recently tried to analyze it. Now, what bothers me a lot is the following observation: once I start processing the data (meaning background removal, pre-edge subtraction etc.) AUTOBK in both Ifeffit and Athena proposes to place the edge energy E0 at the inflection point of the spectrum which lies at about 2838-2839 eV (which corresponds to atomic Ru L3 edge absorption energy). You might say its ok but I cannot accept this value. The inflection point lies on a huge pre-edge peak which is the 4d bound-to-bound transition (white line) which in principle I dont want to include in my chi(k) because its still below the ionization energy as I understand it. I guess the continuum states should start higher in energy and actually from other spectroscopies one would suspect the E0 to be around 2847 eV (so about 7-8 eV higher in energy space). Now I set my E0 to this value and I started fitting the spectrum with FEFF calculation performed on crystalline structure of the same complex. What I end up with is always E0 correction for the first shell of neighbors (meaning N atoms) between -6 to -7.5 eV. I check in chi.dat and xmu.dat files that in my FEFF calculation the k=0 value was assigned to approx. 2839 eV so its the same atomic value again. However I know it shouldnt be like that (apart from a simple fact that Ru in my compound is in its 2+ oxidation state which surely moves the E0 toward higher energies, doesnt it?). So, I tried to fool FEFF and make some tricks like shift my data in energy space or fit the white line and subtract it form the data but it always consistently converges to place the E0 value at the first inflection point meaning between 2839-2842 eV. I thought that when fitting the experimental data with FEFF scattering paths one can choose E0 and then refine its value by shifting the FEFF-calculated E0 by the amount which comes out of the fit. So if I have some value of E0 coming out of my fit then I just shift the initial k=0 value as estimated by FEFF using k -> sqrt( k-E0(2m/h_bar^2) ) (in other words the negative E0 correction would always shift the origin in k-space towards larger k values which means lower values in energy space). Ok, so now my question is the following: is there an explicit way to set E0 value before letting FEFF to do its job or it will always use the tabulated atomic value? So, if I dont know my E0 a priori how can I refine it for a complex or molecule which has different oxidation state than 0? I mean its a serious question in my opinion and I wish I could get some feedback from people who have been doing it for so many years. I hope I made my point clear enough to you. Let me know if you need any more feedback in order to answer my question. Ill be glad to give more details. Best regards,
Wojciech
********************************************************************* Wojciech Gawelda
Laboratoire de Spectroscopie Ultrarapide (LSU) Institut des Sciences et Ingénierie Chimiques (ISIC), Faculté des Sciences de Base (SB-BSP) Ecole Polytechnique Fédérale de Lausanne (EPFL)
CH-1015 Lausanne-Dorigny, Switzerland Tel.: +41 (21) 693 0452 Fax.: +41 (21) 693 0422 E-mail: mailto:wojciech.gawelda@epfl.ch wojciech.gawelda@epfl.ch WWW: http://lsu.epfl.ch http://lsu.epfl.ch *********************************************************************