ebook img

DSP System Toolbox User's Guide PDF

1020 Pages·2016·16.13 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview DSP System Toolbox User's Guide

DSP System Toolbox™ User's Guide R2020a How to Contact MathWorks Latest news: www.mathworks.com Sales and services: www.mathworks.com/sales_and_services User community: www.mathworks.com/matlabcentral Technical support: www.mathworks.com/support/contact_us Phone: 508-647-7000 The MathWorks, Inc. 1 Apple Hill Drive Natick, MA 01760-2098 DSP System Toolbox™ User's Guide © COPYRIGHT 2011–2020 by The MathWorks, Inc. The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathWorks, Inc. FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through the federal government of the United States. By accepting delivery of the Program or Documentation, the government hereby agrees that this software or documentation qualifes as commercial computer software or commercial computer software documentation as such terms are used or defned in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and conditions of this Agreement and only those rights specifed in this Agreement, shall pertain to and govern the use, modifcation, reproduction, release, performance, display, and disclosure of the Program and Documentation by the federal government (or other entity acquiring for or through the federal government) and shall supersede any conficting contractual terms or conditions. If this License fails to meet the government's needs or is inconsistent in any respect with federal procurement law, the government agrees to return the Program and Documentation, unused, to The MathWorks, Inc. Trademarks 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. Patents MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for more information. Revision History April 2011 First printing Revised for Version 8.0 (R2011a) September 2011 Online only Revised for Version 8.1 (R2011b) March 2012 Online only Revised for Version 8.2 (R2012a) September 2012 Online only Revised for Version 8.3 (R2012b) March 2013 Online only Revised for Version 8.4 (R2013a) September 2013 Online only Revised for Version 8.5 (R2013b) March 2014 Online only Revised for Version 8.6 (R2014a) October 2014 Online only Revised for Version 8.7 (R2014b) March 2015 Online only Revised for Version 9.0 (R2015a) September 2015 Online only Revised for Version 9.1 (R2015b) March 2016 Online only Revised for Version 9.2 (R2016a) September 2016 Online only Revised for Version 9.3 (R2016b) March 2017 Online only Revised for Version 9.4 (R2017a) September 2017 Online only Revised for Version 9.5 (R2017b) March 2018 Online only Revised for Version 9.6 (R2018a) September 2018 Online only Revised for Version 9.7 (R2018b) March 2019 Online only Revised for Version 9.8 (R2019a) September 2019 Online only Revised for Version 9.9 (R2019b) March 2020 Online only Revised for Version 9.10 (R2020a) Contents DSP Tutorials 1 Introduction to Streaming Signal Processing in MATLAB . . . . . . . . . . . . . 1-2 Filter Frames of a Noisy Sine Wave Signal in MATLAB . . . . . . . . . . . . . . . 1-6 Filter Frames of a Noisy Sine Wave Signal in Simulink . . . . . . . . . . . . . . . 1-8 Open Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8 Inspect Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8 Compare Original and Filtered Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10 Lowpass Filter Design in MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12 Lowpass IIR Filter Design in Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-20 flterBuilder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-20 Butterworth Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-21 Chebyshev Type I Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-26 Chebyshev Type II Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-27 Elliptic Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-29 Minimum-Order Designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-31 Lowpass Filter Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-34 Variable Bandwidth IIR Filter Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-35 Design Multirate Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-36 Implement an FIR Decimator in MATLAB . . . . . . . . . . . . . . . . . . . . . . . . 1-36 Implement an FIR Decimator in Simulink . . . . . . . . . . . . . . . . . . . . . . . . 1-39 Sample Rate Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-41 Tunable Lowpass Filtering of Noisy Input in Simulink . . . . . . . . . . . . . . 1-45 Open Lowpass Filter Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-45 Simulate the Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-47 Signal Processing Algorithm Acceleration in MATLAB . . . . . . . . . . . . . . 1-51 FIR Filter Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-51 Accelerate the FIR Filter Using codegen . . . . . . . . . . . . . . . . . . . . . . . . . 1-52 Accelerate the FIR Filter Using dspunfold . . . . . . . . . . . . . . . . . . . . . . . . 1-53 Kalman Filter Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-54 Accelerate the Kalman Filter Using codegen . . . . . . . . . . . . . . . . . . . . . . 1-56 Accelerate the Kalman Filter Using dspunfold . . . . . . . . . . . . . . . . . . . . 1-57 Signal Processing Acceleration through Code Generation . . . . . . . . . . . 1-59 FIR Filter Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-59 Accelerate the FIR Filter Using codegen . . . . . . . . . . . . . . . . . . . . . . . . . 1-60 Accelerate the FIR Filter Using dspunfold . . . . . . . . . . . . . . . . . . . . . . . . 1-61 iii Multithreaded MEX File Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-64 Use dspunfold with a MATLAB Function Containing a Stateless Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-64 Using dspunfold with a MATLAB Function Containing a Stateful Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-66 Detecting State Length Automatically . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-67 Verify Generated Multithreaded MEX Using the Generated Analyzer . . . 1-68 Fixed-Point Filter Design in MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-70 Visualizing Multiple Signals Using Logic Analyzer . . . . . . . . . . . . . . . . . 1-76 Model Programmable FIR Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-76 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-77 Use the Logic Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-78 Modify the Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-79 Signal Visualization and Measurements in MATLAB . . . . . . . . . . . . . . . . 1-84 Filter Frames of a Noisy Sine Wave Signal using Testbench Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-96 Create Composite System object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-100 Create Multi-Notch Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-100 Set Up the Multi-Notch Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-100 Contain System Objects as Private Properties . . . . . . . . . . . . . . . . . . . . 1-100 Work with Dependent Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-100 Use the Multi-Notch Filter - Initialization . . . . . . . . . . . . . . . . . . . . . . . 1-101 Use the Multi-Notch Filter - Streaming . . . . . . . . . . . . . . . . . . . . . . . . . 1-101 Input, Output, and Display 2 Discrete-Time Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 Time and Frequency Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 Recommended Settings for Discrete-Time Simulations . . . . . . . . . . . . . . . 2-3 Simulink Tasking Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 Other Settings for Discrete-Time Simulations . . . . . . . . . . . . . . . . . . . . . . 2-5 Cross-Rate Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 Continuous-Time Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8 Continuous-Time Source Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8 Continuous-Time Nonsource Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8 Create Signals for Sample-Based Processing . . . . . . . . . . . . . . . . . . . . . . . 2-9 Create Signals Using Constant Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9 Create Signals Using Signal From Workspace Block . . . . . . . . . . . . . . . . 2-11 Create Signals for Frame-Based Processing . . . . . . . . . . . . . . . . . . . . . . . 2-13 Create Signals Using Sine Wave Block . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14 Create Signals Using Signal From Workspace Block . . . . . . . . . . . . . . . . 2-15 iv Contents Create Multichannel Signals for Sample-Based Processing . . . . . . . . . . 2-18 Multichannel Signals for Sample-Based Processing . . . . . . . . . . . . . . . . . 2-18 Create Multichannel Signals by Combining Single-Channel Signals . . . . 2-19 Create Multichannel Signals by Combining Multichannel Signals . . . . . . 2-20 Create Multichannel Signals for Frame-Based Processing . . . . . . . . . . . 2-23 Multichannel Signals for Frame-Based Processing . . . . . . . . . . . . . . . . . 2-24 Create Multichannel Signals Using Concatenate Block . . . . . . . . . . . . . . 2-24 Deconstruct Multichannel Signals for Sample-Based Processing . . . . . . 2-27 Split Multichannel Signals into Individual Signals . . . . . . . . . . . . . . . . . . 2-27 Split Multichannel Signals into Several Multichannel Signals . . . . . . . . . 2-29 Deconstruct Multichannel Signals for Frame-Based Processing . . . . . . 2-32 Split Multichannel Signals into Individual Signals . . . . . . . . . . . . . . . . . . 2-33 Reorder Channels in Multichannel Signals . . . . . . . . . . . . . . . . . . . . . . . 2-35 Import and Export Signals for Sample-Based Processing . . . . . . . . . . . . 2-38 Import Vector Signals for Sample-Based Processing . . . . . . . . . . . . . . . . 2-38 Import Matrix Signals for Sample-Based Processing . . . . . . . . . . . . . . . . 2-40 Export Signals for Sample-Based Processing . . . . . . . . . . . . . . . . . . . . . . 2-43 Import and Export Signals for Frame-Based Processing . . . . . . . . . . . . . 2-47 Import Signals for Frame-Based Processing . . . . . . . . . . . . . . . . . . . . . . 2-48 Export Frame-Based Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-50 Data and Signal Management 3 Sample- and Frame-Based Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Sample- and Frame-Based Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Model Sample- and Frame-Based Signals in MATLAB and Simulink . . . . . . 3-2 What Is Sample-Based Processing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 What Is Frame-Based Processing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 Inspect Sample and Frame Rates in Simulink . . . . . . . . . . . . . . . . . . . . . . 3-6 Sample Rate and Frame Rate Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Inspect Signals Using the Probe Block . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 Inspect Signals Using Color Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 Convert Sample and Frame Rates in Simulink . . . . . . . . . . . . . . . . . . . . . 3-13 Rate Conversion Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13 Rate Conversion by Frame-Rate Adjustment . . . . . . . . . . . . . . . . . . . . . . 3-14 Rate Conversion by Frame-Size Adjustment . . . . . . . . . . . . . . . . . . . . . . 3-15 Frame Rebufering Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 Bufer Signals by Preserving the Sample Period . . . . . . . . . . . . . . . . . . . 3-19 Bufer Signals by Altering the Sample Period . . . . . . . . . . . . . . . . . . . . . 3-21 Bufering and Frame-Based Processing . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24 Bufer Input into Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24 Bufer Signals into Frames with Overlap . . . . . . . . . . . . . . . . . . . . . . . . . 3-26 Bufer Frame Inputs into Other Frame Inputs . . . . . . . . . . . . . . . . . . . . . 3-28 v Bufer Delay and Initial Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30 Unbufer Frame Signals into Sample Signals . . . . . . . . . . . . . . . . . . . . . 3-31 Delay and Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-35 Computational Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-35 Algorithmic Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-36 Zero Algorithmic Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-36 Basic Algorithmic Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-38 Excess Algorithmic Delay (Tasking Latency) . . . . . . . . . . . . . . . . . . . . . . 3-40 Predict Tasking Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-41 Variable-Size Signal Support DSP System Objects . . . . . . . . . . . . . . . . . . 3-46 Variable-Size Signal Support Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46 DSP System Toolbox System Objects That Support Variable-Size Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46 Filter Analysis, Design, and Implementation 4 Design a Filter in Fdesign — Process Overview . . . . . . . . . . . . . . . . . . . . . 4-2 Process Flow Diagram and Filter Design Methodology . . . . . . . . . . . . . . . 4-2 Use Filter Designer with DSP System Toolbox Software . . . . . . . . . . . . . . 4-9 Design Advanced Filters in Filter Designer . . . . . . . . . . . . . . . . . . . . . . . . 4-9 Access the Quantization Features of Filter Designer . . . . . . . . . . . . . . . . 4-11 Quantize Filters in Filter Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13 Analyze Filters with a Noise-Based Method . . . . . . . . . . . . . . . . . . . . . . . 4-18 Scale Second-Order Section Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22 Reorder the Sections of Second-Order Section Filters . . . . . . . . . . . . . . . 4-25 View SOS Filter Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28 Import and Export Quantized Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-32 Generate MATLAB Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35 Import XILINX Coeficient (.COE) Files . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35 Transform Filters Using Filter Designer . . . . . . . . . . . . . . . . . . . . . . . . . 4-36 Design Multirate Filters in Filter Designer . . . . . . . . . . . . . . . . . . . . . . . 4-42 Realize Filters as Simulink Subsystem Blocks . . . . . . . . . . . . . . . . . . . . . 4-50 FIR Nyquist (L-th band) Filter Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-53 Digital Frequency Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-60 Details and Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-60 Frequency Transformations for Real Filters . . . . . . . . . . . . . . . . . . . . . . 4-65 Frequency Transformations for Complex Filters . . . . . . . . . . . . . . . . . . . 4-74 Digital Filter Design Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-83 Overview of the Digital Filter Design Block . . . . . . . . . . . . . . . . . . . . . . . 4-83 Select a Filter Design Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-84 Create a Lowpass Filter in Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-85 Create a Highpass Filter in Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-85 Filter High-Frequency Noise in Simulink . . . . . . . . . . . . . . . . . . . . . . . . 4-86 vi Contents Filter Realization Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-90 Overview of the Filter Realization Wizard . . . . . . . . . . . . . . . . . . . . . . . . 4-90 Design and Implement a Fixed-Point Filter in Simulink . . . . . . . . . . . . . . 4-90 Set the Filter Structure and Number of Filter Sections . . . . . . . . . . . . . . 4-97 Optimize the Filter Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-97 Digital Filter Implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-100 Using Digital Filter Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-100 Implement a Lowpass Filter in Simulink . . . . . . . . . . . . . . . . . . . . . . . . 4-100 Implement a Highpass Filter in Simulink . . . . . . . . . . . . . . . . . . . . . . . 4-101 Filter High-Frequency Noise in Simulink . . . . . . . . . . . . . . . . . . . . . . . 4-102 Specify Static Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-105 Specify Time-Varying Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-106 Specify the SOS Matrix (Biquadratic Filter Coeficients) . . . . . . . . . . . . 4-106 Removing High-Frequency Noise from an ECG Signal . . . . . . . . . . . . . . 4-108 Adaptive Filters 5 Overview of Adaptive Filters and Applications . . . . . . . . . . . . . . . . . . . . . . 5-2 Adaptive Filters in DSP System Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 Choosing an Adaptive Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 Mean Squared Error Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5 Common Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5 System Identifcation of FIR Filter Using LMS Algorithm . . . . . . . . . . . . . 5-9 System Identifcation of FIR Filter Using Normalized LMS Algorithm . . 5-17 Compare Convergence Performance Between LMS Algorithm and Normalized LMS Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-20 Noise Cancellation Using Sign-Data LMS Algorithm . . . . . . . . . . . . . . . . 5-22 Compare RLS and LMS Adaptive Filter Algorithms . . . . . . . . . . . . . . . . . 5-26 Inverse System Identifcation Using RLS Algorithm . . . . . . . . . . . . . . . . 5-29 Signal Enhancement Using LMS and NLMS Algorithms . . . . . . . . . . . . . 5-34 Noise Cancellation in Simulink Using Normalized LMS Adaptive Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-41 Create an Acoustic Environment in Simulink . . . . . . . . . . . . . . . . . . . . . . 5-41 LMS Filter Confguration for Adaptive Noise Cancellation . . . . . . . . . . . 5-42 Modify Adaptive Filter Parameters During Model Simulation . . . . . . . . . 5-45 vii Multirate and Multistage Filters 6 Multirate Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Why Are Multirate Filters Needed? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Overview of Multirate Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Multistage Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5 Why Are Multistage Filters Needed? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5 Optimal Multistage Filters in DSP System Toolbox . . . . . . . . . . . . . . . . . . 6-5 Compare Single-Rate/Single-Stage Filters with Multirate/Multistage Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6 Design of Decimators/Interpolators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9 Filter Banks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-21 Dyadic Analysis Filter Banks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-21 Dyadic Synthesis Filter Banks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-23 Multirate Filtering in Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27 Datafow 7 Datafow Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 Specifying Datafow Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 Simulation of Datafow Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 Datafow Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3 Unsupported Simulink Software Features in Datafow Domains . . . . . . . . 7-8 Model Multirate Signal Processing Systems Using Datafow . . . . . . . . . 7-10 Multicore Simulation and Code Generation of Datafow Domains . . . . . 7-12 Simulation of Datafow Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12 Code Generation of Datafow Domains . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12 Types of Parallelism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12 Improve Simulation Throughput with Multicore Simulation . . . . . . . . . . 7-14 Generate Multicore Code from a Datafow Subsystem . . . . . . . . . . . . . . . 7-16 Multicore Execution using Datafow Domain . . . . . . . . . . . . . . . . . . . . . . 7-19 Multicore Code Generation for Datafow Domain . . . . . . . . . . . . . . . . . . . 7-27 viii Contents Simulink HDL Optimized Block Examples in DSP System Toolbox 8 Implement CIC Decimation Filter for HDL . . . . . . . . . . . . . . . . . . . . . . . . . 8-2 Fully Parallel Systolic FIR Filter Implementation . . . . . . . . . . . . . . . . . . . 8-5 Partly Serial Systolic FIR Filter Implementation . . . . . . . . . . . . . . . . . . . . 8-9 Automatic Delay Matching for the Latency of FFT HDL Optimized Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13 Simulink Block Examples in Scopes and Data Logging Category 9 Obtain Measurement Data Programmatically for dsp.SpectrumAnalyzer System object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2 Obtain Measurements Data Programmatically for Spectrum Analyzer Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5 DSP System Toolbox Simulink block Examples in Signal Input and Output Category 10 Write and Read Binary Files in Simulink . . . . . . . . . . . . . . . . . . . . . . . . . 10-2 Write and Read Matrix Data from Binary Files in Simulink . . . . . . . . . . 10-6 Write and Read Fixed-Point Data from Binary Files in Simulink . . . . . . 10-8 Write and Read Character Data from Binary Files in Simulink . . . . . . . 10-10 Change the Endianness of the Data in Simulink . . . . . . . . . . . . . . . . . . 10-11 Simulink Block Examples in Signal Generation and Operations Category 11 Delay Signal Using Multitap Fractional Delay . . . . . . . . . . . . . . . . . . . . . 11-2 ix Bidirectional Linear Sweep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7 Unidirectional Linear Sweep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10 When Sweep Time Is Greater than Target Time . . . . . . . . . . . . . . . . . . . 11-12 Sweep with Negative Frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-14 Aliased Sweep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-17 Generate Discrete Impulse with Three Channels . . . . . . . . . . . . . . . . . . 11-19 Generate Unit-Diagonal and Identity Matrices . . . . . . . . . . . . . . . . . . . . 11-20 Generate Five-Phase Output from the Multiphase Clock Block . . . . . . 11-21 Count Down Through Range of Numbers . . . . . . . . . . . . . . . . . . . . . . . . 11-23 Import Frame-Based Signal From Workspace . . . . . . . . . . . . . . . . . . . . . 11-25 Import 3-D Array From Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-26 Generate Sample-Based Sine Waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-27 Generate Frame-Based Sine Waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-28 Design an NCO Source Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-29 Generate Constant Ramp Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-32 Averaged Power Spectrum of Pink Noise . . . . . . . . . . . . . . . . . . . . . . . . . 11-33 Downsample a Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-35 Sample and Hold a Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-38 Generate and Apply Hamming Window . . . . . . . . . . . . . . . . . . . . . . . . . . 11-41 Convert Sample Rate of Speech Signal . . . . . . . . . . . . . . . . . . . . . . . . . . 11-44 Unwrap Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-46 Convolution of Two Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-48 Select Rows or Columns from Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . 11-50 Convert 2-D Matrix to 1-D Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-51 x Contents

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.