Fourier Transformation Algorithms
helperlib
fourier.h
Go to the documentation of this file.
1
#ifndef FOURIER_H
2
#define FOURIER_H
3
4
#include <vector>
5
9
namespace
Fourier
{
10
enum class
Error
{
11
NONE
,
12
NO_VALUES
,
13
INVALID_DATASET
14
};
15
19
struct
InputData
{
21
std::vector<std::pair<double, double>>
data
;
22
24
Error
error
{
Error::NONE
};
25
32
operator
bool()
const
{
33
return
!
data
.empty() &&
error
==
Error::NONE
;
34
}
35
36
std::vector<std::pair<double, double>> &
operator()
() {
return
data
; }
37
const
std::vector<std::pair<double, double>> &
operator()
()
const
{
return
data
; }
38
};
39
43
struct
Coefficients
{
47
struct
Coefficient
{
49
int
order
{0};
51
double
a
{0};
53
double
b
{0};
54
};
55
57
std::vector<Coefficient>
coefficients
;
58
60
Error
error
{
Error::NONE
};
61
68
operator
bool()
const
{
69
return
!
coefficients
.empty() &&
error
==
Error::NONE
;
70
}
71
72
std::vector<Coefficient> &
operator()
() {
return
coefficients
; }
73
const
std::vector<Coefficient> &
operator()
()
const
{
return
coefficients
; }
74
};
75
84
bool
Equal
(
const
Coefficients& expected,
const
Coefficients& result);
85
95
bool
Equal
(
double
expected,
double
result,
double
maximumDelta = 1e-15);
96
};
97
98
#endif
Fourier::Coefficients::error
Error error
Definition:
fourier.h:60
Fourier::Error::NO_VALUES
@ NO_VALUES
Fourier::Coefficients::Coefficient::order
int order
< The order of the coefficient
Definition:
fourier.h:49
Fourier::Error::NONE
@ NONE
fourier.h
Fourier::InputData::operator()
std::vector< std::pair< double, double > > & operator()()
Definition:
fourier.h:36
Fourier::InputData
The input data to perform a fourier transformation.
Definition:
fourier.h:19
main
int main(int argc, char **argv)
Definition:
main.cpp:8
Fourier::Coefficients::Coefficient::a
double a
The b value of the coefficient.
Definition:
fourier.h:51
Fourier::Coefficients::coefficients
std::vector< Coefficient > coefficients
The posible error state of the dataset.
Definition:
fourier.h:57
ctest2JUnit.transform
transform
Definition:
ctest2JUnit.py:13
Fourier
The Fourier namespace is providing data structures to handle input and resulting coefficients of a fo...
Definition:
fourier.h:9
Fourier::InputData::data
std::vector< std::pair< double, double > > data
< The actual data as x/y dataset
Definition:
fourier.h:21
Fourier::Coefficients::operator()
const std::vector< Coefficient > & operator()() const
Definition:
fourier.h:73
Fourier::Coefficients::operator()
std::vector< Coefficient > & operator()()
Definition:
fourier.h:72
Fourier::Coefficients::Coefficient
The actual coefficient data point The actual coefficients derived by a fourier transformation.
Definition:
fourier.h:47
Fourier::Error
Error
Definition:
fourier.h:10
Fourier::Coefficients::Coefficient::b
double b
Definition:
fourier.h:53
Fourier::InputData::error
Error error
Definition:
fourier.h:24
Fourier::InputData::operator()
const std::vector< std::pair< double, double > > & operator()() const
Definition:
fourier.h:37
Fourier::Equal
bool Equal(const Coefficients &expected, const Coefficients &result)
Compares two coefficient lists of the same size.
Definition:
fourier.cpp:5
Fourier::Coefficients
The resulting coefficients of a fourier transformation.
Definition:
fourier.h:43
Fourier::Error::INVALID_DATASET
@ INVALID_DATASET
Generated by
1.8.18