0% found this document useful (0 votes)
9 views

dsp-system-toolbox

DSP System Toolbox™ offers algorithms and tools for designing and simulating streaming signal processing systems in MATLAB® and Simulink®, supporting applications in audio, communications, and medical fields. It includes features for filter design, real-time audio processing, and visualization tools like Time Scope and Spectrum Analyzer, along with capabilities for C/C++ and HDL code generation. The toolbox provides over 350 optimized algorithms for various signal processing tasks, including adaptive filtering, multirate processing, and statistical analysis.

Uploaded by

anantikawahi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

dsp-system-toolbox

DSP System Toolbox™ offers algorithms and tools for designing and simulating streaming signal processing systems in MATLAB® and Simulink®, supporting applications in audio, communications, and medical fields. It includes features for filter design, real-time audio processing, and visualization tools like Time Scope and Spectrum Analyzer, along with capabilities for C/C++ and HDL code generation. The toolbox provides over 350 optimized algorithms for various signal processing tasks, including adaptive filtering, multirate processing, and statistical analysis.

Uploaded by

anantikawahi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

DSP System Toolbox

Design and simulate streaming signal processing systems

DSP System Toolbox™ provides algorithms, filters, design tools, and an app for processing streaming signals in
MATLAB® and Simulink®. These capabilities are provided as MATLAB functions, MATLAB System objects™, and
Simulink blocks. You can create and test systems for audio, communications, medical, and other real-time signal
processing and IoT applications.

With DSP System Toolbox, you can design and analyze FIR, IIR, multirate, multistage, and adaptive filters. You
can stream signals from your audio devices, files, and network to support system development and verification.
The Time Scope, Spectrum Analyzer, and Logic Analyzer tools let you dynamically visualize and measure
streaming signals. For desktop prototyping and deployment to embedded processors, including ARM® Cortex®,
the system toolbox supports C/C++ code generation and fixed-point modeling. It also supports HDL code
generation for algorithms such as FFT and IFFT.

Key Features
▪ Streaming signal processing in MATLAB and frame-based signal processing in Simulink

▪ DSP algorithms optimized for implementation and deployment to hardware

▪ Filter design tools and implementation for FIR, IIR, multistage, multirate, and adaptive filters such as
parametric equalizer, Polyphase, CIC, Farrow, and LMS

▪ Time Scope, Spectrum Analyzer, and Logic Analyzer with measurements including THD, SNR, peak finder,
min-max hold, and harmonic analysis

▪ Multichannel real-time audio processing and I/O including support for ASIO drivers and MIDI controls

▪ Support for fixed-point modeling, HDL code generation, and C-code generation including optimization for
ARM Cortex processors

1
Audio equalization using parametric equalizer (EQ) filters. MATLAB code (top left), with UI for parameter tuning in real
time for audio processing in MATLAB on the desktop (top right), parametric filter magnitude response (bottom right),
and equivalent Simulink model (bottom left).

Streaming Signal Processing in MATLAB

DSP System Toolbox provides a uniform 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 continuingly 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 make it easy 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.

Time Scope and Spectrum Analyzer can be used for visualization and measurement of streaming signals.

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

2
Streaming signal processing technique in MATLAB for removing an interfering tone from a streaming audio signal by
using a tunable notch filter.

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:

▪ Signal transforms such as fast Fourier transform (FFT) and discrete cosine transform (DCT)

▪ Design and implementation techniques for digital FIR and IIR filters

▪ Multirate and multistage filters for sample-rate conversion such as FIR and IIR halfband, Polyphase filters,
CIC filters, and Farrow filters

▪ Statistical and adaptive signal processing techniques for spectral estimation, equalization, and noise
suppression

▪ Signal operations and measurement such as convolution, windowing, padding, modeling delays, peak finding,
and variable fractional delays

▪ Signal visualization at run time with Time Scopes, Spectrum Analyzers, and Logic Analyzers

3
Partial list of System objects available in MATLAB showing audio recorder source (bottom left) and FFT System objects
(bottom right).

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.

4
Efficient sample-rate conversion between arbitrary factors. 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). Spectrum Analyzer showing streaming visualization comparison of frequency responses of single-stage
and multistage FIR and Farrow filter combination (bottom right).

Signal Processing in 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. Many blocks support 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.

5
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 that require 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 NCO, Audio I/O, UDP, MIDI, and more

▪ Numerical linear algebra routines, including linear system solvers, matrix factorizations, and matrix inverses

