O'Reilly logo

Understanding LTE with MATLAB by Houman Zarrinkoub

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10

Prototyping as C/C++ Code

So far we have developed MATLAB® programs and Simulink models in order to simulate the LTE (Long Term Evolution) PHY (Physical Layer) in the MATLAB environment. At some stage in the workflow of a communications system design, we might need to produce a software component that cannot be directly simulated in MATLAB. For example, we might need to interface to an existing simulation environment based on a C/C++ software implementation. If we want to export the result of modeling and simulation in MATLAB to an external C/C++ programming environment, we essentially have two choices: we can either manually translate algorithms developed in MATLAB into a C or C++ implementation or we can take advantage of automatic MATLAB C-code generation.

By using MATLAB Coder, we can generate standalone C and C++ code from MATLAB code. The generated source code is portable and readable. MATLAB Coder supports a subset of MATLAB language features, including program control constructs, functions, and matrix operations. It can generate MATLAB executable (MEX) functions that let us accelerate computationally intensive portions of MATLAB code and verify its behavior. It can also generate C/C++ source code for integration with existing C code, creation of an executable prototype, or direct implementation on a Digital Signal Processor (DSP) or general-purpose CPU using a C/C++ compiler.

In this chapter we examine the process of generating standalone C and C++ code from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required