diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-10-01 23:52:35 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-10-01 23:52:44 +0200 |
| commit | 077065dcaaf276e5b4a87e6525f4ed7d48714ddd (patch) | |
| tree | 51ddc6800ea683f1b36061b98510957512b90fff /src | |
| parent | e873f8724b179ebee28170866f1de222d7a68497 (diff) | |
Remove _ir member variable.
Diffstat (limited to 'src')
| -rw-r--r-- | src/leqm_nrt.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/leqm_nrt.cc b/src/leqm_nrt.cc index 357d1c9..eb2ee3c 100644 --- a/src/leqm_nrt.cc +++ b/src/leqm_nrt.cc @@ -58,11 +58,10 @@ class Worker { public: Worker(std::vector<double> buffer, int nsamples, int nch, std::vector<double> const& ir, Sum* sum, std::vector<double> chconf) - : _ir(ir) - , _sum(sum) + : _sum(sum) , _chconf(chconf) { - _thread = std::thread(std::bind(&Worker::process, this, buffer, nsamples, nch)); + _thread = std::thread(std::bind(&Worker::process, this, buffer, nsamples, nch, ir)); } Worker(Worker& other) = delete; @@ -81,7 +80,7 @@ public: private: - void process(std::vector<double>& buffer, int nsamples, int nch) + void process(std::vector<double>& buffer, int nsamples, int nch, std::vector<double> const& ir) { auto accumulate_ch = [](std::vector<double>& ch_accumulator, std::vector<double> const& input_channel, int nsamples) { for (auto i = 0; i < nsamples; i++) { @@ -130,7 +129,7 @@ private: normalized_buffer[m] = buffer[n] * _chconf[ch]; //this scale amplitude according to specified calibration } - auto convolved_buffer = convolve(normalized_buffer, _ir); + auto convolved_buffer = convolve(normalized_buffer, ir); accumulate_ch(ch_sum_accumulator_norm, rectify(normalized_buffer), frames); accumulate_ch(ch_sum_accumulator_conv, rectify(convolved_buffer), frames); } @@ -138,7 +137,6 @@ private: _sum->sum_samples(ch_sum_accumulator_norm, ch_sum_accumulator_conv, frames); } - std::vector<double> const& _ir; Sum* _sum; std::vector<double> _chconf; |
