libpappsomspp
Library for mass spectrometry
|
uses Savitsky-Golay filter on trace More...
#include <savgolfilter.h>
Public Member Functions | |
FilterSavitzkyGolay (int nL, int nR, int m, int lD, bool convolveWithNr=false) | |
FilterSavitzkyGolay (const SavGolParams sav_gol_params) | |
FilterSavitzkyGolay (const QString ¶meters) | |
FilterSavitzkyGolay (const FilterSavitzkyGolay &other) | |
virtual | ~FilterSavitzkyGolay () |
FilterSavitzkyGolay & | operator= (const FilterSavitzkyGolay &other) |
Trace & | filter (Trace &data_points) const override |
SavGolParams | getParameters () const |
char | runFilter (double *y_data_p, double *y_filtered_data_p, int data_point_count) const |
Perform the Savitzky-Golay filtering process. More... | |
void | filteredData (std::vector< pappso_double > &data) |
QString | name () const override |
QString | toString () const override |
Return a string with the textual representation of the configuration data. More... | |
![]() | |
virtual | ~FilterNameInterface () |
![]() | |
virtual | ~FilterInterface () |
Protected Member Functions | |
void | buildFilterFromString (const QString &strBuildParams) override |
build this filter using a string More... | |
Private Member Functions | |
int * | ivector (long nl, long nh) const |
pappso_double * | dvector (long nl, long nh) const |
pappso_double ** | dmatrix (long nrl, long nrh, long ncl, long nch) const |
void | free_ivector (int *v, long nl, long nh) const |
void | free_dvector (pappso_double *v, long nl, long nh) const |
void | free_dmatrix (pappso_double **m, long nrl, long nrh, long ncl, long nch) const |
void | lubksb (pappso_double **a, int n, int *indx, pappso_double b[]) const |
void | ludcmp (pappso_double **a, int n, int *indx, pappso_double *d) const |
void | four1 (pappso_double data[], unsigned long nn, int isign) |
void | twofft (pappso_double data1[], pappso_double data2[], pappso_double fft1[], pappso_double fft2[], unsigned long n) |
void | realft (pappso_double data[], unsigned long n, int isign) |
char | convlv (pappso_double data[], unsigned long n, pappso_double respns[], unsigned long m, int isign, pappso_double ans[]) |
char | sgcoeff (pappso_double c[], int np, int nl, int nr, int ld, int m) const |
Private Attributes | |
SavGolParams | m_params |
pappso_double * | m_x |
C array of keys of the Trace. More... | |
pappso_double * | m_yr |
C array of raw values of the Trace. More... | |
pappso_double * | m_yf |
C array of filtered values after the computation has been performed. More... | |
uses Savitsky-Golay filter on trace
Definition at line 128 of file savgolfilter.h.
pappso::FilterSavitzkyGolay::FilterSavitzkyGolay | ( | int | nL, |
int | nR, | ||
int | m, | ||
int | lD, | ||
bool | convolveWithNr = false |
||
) |
Construct a FilterSavitzkyGolay instance using the Savitzky-Golay parameters
nL | number of data point left of the point being filtered |
nR | number of data point right of the point being filtered |
m | order of the polynomial to use in the regression analysis |
lD | order of the derivative to extract |
convolveWithNr | set to false |
Definition at line 55 of file savgolfilter.cpp.
References pappso::SavGolParams::convolveWithNr, pappso::SavGolParams::lD, pappso::SavGolParams::m, m_params, pappso::SavGolParams::nL, and pappso::SavGolParams::nR.
pappso::FilterSavitzkyGolay::FilterSavitzkyGolay | ( | const SavGolParams | sav_gol_params | ) |
Definition at line 66 of file savgolfilter.cpp.
References pappso::SavGolParams::convolveWithNr, pappso::SavGolParams::lD, pappso::SavGolParams::m, m_params, pappso::SavGolParams::nL, and pappso::SavGolParams::nR.
pappso::FilterSavitzkyGolay::FilterSavitzkyGolay | ( | const QString & | parameters | ) |
Definition at line 110 of file savgolfilter.cpp.
References buildFilterFromString().
pappso::FilterSavitzkyGolay::FilterSavitzkyGolay | ( | const FilterSavitzkyGolay & | other | ) |
Copy constructor
other | TODO |
Definition at line 76 of file savgolfilter.cpp.
References pappso::SavGolParams::convolveWithNr, pappso::SavGolParams::lD, pappso::SavGolParams::m, m_params, pappso::SavGolParams::nL, and pappso::SavGolParams::nR.
|
virtual |
|
overrideprotectedvirtual |
build this filter using a string
strBuildParams | a string coding the filter and its parameters "filterName|param1;param2;param3" |
Implements pappso::FilterNameInterface.
Definition at line 117 of file savgolfilter.cpp.
References pappso::SavGolParams::convolveWithNr, pappso::SavGolParams::lD, pappso::SavGolParams::m, m_params, name(), pappso::SavGolParams::nL, and pappso::SavGolParams::nR.
Referenced by FilterSavitzkyGolay().
|
private |
Definition at line 533 of file savgolfilter.cpp.
References dvector(), free_dvector(), realft(), and twofft().
Referenced by runFilter().
|
private |
|
private |
Definition at line 216 of file savgolfilter.cpp.
Referenced by convlv(), filter(), ludcmp(), runFilter(), and sgcoeff().
Implements pappso::FilterInterface.
Definition at line 140 of file savgolfilter.cpp.
References pappso::SavGolParams::convolveWithNr, dvector(), m_params, and runFilter().
void pappso::FilterSavitzkyGolay::filteredData | ( | std::vector< pappso_double > & | data | ) |
|
private |
|
private |
Definition at line 276 of file savgolfilter.cpp.
Referenced by sgcoeff().
|
private |
Definition at line 267 of file savgolfilter.cpp.
Referenced by convlv(), ludcmp(), runFilter(), and sgcoeff().
|
private |
Definition at line 258 of file savgolfilter.cpp.
Referenced by sgcoeff().
SavGolParams pappso::FilterSavitzkyGolay::getParameters | ( | ) | const |
Definition at line 180 of file savgolfilter.cpp.
References pappso::SavGolParams::convolveWithNr, pappso::SavGolParams::lD, pappso::SavGolParams::m, m_params, pappso::SavGolParams::nL, and pappso::SavGolParams::nR.
|
private |
|
private |
Definition at line 288 of file savgolfilter.cpp.
References pappso::a, pappso::b, and pappso::sum.
Referenced by sgcoeff().
|
private |
Definition at line 319 of file savgolfilter.cpp.
References pappso::a, dvector(), free_dvector(), and pappso::sum.
Referenced by sgcoeff().
|
overridevirtual |
Implements pappso::FilterNameInterface.
Definition at line 196 of file savgolfilter.cpp.
Referenced by buildFilterFromString(), and toString().
FilterSavitzkyGolay & pappso::FilterSavitzkyGolay::operator= | ( | const FilterSavitzkyGolay & | other | ) |
Definition at line 93 of file savgolfilter.cpp.
References pappso::SavGolParams::convolveWithNr, pappso::SavGolParams::lD, pappso::SavGolParams::m, m_params, pappso::SavGolParams::nL, and pappso::SavGolParams::nR.
|
private |
Definition at line 481 of file savgolfilter.cpp.
References four1().
Referenced by convlv().
char pappso::FilterSavitzkyGolay::runFilter | ( | double * | y_data_p, |
double * | y_filtered_data_p, | ||
int | data_point_count | ||
) | const |
Perform the Savitzky-Golay filtering process.
Definition at line 637 of file savgolfilter.cpp.
References pappso::c, convlv(), dvector(), free_dvector(), pappso::SavGolParams::lD, pappso::SavGolParams::m, m_params, pappso::SavGolParams::nL, pappso::SavGolParams::nR, and sgcoeff().
Referenced by filter().
|
private |
Definition at line 583 of file savgolfilter.cpp.
References pappso::a, pappso::b, pappso::c, dmatrix(), dvector(), free_dmatrix(), free_dvector(), free_ivector(), ivector(), lubksb(), ludcmp(), and pappso::sum.
Referenced by runFilter().
|
overridevirtual |
Return a string with the textual representation of the configuration data.
Implements pappso::FilterNameInterface.
Definition at line 189 of file savgolfilter.cpp.
References m_params, name(), and pappso::SavGolParams::toString().
|
private |
|
private |
Definition at line 181 of file savgolfilter.h.
Referenced by FilterSavitzkyGolay(), buildFilterFromString(), filter(), getParameters(), operator=(), runFilter(), and toString().
|
private |
C array of keys of the Trace.
Definition at line 186 of file savgolfilter.h.
|
private |
C array of filtered values after the computation has been performed.
Definition at line 192 of file savgolfilter.h.
|
private |
C array of raw values of the Trace.
Definition at line 189 of file savgolfilter.h.