Sampling rate conversion issues in HDL coder

9 次查看(过去 30 天)
Hi ,
I am trying to generate HDL code for the file attached.
I am trying to make a state machine which takes data at slow data rate and outputs at higher rate with some zero padding too.
Issue arise when I am forced to insert rate transition block at the input port of the state maschine(subsystem1).
when rate transition block is inserted then code is generated which redundent 1 bit registers requirement.
Is there any way to get rid of rate transition block but maintain the fucntionality too.
note:
load mat file before execution.

回答(2 个)

Aman Vyas
Aman Vyas 2020-11-2
Hi,
Since mostly block design operate on a single clock and thus clock in hdl coder is mostly linked to sample time in simulink. If you have two blocks connected to each other with different sample times, " sample time mismatch" would pop up. To avoid the sample time mismatch we generally use "rate transition block" to bring both the blocks sample time equal by upsampling and downsampling depending upon the application since then both of them can be collected to common clock.
If you wish to keep separate clocks you can make separate blocks and finally integrate using top module from top to bottom. Delays are inserted to match the sampling time and hence that wouldnt count to redundancy.
Hope it helps!

Kiran Kintali
Kiran Kintali 2020-11-2
See attached QPSK Tx, Rx example that works with HDL Coder.
You can read through instructions in QPSKTxRxHDLExample.m on how to model in Simulink for this comms application.

类别

Help CenterFile Exchange 中查找有关 HDL Coder 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by