diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2022-04-30 08:41:56 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2022-04-30 08:42:45 -0400 |
commit | e164629b3839eee0fda0be0e0a9842e78cf02f2b (patch) | |
tree | b72b58665b85a104e5b953af45f00579341b2802 /gui/demos/2_iir_echo.cpp | |
parent | 162dd6de8a0d883962b0b1475f47cbb08e0958d4 (diff) | |
parent | 3dd57491b1e81a9d93054eff19ca0e6c65c85b9b (diff) |
merge in branch devel
Diffstat (limited to 'gui/demos/2_iir_echo.cpp')
-rw-r--r-- | gui/demos/2_iir_echo.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/gui/demos/2_iir_echo.cpp b/gui/demos/2_iir_echo.cpp deleted file mode 100644 index acb5c5d..0000000 --- a/gui/demos/2_iir_echo.cpp +++ /dev/null @@ -1,24 +0,0 @@ -Sample *process_data(Samples samples) -{ - constexpr unsigned int size = samples.size(); - constexpr unsigned int D = 2000; - - float alpha = readalt() / 4095.; - - static Sample output[size]; - static Sample prev[D]; // prev[0] = output[0 - D] - - // Do calculations with previous output - for (unsigned int i = 0; i < D; i++) - output[i] = samples[i] + alpha * (prev[i] - 2048); - - // Do calculations with current samples - for (unsigned int i = D; i < size; i++) - output[i] = samples[i] + alpha * (output[i - D] - 2048); - - // Save outputs for next computation - for (unsigned int i = 0; i < D; i++) - prev[i] = output[size - (D - i)]; - - return output; -} |