diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2021-10-30 10:12:07 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2021-10-30 10:12:07 -0400 |
commit | 6f1c5203f14f82b6a10c9756ef1dc39bc8631ec0 (patch) | |
tree | 61dac19762297fd9ae1111ba47720b61eff02797 /gui/templates/1_convolve_simple.cpp | |
parent | e4a8d6eefc267c3a38d5237205421cbbe6eaebe8 (diff) |
remove gui (now in stmdspgui repo)
Diffstat (limited to 'gui/templates/1_convolve_simple.cpp')
-rw-r--r-- | gui/templates/1_convolve_simple.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/gui/templates/1_convolve_simple.cpp b/gui/templates/1_convolve_simple.cpp deleted file mode 100644 index 0f1973d..0000000 --- a/gui/templates/1_convolve_simple.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 1_convolve_simple.cpp - * Written by Clyne Sullivan. - * - * Computes a convolution in the simplest way possible. While the code is brief, it lacks many - * possible optimizations. The convolution's result will not fill the output buffer either, as the - * transient response is not calculated. - */ - -adcsample_t *process_data(adcsample_t *samples, unsigned int size) -{ - // Define our output buffer. SIZE is the largest size of the 'samples' buffer. - static adcsample_t buffer[SIZE]; - - // Define our filter - constexpr unsigned int filter_size = 3; - float filter[filter_size] = { - 0.3333, 0.3333, 0.3333 - }; - - // Begin convolving: - for (int n = 0; n < size - (filter_size - 1); n++) { - buffer[n] = 0; - for (int k = 0; k < filter_size; k++) - buffer[n] += samples[n + k] * filter[k]; - } - - return buffer; -} |