6
DSP System Toolbox blocks library for signal processing available in Simulink (top). Expanded views of signal
processing Sources blocks: From Audio Device (bottom left), FFT Transforms block (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 (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).

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

▪ Advanced equiripple FIR filters including minimum-order, constrained-ripple, and minimum-phase designs

▪ Nyquist, FIR halfband, and IIR polyphase filters, providing linear phase, minimum-phase, and quasi-linear
phase halfband designs, as well as equiripple, sloped-stopband, and window methods

▪ CIC interpolator and decimator filters for multiplier-less implementation in software-defined-radio and
sigma-delta converters

▪ Optimized multistage designs, enabling you to optimize the number of cascaded stages to achieve the lowest
computational complexity

▪ Fractional-delay filters, including implementation using Farrow filter structures well suited for tunable
filtering applications

▪ Allpass IIR filters with arbitrary group delay, enabling you to compensate for the group delays of other IIR
filters to obtain an approximate linear phase passband response

▪ Lattice wave digital IIR filters for robust implementation

▪ Arbitrary magnitude and phase FIR and IIR filters, enabling design of any filter specification

8
▪ Filters such as octave filters, parametric equalizers, and A and C weighting filters used in audio, speech, and
acoustic applications

Specialized filter designs in MATLAB. Clockwise from upper left: C-message weighting filter for a sampling frequency
of 51.2 kHz, arbitrary magnitude filter design, octave filter design, and direct-form FIR filter responses for fixed-point
data types.

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.

9
System identification using RLS adaptive filtering showing how to tune parameters at run time using the UI. MATLAB
code calling RLS algorithm (top left), UI for tuning the center frequency and the RLS forgetting factor (top right), plot of
the RLS filter learning curve (middle right), 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 using fvtool (left), and performance
of multirate and multistage design plot of power spectral densities of input and various outputs (right).

10
Audio sample-rate conversion of streaming audio signal from 44.1 KHz to 96Khz. MATLAB code (left). 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).

Real-Time Multichannel Audio Processing and I/O

DSP System Toolbox provides multichannel audio capture and processing in real time using a variety of file
formats, sound device I/O, and support for low latency. You can tune parameters of your audio filters at run time
via the UI using UDP or MIDI. The system toolbox offers audio support from MATLAB or Simulink using
microphone arrays and speaker arrays. Pro-audio sound cards and audio interfaces can be used with multiple
sample rates. Low latency can be achieved through ASIO and Core Audio driver support.

The signals that you work with can be acquired in real time from a variety of sources. Simulation results can be
exported to audio files, played on audio devices, or transmitted as UDP packets over an IP network. You can
perform the following on the audio signal you are working with:

▪ Import or export audio signals from or to multimedia files

▪ Record and play back audio data from multichannel soundcards

▪ Support audio interface with ASIO drivers

▪ Receive or send UDP packets from an IP network port for tunability

▪ Acquire control signals from a MIDI surface control hardware

You can generate random signals and colored noise as well as common waveforms such as sine waves and chirp
signals. You can also analyze audio signals using visualization and measurement tools.

11
How to model and simulate a digital audio multiband dynamic range compression system in MATLAB (top left) and
Simulink (bottom left). Static compression characteristics for different values of the knee width (top right), signal
envelope for different release and attack (middle right), effect of dynamic range compression on an audio input signal
when compression threshold is set to -10 dB and the compression ratio is 5 (bottom 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 towards HDL implementation.

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

12
Time Scope for visualization and measurement in time domain of multichannel signals. Clockwise from upper left:
Cursor measurements and triggers, bilevel measurements panel and the overshoots and undershoots pane, peak finder
measurement, cursor measurements.

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.

13
Spectrum Analyzer for frequency-domain visualization and measurements of various multichannel signals. Clockwise
from upper left: Channel measurements such as THD, SNR, SINAD, SFDR; adjacent channel power ratio measurements
(ACPR); spectrogram for time-varying spectra; peak finders and third-order intermodulation distortion measurements
(TOI).

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

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

C and C++ Code Generation for Desktop Acceleration and Deployment

C and C++ Code Generation

Using DSP System Toolbox with MATLAB Coder™ and Simulink Coder™, you can generate C and C++ source
code or an 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
integration of your system during the product development process.

Desktop Acceleration

You can generate efficient and compact executable code, an MEX function, tuned for performance for speedup of
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.

You can also tune your algorithm parameters directly from MATLAB or Simulink in real time via the UI while
your generated C code is executed on the desktop. DSP System Toolbox provides support for C code generation
from Audio I/O so that you can tune and listen to your audio processing in real time.

15
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 to speed up your simulation on the desktop.
MATLAB code of 3-band audio parametric equalizer function (left). Equivalent MEX-file for the main processing
algorithm (right).

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.

16
FFT MATLAB System object provides properties to configure your fixed-point data type specification of accumulator,
product, and output data (left). 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, or Filterbuilder interactive apps, enable you to design
floating-point filters that can be easily 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 easily analyze quantization effects.

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

Code Generation for FPGA/ASICs and Embedded Processors

HDL Code Generation

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 quickly simulating, testing, and verifying
generated code.

17
DSP System Toolbox with HDL Coder™ in Simulink 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 FR filter model. 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); automatically generated HDL code from the Simulink model (bottom left).

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, profiling,
and validation using processor-in-the-loop (PIL).

18
Resources
Product Details, Examples, and System Requirements Online User Community
www.mathworks.com/products/dsp-system www.mathworks.com/matlabcentral
Trial Software Training Services
www.mathworks.com/trialrequest www.mathworks.com/training
Sales Third-Party Products and Services
www.mathworks.com/contactsales www.mathworks.com/connections
Technical Support Worldwide Contacts
www.mathworks.com/support www.mathworks.com/contact

© 2015 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks
for a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders. 19

You might also like