mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-13 12:35:41 +02:00
Added back the digital demodulators
This commit is contained in:
@ -1,8 +1,18 @@
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
|
||||
namespace dsp::math {
|
||||
template <class T>
|
||||
inline T step(T x) {
|
||||
return (x > 0.0) ? 1.0 : -1.0;
|
||||
// TODO: Switch to cursed bit manipulation instead!
|
||||
if constexpr (std::is_same_v<T, complex_t>) {
|
||||
return { (x.re > 0.0f) ? 1.0f : -1.0f, (x.im > 0.0f) ? 1.0f : -1.0f };
|
||||
}
|
||||
else if constexpr (std::is_same_v<T, stereo_t>) {
|
||||
return { (x.l > 0.0f) ? 1.0f : -1.0f, (x.r > 0.0f) ? 1.0f : -1.0f };
|
||||
}
|
||||
else {
|
||||
return (x > 0.0) ? 1.0 : -1.0;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user