@@ -67,10 +67,21 struct SpectrogramCosinus : public ICosinusType { | |||
|
67 | 67 | std::vector<double> valuesData, Unit xAxisUnit, |
|
68 | 68 | Unit valuesUnit) const override |
|
69 | 69 | { |
|
70 | return std::make_shared<SpectrogramSeries>(std::move(xAxisData), m_YAxisData, | |
|
71 | std::move(valuesData), xAxisUnit, m_YAxisUnit, | |
|
72 | valuesUnit); | |
|
70 | 73 | } |
|
71 | 74 | |
|
72 | 75 | void generateValues(double x, std::vector<double> &values, int dataIndex) const override |
|
73 | 76 | { |
|
77 | auto componentCount = this->componentCount(); | |
|
78 | for (int i = 0; i < componentCount; ++i) { | |
|
79 | auto y = m_YAxisData[i]; | |
|
80 | auto r = 3 * std::sqrt(x * x + y * y) + 1e-2; | |
|
81 | auto value = 2 * x * (std::cos(r + 2) / r - std::sin(r + 2) / r); | |
|
82 | ||
|
83 | values[componentCount * dataIndex + i] = value; | |
|
84 | } | |
|
74 | 85 | } |
|
75 | 86 | |
|
76 | 87 | std::vector<double> m_YAxisData; |
General Comments 0
You need to be logged in to leave comments.
Login now