TipiWiki2

[ DeSp ]

edit | Recent Changes | Find Page | All Pages | Front Page |

http://www.musicdsp.org/ - very good page about optimized routines

Calculate Trigonometric functions: sin, cos etc.

using Tables

using Polynomial Approximation

e.g. http://www.math.sfu.ca/~cbm/aands/page_76.htm

function r = cos_poly(x)
   x_rad = x;% * pi/180.0;

% Kosinus m. Genauigkeit p*10^-4
%    a2 = -.49670;
%    a4 = .03705;
%    r = 1+a2*(x_rad)^2 + a4*(x_rad)^4;

% Kosinus m. Genauigkeit p*10^-9
   a2 = -.4999999963;
   a4 =  .0416666418;
   a6 = -.0013888397;
   a8 =  .0000247609;
   a10 =-.0000002605;
   r = 1 + a2*(x_rad)^2 + a4*(x_rad)^4 + a6*x_rad^6 + a8*x_rad^8 + a10*x_rad^10;

DSP Programming

Usually
- very little memory
- no floating point
- possibly use Integer (16 Bit) instead of floating Point (IEEE-754: 32 Bit)