From f211f9628854b417000192c59d6ab22b946119b1 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 22 May 2022 13:37:49 -0400 Subject: make helper funcs inline; drop std::span for algo --- examples/3_fir.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/3_fir.cpp') diff --git a/examples/3_fir.cpp b/examples/3_fir.cpp index 3a68500..b6d8751 100644 --- a/examples/3_fir.cpp +++ b/examples/3_fir.cpp @@ -7,9 +7,9 @@ * within the available execution time. Samples are also normalized so that they center around zero. */ -Sample *process_data(Samples samples) +Sample* process_data(Samples samples) { - static Sample buffer[samples.size()]; + static Samples buffer; // Define the filter: constexpr unsigned int filter_size = 3; @@ -21,7 +21,7 @@ Sample *process_data(Samples samples) // Do an overlap-save convolution static Sample prev[filter_size]; - for (int n = 0; n < samples.size(); n++) { + for (int n = 0; n < SIZE; n++) { // Using a float variable for accumulation allows for better code optimization float v = 0; @@ -40,7 +40,7 @@ Sample *process_data(Samples samples) // Save samples for next convolution for (int i = 0; i < filter_size; i++) - prev[i] = samples[samples.size() - filter_size + i]; + prev[i] = samples[SIZE - filter_size + i]; return buffer; } -- cgit v1.2.3