Forum Discussion
1 Reply
- Altera_Forum
Honored Contributor
For things like that I normally inspect the library code to see if it's possible to offload into hardware. I think the way newlib computes sine and cosine is through lookup tables. There are other ways but I forget the math behind them, some use the Cordic algorithm for computing sine and cosine. Also if you only need a finite number of sine results a lookup table would probably work best. So if you had this: y = sin(a); and you know that you only have a finite input range for the variable 'a' you can just turn that into a lookup table. If you are familar with FFT and other similar algorithms that's what most people use.