Effacer les filtres
Effacer les filtres

Translating matlab functions to c- functions.

2 vues (au cours des 30 derniers jours)
Misha Dabaghyan
Misha Dabaghyan le 17 Août 2015
Hi, I have a matlab code code that analyzes and conditions some signals in a certain way (filters, etc). I would like to translate the whole procedure into C, to be later compiled into dll's that would be used by a bigger suite of programs. The flow of the program is e.g. "1) take the signal, apply a filter, add/subtract something to/from the result of the filter, down-sample, pass it down to the differentiation filter etc ...". I was wondering if each of these steps can be turned into separate C-code with the appropriate input-output capabilities (so that I would be able to choose which filters to "plug in"), and if so, what the best strategy would be. Would using the Simulink coder be the best approach, or should I just go with converting the m-files? Thanks.

Réponses (1)

Walter Roberson
Walter Roberson le 17 Août 2015
Simulink Coder would be appropriate if your data was represented as a Simulink model. If it is not then use MATLAB Coder.
Note: if I recall correctly, the filter design routines cannot be used with MATLAB Coder, but the filter that gets designed can be. Building a general interface that allowed the user to construct new filters would, I suspect, be considered an impermissible duplication of MATLAB functionality that would not be permitted to be compiled by the Terms and Conditions; this would not be an issue if the filter coefficients are already decided and you are applying the filters.

Catégories

En savoir plus sur Code Generation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by