REAL-TIME DIGITAL SIGNAL PROCESSING from MATLAB to C with the TMS320C6x DSK

Similar documents
Digital Signal Processing

ISBN: (ebook) ISBN: (Hardback)

An Introduction to Hardware-Based DSP Using windsk6

Enhancing the TMS320C6713 DSK for DSP Education

DSP in Communications and Signal Processing

Digital Signal Processing Laboratory 7: IIR Notch Filters Using the TMS320C6711

PROVIDING AN ENVIRONMENT TO TEACH DSP ALGORITHMS. José Vieira, Ana Tomé, João Rodrigues

Introduction To LabVIEW and the DSP Board

1.1 Digital Signal Processing Hands-on Lab Courses

Chapter 3. Basic Techniques for Speech & Audio Enhancement

Figure 1: Feature Vector Sequence Generator block diagram.

FPGA Development for Radar, Radio-Astronomy and Communications

S I N E V I B E S FRACTION AUDIO SLICING WORKSTATION

DHANALAKSHMI COLLEGE OF ENGINEERING Tambaram, Chennai

PC-based Personal DSP Training Station

TMS320VC5501/5502/5503/5507/5509/5510 DSP Multichannel Buffered Serial Port (McBSP) Reference Guide

Rapid prototyping of of DSP algorithms. real-time. Mattias Arlbrant. Grupphandledare, ANC

Implementation of Graphical Equalizer using LabVIEW for DSP Kit DSK C6713

IMPLEMENTATION AND ANALYSIS OF FIR FILTER USING TMS 320C6713 DSK Sandeep Kumar

Voice Controlled Car System

Low-Cost Personal DSP Training Station based on the TI C3x DSK

Radar Signal Processing Final Report Spring Semester 2017

Appendix D. UW DigiScope User s Manual. Willis J. Tompkins and Annie Foong

Journal of Theoretical and Applied Information Technology 20 th July Vol. 65 No JATIT & LLS. All rights reserved.

Tempo Estimation and Manipulation

Inside Digital Design Accompany Lab Manual

Analyzing Modulated Signals with the V93000 Signal Analyzer Tool. Joe Kelly, Verigy, Inc.

Embedded Signal Processing with the Micro Signal Architecture

Real-time EEG signal processing based on TI s TMS320C6713 DSK

2. AN INTROSPECTION OF THE MORPHING PROCESS

: DSP-BASED LOW-COST DIGITAL COMMUNICATIONS LABORATORY

Experiment 2: Sampling and Quantization

: INTERFACING J-DSP WITH A TI DSK FOR USE IN A SIGNAL PROCESSING CLASS

RT-DSP Using See Through

Reconfigurable FPGA Implementation of FIR Filter using Modified DA Method

Digital Effects Pedal Description Ross Jongeward 10 December 2014

Research Article. ZOOM FFT technology based on analytic signal and band-pass filter and simulation with LabVIEW

DDC and DUC Filters in SDR platforms

FIBRE CHANNEL CONSORTIUM

Combating Closed Eyes Design & Measurement of Pre-Emphasis and Equalization for Lossy Channels

Combating Closed Eyes Design & Measurement of Pre-Emphasis and Equalization for Lossy Channels

MIXED-SIGNAL AND DSP DESIGN TECHNIQUES

Modeling and Implementing Software-Defined Radio Communication Systems on FPGAs Puneet Kumar Senior Team Lead - SPC

Delta-Sigma Modulators

Contents. xv xxi xxiii xxiv. 1 Introduction 1 References 4

Department of Electrical & Electronic Engineering Imperial College of Science, Technology and Medicine. Project: Real-Time Speech Enhancement

Sample. Data Acquisition and Signal Conditioning. Course Manual. Course Software Version 2011 February 2012 Edition Part Number P-01

Teaching Transfer Functions with MATLAB and Real-Time DSP

University of Maiduguri Faculty of Engineering Seminar Series Volume 6, december 2015

WAVEEXPERT SERIES OSCILLOSCOPES WE 9000 NRO 9000 SDA 100G. The World s Fastest Oscilloscope

DSA-1. The Prism Sound DSA-1 is a hand-held AES/EBU Signal Analyzer and Generator.


International Journal of Engineering Trends and Technology (IJETT) - Volume4 Issue8- August 2013

