2.33333

2.3 | 3 ratings Rate this file 72 Downloads (last 30 days) File Size: 677 KB File ID: #30068

Adaptive Median Filter (MATLAB Code)

by

 

Converting MATLAB Algorithms into Serialized Designs for HDL Code Generation

| Watch this File

File Information
Description

SimulinkĀ® lets you integrate MATLABĀ® algorithms into a Simulink model
for C or HDL code generation. However, many MATLAB implementations of
signal processing, communications, and image processing algorithms require
some redesign to make them suitable for HDL code generation. For example,
they often use data types such as doubles, strings, and structures, and contain
control flow constructs, such as while loops and break statements, that do not
map well to hardware. Apart from these constructs, MATLAB algorithms that
operate on large data sets are not always written to take account of hardware
design characteristics like streaming and resource sharing. This submission uses
a typical software implementation of an adaptive median filter
(discussed in http://www.dspdesignline.com/howto/207800676) to illustrate
the process of converting MATLAB algorithms for HDL code generation.

MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
12 Jul 2014 Nora  
15 Mar 2013 tejaswini kar

I am getting following error. how to fix it.
??? Undefined variable "coder" or class "coder.unroll".

Error in ==> get_median_1d at 8
for ii=coder.unroll(1:numpixels)

Error in ==> aMediantFilter_2D at 31
outbuf = get_median_1d(d3x3(:)');

Error in ==> aMedianFilter_2D_script at 16
[pixel_val, pixel_valid] = aMediantFilter_2D(c_data,
c_idx);

30 Jan 2012 thotareddy manasa  
09 Nov 2011 Suci

Hi,, I am a last year student at Sepuluh November Institute of Technology Surabaya. I have a final project using a median filter as one of method to solve my problem. And I found your project so I'm interested and tried to study it. But I have a problem, I got a problem when running it.
this the error
Error in ==> get_median_1d at 8
for ii=coder.unroll(1:numpixels)

Error in ==> aMediantFilter_2D at 32
outbuf = get_median_1d(d3x3(:)');

Error in ==> aMedianFilter_2D_script at 16
[pixel_val, pixel_valid] = aMediantFilter_2D(c_data, c_idx);

please tell me. I didn't understand becouse I just start learn about MATLAB. thanks so much :D

23 Apr 2011 Dung Nguyen

Hi,
I am a graduate student at University of Arizona research on HDL generation from Matlab m-file. I found your article on this subject at Matlab Central. I download your demo code of Adaptive Median Filter (Matlab code) from http://www.mathworks.com/matlabcentral/fileexchange/30068. The Matlab simulation for the aMedianFilter_2D_script.m in the MATLAB_code error can be found at the attached file (Issue with Matlab Demo code for HDL generation.pdf). File Issues while loading the Simulink blocks in HDL_mdl.pdf capture the issues with the Simulink block under the directory HDL_mdl. File Matlab_Errors.pdf is the error message from the command window.
I used MATLAB R2010b for this simulation. Please recheck the demo package and let I know how to fix these issues.

Thanks,

NOTE: Please see detail issues from my E-mail sendout to your MatWork E-mail.

Contact us