Fourier analysis definition
 @FOURIER_ANALYSIS_DEFINITION {
 @FOURIER_ANALYSIS_NAME {FourierName} {
 @FOURIER_ANALYSIS_TYPE {FourierType}
 @PARAMETERS {
 @NUMBER_OF_FREQUENCIES {N_{f}}
 @CIRCULAR_FREQUENCY {Ω}
 }
 @PARAMETERS {
 @NUMBER_OF_FREQUENCIES {N_{f}}
 @NUMBER_OF_TIME_STEPS {n_{s}}
 }
 @PARAMETERS {
 @FOURIER_FREQUENCIES {f_{1}, f_{2},... , f_{N}}
 @GAIN_COEFFICIENT {g}
 @OUTPUT_CHANNEL_NUMBER {N_{c}}
 }
 @COMMENTS {CommentText}
 }
 }
Notes
 It is often useful to perform a Fourier analysis of a signal. Three types of Fourier analysis can be performed, as selected by the flag FourierType: discrete Fourier transform, Fast fourier transform and online Fourier transform. Fourier analysis is performed on signals, which are defined by a sequence of discrete pairs, (t_{i}, s_{i}), i = 1, 2,... , N, where s_{i} = s(t_{i}) is the discrete value of the signal at time t_{i}, and N the number of sampling points. Note that the sampling points are not necessarily equally spaced in time.
 Fourier analysis is, in general, a postprocessing operation: once the response of the system has been computed, a signal is extracted and the complete signal, i.e. all pairs (t_{i}, s_{i}), i = 1, 2,... , N, is available to perform the Fourier analysis. The discrete Fourier and Fourier analysis are post processing operations. In contrast, online Fourier analysis provides estimates of the signal's Fourier component magnitudes at specific frequencies as the response of the system is being computed: as each new pair, (t_{i}, s_{i}), becomes available, it is used to refine the estimates signal's Fourier component magnitudes.
 Three types of Fourier analysis can be performed on the signal, based on the value of parameter FourierType.

