The Arduino-Filters library is not available in the library manager. To install it, download the .ZIP file from GitHub and follow these instructions: https://www.arduino.cc/en/guide/libraries#toc4
If you have two libraries with "Filters.h" installed, Arduino might select the wrong one, so it's best to uninstall the other ones you might have installed.
The one example does compile now for a Nano but very weird does not compile for the STM32F103C8.
This is my error:
Arduino: 1.8.12 (Windows 10), Board: "Generic STM32F103C series, STM32F103CB (20k RAM. 128k Flash), STLink, 72Mhz (Normal), Smallest (default)"
In file included from C:\Users\mike\Documents\Arduino\libraries\Arduino-Filters-master\src/Filters/Notch.hpp:3:0,
from C:\Users\mike\AppData\Local\Temp\Rar$DIa15332.23396\FIRNotch\FIRNotch.ino:22:
C:\Users\mike\Documents\Arduino\libraries\Arduino-Filters-master\src/AH/STL/cmath:16:31: note: #pragma message: FMA math fix
#pragma message("FMA math fix")
^
C:\Users\mike\AppData\Local\Temp\Rar$DIa15332.23396\FIRNotch\FIRNotch.ino: In function 'void loop()':
FIRNotch:44:27: error: 'A0' was not declared in this scope
auto raw = analogRead(A0);
^
In file included from C:\Users\mike\Documents\Arduino\libraries\Arduino-Filters-master\src/Filters/Notch.hpp:4:0,
from C:\Users\mike\AppData\Local\Temp\Rar$DIa15332.23396\FIRNotch\FIRNotch.ino:22:
C:\Users\mike\Documents\Arduino\libraries\Arduino-Filters-master\src/Filters/FIRFilter.hpp: In instantiation of 'FIRFilter<N, T>::FIRFilter(const AH::Array<T, N>&) [with unsigned char N = 3u; T = float]':
C:\Users\mike\Documents\Arduino\libraries\Arduino-Filters-master\src/Filters/Notch.hpp:34:6: required from 'FIRFilter<3u, T> simpleNotchFIR(double) [with T = float]'
C:\Users\mike\AppData\Local\Temp\Rar$DIa15332.23396\FIRNotch\FIRNotch.ino:39:34: required from here
C:\Users\mike\Documents\Arduino\libraries\Arduino-Filters-master\src/Filters/FIRFilter.hpp:32:52: warning: missing initializer for member 'AH::Array<float, 3u>::data' [-Wmissing-field-initializers]
FIRFilter(const AH::Array<T, N> &coefficients) {
^
exit status 1
'A0' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
You should have installed a third-party core in the Arduino IDE boards manager to be able to compile for the STM32.
I'm not an STM32 expert, but IIRC, there are basically two of these cores: one newer, official core from STMicroelectronics, and one developed by the community. The latter uses an ancient toolchain, so I highly recommend using the official STM one: GitHub - stm32duino/Arduino_Core_STM32: STM32 core support for Arduino
I just tried the Butterworth example and it compiles without issues for the STM32F103C8 using the official core.
Wow...wow...wow Thanks.
If the Carma button was still on this new web page I will press it a 1000 times.
Now compiling without errors for the STM32F103C.
They have specific Filtering Functions
I'm not sure if the F103C8 has any SIMD or DSP instructions, but you might be able to squeeze a tiny bit of extra performance out of the (hand-?) optimized CMSIS filtering functions compared to the Arduino-Filters library. CMSIS also has fixed-point integer-math filters.