MATLAB® provides an ideal environment for mixed-signal analysis, providing you with much greater analysis and visualization functionality than spreadsheets or traditional programming languages like C/C++. However, you don’t have to abandon your existing investments; MATLAB will work with Microsoft® Excel® and with C/C++.
At the highest level of mixed-signal analysis, MATLAB is used to create basic system architectures; for example, which is better: a second or third order sigma-delta modulator? What type of PLL is best? What do the Bode plots say about system stability? In industry, MATLAB is used to figure out the best starting point for design.
MATLAB is also used for detailed mixed-signal analysis in subsystems. For example, MATLAB's curve fitting, statistics, and visualization features are used to calculate a digital function that corrects for amplifier non-linearity in digital predistortion. In ADCs, MATLAB is used extensively for filter design. In both examples, you can build a solution and visualize the results as you go.
Mixed-Signal Top-Down Design
Top-down design in MATLAB® and Simulink® is about speed of design and speed of simulation. Using circuit simulation, you can iterate on design alternatives to look for the best solution, but these rapid change-and-evaluate cycles are time-consuming when simulated in low-level SPICE models. Top-down design in Simulink uses behavioral modeling to achieve significant speed compared to SPICE modeling.
Perform Rapid Loop Simulation: Loop simulation in SPICE tools can be slow. By contrast, Simulink's built-in solvers are designed and proven to simulate feedback loops efficiently and accurately, resulting in faster simulation times for mixed-signal devices such as ADCs, PLLs, and SERDES. Top-down design in Simulink not only speeds simulation, its speed makes it possible for the user to evaluate design alternatives for complex systems.
Simulate Circuit Models Faster: Top-down design in Simulink includes behavioral circuit simulation using Simscape Power Systems™. Simscape Power Systems lets you model RLC elements, op-amps, and switches. Electronic circuit models created with Simscape Power Systems simulate faster than lower-level SPICE models.
The ability to combine both design abstractions and circuit-level elements in the same Simulink model enables you to reuse behavioral models as test harnesses for SPICE models or for prototype devices.
Analog and Digital Design
Using isolated design tools constrains you to follow separate design paths for analog and digital design. This tool isolation delays the discovery of errors at the analog-digital interface and makes the evaluation of trade-offs between analog and digital designs difficult.
Design and Verify Analog and Digital Systems in the Same Environment: The advanced simulation engine in Simulink® enables you to simulate analog and digital designs together in the same model and thoroughly test the analog-digital interface early in the design process. The cosimulation links between MATLAB® and Simulink and third-party design tools, such as Cadence® Virtuoso® AMS Designer and Mentor Graphics ModelSim®, further enable you to verify SPICE or HDL models in the same analog and digital design environment.
Evaluate Analog and Digital Design Tradeoffs: Having analog and digital design in the same model lets you design across domains. For example, you can model digital predistortion – allowing you to digitally correct analog amplifier non-linearities. You can compare all-digital PLLs and mixed-signal PLLs in the same model.
Top-down design must be linked to the next stages in the design flow. You want to use your MATLAB® and Simulink® models as test harnesses to test your SPICE models, HDL code, or hardware. Mixed-signal cosimulation is one way to bridge the gap between stages.
Cosimulation is a run time link between different tools; at every simulation time step, data is exchanged between tools, enabling them to run together to simulate a model. In the analog domain, Cadence SpectreRF provides cosimulation links to Simulink and in the digital domain, Simulink has cosimulation links to Mentor Graphics ModelSim®.
Using these mixed-signal cosimulation links, you can build mixed-signal systems. You can swap out the analog components of your Simulink models for SPICE models running in circuit simulators, and similarly, you can swap out the digital components of the system for HDL code running in hardware simulators. In this way, MATLAB and Simulink models are reused as test harnesses at the next design stage.
Cosimulation isn't the only way of linking design stages. MathWorks customers have used HDL code generation and C code generation to link MATLAB and Simulink models to design tools used elsewhere in the design process.
MATLAB® and Simulink® make mixed-signal verification easier from the system-level through to device testing.
Parameter Sweeps: At the system level, you can run parameter sweeps on mixed-signal MATLAB or Simulink models to verify how the system will behave under a variety of operating conditions.
Simulink models can be controlled by MATLAB scripts that vary Simulink block parameters and collect the simulation results. Using this approach, companies have written scripts that iterate across a large number of parameters.
Linking tools: At the next level of design, cosimulation and code generation are used to link system-level models to circuit simulation and HDL simulators. With cosimulation, MATLAB and Simulink models are used as test harness to verify the circuit or HDL implementation at run time. With code generation, C or HDL code generated from system-level models is included in circuit or HDL simulators.
Device testing: The final level of mixed-signal verification is device testing. At this stage, MATLAB and Simulink integrate with a variety of test equipment, enabling engineers to build test systems that create test vectors via models, control test equipment, and analyze the results.