modulator FM from matlab to vhdl

2 views (last 30 days)
kaou
kaou on 8 Jun 2014
Answered: Tim McBrayer on 9 Jun 2014
i have both a simulink model and an m-file (matlab code) about FM modulator which were succesfuly simulated and i would like to convert at least one of them to a vhdl code but i don't succeed, i have errors due to fixed point stuff or trigonometric functions that can't be converted..is that doable? if yes how ( i work on matlab 2012b and xilinx 14,6 and i ve tried with both hdl coder and system generator)
PS: i have attached the simulink model. i am not a pro please help me with a very clear answer

Accepted Answer

Tim McBrayer
Tim McBrayer on 9 Jun 2014
You will need to update your modeling mindset from simulation to that needed for creating digital hardware. Digital hardware operates with discrete data in the discrete time domain. Given the Simulink model you attached, you will need to:
  1. Determine what portion of the model is testbench and what is design.
  2. Use discrete time modeling, with an appropriate fixed time step. Note: this involves changing at least one block as well.
  3. Use fixed point data for your data sources, not doubles.
In addition, the cosine block is not supported as-is for HDL code generation in R2012b. (It is supported in newer releases.) The error messages will lead you to what modifications are necessary to make, if you break the library link. Alternatively, should you have it available, the DSP System Toolbox > Sources > Sine Wave block can be used in R2012b.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!