DSP Blockset    

Model Definition

Simulink is a model definition environment. You define a model by creating a block diagram that represents the computations of your system or application. Try building a simple model that adds two sine waves and displays the result.

  1. Type dspstartup at the MATLAB command line to configure Simulink for DSP simulation (optional).
  1. One of the things that dspstartup does is set the Stop time value in the Simulation parameters dialog box to inf for all new models. The inf setting instructs Simulink to run the model until you click the simulation stop button. You can access this dialog box and enter a different Stop time value by selecting Simulation parameters from the model window's Simulation menu.

  1. Start Simulink by clicking the

    button in the MATLAB toolbar. The Library Browser appears.
  2. Select New > Model from the File menu in the Library Browser. A new model window appears on your screen.
  3. Add a Sine Wave block to the model.
    1. In the Library Browser, click the  symbol next to DSP Blockset to expand the hierarchical list of DSP libraries.
    2. In the expanded list, click DSP Sources to view the blocks in the DSP Sources library.
    3. Drag the Sine Wave block into the new model window.
  4. Add a Matrix Sum block to the model.
    1. Click the  symbol next to Math Functions to expand the Math Functions library.
    2. Click the  symbol next to Matrices and Linear Algebra to expand the Matrices and Linear Algebra sublibrary.
    3. In the expanded list, click Matrix Operations to view the blocks in the Matrix Operations library.
    4. Drag the Matrix Sum block into the model window.
  5. Add a Scope block to the model.
    1. Click Sinks (in the Simulink tree) to view the blocks in the Simulink Sinks library.
    2. Drag the Scope block from the Sinks library into the model window. (The Simulink Scope block is the same as the Time Scope block in the DSP Sinks library.)
  6. Connect the blocks.
    1. Position the pointer near the output port of the Sine Wave block. Hold down the mouse button (the left button for a multibutton mouse) and drag the line that appears until it touches the input port of the Matrix Sum block. Release the mouse button.
    2. Using the same technique, connect the output of the Matrix Sum block to the input port of the Scope block.
  7. Set the block parameters.
    1. Double-click on the Sine Wave block. The dialog box that appears allows you to set the block's parameters. Parameters are defining values that tell the block how to operate.
    1. Double-click on the Matrix Sum block. Select Rows from the Sum along parameter, and close the dialog box.

You can now move on to the model simulation phase.


  Getting Started with Simulink Model Simulation