Added macro for calculating the squared absolute value of a complex variable

master
Xavier Arteaga 4 years ago committed by Xavier Arteaga
parent 653177ca7c
commit fd0d804321

@ -44,6 +44,9 @@ extern "C" {
#define SRSRAN_FLOOR(NUM, DEN) ((NUM) / (DEN)) #define SRSRAN_FLOOR(NUM, DEN) ((NUM) / (DEN))
#define SRSRAN_ROUND(NUM, DEN) ((uint32_t)round((double)(NUM) / (double)(DEN))) #define SRSRAN_ROUND(NUM, DEN) ((uint32_t)round((double)(NUM) / (double)(DEN)))
// Complex squared absolute value
#define SRSRAN_CSQABS(X) (__real__(X) * __real__(X) + __imag__(X) * __imag__(X))
// Cumulative moving average // Cumulative moving average
#define SRSRAN_VEC_CMA(data, average, n) ((average) + ((data) - (average)) / ((n) + 1)) #define SRSRAN_VEC_CMA(data, average, n) ((average) + ((data) - (average)) / ((n) + 1))

Loading…
Cancel
Save