Index: trunk/SophyaLib/NTools/fftpserver.cc
===================================================================
--- trunk/SophyaLib/NTools/fftpserver.cc	(revision 1402)
+++ trunk/SophyaLib/NTools/fftpserver.cc	(revision 1405)
@@ -15,6 +15,4 @@
 necessarily correspond with the equivalent fftpack function.  For example,
 fftpack "forward" transformations are in fact inverse fourier transformations.
-Otherwise, the output is in the fftpack format.
-
 
 Due to the way that fftpack manages
@@ -23,4 +21,19 @@
 of differing length, it may be more efficient to create an fftserver object
 for each length.
+
+  \code
+  #include "fftpserver.h"
+  // ...
+  TVector<r_8> in(32);
+  TVector< complex<r_8> > out;
+  in = RandomSequence();
+  FFTPackServer ffts;
+  ffts.setNormalize(true);  // To have normalized transforms
+  cout << " FFTServer info string= " << ffts.getInfo() << endl;
+  cout << "in= " << in << endl;
+  cout << " Calling ffts.FFTForward(in, out) : " << endl;
+  ffts.FFTForward(in, out);
+  cout << "out= " << out << endl;
+  \endcode
 */
 
Index: trunk/SophyaLib/NTools/fftservintf.cc
===================================================================
--- trunk/SophyaLib/NTools/fftservintf.cc	(revision 1402)
+++ trunk/SophyaLib/NTools/fftservintf.cc	(revision 1405)
@@ -6,4 +6,45 @@
   \ingroup NTools
   Defines the interface for FFT (Fast Fourier Transform) operations.
+  Definitions : 
+    - Sampling period \b T
+    - Sampling frequency \b fs=1/T
+    - Total number of samples \b N
+    - Frequency step in Fourier space \b =fs/N=1/(N*T)
+    - Component frequencies
+        - k=0      ->  0
+	- k=1      ->  1/(N*T)
+	- k        ->  k/(N*T)
+	- k=N/2    ->  1/(2*T)   (Nyquist frequency)
+	- k>N/2    ->  k/(N*T)   (or negative frequency -(N-k)/(N*T))
+
+  For a sampling period T=1, the computed Fourier components correspond to :
+  \verbatim
+  0  1/N  2/N  ... 1/2  1/2+1/N  1/2+2/N ... 1-2/N  1-1/N
+  0  1/N  2/N  ... 1/2                   ...  -2/N   -1/N
+  \endverbatim
+
+  For complex one-dimensional transforms:
+  \f[
+  out(i) = F_{norm} \Sigma_{j} \ e^{-2 \pi \sqrt{-1} \ i \  j} \ {\rm (forward)}
+  \f]
+  \f[
+  out(i) = F_{norm} \Sigma_{j} \ e^{2 \pi \sqrt{-1} \ i \  j} \ {\rm (backward)}
+  \f]
+  i,j= 0..N-1 , where N is the input or the output array size.
+
+  For complex multi-dimensional transforms:
+  \f[
+  out(i1,i2,...,id) = F_{norm} \Sigma_{j1} \Sigma_{j2} ... \Sigma_{jd} \ 
+  e^{-2 \pi \sqrt{-1} \ i1 \ j1} ... e^{-2 \pi \sqrt{-1} \ id \ jd} \ {\rm (forward)}
+  \f]
+  \f[
+  out(i1,i2,...,id) = F_{norm} \Sigma_{j1} \Sigma_{j2} ... \Sigma_{jd} \ 
+  e^{2 \pi \sqrt{-1} \ i1 \ j1} ... e^{2 \pi \sqrt{-1} \ id \ jd} \ {\rm (backward)}
+  \f]
+
+  For real forward transforms, the input array is real, and
+  the output array complex, with Fourier components up to k=N/2.
+  For real backward transforms, the input array is complex and
+  the output array is real. 
 */
 
@@ -23,4 +64,9 @@
 
 /* --Methode-- */
