Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
List of all members
CompareFouriertransform Class Reference

Compare Discrete Cosines value from a Fourier transformation, also known as Discrete Cosines Transformation. More...

#include <OpenMS/COMPARISON/SPECTRA/CompareFouriertransform.h>

Inheritance diagram for CompareFouriertransform:
PeakSpectrumCompareFunctor DefaultParamHandler

Public Member Functions

 CompareFouriertransform ()
 default constructor More...
 
 CompareFouriertransform (const CompareFouriertransform &source)
 copy constructor More...
 
virtual ~CompareFouriertransform ()
 destructor More...
 
- Public Member Functions inherited from PeakSpectrumCompareFunctor
 PeakSpectrumCompareFunctor ()
 default constructor More...
 
 PeakSpectrumCompareFunctor (const PeakSpectrumCompareFunctor &source)
 copy constructor More...
 
virtual ~PeakSpectrumCompareFunctor ()
 destructor More...
 
PeakSpectrumCompareFunctoroperator= (const PeakSpectrumCompareFunctor &source)
 assignment operator More...
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
virtual DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 
CompareFouriertransformoperator= (const CompareFouriertransform &source)
 assignment operator More...
 
double operator() (const PeakSpectrum &) const
 Dummy function. More...
 
double operator() (const PeakSpectrum &spec1, const PeakSpectrum &spec2) const
 compare two PeakSpectrum by their Discrete Cosines Transformation. More...
 
void transform (PeakSpectrum &spec)
 calculate the Discrete Cosines Fourier Transformation. More...
 
static PeakSpectrumCompareFunctorcreate ()
 
static const String getProductName ()
 Returns the name used in the factory. More...
 
UInt searchTransformation_ (const PeakSpectrum &spec) const
 Search in the PeakSpectrum, if a Discrete Fourier transformation occurs, if not an error is going to be thrown, else the index of the occurrence is returned. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from PeakSpectrumCompareFunctor
static void registerChildren ()
 registers all derived products More...
 
static const String getProductName ()
 
- Protected Member Functions inherited from DefaultParamHandler
virtual void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Detailed Description

Compare Discrete Cosines value from a Fourier transformation, also known as Discrete Cosines Transformation.

The Direct Cosines Transformation based on the theory of the Fourier transformation. In this class the Fast Fourier Transformation(FFT) algorithm of the gsl library is used. FFT has a run-time complexity of n (log n). To get the Direct Cosines Transformation from a FFT there is preparation necessary. First the input data has to be mirrored. This is necessary, because FFT needs data which has a periodic nature. After the computation of FFT only the cosine values are important and stored in the Meta Data Array. So an inverse transformation of these values to get the original spectrum is not available. The comparison is done between two Meta Data Arrays, which contain the stored cosine values of their individual spectrum. The advantage of this method is how the comparison works. There is only one sum which has to be count, no multiplication is needed.

Attention: only use the compare function, if the Spectrum was transformed earlier, else an error is going to appear. Only use this method of transformation, if you are sure there exists enough free memory. This is a fast estimation, but it only gives one or zero back.

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
epsilon float0.2  defines the absolute error of the mass spectrometer

Note:

Constructor & Destructor Documentation

default constructor

copy constructor

virtual ~CompareFouriertransform ( )
virtual

destructor

Member Function Documentation

static PeakSpectrumCompareFunctor* create ( )
inlinestatic
static const String getProductName ( )
inlinestatic

Returns the name used in the factory.

double operator() ( const PeakSpectrum ) const
virtual

Dummy function.

This function only returns 0 for any given PeakSpectrum, please use the other compare operator function

Implements PeakSpectrumCompareFunctor.

double operator() ( const PeakSpectrum spec1,
const PeakSpectrum spec2 
) const
virtual

compare two PeakSpectrum by their Discrete Cosines Transformation.

This function compares two given PeakSpectrum about their Discrete Cosines Transformation. First, a transformation has to be calculated. Please use the function transform() in this class, before calling this function. The comparison works by summing the subtractions of each coefficient for all elements of both transformations. sum(_i=1) ^n x_i-y_i. If the sum is zero, both Spectrums are identical in the real part and one is emited, otherwise a zero.

Implements PeakSpectrumCompareFunctor.

CompareFouriertransform& operator= ( const CompareFouriertransform source)

assignment operator

UInt searchTransformation_ ( const PeakSpectrum spec) const
protected

Search in the PeakSpectrum, if a Discrete Fourier transformation occurs, if not an error is going to be thrown, else the index of the occurrence is returned.

This function gives back the position, where the transformation was saved in a FloatDataArray. If there is no entry, an error is thrown to indicate that a transformation has to be calculated before calling this comparison operator.

void transform ( PeakSpectrum spec)

calculate the Discrete Cosines Fourier Transformation.

This function transforms a given PeakSpectrum to a Discrete Cosines Fourier Transformation. It stores only the part of the cosines of the FFT in the FloatDataArray which is a container from the PeakSpectrum. Only call this function, if you are sure there is no other transformation done earlier over the same PeakSpectrum, because it isn't checked if there already exists a transformation.


OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:28 using doxygen 1.8.5