Using HDL coder for Matlab Function block of Simulink

1 view (last 30 days)
Hello,
On the big picture, I am trying to implement a filter with around 150-200 taps but my filter has some special features thus I don't want to use Simulink's HDL optimized FIR filter. To do this I've written a code that puts simple Simulink blocks into a subsystem, however since a Simulink canvas has finite size and the amount of blocks I can use are naturally limited by the Simulink itself, when there are more taps to the filter (say 600 taps) it gives an error. Also yes, I did as much modularization as I could by gathering constantly used blocks within subsystems as well.
Since I have this problem I thought using Matlab Function block of Simulink would be a better approach. But creating a delay line is a bit problematic for huge amounts of delay. I am trying to use for loop for signal pipelining in the delay line but it either doesn't work as intended, i.e. it doesn't delay the signal right amount, or I am forced to write all the signal pipeline with my hand but then this makes filters with huge number of taps not so practical.
Is there a better tutorial about using HDL coder through Matlab for example? That shows how to do bigger delay lines faster and more modular using loops.

Accepted Answer

Kiran Kintali
Kiran Kintali on 15 Dec 2018
kiran.kintali@mathworks.com
Can you share sample abstract MATLAB code and testbench on what you are describing here?
type "eml_hdl_design_patterns" to see some MATLAB function block examples.
Please check mlhdlc_tutorial_corner_detection.m and mlhdlc_tutorial_corner_detection_tb.m
There are lot of such demos in <matlabroot>\toolbox\hdlcoder\hdlcoderdemos\matlabhdlcoderdemos for your review.

More Answers (0)

Categories

Find more on Optimization 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!