Compare Discrete Cosines value from a Fourier transformation, also known as Discrete Cosines Transformation. More...
#include <OpenMS/COMPARISON/SPECTRA/CompareFouriertransform.h>
Public Member Functions | |
| CompareFouriertransform () | |
| default constructor | |
| CompareFouriertransform (const CompareFouriertransform &source) | |
| copy constructor | |
| virtual | ~CompareFouriertransform () |
| destructor | |
|
| |
| CompareFouriertransform & | operator= (const CompareFouriertransform &source) |
| assignment operator | |
| double | operator() (const PeakSpectrum &) const |
| Dummy function. | |
| double | operator() (const PeakSpectrum &spec1, const PeakSpectrum &spec2) const |
| compare two PeakSpectrum by their Discrete Cosines Transformation. | |
| void | transform (PeakSpectrum &spec) |
| calculate the Discrete Cosines Fourier Transformation. | |
| static PeakSpectrumCompareFunctor * | create () |
| static const String | getProductName () |
| Returns the name used in the factory. | |
| 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. | |
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:| Name | Type | Default | Restrictions | Description |
|---|---|---|---|---|
| epsilon | float | 0.2 | defines the absolute error of the mass spectrometer |
default constructor
| CompareFouriertransform | ( | const CompareFouriertransform & | source | ) |
copy constructor
| virtual ~CompareFouriertransform | ( | ) | [virtual] |
destructor
| static PeakSpectrumCompareFunctor* create | ( | ) | [inline, static] |
| static const String getProductName | ( | ) | [inline, static] |
Returns the name used in the factory.
Reimplemented from PeakSpectrumCompareFunctor.
| 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.10.0 | Documentation generated on Thu Mar 7 2013 09:42:51 using doxygen 1.7.1 |