Accelerating the pace of engineering and science

DSP System Toolbox

Key Features

  • Streaming signal processing in MATLAB®
  • Signal processing and linear algebra blocks for Simulink®
  • Single-rate, multirate, FIR, IIR, and adaptive filter design
  • Time Scope, Spectrum Analyzer, and Logic Analyzer for visualizing and measuring streaming signals
  • Fixed-point modeling and simulation of signal processing algorithms
  • Support for C and C++ code generation
  • Support for HDL code generation

Streaming Signal Processing in MATLAB

DSP System Toolbox™ provides a framework for processing streaming signals in MATLAB. The system toolbox includes a library of signal processing algorithms optimized for processing streaming signals such as single-rate and multirate filters, adaptive filtering, and FFTs. The system toolbox is ideal for designing, simulating, and deploying signal processing solutions for applications including audio, biomedical, communications, control, seismic, sensors, and speech.

Streaming signal processing techniques enable processing of continuously flowing data streams, which can often accelerate simulations by dividing input data into frames and processing each frame as it is acquired. For example, streaming signal processing in MATLAB enables real-time processing of multichannel audio.

Streaming signal processing is enabled using a library of DSP algorithm components called System objects™ to represent data-driven algorithms, sources, and sinks. System objects enable you to create streaming applications by automating tasks such as data indexing, buffering, and algorithm state management. You can mix MATLAB System objects with standard MATLAB functions and operators.

You can use the Time Scope and Spectrum Analyzer to visualize and measure streaming signals.

You can apply single-rate, multirate, and adaptive filters to streaming data using algorithms optimized for streaming signals and data.

Streaming signal processing technique in MATLAB.
MATLAB code implementing a basic streaming loop (left). The Time Scope (top right) and the Spectrum Analyzer (bottom right) visualize and measure the live signals as they are generated and processed.

Algorithm Library for DSP System Design, Implementation, and Testing

DSP System Toolbox provides more than 350 algorithms optimized for design, implementation, and validation of streaming systems—whether implemented as MATLAB functions or as MATLAB System objects. The algorithms support double-precision and single-precision floating-point data types. Most of the algorithms also support integer data types, as well as fixed-point data types that require Fixed-Point Designer™.

In MATLAB, the system toolbox algorithm categories include:

Partial list of System objects available in MATLAB.
Partial lists of signal processing algorithms available in MATLAB, as displayed by the command-line help or discoverable via tab completion.

Multirate Systems

In MATLAB, DSP System Toolbox supports multirate processing for sample-rate conversion and the modeling of systems in which different sample rates or clock rates need to be interfaced. Multirate functionality includes multistage and multirate filters such as FIR and IIR halfband, Polyphase filters, CIC filters, and Farrow filters. It also includes signal operations such as interpolation, decimation, and arbitrary sample-rate conversion.

Efficient sample-rate conversion between arbitrary factors.
Efficient sample-rate conversion between arbitrary factors. Examples shown include MATLAB code showing various implementation structures and their cost analysis including Farrow structures, which can be an efficient implementation of sample-rate conversion (left); magnitude responses showing comparison between Polyphase and Farrow filters implementation of sample-rate conversion (top right); hybrid solution for sample-rate conversion using cascade of Farrow and FIR Polyphase structures (middle right); and Spectrum Analyzer showing streaming visualization comparison of frequency responses of single-stage and multistage FIR and Farrow filter combination (bottom right).

Signal Processing and Linear Algebra Blocks for Simulink

In Simulink, DSP System Toolbox offers a library of signal processing algorithm blocks for filters, transforms, and linear algebra. These blocks process streaming input signals as individual samples or as collections of samples called frames. Sample-based processing enables low-latency processes and applications that require scalar processing. Frame-based processing enables higher throughput in exchange for latency. The system toolbox supports both sample-based and frame-based processing modes.

MATLAB programs that use System objects can be incorporated into Simulink models through either the MATLAB Function block or the MATLAB System block. Most of the System objects have corresponding Simulink blocks with the same capabilities.

Frame-based operation showing frame-based throughput rate vs. sample-based alternative.
Frame-based operation, which acquires a frame of 16 samples between each interrupt service routine (ISR), showing that the frame-based throughput rate is many times higher than the sample-based alternative.

Signal Processing Blocks for DSP System Design, Implementation, and Validation

Simulink blocks for signal processing support double-precision and single-precision floating-point data types and integer data types. They also support fixed-point data types when used with Fixed-Point Designer.