+//! Forward Fourier transform for double precision complex data 
+/*!
+  \param in : Input complex array
+  \param out : Output complex array
+ */
 void FFTServerInterface::FFTForward(TArray< complex<r_8> > const &, TArray< complex<r_8> > &)
 {
@@ -29,4 +75,9 @@
 
 /* --Methode-- */
+//! Backward (inverse) Fourier transform for double precision complex data 
+/*!
+  \param in : Input complex array
+  \param out : Output complex array
+ */
 void FFTServerInterface::FFTBackward(TArray< complex<r_8> > const &, TArray< complex<r_8> > &)
 {
@@ -35,4 +86,9 @@
 
 /* --Methode-- */
+//! Forward Fourier transform for double precision real input data
+/*!
+  \param in : Input real array
+  \param out : Output complex array
+ */
 void FFTServerInterface::FFTForward(TArray< r_8 > const &, TArray< complex<r_8> > &)
 {
@@ -41,4 +97,10 @@
 
 /* --Methode-- */
+//! Backward (inverse) Fourier transform for double precision real output data 
+/*!
+  \param in : Input complex array
+  \param out : Output real array
+  \param usoutsz : if true, use the output array size for computing the inverse FFT.
+ */
 void FFTServerInterface::FFTBackward(TArray< complex<r_8> > const &, TArray< r_8 > &, bool)
 {
@@ -50,4 +112,9 @@
 
 /* --Methode-- */
+//! Forward Fourier transform for complex data 
+/*!
+  \param in : Input complex array
+  \param out : Output complex array
+ */
 void FFTServerInterface::FFTForward(TArray< complex<r_4> > const &, TArray< complex<r_4> > &)
 {
@@ -56,4 +123,9 @@
 
 /* --Methode-- */
+//! Backward (inverse) Fourier transform for complex data 
+/*!
+  \param in : Input complex array
+  \param out : Output complex array
+ */
 void FFTServerInterface::FFTBackward(TArray< complex<r_4> > const &, TArray< complex<r_4> > &)
 {
@@ -62,4 +134,9 @@
 
 /* --Methode-- */
+//! Forward Fourier transform for real input data
+/*!
+  \param in : Input real array
+  \param out : Output complex array
+ */
 void FFTServerInterface::FFTForward(TArray< r_4 > const &, TArray< complex<r_4> > &)
 {
@@ -68,4 +145,10 @@
 
 /* --Methode-- */
+//! Backward (inverse) Fourier transform for real output data 
+/*!
+  \param in : Input complex array
+  \param out : Output real array
+  \param usoutsz : if true, use the output array size for computing the inverse FFT.
+ */
 void FFTServerInterface::FFTBackward(TArray< complex<r_4> > const &, TArray< r_4 > &, bool)
 {
@@ -76,4 +159,11 @@
 
 /* --Methode-- */
+/*!
+  \class SOPHYA::FFTArrayChecker
+  \ingroup NTools
+  Service class for checking array size and resizing output arrays,
+  to be used by FFTServer classes
+*/
+
 template <class T>
 FFTArrayChecker<T>::FFTArrayChecker(string msg, bool checkpack, bool onedonly)
Index: trunk/SophyaLib/NTools/fftservintf.h
===================================================================
--- trunk/SophyaLib/NTools/fftservintf.h	(revision 1402)
+++ trunk/SophyaLib/NTools/fftservintf.h	(revision 1405)
@@ -27,6 +27,9 @@
   virtual FFTServerInterface * Clone() = 0;
 
+//! Set/clear the flag for normalizing Fourier transforms.
   inline void setNormalize(bool fg=false) { _fgnorm = fg; }
+//! Returns the status of normalization flag for the server
   inline bool getNormalize() const { return(_fgnorm); } 
+//! Returns the information string associated with the server
   inline string getInfo() const { return _info; }
 
@@ -53,5 +56,4 @@
 };
 
-} // Fin du namespace
 
 template <class T> 
@@ -79,3 +81,5 @@
 };
 
+} // Fin du namespace
+
 #endif
