Trigonometric functions are commonly used in real-time control applications, particularly within the inner loops of control algorithms, where speed and accuracy is essential. The performance of trigonometric functions is a key careabout for designers of these systems as it can have a significant impact on the overall performance of the system. Until recently, trignometric functions based on lookup tables were considered faster than the polynomial-based methods; however, with the inclusion of floating-point units (FPUs) and faster clock speeds, polynomial-based approximations have gained favor. TI has developed C functions of the most commonly used trigonometric functions using these polynomial-based methods and has optimized them for TI's Arm®-based microcontrollers (MCUs) and microprocessors (MPUs). This application note surveys the trigonometric functions that are available today and shares the optimization techniques used in these functions, as well as the results of our optimization efforts.
The TI-optimized trigonometric functions presented in this document can be found in MCU+ SDK v8.5 and later.
Arm® and Cortex® are registered trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
All trademarks are the property of their respective owners.
Trigonometric functions are commonly used in real-time control applications, particularly within the inner loops of control algorithms, where speed and accuracy is essential. The performance of trigonometric functions is a key careabout for designers of these systems as it can have a significant impact on the overall performance of the system. Until recently, trignometric functions based on lookup tables were considered faster than the polynomial-based methods; however, with the inclusion of floating-point units (FPUs) and faster CPU clock speeds, polynomial-based approximations are gaining favor.
The most commonly used trigonometric functions are sine, cosine, arcsine, arccosine, arctangent, and atan2. Trigonometric optimization techniques for these functions fall into two categories:
These techniques are described in the following sections and the polynomial-based optimization techniques used by the TI Arm® Trigonometric Library are discussed.