diff --git a/plotter.cpp b/plotter.cpp index 1f2aecdd..07bd92ed 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -191,7 +191,7 @@ CPlotter::drawData(WF::SWide swide) swide.begin(), [](auto const value) { - return 10.0f * std::log10(value); + return 10.0f * std::log10(value); }); // Same deal for flattening; full range. diff --git a/widegraph.cpp b/widegraph.cpp index 05c632c3..a5ba7c28 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -462,7 +462,13 @@ WideGraph::dataSink(WF::SPlot const & s, { // Normalize the average, unless there's just one round present. - if (m_waterfallNow != 1) for (auto & item : m_splot) item /= m_waterfallNow; + if (m_waterfallNow != 1) std::transform(m_splot.begin(), + m_splot.end(), + m_splot.begin(), + [now = m_waterfallNow](auto const value) + { + return value / now; + }); // Next round, we'll need a fresh picture. @@ -474,13 +480,7 @@ WideGraph::dataSink(WF::SPlot const & s, auto const end = it + std::min(m_swide.size(), static_cast(5000.0f / (nbpp * df3))); - for (; it != end; ++it) - { - auto const end = sit + nbpp; - - *it = nbpp * std::accumulate(sit, end, 0.0f); - sit = end; - } + for (; it != end; ++it, sit += nbpp) *it = nbpp * std::reduce(sit, sit + nbpp); } }