The signal processing blocks in DSP System Toolbox include:

  • Signal transforms such as fast Fourier transform (FFT), discrete cosine transform (DCT), short-time Fourier transform (STFT), and discrete wavelet transform (DWT)
  • Filter design and implementation of FIR, IIR, and analog filters
  • Multirate and multistage filters for sample-rate conversion such as CIC, Halfband, Polyphase, and Farrow
  • Statistical and adaptive signal processing techniques for spectral estimation, equalization, and noise suppression
  • Signal operations and measurement such as convolution, windowing, padding, delays, peak finding, and zero-crossing
  • Streaming signal visualization and measurements with Time Scope, Spectrum Analyzer, and more
  • Signal management methods such as buffering, indexing, switching, stacking, and queuing
  • Sinks and sources such as chirp and colored noise generators, NCO, UDP receiver and transmitter, and more
  • Numerical linear algebra routines, including linear system solvers, matrix factorizations, and matrix inverses
DSP System Toolbox blocks library for signal processing available in Simulink.
DSP System Toolbox block library for signal processing available in Simulink (top), along with expanded views of linear system solvers (bottom left) and transforms (bottom right).

Modeling Multirate Systems

In Simulink, DSP System Toolbox supports multirate processing for sample-rate conversion and the modeling of systems in which different sample rates or clock rates need to be interfaced. Multirate filter blocks include multistage and multirate filter blocks such as CIC, FIR rate conversion, FIR interpolator and decimator, and Dyadic Analysis Filter Bank.

Sigma-delta A/D converter model in Simulink showing signals operating at multiple sample rates.
Sigma-delta A/D converter model in Simulink showing signals operating at multiple sample rates (left). Simulating the behavior of a simple digital down converter (DDC) for a baseband conversion in a communication system includes an NCO, CIC decimator, CIC compensator, halfband decimator, and sample-rate converter for final rate adjustments (right).

Single-Rate and Multirate FIR and IIR Filter Design, and Adaptive Filters

DSP System Toolbox provides extensive filter design and implementation algorithms for FIR, IIR, multistage, multirate, and adaptive filters. You can design filters with lowpass, highpass, bandpass, bandstop, and other response types. You can realize them using filter structures such as direct-form FIR, overlap-add FIR, IIR second-order sections (Biquad), cascade allpass, and lattice structures.

You can design filters using the Filterbuilder app, MATLAB code, or Simulink blocks. Also, you can analyze fixed-point quantization effects for FIR and IIR filters and determine the optimal word length for the filter coefficients.

You can also design tunable filters where you can tune key filter parameters, such as bandwidth and gain, at run time.

Filterbuilder app for interactive filter design.
Filterbuilder app for interactive design of a lowpass filter (left), UI filter specification implementation manipulation (middle), and visualization of magnitude of LPF response (right).

The digital filters you design with DSP System Toolbox in MATLAB can also be used in system-level models in Simulink. There is a ready-to-use library of filter blocks in the system toolbox for designing, simulating, and implementing lowpass, highpass, and other filters directly in Simulink.

In addition to conventional FIR and IIR filter design algorithms, DSP System Toolbox supports specialized filters and design methods such as:

Specialized filter designs in MATLAB.
Examples of filter designs in MATLAB. Clockwise from upper left: arbitrary magnitude response, lowpass FIR design comparison, bandpass IIR design comparison, cumulative section analysis of a biquad filter, response analysis of a fixed-point 256-factor digital down converter, and multistage complex bandpass FIR.

Adaptive Filters

DSP System Toolbox provides several techniques for adaptive filtering in MATLAB and Simulink. These techniques are widely used for applications such as system identification, spectral estimation, equalization, and noise suppression. Such adaptive filters include LMS-based, RLS-based, affine projection, fast transversal, frequency-domain, lattice-based, and Kalman. The system toolbox includes algorithms for the analysis of these adaptive filters, including tracking of coefficients, learning curves, and convergence.

System identification using RLS adaptive filtering showing how to tune parameters at run time using the UI.
System identification using RLS adaptive filtering showing how to tune parameters at run time using the UI. This illustration includes MATLAB code calling the RLS algorithm (top left), the UI for tuning the center frequency and the RLS forgetting factor (top right), a plot of the RLS filter learning curve (middle right), a plot of the desired and estimated transfer function (bottom right), and the Simulink model version (bottom left).

Multirate and Multistage Filters and Analysis