DESIGN OF HIGH PERFORMANCE, AREA EFFICIENT FIR FILTER USING CARRY SELECT ADDER

THDB_ADA. High-Speed A/D and D/A Development Kit

Fraction by Sinevibes audio slicing workstation

Audio Signal Processing Studio Remote Lab for Signals and Systems Class

NanoGiant Oscilloscope/Function-Generator Program. Getting Started

OF AN ADVANCED LUT METHODOLOGY BASED FIR FILTER DESIGN PROCESS

Keywords Xilinx ISE, LUT, FIR System, SDR, Spectrum- Sensing, FPGA, Memory- optimization, A-OMS LUT.

VXI RF Measurement Analyzer

MAutoPitch. Presets button. Left arrow button. Right arrow button. Randomize button. Save button. Panic button. Settings button

A First Laboratory Course on Digital Signal Processing

Lab experience 1: Introduction to LabView

AN ARTISTIC TECHNIQUE FOR AUDIO-TO-VIDEO TRANSLATION ON A MUSIC PERCEPTION STUDY

AND8383/D. Introduction to Audio Processing Using the WOLA Filterbank Coprocessor APPLICATION NOTE

Chapter 1. Introduction to Digital Signal Processing

CONVOLUTIONAL CODING

Design and Implementation of Partial Reconfigurable Fir Filter Using Distributed Arithmetic Architecture

Laboratory 4. Figure 1: Serdes Transceiver

Implementation of CRC and Viterbi algorithm on FPGA

Designing Intelligence into Commutation Encoders

Product Update. JTAG Issues and the Use of RT54SX Devices

Getting Started with the LabVIEW Sound and Vibration Toolkit

DT9857E. Key Features: Dynamic Signal Analyzer for Sound and Vibration Analysis Expandable to 64 Channels

High Performance Real-Time Software Asynchronous Sample Rate Converter Kernel

Memory efficient Distributed architecture LUT Design using Unified Architecture

PEP-II longitudinal feedback and the low groupdelay. Dmitry Teytelman

Robert Alexandru Dobre, Cristian Negrescu

Experiment # 5. Pulse Code Modulation

Design on CIC interpolator in Model Simulator

CM3106 Solutions. Do not turn this page over until instructed to do so by the Senior Invigilator.

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

A Fast Constant Coefficient Multiplier for the XC6200

Diamond Cut Productions / Application Notes AN-2

for Digital IC's Design-for-Test and Embedded Core Systems Alfred L. Crouch Prentice Hall PTR Upper Saddle River, NJ

Powering Collaboration and Innovation in the Simulation Design Flow Agilent EEsof Design Forum 2010

GALILEO Timing Receiver

MIE 402: WORKSHOP ON DATA ACQUISITION AND SIGNAL PROCESSING Spring 2003

This project will work with two different areas in digital signal processing: Image Processing Sound Processing

Online Help. RT-Eye Serial Compliance and Analysis Application Adapted from the RT-Eye Online Help.

FPGA Digital Signal Processing. Derek Kozel July 15, 2017

ECE 4220 Real Time Embedded Systems Final Project Spectrum Analyzer

Logic Devices for Interfacing, The 8085 MPU Lecture 4

Risk Risk Title Severity (1-10) Probability (0-100%) I FPGA Area II Timing III Input Distortion IV Synchronization 9 60

Controlling adaptive resampling

ECE438 - Laboratory 4: Sampling and Reconstruction of Continuous-Time Signals

DATUM SYSTEMS Appendix A

LOW POWER DIGITAL EQUALIZATION FOR HIGH SPEED SERDES. Masum Hossain University of Alberta

Lab 1 Introduction to the Software Development Environment and Signal Sampling

Transcription:

