question about HDL Coder and simulink

6 Ansichten (letzte 30 Tage)
iban
iban am 12 Jul. 2011
Hello to everybody is the first time I am writting in a forum. I am working with Matlab HDL Coder and I have some questions.
1:I know that HDL Coder can not implement transfer functions so I am using simulink blocks like delays and gains for example, to get the same answer. I am trying to make a discrete filter using a transfer function. I get a same signal but with different amplitude. anybody knows why? 2:I also want to implement a integer variable delay but HDL Coder does not implement it. anybody knows how can I implement a variable integer delay using simulink blocks that HDL Coder supported?
thank you for all and sorry about my english

Akzeptierte Antwort

Tim McBrayer
Tim McBrayer am 12 Jul. 2011
For question 1, there's no way to debug your code remotely. You will need to analyze the numerics of your implementation and see where they differ from the implementation provided by the Discrete Transfer Function block.
For question 2: a real runtime-variable delay is essentially impossible in hardware; you can't dynamically create or destroy registers, but have to have a fixed maximum. You will need to consider what your requirements for your maximum delay are. Based on this there are several approaches available. You could use a Tapped Delay block and a Multiport Switch block, or a shift register/counter combination, or perhaps a RAM and counter combination. Make sure to consider what you will do with data in flight if the size of the delay changes during processing.
  1 Kommentar
iban
iban am 12 Jul. 2011
thanks for answer me Tim.
about the first question I have a continious transfer function so first I get the discrete parameters with the function c2dm.after I get the discrete parameters,I build my filter with simulink blocks but I get a lower amplitude than the continious filter. I have been analyzing many times the implementation.where it would be failing?
about the second question they look good ideas. Iwill try with them.
thanks again

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by