DSP System Toolbox provides design and implementation of multirate filters, including Polyphase interpolators, decimators, sample-rate converters, FIR halfband and IIR halfband, Farrow filters, and CIC filters and compensators, as well as support for multistage design methods. The system toolbox also provides specialized analysis functions to estimate the computational complexity of multirate and multistage filters.

Responses of equiripple design and corresponding multirate and multistage design.
Responses of equiripple design and corresponding multirate and multistage design using fvtool (left), and performance of multirate and multistage design plot of power spectral densities of input and various outputs (right).
Audio sample-rate conversion of streaming audio signal.
Audio sample-rate conversion of streaming audio signal from 44.1 KHz to 96 Khz. This illustration shows MATLAB code (left) and the magnitude response of multirate filters used in the two stages of sample-rate conversion, where filter 1 is an FIR rate converter with interpolation factor of 160 and decimation factor of 147, and filter 2 is an FIR interpolator filter with interpolation factor of 2 (right).

Signal Scopes, Analyzers, and Measurements

DSP System Toolbox provides scopes and data logging for time-domain or frequency-domain visualization, measurements, and analysis of streaming signals in MATLAB and Simulink. The scopes come with measurements and statistics familiar to users of industry-standard oscilloscopes and spectrum analyzers.

The system toolbox also provides the Logic Analyzer for displaying the transitions in time-domain signals, which is helpful in debugging models targeted toward HDL implementation.

You can also create an arbitrary plot for visualizing data vectors, such as the evolution of filter coefficients over time.

Time Scope for visualization and measurement in time domain of multichannel signals.
Time Scope for visualization and measurement in the time domain of multichannel signals. Included in the illustration are cursor measurements and triggers (top left), the bilevel measurements panel and the overshoots and undershoots pane (top right), peak finder measurement (bottom right), and cursor measurements (bottom left).

Time Scope displays signals in the time domain and supports a variety of signals—continuous, discrete, fixed-size, variable-size, floating-point data, fixed-point data, and N-dimensional signals for multichannel I/O system. Time Scope lets you display multiple signals either on the same axis where each input signal has different dimensions, sample rates, and data types, or on multiple channels of data on different displays in the scope window. Time Scope performs analysis, measurement, and statistics including root-mean-square (RMS), peak-to-peak, mean, and median.

Spectrum Analyzer for frequency-domain visualization and measurements of various multichannel signals.
Spectrum Analyzer for frequency-domain visualization and measurements of various multichannel signals. The illustrations show harmonic distortion measurements such as THD, SNR, SINAD, SFDR (top left); adjacent channel power ratio measurements (ACPR) (top right); spectrogram for time-varying spectra (bottom left); and peak finders and third-order intermodulation distortion measurements (TOI) (bottom right).

Spectrum Analyzer computes the frequency spectrum of a variety of input signals and displays its frequency spectrum on either a linear scale or a log scale. Spectrum Analyzer performs measurements and analysis such as harmonic distortion measurements (THD, SNR, SINAD, SFDR), third-order intermodulation distortion measurements (TOI), adjacent channel power ratio measurements (ACPR), complementary cumulative distribution function (CCDF), and peak-to-average power ratio (PAPR). The spectrogram mode view of Spectrum Analyzer shows how to view time-varying spectra and allows automatic peak detection.

DSP System Toolbox provides an additional family of visualization tools you can use to display and measure a variety of signals or data, including real-valued or complex-valued data, vectors, arrays, and frames of any data type including fixed-point, double-precision, or user-defined data input sequence. Some of the visualization tools can show a 3D display of your streaming data or signals so that you can analyze your data over time until your simulation stops.

View of LMS adaptive filter weights on the array plot.
View of LMS adaptive filter weights on the array plot. When you run this example, you can watch the filter weights change as they adapt to filter a noisy input signal (upper left). Logic Analyzer displays the transitions in time-domain signals (upper right). Vector Scope block displays the number of the current frame in the user defined data input sequence over time, automatically increments the count as each new input is received, and continues until the simulation stops (bottom right). Waterfall scope block displays multiple vectors of data at one time, representing the output data at consecutive sample time of an acoustic noise cancellation (bottom left).

Fixed-Point Modeling and Simulation

You can use DSP System Toolbox with Fixed-Point Designer to model fixed-point signal processing algorithms, as well as to analyze the effects of quantization on system behavior and performance. You can also generate fixed-point C code from your MATLAB code or Simulink model.

