IQmath Library
IQmath Library
IQmath
IQmath
Library:
Library:
math & trig functions (v1.4)
math & trig functions (v1.4)
Accuracy of functions/operations approx ~28 to ~31 bits
IQsin
IQsin
(A),
(A),
IQcos
IQcos
(A)
(A)
IQsinPU
IQsinPU
(A),
(A),
IQcosPU
IQcosPU
(A)
(A)
IQatan(A),IQatan2(A,B)
IQatan(A),IQatan2(A,B)
IQatan2PU(A,B)
IQatan2PU(A,B)
IQsqrt
IQsqrt
(A),
(A),
IQisqrt
IQisqrt
(A)
(A)
IQmag
IQmag
(A,B)
(A,B)
_
_
IQsin
IQsin
(A), _
(A), _
IQcos
IQcos
(A)
(A)
_
_
IQsinPU
IQsinPU
(A), _
(A), _
IQcosPU
IQcosPU
(A)
(A)
_
_
IQatan
IQatan
(A), _IQatan2(A,B)
(A), _IQatan2(A,B)
_IQatan2PU(A,B)
_IQatan2PU(A,B)
_
_
IQsqrt
IQsqrt
(A), _
(A), _
IQisqrt
IQisqrt
(A)
(A)
_
_
IQmag
IQmag
(A,B)
(A,B)
sin(A),
sin(A),
cos
cos
(A)
(A)
sin(A*2pi),cos(A*2pi)
sin(A*2pi),cos(A*2pi)
atan(A),atan2(A,B)
atan(A),atan2(A,B)
atan2(A,B)/2pi
atan2(A,B)/2pi
sqrt(A),1/sqrt(A)
sqrt(A),1/sqrt(A)
sqrt
sqrt
(A*A + B*B)
(A*A + B*B)
trig
trig
functions
functions
IQsat
IQsat
(A,Pos,
(A,Pos,
Neg
Neg
)
)
_
_
IQsat
IQsat
(A,Pos,
(A,Pos,
Neg
Neg
)
)
if(A > Pos) A = Pos
if(A > Pos) A = Pos
if(A <
if(A <
Neg
Neg
) A =
) A =
Neg
Neg
saturation
saturation
A
A
–
–
B
B
A
A
-
-
B
B
A
A
-
-
B
B
substract
substract
>, >=, <, <=, ==, |=, &&, ||
>, >=, <, <=, ==, |=, &&, ||
>, >=, <, <=, ==, |=, &&, ||
>, >=, <, <=, ==, |=, &&, ||
>, >=, <, <=, ==, |=, &&, ||
>, >=, <, <=, ==, |=, &&, ||
boolean
boolean
A + B
A + B
A + B
A + B
A + B
A + B
add
add
A / B
A / B
_
_
IQdiv
IQdiv
(A , B)
(A , B)
A / B
A / B
divide
divide
A * B
A * B
_
_
IQmpy
IQmpy
(A , B)
(A , B)
A * B
A * B
multiply
multiply
A = IQ(1.2345)
A = IQ(1.2345)
A = _IQ(1.2345)
A = _IQ(1.2345)
A = 1.2345
A = 1.2345
constant
constant
iq
iq
A, B;
A, B;
_
_
iq
iq
A, B;
A, B;
float A, B;
float A, B;
type
type
“IQmath” in C++
“IQmath” in C++
“IQmath” in C
“IQmath” in C
Floating
Floating
-
-
Point
Point
Operation
Operation
Additionally, the "IQmath" library contains DSP library modules for filters (FIR & IIR) and Fast
Fourier Transforms (FFT & IFFT).
IQmath
IQmath
Library:
Library:
Conversion Functions (v1.4)
Conversion Functions (v1.4)
IQmath.lib
> contains library of math functions
IQmathLib.h
> C header file
IQmathCPP.h
> C++ header file
atoIQ
atoIQ
(char)
(char)
_
_
atoIQ
atoIQ
(char)
(char)
atof
atof
(char)
(char)
string to
string to
iq
iq
IQtoQN
IQtoQN
(A)
(A)
_
_
IQtoQN
IQtoQN
(A)
(A)
A
A
iq
iq
to
to
qN
qN
QNtoIQ
QNtoIQ
(A)
(A)
_
_
QNtoIQ
QNtoIQ
(A)
(A)
A
A
qN
qN
to
to
iq
iq
IQmpyI32int(A,B)
IQmpyI32int(A,B)
_IQmpyI32int(A,B)
_IQmpyI32int(A,B)
(long) (A * (float) B)
(long) (A * (float) B)
integer(
integer(
iq
iq
*long)
*long)
IQmpyI32frac(A,B)
IQmpyI32frac(A,B)
_IQmpyI32frac(A,B)
_IQmpyI32frac(A,B)
A
A
-
-
(long) (A * (float) B)
(long) (A * (float) B)
fraction(
fraction(
iq
iq
*long)
*long)
IQtoF
IQtoF
(A)
(A)
_
_
IQtoF
IQtoF
(A)
(A)
A
A
IQ to float
IQ to float
IQmpyI32(A,B)
IQmpyI32(A,B)
_IQmpyI32(A,B)
_IQmpyI32(A,B)
A * (float) B
A * (float) B
iq
iq
=
=
iq
iq
*long
*long
IQfrac
IQfrac
(A)
(A)
_
_
IQfrac
IQfrac
(A)
(A)
A
A
–
–
(long) A
(long) A
fraction(
fraction(
iq
iq
)
)
IQint
IQint
(A)
(A)
_
_
IQint
IQint
(A)
(A)
(long) A
(long) A
integer(
integer(
iq
iq
)
)
IQNtoIQ
IQNtoIQ
(A)
(A)
_
_
IQNtoIQ
IQNtoIQ
(A)
(A)
A
A
iqN
iqN
to
to
iq
iq
IQtoIQN
IQtoIQN
(A)
(A)
_
_
IQtoIQN
IQtoIQN
(A)
(A)
A
A
iq
iq
to
to
iqN
iqN
“IQmath” in C++
“IQmath” in C++
“IQmath” in C
“IQmath” in C
Floating
Floating
-
-
Point
Point
Operation
Operation
8 - 24
C28x - Numerical Concepts & IQmath
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...