DSP System Toolbox

 

DSP System Toolbox

Design and simulate streaming signal processing systems

Get Started:

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 processing in embedded systems.

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
Signal processing block libraries for 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 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.

Multistage decimator for sigma-delta ADC.

Simulink model of a multistage decimation filter for a sigma-delta analog-to-digital converter.

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 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:

Libraries for streaming signal processing 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.

Analysis of a three-stage DDC design.

Frequency response of the individual stages of a multistage digital down converter.

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.

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:

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.

Visualizing the dynamic response of a normalized LMS adaptive filter while simulating the model of an acoustic noise cancellation system.

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.

Single stage and multistage filter 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).

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 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.

Data Cursors for Waveform Measurements in Time Scope

Using data cursors to measure time and amplitude differences between two points of a waveform in Time Scope.

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.

Spectrum Analyzer measurements shown on color display.

Measuring the frequency and power of spectral peaks generated by applying a nonlinear amplifier model to a chirp signal.

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 properties for fixed-point data types.

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 and analysis.

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.

Optimized C Code Generation for ARM Cortext 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. For optimized FPGA/ASIC resource usage and performance, consider using blocks from DSP HDL Toolbox.

Verifying a hardware model using the Waves tab on Logic Analyzer.

Logic analyzer used for the verification of a hardware model of a programmable FIR filter