/**
 * \page BoxAlgorithm_SpectralAnalysis Spectral analysis
__________________________________________________________________

Detailed description
__________________________________________________________________

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Description|
 
 The Spectral Analysis box performs spectrum computations on incoming signals and possible outputs include the spectrum amplitude (the power of the signal in a number of frequency bands), as well as its phase, real part and imaginary part. 
 Output computations may be enabled/disabled from the settings dialogue box. The analysis is performed using a <b> Fast Fourier Transform </b>.
 Do not forget to apply a \ref Doc_BoxAlgorithm_Windowing step before spectral analysis.
 
 Considering an input signal \f$ X \in \mathbb{R}^{C \times N} \f$, composed of \f$ C \f$ channels and \f$ N \f$ temporal samples, this plugin computes the spectrum of this signal \f$ \Phi \in \mathbb{C}^{C \times F} \f$, composed of \f$ C \f$ channels and \f$ F \f$ frequencies.
 Input signal being real, the spectrum exhibits conjugate symmetry: consequently, only half of the spectrum is returned with \f$ F = \left\lfloor N/2 \right\rfloor + 1 \f$.
 For the \f$ c^{ \text{th} } \f$ channel and the \f$ f^{ \text{th} } \f$ frequency, the spectrum is defined as:
 \f[ \Phi(c,f) = \Phi_r(c,f) + \mathsf{i} \times \Phi_i(c,f) = \left| \Phi(c,f) \right| \times e^{\mathsf{i} \arg(\Phi(c,f))} \f]
 with \f$ \mathsf{i} \f$ being the imaginary unit.

 Using these notations, for the \f$ c^{ \text{th} } \f$ channel, the Parseval's Theorem gives:
 \f[ \sum_{n=0}^{N-1} \left| X(c,n) \right|^2 = \frac{1}{N} \sum_{f=0}^{F-1} \left| \Phi(c,f) \right|^2 \f]
 with \f$ \left| \Phi(c,f) \right|^2 = \Phi_r(c,f)^2 + \Phi_i(c,f)^2 \f$.
 
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Description|
__________________________________________________________________

Inputs description
__________________________________________________________________

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Inputs|
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Inputs|

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Input1|
 
 An input multichannel signal \f$ X \in \mathbb{R}^{C \times N} \f$, composed of \f$ C \f$ channels and \f$ N \f$ temporal samples.
 
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Input1|
__________________________________________________________________

Outputs description
__________________________________________________________________

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Outputs|
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Outputs|

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Output1|
 
 An output spectral amplitude (absolute value) \f$ \left| \Phi \right| \in \mathbb{R}^{C \times F} \f$.
 
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Output1|

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Output2|
 
 An output spectral phase \f$ \arg(\Phi) \in \mathbb{R}^{C \times F} \f$, in radians.
 
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Output2|

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Output3|
 
 An output real part of the spectrum \f$ \Phi_r \in \mathbb{R}^{C \times F} \f$.
 
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Output3|

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Output4|
  
 An output imaginary part of the spectrum \f$ \Phi_i \in \mathbb{R}^{C \times F} \f$.
 
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Output4|
__________________________________________________________________

Settings description
__________________________________________________________________

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Settings|
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Settings|

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Setting1|
 
 Activate or not the Amplitude output. 
 
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Setting1|
 
 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Setting2|
 
  Activate or not the Phase output. 
 
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Setting2|
 
 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Setting3|
 
  Activate or not the Real Part output. 
 
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Setting3|
 
 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Setting4|
 
  Activate or not the Imaginary Part output. 
 
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Setting4|
__________________________________________________________________

Examples description
__________________________________________________________________

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Examples|
Practical example : visualising the power spectrum of a signal.
 	
 Let's use a Signal Oscillator box to generator sinusoidal signals on one channel. Next we add a Spectral Analysis box and connect boxes together. We make sure the 'Amplitude' of the signal is computed by checking the appropriate setting in the settings dialog box (see image below). Finally, we connect the 'Amplitude' output connector of the Spectral Analysis box to the input connector of a Power Spectrum Display box. The player may now be launched to visualize the power spectrum of the signal.
 
 \image html spectralanalysis_online.png "Visualising the power spectrum of sinusoidal signals."
 \image latex spectralanalysis_online.png "Visualising the power spectrum of sinusoidal signals." width=8cm
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Examples|

__________________________________________________________________

Miscellaneous description
__________________________________________________________________

 * |OVP_DocBegin_BoxAlgorithm_SpectralAnalysis_Miscellaneous|
 
 To verify the Parseval's Theorem, in version 1.1, spectra have been multiplied by \f$ \sqrt{2} \f$ with respect the previous version 1.0.
 DC bin and Nyquist bin (when \f$ N \f$ is even) are not concerned by this correction.
 
 * |OVP_DocEnd_BoxAlgorithm_SpectralAnalysis_Miscellaneous|
 */
