Double to fixpoint conversion of Sum and Discrete transfer function block
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, this model works fine with data types shown
for summer (input1 : ufix6_En7, input2: ufixe6_En6, output : double) and
Discrete TF.. (output: double)
but when i change the sum block output to any fix point it does not give the correct results. what should be the correct method So that I can convert all these to fixed point so that HDL code can be generated.
- Do we need to insert ZOH block prior to conversion , or some fix point tool will insert where necessary.
- what should be the fix point settings for Discrete TF block
- what does the wire color shows,,, when I update diagram it turns to red
- for above both blocks ,, how to set the Accumulator/ ouput data type settings..
Thank you
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/151133/image.png)
0 件のコメント
回答 (1 件)
Andrew Schenk
2015 年 6 月 15 日
It is best practice to insert a ZOH block after the input port to the model as it will convert an input signal with continuous sample time to an output signal with a discrete sample time.
The reason you are getting incorrect results is likely because the fixed point data type has not been selected correctly for your specific signal data range. If you use the Simulink Menu Bar -> Analysis -> Fixed Point Tool utility, this will simulate your model, derive signal ranges, and automatically propose data types that prevent over/underflow errors while maximizing resolution.
Finally, the blocks are colored red to indicate the particular sample time. This can be changed by clicking: Display -> Sample Time -> Off. Also, click Display -> Sample Time -> Display Sample Time Legend will pop-up a window describing the meaning of each color.
参考
カテゴリ
Help Center および File Exchange で Hierarchical Designs and Synchronous Hardware Behavior についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!