mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-12-25 10:28:28 +01:00
Fixed bug with operators
This commit is contained in:
parent
27394a091f
commit
38c1949538
@ -124,7 +124,7 @@ namespace dsp {
|
||||
}
|
||||
|
||||
if constexpr (std::is_same_v<T, complex_t>) {
|
||||
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);
|
||||
|
@ -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};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user