MATLAB REAL-TIME WORKSHOP EMBEDDED CODER - S Manuel d'utilisateur Page 36

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 76
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 35
28
value. To solve this kind of problem a conversion rule is made to use the entire
number range provided by an integer and to be able to shift this range. The
following equation describes the relation between the real value, x, and its integer
representation, x´:
xx
OxSx += ´
, where
x
S is the scaling factor and
x
O represents an offset
that can be used to shift the integer number range.
Using a scaling factor of 0.5,
x
S =
1
2
, and an offset, 25
=
x
O gives the following
conversion of the real value into the 8-bit unsigned integer range:
Figure 8: Representing a value with scaling
Using this approach, more than 75% of the 8-bit integer number range is covered
and used. This gives a better resolution of the representation of the real value.
This kind of scaling is called the power-of-two scaling which uses the scaling
factor
n
x
S 2=
, where n is an integer type. Another type of scaling can be used
too, called arbitrary scaling where
x
S is an arbitrary real number.
6.3.1 TargetLink
Fixed-point is supported in all TargetLink blocks, as mentioned earlier. Both
power of two scaling and arbitrary scaling, where the scaling factor is an arbitrary
real number, are supported in TargetLink. Scaling can be done with or without
offset value. The user can easily choose scaling parameters manually in every
block in the model. Blocks can also refer to an already defined scaling objects
from the Data Dictionary, see chapter 5.1.1 TargetLink and Table 4.
The user can also perform automatic scaling in the model. TargetLink supports
two methods for the determination of the range of a variable: by simulation and by
worst case value range propagation. Based on the determined ranges, TargetLink
calculates suitable scaling parameters and automatically enters them in the
respective block dialog. The user must first enter as many known ranges as
possible in the model. If there is a closed loop in the model, at least one block
must have known ranges otherwise worst case value range propagation will stop.
Every block has a protection option against scaling. The user can choose to leave
Vue de la page 35
1 2 ... 31 32 33 34 35 36 37 38 39 40 41 ... 75 76

Commentaires sur ces manuels

Pas de commentaire