Mantid
Loading...
Searching...
No Matches
Smoothing.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2025 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "MantidKernel/DllConfig.h"
10
11#include <span>
12#include <vector>
13
14namespace Mantid::Kernel {
15
16namespace Smoothing {
17
26template <typename T> std::vector<T> boxcarSmooth(std::vector<T> const &input, unsigned int const numPoints);
27
38template <typename T> std::vector<T> boxcarErrorSmooth(std::vector<T> const &input, unsigned int const numPoints);
39
50MANTID_KERNEL_DLL std::vector<double> boxcarSmooth(std::span<double const> input, unsigned int const numPoints);
51MANTID_KERNEL_DLL std::vector<double> boxcarErrorSmooth(std::span<double const> input, unsigned int const numPoints);
52
62template <typename T> std::vector<T> boxcarRMSESmooth(std::vector<T> const &input, unsigned int const numPoints);
63
72template <typename Y> std::vector<Y> fftSmooth(std::vector<Y> const &input, unsigned const cutoff);
73
83template <typename Y>
84std::vector<Y> fftButterworthSmooth(std::vector<Y> const &input, unsigned const cutoff, unsigned const order);
85
86} // namespace Smoothing
87} // namespace Mantid::Kernel
std::vector< T > boxcarErrorSmooth(std::vector< T > const &input, unsigned int const numPoints)
Performs boxcar (moving average) smoothing on the input data, using error propagation formula.
std::vector< T > boxcarSmooth(std::vector< T > const &input, unsigned int const numPoints)
Performs boxcar (moving average) smoothing on the input data.
std::vector< Y > fftButterworthSmooth(std::vector< Y > const &input, unsigned const cutoff, unsigned const order)
Performs FFT smoothing on the input data, using a Butterworth filter NOTE: the input data MUST be def...
std::vector< T > boxcarRMSESmooth(std::vector< T > const &input, unsigned int const numPoints)
Performs boxcar (moving average) smoothing on the input data, using a RMSE average,...
std::vector< Y > fftSmooth(std::vector< Y > const &input, unsigned const cutoff)
Performs FFT smoothing on the input data, with high frequencies set to zero NOTE: the input data MUST...