Fixed point tool conversion

3 vues (au cours des 30 derniers jours)
Giuseppe Galioto
Giuseppe Galioto le 21 Déc 2019
Hi there,
How can I convert just a subsystem and not the entire model with the fixed point tool?
The tool, when I try to simulate, converts the overall system in fixed point, which is not my purpose.
Thanks in advance

Réponses (2)

Asvin Kumar
Asvin Kumar le 26 Déc 2019
You can convert a particular subsystem to Fixed Point by selecting it under System Under Design while preparing the system. Check out the example at https://www.mathworks.com/help/releases/R2018a/fixedpoint/ug/tutorial-steps.html#bs4b8ai for more details.
  3 commentaires
Asvin Kumar
Asvin Kumar le 6 Jan 2020
I see. Is there any way you know to reproduce this issue? So that I can check it out on my end. Or anyone else from the community can confirm.
Evangelos Denaxas
Evangelos Denaxas le 15 Jan 2020
What could be happening here is that fixed-point leaks out from the system under design by following data type propagation rules. So things that outside your system under design are not "converted" per se but rather propagating the data types they get as input. In order to avoid any of these unexpected issues you may want to properly isolate your system under design with a block called "data type converter". If you put one of these blocks to each line going in and out of your SUD then you'll minimize the chances of fixed-point trickling outside your system.

Connectez-vous pour commenter.


stozaki
stozaki le 17 Jan 2020
Please try following script.
model = 'modelName'; % define your model name
sud = [model '/sud']; % define system under design as sybsystem block path
opt = fxpOptimizationOptions(); % Specify options for data type optimization
allowableWL = (10:20); % set allow word length
opt.AllowableWordLengths = allowableWL;
tol = 0.1; % define tolerance
opt.addTolerance([model '/diff'], 1, 'AbsTol', tol); % set tolerance
opt.addTolerance([model '/diff'], 2, 'AbsTol', tol); % set tolerance
opt.UseParallel = false;
optRes = fxpopt(model, sud, opt); % execute
Regards,
Shuhei

Produits


Version

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by