If FourierType = DISCRETE_FOURIER, a discrete Fourier transform of the signal will be performed, as defined by the following equation
s(t) = a_{0} + a_{1s} sin Ωt + a_{1c} cos Ωt + a_{2s} sin 2Ωt + a_{2c} cos 2Ωt + ... + a_{Nfs} sin N_{f}Ωt + a_{Nfc} cos N_{f}Ωt.
This analysis requires two input parameters, the number of frequencies, N_{f}, to be used in the Fourier expansion, and the fundamental circular frequency of the signal, Ω. It is assumed that the signal is defined over one period, T, where T = 2π/Ω. If it is not, signal preconditioning must be used to select one period of the signal precisely. 
If FourierType = FOURIER, a Fourier transform of the signal will be performed, as defined by the following equation
S_{i} = Σ_{n = 1}^{Ns} s_{N} { cos [(n1) (2π(i1))/N_{s}]  j sin [(n1) (2π(i1))/N_{s}]}, i = 1, 2,... ,N_{s}
where j = √(1), and N_{s} the number of data points in the signal. The output of the post processing operation are the absolute value of the complex numbers S_{i} as a function of frequency.
This analysis uses two optional parameters, the number of time steps of the signal, n_{s}, and the number of frequencies, N_{f}, to be extracted. If the the number of time steps, n_{s}, is not defined, the default value is n_{s} = N. Since the algorithms used for the Fourier transform assume equally spaced sampling points, the first phase of the algorithm is to resample the original signal, defined by N discrete values, to create a new signal with n_{s} equally spaced discrete values. Linear interpolation is used in this operation. While the Fourier transform is defined for all values of k = 1, 2,... , n_{s}, only those values below the Nyquist frequency are relevant, i.e., k ≤ n_{s}/2. If N_{f} is not defined, N_{f} = n_{s}/2. 
If FourierType = ON_LINE, an online Fourier analysis will be performed, as defined by the following equation
s(t) = a_{0} + a_{1s} sin Ωt + a_{1c} cos Ωt + a_{2s} sin 2Ωt + a_{2c} cos 2Ωt + ... + a_{Nfs} sin N_{f}Ωt + a_{Nfc} cos N_{f}Ωt.
The goal of this analysis is to estimate the magnitudes of the Fourier components of a signal at specific, given frequencies, i.e., to estimate coefficients a_{0}, a_{is}, and a_{ic}, for i = 1, 2,..., N_{f}.
This analysis requires the following input: the number of frequencies, N_{f}, to be used in the Fourier expansion, the frequency content of the signal, f_{k}, k=1, 2,..., N_{f}, and the gain coefficient, g. The optimal value of the gain coefficient is twice the time step size divided by the fundamental period of the signal. The frequency content of the signal must be known prior to performing an online Fourier analysis, which only estimates the amplitudes of the signal at those frequencies. If the user provided frequency content, f_{k}, k=1, 2,..., N_{f}, is not correct, erroneous amplitudes will be estimated.
Typically, the online Fourier analysis is used to condition a signal to be used by a controller. A single Fourier components will be returned to the controller, as defined output channel number, 0 ≤ N_{c} ≤ 2N_{f} + 1.  It is possible to attach comments to the definition of the object; these comments have no effect on its definition.
N_{c}  0  1  2  3  4  ...  2N_{f}  1  2N_{f} 
Component  a_{0}  a_{1s}  a_{1c}  a_{2s}  a_{2c}  ...  a_{Nfs}  a_{Nfc} 
Example 1
In the first example, a signal SignalRotationC extracts the relative rotation at a revolute joint; this relative rotation is shown in fig. 1. Note the preconditioning applied to the signal to extract from the simulation one single period of the periodic response. Next, a discrete Fourier transform of this signal is performed; 5 harmonics are computed and the base circular frequency of the signal is given as Ω = 5 rad/sec. Figure 2 shows the sine and cosine components of the given signal. The left figure shows a bar chart with a_{0} and a_{is}, i = 1, 2,... , N_{f}, and the right figure shows a bar chart with a_{0} and a_{ic}, i = 1, 2,... , N_{f}.
 SIGNAL_DEFINITION {
 @SIGNAL_NAME {SignalRotationC} {
 @SENSOR_NAME {SensorRotationC}
 @CHANNEL_NUMBER {4}
 @SIGNAL_PRECONDITIONING_NAME {PreconRotationC}
 @SIGNAL_CONDITIONING_NAME {FourierDiscrete}
 }
 }
 SIGNAL_PRECONDITIONING_DEFINITION {
 @SIGNAL_PRECONDITIONING_NAME {PreconRotationC} {
 @INITIAL_TIME {2.51327412287183}
 @NORMALIZED_TIME_RANGE {0.0, 1.25663706143592}
 @TIME_AXIS_LABEL {REVOLUTIONS [DEG]}
 }
 }
 FOURIER_ANALYSIS_DEFINITION {
 @FOURIER_ANALYSIS_NAME {FourierDiscrete} {
 @FOURIER_ANALYSIS_TYPE {DISCRETE_FOURIER}
 @PARAMETERS {
 @NUMBER_OF_FREQUENCIES {5}
 @CIRCULAR_FREQUENCY {5.0}
 }
 }
 }
Figure 1. Output created by signal SignalRotationC.
Figure 2. Output created by the discrete Fourier analysis FourierDiscrete.
Example 2
Signal SignalRotationC extracts the relative rotation at a revolute joint; this relative rotation is shown in fig. 1. Note the preconditioning applied to the signal to extract from the simulation one single period of the periodic response. Next, the Fourier transform of this signal is performed and the first 25 values of the transform are computed, k = 1, 2,... , 25. Figure 4 shows the result of the analysis: the norms, S_{k}, of the complex numbers generated by the Fourier transform are shown for k = 1, 2,... , 25. Since the number k have no physical meaning, the horizontal axis is transformed to physical frequencies, f_{k} = k / (n_{s} Δt), where Δt is the signal sampling rate.
 FOURIER_ANALYSIS_DEFINITION {
 @FOURIER_ANALYSIS_NAME {Fourier} {
 @FOURIER_ANALYSIS_TYPE {FOURIER}
 @PARAMETERS {
 @NUMBER_OF_FREQUENCIES {25}
 }
 }
 }