since I'm making a "synth" (drum synth), learning DSP and (recently) using optimization with SIMD, I'd like your opinion about two points, speaking about accuracy.
1 - on generating waves, which fp precision do you use?
Float or double? I'm really not able to "perceive" any differences generating a sin (or square) with basic functions like this:
Code: Select all
double value = sin(phase) * gain; // sine
double value = (phase <= PI ? 1.0 : -1.0) * gain; // square
double value = (((2.0 / TWOPI) * phase) - 1.0) * gain; // triangle
Or float is enough for a generated signal? Because processing floats with SIMD make stuff really lighter on CPU
2 - which kind of approx fuction error is required? I'm trying the "out of the box" IPP sin function right now, and I'm noticing that the performance really change between ippsSin_64fc_A26 (approximately 8 exact decimal digits) and ippsSin_64fc_A53 (maximum guaranteed error within 1 ulp). Would the first be enough, or its ALWAYS better stay at higher precision?
The idea is to abandon IPP and replace with a fancy SSE2 library sin approx, but I'd like to got any idea of what I need.
Or it really doesn't matter? For example, the (scalar) sin() function on math.h (for what I've read) seems to be dispatched due to the input vaue range, choosing the correct sin math approx (which I don't know the accuracy).
What do you use in your plugins?
Your opinios are always great
Thanks