1 / 27

PC deployment solutions of MATLAB-based applications – MATLAB Compiler vs. MATLAB Coder

PC deployment solutions of MATLAB-based applications – MATLAB Compiler vs. MATLAB Coder. Michael Donnenfeld Roy Fahn Application Engineer Application Engineer. Agenda. Mathworks tools for PC deployment - overview MATLAB Compiler vs. MATLAB Coder

tess
Télécharger la présentation

PC deployment solutions of MATLAB-based applications – MATLAB Compiler vs. MATLAB Coder

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PC deployment solutions of MATLAB-based applications – MATLAB Compiler vs. MATLAB Coder Michael Donnenfeld Roy Fahn Application Engineer Application Engineer

  2. Agenda • Mathworks tools for PC deployment - overview • MATLAB Compiler vs. MATLAB Coder • MATLAB Compiler Deployment and GPU solution • Retinal Blood Vessel Extraction Using Kirsch's Templates • Speeding-Up Image Processing Applications using the GPU • Break • C code generation using MATLAB Coder • MATLAB Coder flow • Signal processing example • System Objects overview • Embedded coder features

  3. הצטרפו לכנס ראשון מסוגו, במהלכו תוכלו: • להרחיב את ידיעותיכם על השימוש בכלי MATLAB ו-Simulink • להחליף רעיונות, לשתף בסיפורי הצלחה של עמיתים, ולהיפגש עם מומחי MATLAB מחברות אחרות • לחלוק את חוויית העבודה שלכם בסביבת MATLAB http://tinyurl.com/nozbmyt OR: http://www.systematics.co.il/MathWorks/Events/Conference/2013/MWUserConf-CFP01.html

  4. MATLAB Compiler vs. MATLAB Coder fetal_ecg.m

  5. MATLABCoder MATLABCompiler fetal_ecg.m .dll .exe .lib .lib .dll .exe

  6. Choosing the Right Deployment SolutionMATLAB Coder and MATLAB Compiler MATLAB Coder MATLAB Compiler

  7. PC Deployment solution with MATLAB Compiler

  8. PC Deployment solution with MATLAB Coder C Code

  9. MATLAB Coder generates embeddable C-code directly and automatically from M-Code What is Supported for code generation? • A subset of MATLAB language • More than 400 MATLAB operators and functions • More than 100 Fixed-point toolbox functions • More than 200 functions from signal processing video/image processing and communication (Some available as System Objects with the new System Toolboxes) Supported for codegen MATLAB

  10. Fixed-Point Toolbox What is not supported? MATLAB visualization Communication System Toolbox variable-sized data File I/O functions struct java malloc numeric Sparse global sparse System objects Visualization cell arrays complex arrays fixed-point Cell Computer Vision Toolbox recursion persistent nested functions try-catch classes Object Oriented nested functions Recursion anonymous functions DSP System toolbox

  11. Traditional Algorithm-to-C Workflow

  12. Using MATLAB Coder • 3. Generate C or C++ source code • Iterate in MATLAB to optimize . .DLL • 1. Develop/prepare MATLAB code • Separate algorithm code from other code • Use supported language features • Make implementation choices (e.g., data types, memory allocation) • 2. Execute generated code in MATLAB • Validate that MATLAB program generates code • Accelerate execution of user-written algorithm

  13. How MATLAB Coder Accelerates Development .DLL .DLL Develop algorithm Test Convert to C/C++ Test Iterate Test Deploy Time savings Develop algorithm Test and Iterate Test Deploy Generate code

  14. Adaptive Noise Canceling (ANC) Applied to Fetal Electrocardiography

  15. Fetal ECG Referenced signal: maternal thorax ECG Error signal: fetal ECG Noisy signal: maternal abdominal ECG Adaptive filter

  16. Lets go to example…… C Code

  17. System Objects MATLAB objects that represent time-based and data-driven algorithms, sources, and sinks • Simplify streaming in MATLAB • Provide more algorithms in MATLAB • Support of fixed-point data types • Generate C code automatically

  18. System Objects Two functionally-equivalent options • >> X = fft(x,1024) • >> hfft = dsp.FFT(‘BitReversedOutput’,true); • … • >> X = hfft.step(x);

  19. System Objects persistent hfft ; % instatiate if isempty(hfft) hfft = dsp.FFT(‘BitReversedOutput’,true); end % iteratively process streamed data while(…) … % process hfftData = hfft.step(data); … end • Separate instantiation and runtime calls • Call compiled object code

  20. System Objects Where can System Objects be found? Video and Image Processing Blockset Communications Toolbox Communication System Toolbox Phased Array System Toolbox Computer Vision System Toolbox Communications Blockset Signal Processing Blockset DSP System Toolbox Image Processing Toolbox Filter Design Toolbox Signal Processing Toolbox • Learn more: Designing Signal Processing Systems with MATLAB (online webinar)

  21. Lets return to previous example…… C Code

  22. Code Optimization – Cont. Embedded Coder features: • Target Code Replacement Libraries (CRL) for embedded targets • Generate reentrant code • Customize the code style such as defining name rules for variables • Links between C-code and MATLAB code for better traceability

  23. What’s new R2012 • Code Generation for MATLAB Classes • Selective Dynamic Memory Allocation Based on Size • C/C++ Dynamic Library Generation (DLL) • Package generated code in zip file for relocation (packNGo command) • parfor function support for MEX code generation, enabling execution on multiple cores • Visualization functions in generated MEX functions

  24. What’s new R2013 • Code generation support for Statistics Toolbox and Phased Array System Toolbox • parfor function support for standalone code generation, enabling execution on multiple cores • Generation of simplified code using built-in C types • Change to passing structures by reference (Entry Point function) • Code Generation Support for int64, uint64 data types • Custom toolchain registration

  25. לסיום אתר סיסטמטיקס – סמינרים, קורסים ועוד MATLAB CENTRAL תמיכה מלאה ע"י חברת סיסטמטיקס 03-7660101 תודה על השתתפותכם!

  26. MathWorks Code Generation Products: Old and New MATLAB Coder New features Embedded MATLAB feature of Real-Time Workshop Simulink Coder Real-Time Workshop Stateflow Coder Embedded IDE Link Embedded Coder Real-Time Workshop Embedded Coder Target Support Package

  27. System Toolboxes

More Related