diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-10-01 23:44:59 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-10-01 23:44:59 +0200 |
| commit | e91c0c06be6334f2566cfffe74b7f79dc2e11131 (patch) | |
| tree | d7758ca175ef71fe80207c078acf384e1d45cffe /src | |
| parent | b7f91b2da4c98318c24d94d613f188663d366ee2 (diff) | |
Move rectify into process.
Diffstat (limited to 'src')
| -rw-r--r-- | src/leqm_nrt.cc | 17 |
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; |