REAL-TIME DIGITAL SIGNAL PROCESSING from MATLAB to C with the TMS320C6x DSK Thad B. Welch United States Naval Academy, Annapolis, Maryland Cameron KG. Wright University of Wyoming, Laramie, Wyoming Michael G. Morrow University of Wisconsin, Madison, Wisconsin (CoC\ Taylor &. Francis ^ ^ J Taylor & Francis Group Boca Raton London New York A CRC title, part of the Taylor & Francis imprint, a member of the Taylor & Francis Croup, the academic division of T&F Informa pic.

Contents Preface Acknowledgments xxxi xxxiii Enduring Fundamentals 1 1 Introduction and Organization 3 1.1 Why Do You Need This Book? 3 1.1.1 Other DSP Books 3 1.1.2 Demos and DSP Hardware 4 1.1.3 Philosophy of This Book 4 1.2 Real-Time DSP 4 1.3 How to Use This Book 5 1.3.1 Transition to Real-Time 8 1.3.2 Chapter Coverage 8 1.3.3 Hardware and Software Installation 9 1.3.4 Reading Program Listings 9 1.4 Get Started 10 2 Sampling and Reconstruction 11 2.1 Theory 11 2.1.1 Choosing a Sampling Frequency 11 2.1.2 Input/Output Issues: Samples or Frames? 11 2.1.3 The Talk-Through Concept 12 2.2 windsk6 Demonstration 12 2.2.1 Starting windsk6 12 2.2.2 Talk-Thru Application 13 2.3 Talk-Through Using Windows 15 2.4 Talk-Through Using MATLAB and Windows 16 2.4.1 Talk-Through Using MATLAB Only 18 2.4.2 Talk-Through Using MATLAB 21 2.5 DSK Implementation in C 22 2.6 Follow-On Challenges 23 3 FIR Digital Filters 25 3.1 Theory 25 3.1.1 Traditional Notation 25 3.1.2 FIR Filters Compared to IIR Filters... 26 3.1.3 Calculating the Output of a Filter 26 xi

CONTENTS 3.2 windsk6 Demonstration 28 3.2.1 Graphic Equalizer Application 29 3.2.2 Notch Filter Application 30 3.2.3 Audio Effects Application 32 3.3 MATLAB Implementation 33 3.3.1 Built-in Approach 33 3.3.2 Creating Your Own Filter Algorithm 37 3.4 DSK Implementation in C 39 3.4.1 Brute Force FIR Filtering in C: Part 1 39 3.4.2 Brute Force FIR Filtering in C: Part 2 41 3.4.3 Circular Buffered FIR Filtering 43 3.5 Follow-On Challenges 44 IIR Digital Filters 47 4.1 Theory 47 4.2 windsk6 Demonstration: Notch Filter Application 50 4.3 MATLAB Implementation 53 4.3.1 Filter Design and Analysis 53 4.3.2 IIR Filter Notation 58 4.3.3 Block Diagrams 60 4.3.4 Built-in Approach 65 4.3.5 Creating Your Own Filter Algorithm,. 65 4.4 DSK Implementation in C 68 4.4.1 Brute Force IIR Filtering 68 4.4.2 More Efficient IIR Filtering 70 4.5 Follow-On Challenges 70 Periodic Signal Generation 71 5.1 Theory 71 5.1.1 Periodic Signals in DSP 71 5.1.2 Signal Generation 72 5.2 windsk6 Demonstration 79 5.2.1 Arbitrary Waveform. 80 5.2.2 DTMF 81 5.3 MATLAB Implementation 83 5.3.1 Direct Digital Synthesizer Technique 83 5.3.2 Table Lookup Technique 84 5.4 DSK Implementation in C : 84 5.4.1 Direct Digital Synthesizer Technique. 85 5.4.2 Table Lookup Technique 86 5.4.3 Table Lookup Technique with Table Creation 87 5.4.4 Digital Resonator Technique 89 5.5 Follow-On Challenges 90 Frame-Based DSP 91 6.1 Theory 91 6.1.1 Drawbacks of Sample-Based DSP 91 6.1.2 What Is a Frame? 92 6.2 windsk6 Demonstration 93 6.3 MATLAB Implementation 95 6.4 DSK Implementation in C 95

CONTENTS xiii 6.4.1 Triple Buffering 95 6.4.2 A Frame-Based DSP Example 96 6.4.3 Using Direct Memory Access 101 6.5 Summary of Frame-Based Processing 109 6.6 Follow-On Challenges 110 7 Digital Filters Using Frames 111 7.1 Theory Ill 7.2 windsk6 Demonstration Ill 7.3 MATLAB Implementation Ill 7.4 DSK Implementation in C Ill 7.4.1 Understanding the FIR Process for Frames 112 7.4.2 How to Avoid the "Edge" Problems 113 7.4.3 Explanation of the C Code 113 7.5 Follow-On Challenges 115 8 The Fast Fourier Transform 117 8.1 Theory 117 8.1.1 Defining the FFT 117 8.1.2 The Twiddle Factors 117 8.1.3 The FFT Process 118 8.1.4 Bit-Reversed Addressing 121 8.1.5 Using the FFT for Filtering 121 8.1.6 Avoiding Circular Convolution 122 8.1.7 Real-Time Fast Convolution 124 8.2 windsk6 Demonstration 127 8.3 MATLAB Implementation 127 8.4 DSK Implementation in C 127 8.5 Follow-On Challenges 130 9 Spectral Analysis and Windowing 131 9.1 Theory 131 9.1.1 Power Spectrum of a Signal 131 9.1.2 The Need for Windowing 133 9.1.3 Window Characteristics 135 9.2 windsk6 Demonstration 138 9.3 MATLAB Implementation 138 9.4 DSK Implementation in C 141 9.5 Conclusion 141 9.6 Follow-On Challenges '. 141 Projects 143 10 Project 1: Guitar Special Effects 145 10.1 Introduction to Projects 145 10.2 Theory 145 10.2.1 Background 145 10.2.2 How the Effects Work 146 10.3 windsk6 Demonstration 158 10.4 MATLAB Implementation 158 10.4.1 FIR Comb Filter 158

xiv CONTENTS 10.4.2 IIR Comb Filter 159 10.4.3 Notch Filter 161 10.4.4 Flanger 162 10.4.5 Tremelo 163 10.5 DSK Implementation in C 164 10.5.1 Real-Time Comb Filters 164 10.5.2 Other Real-Time Special Effects 168 10.6 Follow-On Challenges 169 11 Project 2: Graphic Equalizer 171 11.1 Theory....' 171 11.2 windsk6 Demonstration 172 11.2.1 Graphic Equalizer Application 172 11.2.2 Effect of the Graphic Equalizer 172 11.3 MATLAB Implementation 174 11.4 DSK Implementation in C 176 11.4.1 Applying Gain to Filter Bands 176 11.4.2 GEL File Slider Control 179 11.5 Follow-On Challenges 181 12 Project 3: Peak Program Meter 183 12.1 Theory 183 12.2 windsk6 Demonstration: commdsk 184 12.3 MATLAB Implementation 185 12.4 DSK Implementation in C 185 12.4.1 Example PPM Code 185 12.4.2 DSK LED Control 187 12.4.3 Another PPM Code Version 187 12.5 Follow-On Challenges 189 13 Project 4: AM Transmitter 191 13.1 Theory 191 13.2 windsk6 Demonstration 194 13.3 MATLAB Implementation 194 13.4 DSK Implementation in C 196 13.5 Follow-On Challenges 198 14 Project 5: AM Receiver 199 14.1 Theory 199 14.1.1 Envelope Detector 200 14.1.2 The Hilbert-Based AM Receiver 206 14.2 windsk6 Demonstration 209 14.3 MATLAB Implementation 209 14.4 DSK Implementation in C 211 14.5 Follow-On Challenges 213 15 Project 6: Phase-Locked Loop 215 15.1 Theory 215 15.2 windsk6 Demonstration 216 15.3 MATLAB Implementation 216 15.3.1 PLL Simulation 216

CONTENTS xv 15.3.2 A Few Updates to the MATLAB Implementation 222 15.4 DSK Implementation in C 225 15.4.1 Components of the PLL 225 15.4.2 System Testing 228 15.5 Follow-On Challenges 228 16 Project 7: Digital Communications Transmitters 231 16.1 Theory 231 16.1.1 Random Data and Symbol Generation 231 16.1.2 BPSK Using Antipodal Rectangularly Shaped Bits 233 16.1.3 BPSK Using Impulse Modulated Raised-Cosine Shaped Bits... 233 16.2 windsk6 Demonstration 234 16.2.1 commdsk: Unfiltered BPSK 236 16.2.2 commdsk: Raised-Cosine Filtered BPSK 237 16.3 MATLAB Implementation 240 16.3.1 Rectangular Shaped BPSK Signal Generator 240 16.3.2 Impulse Modulated Raised-Cosine BPSK Signal Generator 242 16.4 DSK Implementation in C 245 16.4.1 A Rectangular Pulse Shaped BPSK Transmitter 246 16.4.2 A Raised-Cosine Pulse Shaped BPSK Transmitter 247 16.4.3 Summary of Real-Time Code 249 16.5 Follow-On Challenges 249 17 Project 8: Digital Communications Receivers 251 17.1 Theory : 251 17.1.1 The Output of the Matched Filter 253 17.1.2 The Eye-Pattern 254 17.1.3 Maximum Likelihood Timing Recovery 255 17.2 windsk6 Demonstration 257 17.3 MATLAB Implementation 258 17.4 DSK Implementation in C 262 17.4.1 Components of the Digital Receiver 262 17.4.2 System Testing 266 17.5 Follow-On Challenges 268 Appendices 271 A Code Composer Studio: A Brief Tutorial 273 A.I Introduction 273 A.2 Starting Code Composer Studio 273 A.3 Needed Files 277 A.4 Creating a New Project 278 A.5 Opening Existing Projects 280 A.6 Adding Files to a Project 281 A.7 Project Options 284 A.8 Building the Project 285 A.9 Loading the Program on the DSK 287 A.10 Running the Program on, the DSK 290 A.ll Get to Know CCS 291 A.12 Typical Files for Our CCS Projects 291

xvi CONTENTS B DSP/BIOS 295 B.I Introduction 295 B.I.I DSP/BIOS Major Features 295 B.1.2 DSP/BIOS Threads 295 B.2 Using the DSP/BIOS Scheduler 296 B.2.1 Adding a PRD Function 297 B.2.2 Adding a HWI Function 297 B.2.3 Adding a SWI Function 298 B.2.4 Adding a TSK Function 299 B.2.5 Real-Time Analysis Tools 299 B.3 A DSP/BIOS Talk-Through Application for the 6711 DSK 300 B.3.1 main.c 300 B.3.2 hwi.c 301 B.3.3 DSP/BIOS HWI Configuration 301 B.3.4 DSP/BIOS Serial Port Configuration 302 B.3.5 ' Source Code 302 B.4 Modification Needed for the Stereo Codecs 303 B.4.1 main.c 303 B.4.2 hwi.c 303 B.4.3 DSP/BIOS HWI Configuration 304 B.4.4 DSP/BIOS Serial Port Configuration 304 B.5 A DSP/BIOS Talk-Through Application for the 6713 DSK 305 B.5.1 main.c 305 B.5.2 hwi.c 306 B.5.3 DSP/BIOS HWI Configuration 306 B.5.4 DSP/BIOS Serial Port Configuration 307 B.5.5 Source Code 307 C Numeric Representations 311 C.I Endianness 311 C.2 Integer Representations 312 C.3 Integer Division and Rounding 313 C.4 Floating-Point Representations 314 C.5 Fixed-Point Representations 316 C.6 Summary of Numeric Representations 317 D TMS320C6x Architecture 319 D.I Computer Architecture Basics 319 D.I.I Instruction Set Architecture 320 D.1.2 Register Architectures 320 D.I.3 Memory Architectures 321 D.1.4 Fetch-Execute Model 322 D.I.5 Pipelining 322 D.I.6 Single- versus Multiple-Issue 325 D.I.7 Scheduling 325 D.2 TMS320C671x Architecture 326 D.2.1 Memory System 328 D.2.2 Pipeline and Scheduling 329 D.2.3 Peripherals 329 D.2.4 Host Port Interface :. 330

CONTENTS xvii E Related Tools for DSKs 331 E.I Introduction 331 E.2 Windows Control Applications 331 E.2.1 The Basic Windows Control Application 332 E.2.2 Creating an Oscilloscope Application 333 E.2.3 Creating a Spectrum Analyzer Application 339 E.3 MATLAB Exports 339 E.3.1 Exporting Direct-Form II Implementations 340 E.3.2 Exporting Second Order Section Implementations 341 E.4 MATLAB Real-Time Interface 342 F Programming Perils and Pitfalls 343 F.I Debug versus Release Builds 343 F.2 The Volatile Keyword 343 F.3 Function Prototypes and Return Types 344 F.4 Arithmetic Issues 345 F.5 Controlling the Location of Variables in Memory 346 F.6 Real-Time Schedule Failures 347 G Abbreviations 349 References 355 Index 361