Fourier sine transforms of data
Jim
I have some diffraction data which consists of two columns, one is intensity S(Q) the other is detector position (Q). I want to calculate the Fourier sine transformation as follows:
f(x) = 2/PI * Int[S(Q).sin(Q.x)dQ]
Any suggestion of how to do this would be gratefully appreciated.
best wishes,
Jim
You are not telling us about the sampling of your data. At this point I'm only assuming that your detector gives you real (not complex) values. This is important in order to be able to use the FFT for this application.
1. If the two columns represent samples at equal distances on the detector then you should extract two numbers from your position wave: x0 (the origin) and deltaX (the offset between consecutive data). Next use the SetScale operation to apply this scaling to the "Intensity" (or whatever the detector reads) data which I'll call yWave.
If the two columns do not represent equal distance sampling create a new wave of the desired dimensions and use the Interp() function to generate an equally sampled yWave.
2. Now that you have an equally sampled yWave convert it into a complex wave using Redimension/C. This will make your yWave complex with the imaginary part equal to zero.
3. Use the FFT operation with /OUT=1. This will give you the full complex FFT out of which you only want the imaginary part. For example
FFT/OUT=1/DEST=CFTWave yWave
MatrixOP/O sinXform=imag(CFTWave)
Note that IGOR does not use the (2/pi) factor in the FFT's forward direction so you might want to combine that in the last MatrixOP as:
Variable myFactor=(2/pi)
MatrixOP/O sinXform=myFactor*imag(CFTWave)
I hope this helps,
A.G.
WaveMetrics, Inc.
June 19, 2011 at 11:02 am - Permalink