97 std::vector<double>
smooth(
const std::vector<double>& data);
248 std::vector<double>
makeKernel(
bool isMS1,
int degree,
int m,
const std::vector<double>& coeffs);
292 std::vector<double>
extendData(
const std::vector<double>& data,
int m);
302 double sum_weights = 0;
309 bool calculated =
false;
354 static double sqr(
double x) {
return x * x; }
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
The representation of a chromatogram.
Definition MSChromatogram.h:30
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
The representation of a 1D ion mobilogram.
Definition Mobilogram.h:32
Computes a modified sinc smoothing filter for profile data.
Definition ModifiedSincSmoother.h:66
std::vector< double > fit_weights_
Weights for boundary linear regression fitting.
Definition ModifiedSincSmoother.h:234
void filter(MSChromatogram &chromatogram)
Apply modified sinc smoothing to an MSChromatogram.
void filter(MSSpectrum &spectrum)
Apply modified sinc smoothing to an MSSpectrum.
std::vector< double > extendData(const std::vector< double > &data, int m)
Extend data boundaries using weighted linear regression.
static double sqr(double x)
Helper: square function.
Definition ModifiedSincSmoother.h:354
void filter(Mobilogram &mobilogram)
Apply modified sinc smoothing to a Mobilogram.
void filterExperiment(PeakMap &map)
Apply modified sinc smoothing to all spectra and chromatograms in an experiment.
int degree_
Polynomial degree for sinc modification (even, 2-10)
Definition ModifiedSincSmoother.h:228
std::vector< double > makeFitWeights(bool isMS1, int degree, int m)
Construct weights for boundary linear regression.
std::vector< double > makeKernel(bool isMS1, int degree, int m, const std::vector< double > &coeffs)
Construct the modified sinc convolution kernel.
std::vector< double > kernel_
Symmetric convolution kernel coefficients [k_0, k_1, ..., k_m].
Definition ModifiedSincSmoother.h:232
std::vector< double > smooth(const std::vector< double > &data)
Smooth a vector of data values with boundary extrapolation.
int m_
Kernel half-width parameter (spatial domain)
Definition ModifiedSincSmoother.h:230
bool isMS1_
MS1 vs MS filter variant selection.
Definition ModifiedSincSmoother.h:226
void updateMembers_() override
Sync internal state from parameters.
static int noiseGainToM(bool isMS1, int degree, double noiseGain)
Convert desired noise gain to optimal parameter m.
static double savitzkyGolayBandwidth(int degree, int m)
Compute equivalent Savitzky-Golay bandwidth for comparison.
std::vector< double > smoothExceptBoundaries(const std::vector< double > &data)
Smooth data without boundary extension (interior points only).
static int bandwidthToM(bool isMS1, int degree, double bandwidth)
Convert frequency domain bandwidth to spatial domain parameter m.
std::vector< double > getCoefficients(bool isMS1, int degree, int m)
Get correction coefficients for kernel modification.
ModifiedSincSmoother()
Default constructor with parameter registration.
ModifiedSincSmoother(bool isMS1, int degree, int m)
Constructor initializing the modified sinc smoother.
void registerDefaults_()
Register default parameters (shared by both constructors)
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:27
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Helper class for weighted linear regression.
Definition ModifiedSincSmoother.h:301
double getSlope()
Get regression slope (dy/dx).
double getOffset()
Get regression intercept (y-value at x=0).
void clear()
Reset accumulator for new regression.
void addPointW(double x, double y, double weight)
Add a weighted data point to the regression.
void calculate()
Compute least-squares line parameters.