sort() in HDL Coder

9 views (last 30 days)
DN
DN on 28 Jul 2016
Commented: DN on 26 Sep 2016
Hi, there is no sort() block in HDL Coder, right? I see there is a Simulink sort block in DSP toolbox under Simulink but it falls away in HDL coder library and is not HDL code generation compatible. Has anyone come across having to sort() for HDL coder as I don't want to write it all from scratch? Thanks

Answers (2)

Bharath Venkataraman
Bharath Venkataraman on 22 Sep 2016
If you have the Vision HDL Toolbox, it has a Histogram block that is optimized for HDL.
  4 Comments
DN
DN on 26 Sep 2016
Hmm...I'm not that sure...I was under the impression that first you select your Video format from the drop down list in the Frame To Pixels block (even if you are not interested in video at all the block comes with these settings - you have to specify it in this block). Once the drop down option is selected below it will specify your "Active pixels per line by Active video lines" regardless whether you want it or not. So if I chose say 240p for example, it shows 320 x 240, which is not just any 2-D array as you suggest. I have a 480 x 64 array for example. In Matlab for example this would have just simply been putting a row vector M of size 480 in to histc() specifying it over a range t of size 64, i.e. y = histc(M,t).
I guess what you really mean is you don't need to think in terms of video format you can use any 2-D data set that you want to find a histogram of, but perhaps use a MxN ratio similar to the video format option lines specified by the drop down list of the block "Frame to Pixel Block", then it will work. Let me know if I'm missing your point.
DN
DN on 26 Sep 2016
Actually I saw later on that there is a custom setting, so one would just have to figure out how to adjust the "front porch", and other inputs here for a normal 2D array associated with usual stats and not so image specific.

Sign in to comment.


Bharath Venkataraman
Bharath Venkataraman on 31 Jul 2016
There is no support for sort, but it may be useful to know why you would like to implement sort. Is it for a median filter, which is supported?
  3 Comments
Walter Roberson
Walter Roberson on 31 Jul 2016
You do not need sorted order to select the binning process. You need to know the range of values which you can get with max and min
DN
DN on 2 Aug 2016
Thanks Walter, true I see what you mean.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!