eisgenerator 1.0.x
|
Various math functions performed on eisgenerator types . More...
Functions | |
std::complex< fvalue > | eis::absGrad (const std::vector< eis::DataPoint > &data, size_t index) |
Calculates the element wise absolute gradient at the given point of the data given. | |
fvalue | eis::grad (const std::vector< fvalue > &data, const std::vector< fvalue > &omega, size_t index) |
Calculates derivative at the given point of the data given. | |
std::complex< fvalue > | eis::grad (const std::vector< eis::DataPoint > &data, size_t index) |
Calculates the gradient at the given point of the data given. | |
fvalue | eis::mean (const std::vector< fvalue > &data) |
Calculates the mean of the given data. | |
std::complex< fvalue > | eis::mean (const std::vector< eis::DataPoint > &data) |
Calculates the mean of the given data. | |
fvalue | eis::median (std::vector< fvalue > data) |
Calculates the median of the given data. | |
std::complex< fvalue > | eis::median (const std::vector< eis::DataPoint > &data) |
Calculates the median of the given data. | |
void | eis::difference (std::vector< eis::DataPoint > &a, const std::vector< eis::DataPoint > &b) |
Calculates the difference between two spectra. | |
std::vector< eis::DataPoint > | eis::rescale (const std::vector< eis::DataPoint > &data, size_t outputSize) |
Resamples the data to the given amount of points. | |
fvalue | eis::pearsonCorrelation (const std::vector< eis::DataPoint > &data) |
Calculates the Pearson correlation between the imaginary and the real part of the data. | |
fvalue | eis::nyquistAreaVariance (const std::vector< eis::DataPoint > &data, eis::DataPoint *centroid=nullptr) |
Calculates the variance of the distance of the data from a centroid in the nyquist plane. | |
fvalue | eis::maximumNyquistJump (const std::vector< eis::DataPoint > &data) |
Finds the maximum distance between subsequent points in the data in the nyquist plane. | |
void | eis::noise (std::vector< eis::DataPoint > &data, double amplitude, bool relative) |
Adds white noise to the data. | |
void | eis::removeDuplicates (std::vector< eis::DataPoint > &data) |
Removes duplicate data points from the data. | |
bool | eis::fvalueEq (fvalue a, fvalue b, unsigned int ulp=4) |
Checks two fvalues for equality. | |
std::vector< eis::DataPoint > | eis::fitToFrequencies (std::vector< fvalue > omegas, const std::vector< eis::DataPoint > &data, bool linearExtrapolation=false) |
This function resamples, extrapolates and interpolates to fit the data given to the frequencies also given. | |
Various math functions performed on eisgenerator types .
std::complex< fvalue > eis::absGrad | ( | const std::vector< eis::DataPoint > & | data, |
size_t | index ) |
Calculates the element wise absolute gradient at the given point of the data given.
data | The data to calculate the gradient on. |
index | The position in the data to calculate the gradient at. |
void eis::difference | ( | std::vector< eis::DataPoint > & | a, |
const std::vector< eis::DataPoint > & | b ) |
Calculates the difference between two spectra.
this function calculates an element wise a = a-b and ingores omega
a | The first operand, where b is subtracted |
b | The second operand that is subtracted from the first, must be the same size as a |
std::vector< eis::DataPoint > eis::fitToFrequencies | ( | std::vector< fvalue > | omegas, |
const std::vector< eis::DataPoint > & | data, | ||
bool | linearExtrapolation = false ) |
This function resamples, extrapolates and interpolates to fit the data given to the frequencies also given.
Data is resampled to the target size, interpolation for data points is performed using linear interpolation, extrapolation is performed using linear or base 10 logarithmic extrapolation.
omegas | The frequencies to resample the data to. |
data | The data to resample. |
linearExtrapolation | true if linear extrapolation is to be performed, otherwise base 10 logarithmic extrapolation is used. |
bool eis::fvalueEq | ( | fvalue | a, |
fvalue | b, | ||
unsigned int | ulp = 4 ) |
Checks two fvalues for equality.
Equality is considered given when the values are within ulp epsilons at the magnitude of the sum of operands.
a | the first value to compare |
b | the second value to compare |
std::complex< fvalue > eis::grad | ( | const std::vector< eis::DataPoint > & | data, |
size_t | index ) |
Calculates the gradient at the given point of the data given.
data | The data to calculate the gradient on. |
index | The position in the data to calculate the gradient at. |
fvalue eis::grad | ( | const std::vector< fvalue > & | data, |
const std::vector< fvalue > & | omega, | ||
size_t | index ) |
Calculates derivative at the given point of the data given.
data | The data to calculate the gradient on. |
index | The position in the data to calculate the gradient at. |
fvalue eis::maximumNyquistJump | ( | const std::vector< eis::DataPoint > & | data | ) |
Finds the maximum distance between subsequent points in the data in the nyquist plane.
data | The data to use. |
std::complex< fvalue > eis::mean | ( | const std::vector< eis::DataPoint > & | data | ) |
Calculates the mean of the given data.
data | The data to calculate the mean of. |
fvalue eis::mean | ( | const std::vector< fvalue > & | data | ) |
Calculates the mean of the given data.
data | The data to calculate the mean of. |
std::complex< fvalue > eis::median | ( | const std::vector< eis::DataPoint > & | data | ) |
Calculates the median of the given data.
data | The data to calculate the median of. |
fvalue eis::median | ( | std::vector< fvalue > | data | ) |
Calculates the median of the given data.
data | The data to calculate the median of. |
void eis::noise | ( | std::vector< eis::DataPoint > & | data, |
double | amplitude, | ||
bool | relative ) |
Adds white noise to the data.
data | The data to add noise to. |
amplitude | The amplitude of the noise. |
relative | If true, the amplitude will be taken as relative to the magnitude of the data, otherwise it will be taken as an absolute value. |
fvalue eis::nyquistAreaVariance | ( | const std::vector< eis::DataPoint > & | data, |
eis::DataPoint * | centroid = nullptr ) |
Calculates the variance of the distance of the data from a centroid in the nyquist plane.
data | The data to calculate on. |
centroid | The centroid to use, if nullptr is passed here, the mean of the data will be used as the centroid. |
fvalue eis::pearsonCorrelation | ( | const std::vector< eis::DataPoint > & | data | ) |
Calculates the Pearson correlation between the imaginary and the real part of the data.
data | Data to calculate the Pearson correlation on. |
void eis::removeDuplicates | ( | std::vector< eis::DataPoint > & | data | ) |
Removes duplicate data points from the data.
Duplicates are detected by checking the value of omega for sameness using fvalueEq with the default ulp.
data | the data to remove duplicates from |
std::vector< eis::DataPoint > eis::rescale | ( | const std::vector< eis::DataPoint > & | data, |
size_t | outputSize ) |
Resamples the data to the given amount of points.
data | Data to resample. |
outputSize | Size to resample to. |