sort() in HDL Coder

7 次查看(过去 30 天)
DN
DN 2016-7-28
评论: DN 2016-9-26
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

回答(2 个)

Bharath Venkataraman
If you have the Vision HDL Toolbox, it has a Histogram block that is optimized for HDL.
  4 个评论
DN
DN 2016-9-26
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 2016-9-26
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.

请先登录,再进行评论。


Bharath Venkataraman
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 个评论
Walter Roberson
Walter Roberson 2016-7-31
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 2016-8-2
Thanks Walter, true I see what you mean.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by