Fixed point tool conversion
3 views (last 30 days)
Show older comments
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
0 Comments
Answers (2)
Asvin Kumar
on 26 Dec 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 Comments
Asvin Kumar
on 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
on 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.
stozaki
on 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
0 Comments
See Also
Categories
Find more on Fixed-Point Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!