Skip to content
Snippets Groups Projects
ApodizationFunctions.cpp 1.42 KiB
Newer Older
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
Anthony Lim's avatar
Anthony Lim committed
#include "MantidAlgorithms/ApodizationFunctions.h"
Anthony Lim's avatar
Anthony Lim committed
namespace Mantid {
namespace Algorithms {
namespace ApodizationFunctions {
 * Returns the evaluation of the Lorentz
 * (an exponential decay)
 * apodization function at a time (t) and
 * decay constant tau:
 * f = exp(-t/tau)
 * @param time :: [input] current time (t)
 * @param decayConstant :: [input] the decay constant (tau)
 * @returns :: Function evaluation
 */
double lorentz(const double time, const double decayConstant) {
Anthony Lim's avatar
Anthony Lim committed
  return exp(-time / decayConstant);
 * Returns the evaluation of the Gaussian
 * apodization function at a time (t) and
 * decay constant tau:
 * f =exp(-time^2/(2*tau^2))
 * @param time :: [input] current time (t)
 * @param decayConstant :: [input] the decay constant (tau)
 * @returns :: Function evaluation
 */
double gaussian(const double time, const double decayConstant) {
Anthony Lim's avatar
Anthony Lim committed
  return exp(-(time * time) / (2. * decayConstant * decayConstant));
 * Returns no
 * apodization function. i.e. the data is unchanged
 * @param :: [input] current time (t)
 * @param :: [input] the decay constant (tau)
 * @returns :: Function evaluation
 */
Anthony Lim's avatar
Anthony Lim committed
double none(const double, const double) { return 1.; }
} // namespace ApodizationFunctions
} // namespace Algorithms
} // namespace Mantid