vinniefalco / DSPFilters

A Collection of Useful C++ Classes for Digital Signal Processing
1.79k stars 371 forks source link

Optimize on 32bit machines using 32-bit float as default type #33

Open qywx opened 7 years ago

qywx commented 7 years ago

For example ARM Cortex-M4 is 32-bit core. It has 32-bit FPU and can multiply and divide float values in one instruction. But operating with double values is much less efficient. So let's discuss and decide what should be changed to make float default type for the DspFilters library. Please help. Thank you.

galchinsky commented 7 years ago
  1. Templates in templates like in this PR https://github.com/vinniefalco/DSPFilters/pull/22/files
  2. Preprocessor macro #define FLOATTYPE float

The second one is easier to implement. You should check for numerical issues though.