LIBML
Version 3.2.4
LIBML DSP Software Library
|
Functions | |
f32_t | tpt_cos_f32 (f32_t x) |
Fast approximation to the trigonometric cosine function for floating-point data. More... | |
f64_t | tpt_cos_f64 (f64_t x) |
Fast approximation to the trigonometric cosine function for floating-point data. More... | |
q15_t | tpt_cos_q15 (q15_t x) |
Fast approximation to the trigonometric cosine function for Q15 data. More... | |
q31_t | tpt_cos_q31 (q31_t x) |
Fast approximation to the trigonometric cosine function for Q31 data. More... | |
Use the look-up table to calculate the cosine value There are separate functions for Q15, Q31, and floating-point data types. The input to the floating-point version is in radians while the fixed-point Q15 and Q31 have a scaled input with the range [-1, 1) mapping to [-π, π). The fixed-point range is chosen so that a value of π wraps around to -π.
The implementation is based on table lookup using 4096 values.
Fast approximation to the trigonometric cosine function for floating-point data.
[in] | x | input value in radians |
Fast approximation to the trigonometric cosine function for floating-point data.
[in] | x | input value in radians |
Fast approximation to the trigonometric cosine function for Q15 data.
Fast approximation to the trigonometric cosine function for Q15.
[in] | x | Scaled input value in radians |
The Q15 input value is in the range [-1, 1) and is mapped to a radian value in the range [-π, π).