RM0440
that only one operation is needed to obtain two values. This is the case, for example, when
performing polar-to-rectangular conversion: sin θ also generates cos θ, while cos θ also
generates sin θ. Similarly for rectangular-to-polar conversion (phase(x,y), modulus(x,y)) and
for hyperbolic functions (cosh θ, sinh θ).
Note:
The exponential function, exp x, can be obtained as the sum of sinh x and cosh x.
Furthermore, base N logarithms, log
where K = 1/ln N.
For certain functions (atan, log, sqrt) a scaling factor (see
extend the range of the function beyond the maximum [-1, 1] supported by the q1.31 fixed
point format. The scaling factor must be set to 0 for all other circular functions, and to 1 for
hyperbolic functions.
Cosine
Parameter
ARG1
ARG2
RES1
RES2
SCALE
This function calculates the cosine of an angle in the range -π to π. It can also be used to
perform polar to rectangular conversion.
The primary argument is the angle θ in radians. It must be divided by π before programming
ARG1.
The secondary argument m is the modulus, m. If m is greater than 1, a scaling must be
applied in software to adapt it to the q1.31 range of ARG2.
The primary result, RES1, is the cosine of the angle, multiplied by the modulus.
The secondary result, RES2, is the sine of the angle, multiplied by the modulus.
Sine
Parameter
ARG1
ARG2
RES1
RES2
SCALE
This function calculates the sine of an angle in the range -π to π. It can also be used to
perform polar to rectangular conversion.
x, can be derived by multiplying ln x by a constant K,
N
Table 92. Cosine parameters
Angle θ in radians, divided by π
Modulus m
m · cos θ
m · sin θ
Not applicable
Table 93. Sine parameters
Angle θ in radians, divided by π
Modulus m
m · sin θ
m · cos θ
Not applicable
RM0440 Rev 1
CORDIC co-processor (CORDIC)
Section
Description
Description
16.3.4) can be applied to
Range
[-1, 1]
[0, 1]
[-1, 1]
[-1, 1]
0
Range
[-1, 1]
[0, 1]
[-1, 1]
[-1, 1]
0
427/2083
445
Need help?
Do you have a question about the STM32G4 Series and is the answer not in the manual?