MATLAB Examples

Real-Time Filter

This example shows a real-time filter built using DSP System Toolbox™ and Simulink Desktop Real-Time™. The unfiltered signal is acquired by the analog input, passed through a filter designed by DSP System Toolbox and finally sent to analog output. Both the unfiltered and filtered signals are shown in real-time using the Scope block.

Note: To run this model, you must have a data acquisition board connected to your computer. This model requires DSP System Toolbox.

Contents

How to run this model in Normal Mode

  1. Open the Analog Input and Analog Output blocks and select your data acquisition board. If there's no board installed, install it using the Install new board button.
  2. Double-click the orange button to switch to Normal Mode if needed.
  3. Start the real-time execution using Simulation->Run.

How to run this model in External Mode

  1. Open the Analog Input and Analog Output blocks and select your data acquisition board. If there's no board installed, install it using the Install new board button.
  2. Double-click the orange button to switch to External Mode if needed.
  3. Start the real-time execution using Simulation->Run. The model will automatically build, connect to Simulink in External Mode and start.

Open the model

open_system(fullfile(matlabroot,'toolbox','sldrt','sldrtexamples','sldrtex_filter'));

Close open Scopes

close_system(find_system(gcs ,'BlockType', 'Scope'));

Clean up

clear
close all
bdclose all

See Also