##// END OF EJS Templates
Implements methods for generating spectrograms in the plugin
Alexandre Leroux -
r896:ba6dbb64fae0
parent child
Show More
@@ -67,10 +67,21 struct SpectrogramCosinus : public ICosinusType {
67 std::vector<double> valuesData, Unit xAxisUnit,
67 std::vector<double> valuesData, Unit xAxisUnit,
68 Unit valuesUnit) const override
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 void generateValues(double x, std::vector<double> &values, int dataIndex) const override
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 std::vector<double> m_YAxisData;
87 std::vector<double> m_YAxisData;
General Comments 0
You need to be logged in to leave comments. Login now