From 38c1949538f05d367ab112d5608f14e01ef4ed58 Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Mon, 29 Mar 2021 22:28:26 +0200 Subject: [PATCH] Fixed bug with operators --- core/src/dsp/math.h | 2 +- core/src/dsp/types.h | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/src/dsp/math.h b/core/src/dsp/math.h index b2f8e8ec..62241d1f 100644 --- a/core/src/dsp/math.h +++ b/core/src/dsp/math.h @@ -124,7 +124,7 @@ namespace dsp { } if constexpr (std::is_same_v) { - volk_32fc_x2_multiply_32fc(out.writeBuf, _a->readBuf, _b->readBuf, a_count); + volk_32fc_x2_multiply_32fc((lv_32fc_t*)out.writeBuf, (lv_32fc_t*)_a->readBuf, (lv_32fc_t*)_b->readBuf, a_count); } else { volk_32f_x2_multiply_32f(out.writeBuf, _a->readBuf, _b->readBuf, a_count); diff --git a/core/src/dsp/types.h b/core/src/dsp/types.h index 787bb590..af1e35c8 100644 --- a/core/src/dsp/types.h +++ b/core/src/dsp/types.h @@ -2,19 +2,19 @@ namespace dsp { struct complex_t { - complex_t& operator*(const float& b) { + complex_t operator*(const float b) { return complex_t{re*b, im*b}; } - complex_t& operator*(const complex_t& b) { + complex_t operator*(const complex_t& b) { return complex_t{(re*b.re) - (im*b.im), (im*b.re) + (re*b.im)}; } - complex_t& operator+(const complex_t& b) { + complex_t operator+(const complex_t& b) { return complex_t{re+b.re, im+b.im}; } - complex_t& operator-(const complex_t& b) { + complex_t operator-(const complex_t& b) { return complex_t{re-b.re, im-b.im}; } @@ -27,15 +27,15 @@ namespace dsp { }; struct stereo_t { - stereo_t& operator*(const float& b) { + stereo_t operator*(const float b) { return stereo_t{l*b, r*b}; } - stereo_t& operator+(const stereo_t& b) { + stereo_t operator+(const stereo_t& b) { return stereo_t{l+b.l, r+b.r}; } - stereo_t& operator-(const stereo_t& b) { + stereo_t operator-(const stereo_t& b) { return stereo_t{l-b.l, r-b.r}; }