Analog Devices VISUALDSP++ 3.5 Manual page 371

C/c++ compiler and library for adsp-219x processors
Hide thumbs Also See for VISUALDSP++ 3.5:
Table of Contents

Advertisement

π
sine [0,
π
sine [-
/2, 0] = -sine [
The function below uses these properties to calculate the full period (from
0 to 2π) of the
#include <math.h>
fract16 sin2pi_fr16 (fract16 x)
{
if (x < 0x2000) {
/* first quadrant [0..
/* sin_fr16([0x0..0x7fff]) = [0..0x7fff)
return sin_fr16(x * 4);
} else if (x < 0x6000) {
/* if (x < 0x4000)
/* second quadrant [
/* -sin_fr16([0x8000..0x0)) = [0x7fff..0) */
/*
/* if (x < 0x6000)
/* third quadrant [
/* -sin_fr16([0x0..0x7fff]) = [0..0x8000) */
return -sin_fr16((0xc000 + x) * 4);
} else {
/* fourth quadrant [3/2
/* sin_fr16([0x8000..0x0)) = [0x8000..0)
return sin_fr16((0x8000 + x) * 4);
}
}
See Also
asin,
cos
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
for ADSP-219x DSPs
π
/2] = -sine [
, 3/2
π
/2,
function using an input domain of
sine
π
C/C++ Run-Time Library
π
]
π
]
/* <0.25 */
π
/2):
/* < 0.75 */
π
π
/2..
):
π
..3/2
):
π
π
..
):
.
[0, 0x7fff]
*/
*/
*/
*/
*/
*/
*/
*/
*/
3-117

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?

Related Products for Analog Devices VISUALDSP++ 3.5

Table of Contents