Changeset 316
- Timestamp:
- Mar 30, 2004, 2:41:29 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibADD.tex (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibADD.tex
r315 r316 482 482 \subsection{(Fast) Fourier Transforms} 483 483 484 (Fast) Fourier Transforms (FFTs) shall be implemented using the FFTW 485 package (www.fftw.org). 484 (Fast) Fourier Transforms (FFTs) shall be implemented using the {\em 485 Fastest Fourier Transform in the West} (FFTW) library 486 (\href{www.fftw.org}). 486 487 487 488 \subsubsection{FFTW Plans} … … 494 495 In the \PS{} IPP, we will want to perform FFTs on images of common 495 496 sizes (e.g.\ $512 \times 512$) regularly. This means that we would 496 gain from determining a FFTW plan for each of these common sizes. 497 PSLib should therefore maintain a library of these plans, which can be 498 loaded and employed as required. The location of this library on disk 499 will be specified as a configuration variable for the IPP. 500 501 A program to generate plans for a list of common image sizes should be 502 provided. For example: 503 \begin{verbatim} 504 machine01% cat myImageSizes.txt 505 512 512 506 256 256 507 32 32 508 machine01% psMakeFFTPlans myImageSizes.txt 509 machine01% ls 510 fftw.machine01.512.512.plan 511 fftw.machine01.256.256.plan 512 fftw.machine01.32.32.plan 513 \end{verbatim} 514 515 Plans should be generated using the \code{FFTW_MEASURE} flag of FFTW. 516 517 The list of known plans should be read in upon initialisation of the 518 PSLib FFT functions, and the appropriate plan should be used for 519 transformations. 497 gain from determining an FFTW plan for each of these common sizes. 498 FFTW provides a binary, \code{fftw-wisdom} which may be used to 499 generate and save ``wisdom''. The location of the \code{wisdom} file 500 will be specified as a configuration variable for the IPP (defaulting 501 to \code{/etc/fftw/wisdom}). The \code{wisdom} should be read in upon 502 initialisation of the PSLib FFT functions and saved at the conclusion. 520 503 521 504 \subsubsection{Function mapping} 522 505 523 506 The forward and reverse transforms call the corresponding 507 FFTW function to plan the transform: 508 509 \begin{tabular}{ll} 510 PSLib function & Major FFTW call \\ \hline 511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 512 psFFTForward() & fftw_plan_dft_r2c_2d() 513 psFFTReverse() & fftw_plan_dft_c2r_2d() 514 \end{tabular} 515 516 These plans should be formulated using the \code{FFTW_ESTIMATE} flag, 517 which will allow FFTW to default to a short planning time if the 518 wisdom has not been loaded. Transforms should be performed out of 519 place to avoid the need to pad the input array. 520 521 \subsubsection{More Complicated Functions} 522 523 The \code{psFFTFilter} and \code{psFFTFilterComplex} functions provide 524 a means to apply a filter (purely real and imaginary multipliers, 525 respectively) to the data in the Fourier plane. If the filter 526 function specified for \code{psFFTFilter} returns a real value, $r$, 527 then the corresponding value in the Fourier plane should be multiplied 528 by $r$. If the real and imaginary filter functions specified for 529 \code{psFFTFilterComplex} returns the values $r$ and $s$, 530 respectively, then the corresponding value in the Fourier plane should be 531 multiplied by the complex number $(r + si)$. 532 533 \code{psFFTCrossCorrelate()} and \code{psFFTConvolve()} both involve 534 multiplication of two Fourier transforms. In the former, the first 535 Fourier transform is multiplied by the complex conjugate of the second 536 Fourier transform to yield the Fourier transform of the cross-correlation. 537 In the latter, the two Fourier transforms are multiplied directly to yield 538 the Fourier transform of the convolution. 539 540 If the elements of the discrete Fourier transform are $C_k$, then the 541 the elements of the power spectrum are defined (NR 13.4): 542 \begin{eqnarray} 543 P_0 & = & \| C_0 \|^2 / N^2 \\ 544 P_j & = & \left( \| C_j \|^2 + \| C_{N-j} \|^2 \right)/ N^2 & j = 1, 2, \ldots, (N/2 - 1) \\ 545 P_{N/2} & = & \| C_{N/2} \|^2 / N^2 \\ 546 \end{eqnarray} 547 548 Note that we leave the issue of ``windowing'' the data up to the 549 caller, and choose to normalise by $1/N^2$. 524 550 525 551 \subsection{Astronomy Utilities}
Note:
See TracChangeset
for help on using the changeset viewer.
