Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Member Functions | Protected Attributes

GaussFilter Class Reference
[SignalProcessing]

This class represents a Gaussian lowpass-filter which works on uniform as well as on non-uniform profile data. More...

#include <OpenMS/FILTERING/SMOOTHING/GaussFilter.h>

Inheritance diagram for GaussFilter:
ProgressLogger DefaultParamHandler

List of all members.

Public Member Functions

 GaussFilter ()
 Constructor.
virtual ~GaussFilter ()
 Destructor.
template<typename PeakType >
void filter (MSSpectrum< PeakType > &spectrum)
 Smoothes an MSSpectrum containing profile data.
template<typename PeakType >
void filterExperiment (MSExperiment< PeakType > &map)
 Smoothes an MSExperiment containing profile data.

Protected Member Functions

virtual void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method.
template<typename InputPeakIterator >
DoubleReal integrate_ (InputPeakIterator x, InputPeakIterator first, InputPeakIterator last)
 Computes the convolution of the raw data at position x and the gaussian kernel.

Protected Attributes

std::vector< DoubleRealcoeffs_
 Coefficients.
DoubleReal sigma_
 The standard derivation $ \sigma $.
DoubleReal spacing_
 The spacing of the pre-tabulated kernel coefficients.

Detailed Description

This class represents a Gaussian lowpass-filter which works on uniform as well as on non-uniform profile data.

Gaussian filters are important in many signal processing, image processing, and communication applications. These filters are characterized by narrow bandwidths, sharp cutoffs, and low passband ripple. A key feature of Gaussian filters is that the Fourier transform of a Gaussian is also a Gaussian, so the filter has the same response shape in both the time and frequency domains. The coefficients $ \emph{coeffs} $ of the Gaussian-window with length $ \emph{frameSize} $ are calculated from the gaussian distribution

\[ \emph{coeff}(x) = \frac{1}{\sigma \sqrt{2\pi}} e^{\frac{-x^2}{2\sigma^2}} \]

where $ x=[-\frac{frameSize}{2},...,\frac{frameSize}{2}] $ represents the window area and $ \sigma $ is the standard derivation.

Note:
The wider the kernel width the smoother the signal (the more detail information get lost!). Use a gaussian filter kernel which has approximately the same width as your mass peaks, whereas the gaussian peak width corresponds approximately to 8*sigma.
The data must be sorted according to ascending m/z!
Parameters of this class are:

NameTypeDefaultRestrictionsDescription
gaussian_width float0.2  Use a gaussian filter width which has approximately the same width as your mass peaks (FWHM in m/z).
ppm_tolerance float10  Gaussian width, depending on the m/z position.
The higher the value, the wider the peak and therefore the wider the gaussian.
use_ppm_tolerance stringfalse true, falseIf true, instead of the gaussian_width value, the ppm_tolerance is used. The gaussian is calculated in each step anew, so this is much slower.

Note:

Constructor & Destructor Documentation

GaussFilter (  ) 

Constructor.

virtual ~GaussFilter (  )  [virtual]

Destructor.


Member Function Documentation

void filter ( MSSpectrum< PeakType > &  spectrum  )  [inline]

Smoothes an MSSpectrum containing profile data.

Convolutes the filter and the profile data and writes the result back to the spectrum.

Exceptions:
Exception::IllegalArgument is thrown, if the gaussian_width parameter is too small.

References MSSpectrum< PeakT >::getRT(), SpectrumSettings::RAWDATA, and SpectrumSettings::setType().

Referenced by EmgScoring::prepareFit_(), and FeatureFinderAlgorithmMRM< PeakType, FeatureType >::run().

void filterExperiment ( MSExperiment< PeakType > &  map  )  [inline]

Smoothes an MSExperiment containing profile data.

Exceptions:
Exception::IllegalArgument is thrown, if the gaussian_width parameter is too small.
DoubleReal integrate_ ( InputPeakIterator  x,
InputPeakIterator  first,
InputPeakIterator  last 
) [inline, protected]

Computes the convolution of the raw data at position x and the gaussian kernel.

References OpenSwath::norm().

virtual void updateMembers_ (  )  [protected, virtual]

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.


Member Data Documentation

std::vector<DoubleReal> coeffs_ [protected]

Coefficients.

DoubleReal sigma_ [protected]

The standard derivation $ \sigma $.

DoubleReal spacing_ [protected]

The spacing of the pre-tabulated kernel coefficients.


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:53 using doxygen 1.7.1