You can configure MATLAB System objects and Simulink blocks in the system toolbox for fixed-point modes of operation, enabling you to perform design tradeoff analyses and optimization by running simulations with different word lengths, scaling, overflow handling, and rounding method choices before you commit to hardware.

Fixed-point modes are supported for many DSP algorithms, including FFT, filters, statistics, and linear algebra. DSP System Toolbox automates the configuration of System objects and blocks for fixed-point operation.

FFT MATLAB System object and FFT Simulink block provisions.
FFT MATLAB System object, which provides properties to configure your fixed-point data type specification of accumulator, product, and output data (left). The FFT Simulink block dialog box provides options for fixed-point data type specification of accumulator, product, and output signals, which requires Fixed-Point Designer (right).

Fixed-Point Filter Design

In DSP System Toolbox, filter design functions and the Filterbuilder app enable you to design floating-point filters that can be converted to fixed-point data types with Fixed-Point Designer. This design flow simplifies the design and optimization of fixed-point filters and lets you analyze quantization effects.

Fixed-point filter design analysis of quantization noise.
Fixed-point filter design analysis of quantization noise where the filter design constraints are not met, and the stop band attenuation is insufficient because of the 8-bit word length (left). Experimenting with different coefficient word lengths and using 12-bit word length is sufficient, and the filter design constraints are met (right).

C and C++ Code Generation for Desktop and Embedded Workflows

Using DSP System Toolbox with MATLAB Coder™ and Simulink Coder™, you can generate C and C++ source code or a MEX function tuned for performance from your signal processing algorithms and system models in MATLAB and Simulink, respectively.

The generated code can be used for acceleration, rapid prototyping, implementation and deployment, or for the integration of your system during the product development process.

Desktop Acceleration

You can generate efficient and compact executable code, a MEX function, tuned for performance to speed up computation-intensive algorithms in your simulation. You can accelerate your floating-point and fixed-point algorithms including filters, FFTs, statistics, and linear algebra in MATLAB and Simulink.

To accelerate frame-based streaming simulations, dspunfold uses DSP unfolding to distribute the computational load in the generated MEX function across multiple threads.

Standalone Execution and Integration with Other Environments

With DSP System Toolbox, you can also use the generated C code from your MATLAB code or Simulink model for deployment and prototyping on the desktop by generating a standalone executable of your algorithm. This standalone executable can still be tuned directly from within MATLAB or Simulink in real time by using the UDP components. Because this standalone executable runs on a different thread than the MATLAB code or Simulink model, it improves the real-time performance of your algorithm.

The generated C code of your signal processing algorithms can be integrated as a compiled library component into other software, such as a custom simulator, or standard modeling software such as SystemC.

How to generate an MEX function tuned for performance from MATLAB.
How to generate a MEX function tuned for performance from MATLAB to speed up your simulation on the desktop. Shown are sample MATLAB code of the three-band audio parametric equalizer function (left), and the equivalent MEX-file for the main processing algorithm (right).

Optimized C Code Generation for ARM Cortex Processors

Using DSP System Toolbox with the hardware support add-on for ARM Cortex-A or ARM Cortex-M and Embedded Coder® you can generate optimized C code from MATLAB System objects or Simulink blocks for key DSP algorithms, such as FFT, FIR, and Biquad filters. The generated code provides calls to optimized routines for either the ARM Cortex-A Ne10 library or the ARM Cortex-M CMSIS library. A key benefit is an immediate increase in performance when compared to standard C code. You can also perform code verification and profiling using processor-in-the-loop (PIL) testing.

HDL Code Generation for FPGA and ASIC Development

Using DSP System Toolbox with Filter Design HDL Coder™ in MATLAB, you can design digital filters and generate efficient, synthesizable, and portable VHDL® and Verilog® code for implementation in FPGAs or ASICs. You can also automatically create VHDL and Verilog test benches for simulating, testing, and verifying generated code.

Using DSP System Toolbox with HDL Coder™ provides synthesizable and readable VHDL and Verilog code generation for your system design. This support includes algorithms optimized for resource and performance, such as filters, FFT, IFFT, and NCO.

Generate HDL code for programmable FIR filter model.
Generating HDL code for a programmable FR filter model. These illustrations show a programmable FIR filter model in Simulink for HDL implementation (top left); programmable FIR via registers subsystem (top right); scope display of filter input and reference signals (middle right); Logic Analyzer display of the coefficients, write address and enables, and filter input and reference signals (bottom right); and automatically generated HDL code from the Simulink model (bottom left).

Real-time Audio Processing for Algorithm Prototyping and Custom...

View webinar