aboutsummaryrefslogtreecommitdiffstats
path: root/templates/1_convolve_simple.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2021-08-08 22:12:53 -0400
committerClyne Sullivan <clyne@bitgloo.com>2021-08-08 22:12:53 -0400
commitbf0a126e8a9d30b77007829166f4bf91a3900079 (patch)
tree9d4a769daca81393a4562e96d9c2efb96092100a /templates/1_convolve_simple.cpp
parent707b24dd07236243269cf092728f85172e94e8a4 (diff)
update templates to new api; open template status fix
Diffstat (limited to 'templates/1_convolve_simple.cpp')
-rw-r--r--templates/1_convolve_simple.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/1_convolve_simple.cpp b/templates/1_convolve_simple.cpp
index 0f1973d..8de05d3 100644
--- a/templates/1_convolve_simple.cpp
+++ b/templates/1_convolve_simple.cpp
@@ -7,10 +7,10 @@
* transient response is not calculated.
*/
-adcsample_t *process_data(adcsample_t *samples, unsigned int size)
+Sample *process_data(Samples samples)
{
// Define our output buffer. SIZE is the largest size of the 'samples' buffer.
- static adcsample_t buffer[SIZE];
+ static Sample buffer[samples.size()];
// Define our filter
constexpr unsigned int filter_size = 3;
@@ -19,7 +19,7 @@ adcsample_t *process_data(adcsample_t *samples, unsigned int size)
};
// Begin convolving:
- for (int n = 0; n < size - (filter_size - 1); n++) {
+ for (int n = 0; n < samples.size() - (filter_size - 1); n++) {
buffer[n] = 0;
for (int k = 0; k < filter_size; k++)
buffer[n] += samples[n + k] * filter[k];