summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-10-01 23:44:59 +0200
committerCarl Hetherington <cth@carlh.net>2023-10-01 23:44:59 +0200
commite91c0c06be6334f2566cfffe74b7f79dc2e11131 (patch)
treed7758ca175ef71fe80207c078acf384e1d45cffe /src
parentb7f91b2da4c98318c24d94d613f188663d366ee2 (diff)
Move rectify into process.
Diffstat (limited to 'src')
-rw-r--r--src/leqm_nrt.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/leqm_nrt.cc b/src/leqm_nrt.cc
index 9f3e3f7..484474d 100644
--- a/src/leqm_nrt.cc
+++ b/src/leqm_nrt.cc
@@ -84,15 +84,6 @@ public:
private:
- std::vector<double> rectify(std::vector<double> const& input) const
- {
- std::vector<double> squared;
- for (auto i: input) {
- squared.push_back(pow(i, 2));
- }
- return squared;
- }
-
void process()
{
auto accumulate_ch = [](std::vector<double>& ch_accumulator, std::vector<double> const& input_channel, int nsamples) {
@@ -118,6 +109,14 @@ private:
return result;
};
+ auto rectify = [](std::vector<double> const& input) {
+ std::vector<double> squared;
+ for (auto i: input) {
+ squared.push_back(pow(i, 2));
+ }
+ return squared;
+ };
+
/* Round-up in case _nsamples is not a multiple of _nch */
int const frames = (_nsamples + _nch - 1) / _nch;