Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

GaussFilter Class Reference
[Spectrum filters]

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

Inheritance diagram for GaussFilter:

SmoothFilter DefaultParamHandler ProgressLogger

List of all members.


Detailed Description

This class represents a Gaussian lowpass-filter which works on uniform as well as on non-uniform raw 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.
GaussFilter Parameters are explained on a separate page.

Public Member Functions

 GaussFilter ()
 Constructor.
virtual ~GaussFilter ()
 Destructor.
template<typename InputPeakIterator, typename OutputPeakContainer>
void filter (InputPeakIterator first, InputPeakIterator last, OutputPeakContainer &smoothed_data_container)
 Applies the convolution with the filter coefficients to an given iterator range.
template<typename InputPeakContainer, typename OutputPeakContainer>
void filter (const InputPeakContainer &input_peak_container, OutputPeakContainer &smoothed_data_container)
 Convolutes the filter coefficients and the input raw data.
template<typename InputSpectrumIterator, typename OutputPeakType>
void filterExperiment (InputSpectrumIterator first, InputSpectrumIterator last, MSExperiment< OutputPeakType > &ms_exp_filtered)
 Filters every MSSpectrum in a given iterator range.
template<typename InputPeakType, typename OutputPeakType>
void filterExperiment (const MSExperiment< InputPeakType > &ms_exp_raw, MSExperiment< OutputPeakType > &ms_exp_filtered)
 Filters a MSExperiment.

Protected Member Functions

virtual void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParam() 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

DoubleReal sigma_
 The standard derivation $ \sigma $.
DoubleReal spacing_
 The spacing of the pre-tabulated kernel coefficients.

Constructor & Destructor Documentation

GaussFilter (  )  [inline]

Constructor.

virtual ~GaussFilter (  )  [inline, virtual]

Destructor.


Member Function Documentation

void filter ( InputPeakIterator  first,
InputPeakIterator  last,
OutputPeakContainer &  smoothed_data_container 
) [inline]

Applies the convolution with the filter coefficients to an given iterator range.

Convolutes the filter and the raw data in the iterator intervall [first,last) and writes the resulting data to the smoothed_data_container.

Note:
This method assumes that the InputPeakIterator (e.g. of type MSSpectrum<RawDataPoint1D >::const_iterator) points to a data point of type RawDataPoint1D or any other class derived from RawDataPoint1D.

The resulting peaks in the smoothed_data_container (e.g. of type MSSpectrum<RawDataPoint1D >) can be of type RawDataPoint1D or any other class derived from DRawDataPoint.

Reimplemented from SmoothFilter.

void filter ( const InputPeakContainer &  input_peak_container,
OutputPeakContainer &  smoothed_data_container 
) [inline]

Convolutes the filter coefficients and the input raw data.

Convolutes the filter and the raw data in the input_peak_container and writes the resulting data to the smoothed_data_container.

Note:
This method assumes that the elements of the InputPeakContainer (e.g. of type MSSpectrum<RawDataPoint1D >) are of type RawDataPoint1D or any other class derived from RawDataPoint1D.

The resulting peaks in the smoothed_data_container (e.g. of type MSSpectrum<RawDataPoint1D >) can be of type RawDataPoint1D or any other class derived from DRawDataPoint.

Reimplemented from SmoothFilter.

void filterExperiment ( InputSpectrumIterator  first,
InputSpectrumIterator  last,
MSExperiment< OutputPeakType > &  ms_exp_filtered 
) [inline]

Filters every MSSpectrum in a given iterator range.

Filters the data successive in every scan in the intervall [first,last). The filtered data are stored in a MSExperiment.

Note:
The InputSpectrumIterator should point to a MSSpectrum. Elements of the input spectra should be of type RawDataPoint1D or any other derived class of DRawDataPoint.

You have to copy the ExperimentalSettings of the raw data by your own.

Reimplemented from SmoothFilter.

void filterExperiment ( const MSExperiment< InputPeakType > &  ms_exp_raw,
MSExperiment< OutputPeakType > &  ms_exp_filtered 
) [inline]

Filters a MSExperiment.

Filters the data every scan in the MSExperiment. The filtered data are stored in a MSExperiment.

Note:
The InputPeakType as well as the OutputPeakType should be of type RawDataPoint1D or any other derived class of DRawDataPoint.

Reimplemented from SmoothFilter.

virtual void updateMembers_ (  )  [inline, protected, virtual]

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

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

The default implementation is empty.

Reimplemented from DefaultParamHandler.

DoubleReal integrate_ ( InputPeakIterator  x,
InputPeakIterator  first,
InputPeakIterator  last 
) [inline, protected]

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


Member Data Documentation

DoubleReal sigma_ [protected]

The standard derivation $ \sigma $.

DoubleReal spacing_ [protected]

The spacing of the pre-tabulated kernel coefficients.


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:44 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1