Main Content

Compare Speed Performance in Frame-Based Processing Mode Using Simulink Profiler

You can filter a noisy sinusoidal signal using a Biquad Filter block. The Biquad Filter block operates in the frame-based processing mode. You can change the input frame size and compare the simulation speed using Simulink Profiler (Simulink).

Open the Model

Open the filterUsingBiquad.slx model.

The input signal in the model is the sum of two sine waves with frequencies of 1 kHz and 10 kHz and white Gaussian noise with zero mean and a variance of 0.05. The sample rate of the signal is 44.1 kHz.

The Input processing parameter in the Biquad Filter block is set to Columns as channels(frame based). The block is configured to operate in the frame-based processing mode, and therefore processes signals one frame at a time. In this case, the input signal has 256 samples per frame.

Run the Model with Simulink Profiler

Analyze the model using the Simulink Profiler. Before profiling the model, replace the Spectrum Analyzer with output ports so that the scope does not affect the overall speed performance.

To open the Simulink Profiler, on the Debug tab, click Performance > Simulink Profiler. On the Profiler tab, click Profile. When simulation is complete, the Profiler Report pane opens and displays the simulation profile for the model. Note the Total Time (s) value and the Number of Calls made by the Simulink scheduler.

Increase Frame Size and Compare Simulation Performance

Now increase the signal frame size by setting the Samples per frame parameter in the source blocks to 1024.

Profile the model again. To compare the performance side-by-side, open another report panel. On the Profiler tab, click Add Report Panel. A new report panel window opens. Click Profile to rerun the Simulink Profiler. In the Run dropdown, you can select the simulation reports to compare.

When you increase the frame size, the Total time (s) and the Number of Calls metrics improved significantly. This is because simulating with a larger frame size requires fewer block calls and fewer calls to the Simulink scheduler.

See Also

| | |

Related Topics