diff --git a/core/src/dsp/utils/math.h b/core/src/dsp/utils/math.h new file mode 100644 index 00000000..17fe733b --- /dev/null +++ b/core/src/dsp/utils/math.h @@ -0,0 +1,12 @@ +#pragma once +#include + +#define FL_M_PI 3.1415926535f + +namespace dsp { + namespace math { + inline float sinc(float omega, float x, float norm) { + return (x == 0.0f) ? 1.0f : (sinf(omega*x)/(norm*x)); + } + } +} \ No newline at end of file diff --git a/core/src/dsp/utils/window_functions.h b/core/src/dsp/utils/window_functions.h new file mode 100644 index 00000000..5f2dd4a0 --- /dev/null +++ b/core/src/dsp/utils/window_functions.h @@ -0,0 +1,28 @@ +#pragma once +#include + +namespace dsp { + namespace window_function { + inline float blackman(float n, float N, float alpha = 0.16f) { + float a0 = (1.0f-alpha) / 2.0f; + float a2 = alpha / 2.0f; + return a0 - (0.5f*cosf(2.0f*FL_M_PI*(n/N))) + (a2*cosf(4.0f*FL_M_PI*(n/N))); + } + + inline float blackmanThirdOrder(float n, float N, float a0, float a1, float a2, float a3) { + return a0 - (a1*cosf(2.0f*FL_M_PI*(n/N))) + (a2*cosf(4.0f*FL_M_PI*(n/N))) - (a3*cosf(6.0f*FL_M_PI*(n/N))); + } + + inline float nuttall(float n, float N) { + return blackmanThirdOrder(n, N, 0.3635819f, 0.4891775f, 0.1365995f, 0.0106411f); + } + + inline float blackmanNuttall(float n, float N) { + return blackmanThirdOrder(n, N, 0.3635819f, 0.4891775f, 0.1365995f, 0.0106411f); + } + + inline float blackmanHarris(float n, float N) { + return blackmanThirdOrder(n, N, 0.35875f, 0.48829f, 0.14128f, 0.01168f); + } + } +} \ No newline at end of file diff --git a/root/res/colormaps/websdr.json b/root/res/colormaps/websdr.json new file mode 100644 index 00000000..5c1302cb --- /dev/null +++ b/root/res/colormaps/websdr.json @@ -0,0 +1,11 @@ +{ + "name": "WebSDR", + "author": "Ryzerth", + "map": [ + "#000000", + "#000050", + "#FF00FF", + "#FFFF50", + "#FFFFFF" + ] +} \ No newline at end of file