logo资料库

TI DSP 函数库说明书(英文).pdf

第1页 / 共143页
第2页 / 共143页
第3页 / 共143页
第4页 / 共143页
第5页 / 共143页
第6页 / 共143页
第7页 / 共143页
第8页 / 共143页
资料共143页,剩余部分请下载后查看
SPRU422I - TMS320C55x
IMPORTANT NOTICE
Preface
Read This First
About This Manual
Related Documentation
Trademarks
Contents
Figures
Tables
Chapter 1: Introduction
1.1 DSP Routines
1.2 Features and Benefits
1.3 DSPLIB: Quality Freeware That You Can Build On and Contribute To
Chapter 2: Installing DSPLIB
2.1 DSPLIB Content
2.2 How to Install DSPLIB
2.2.1 De-Archive DSPLIB
2.2.2 Relocate Library File
2.3 How to Rebuild DSPLIB
2.3.1 For Full Rebuild of 55xdsp.lib
2.3.2 For Partial Rebuild of 55xdsp.lib ( modification of a specific DSPLIB function, for example fir.asm)
Chapter 3: Using DSPLIB
3.1 DSPLIB Arguments and Data Types
3.1.1 DSPLIB Arguments
3.1.2 DSPLIB Data Types
3.2 Calling a DSPLIB Function from C
3.3 Calling a DSPLIB Function from Assembly Language Source Code
3.4 Where to Find Sample Code
3.5 How DSPLIB is Tested - Allowable Error
3.6 How DSPLIB Deals with Overflow and Scaling Issues
3.7 Where DSPLIB Goes From Here
Chapter 4: Function Descriptions
4.1 Arguments and Conventions Used
4.2 DSPLIB Functions
acorr: Autocorrelation
add: Vector Add
atan2_16: Arctangent 2 Implementation
atan16: Arctangent Implementation
bexp: Block Exponent Implementation
cbrev: Complex Bit Reverse
cbrev32: 32-Bit Complex Bit Reverse
cfft: Forward Complex FFT
cfft32: 32-Bit Forward Complex FFT
cfir: Complex FIR Filter
cifft: Inverse Complex FFT
cifft32: 32-Bit Inverse Complex FFT
convol: Convolution
convol1: Convolution (fast)
convol2: Convolution (fastest)
corr: Correlation, full-length
dlms: Adaptive Delayed LMS Filter
dlmsfast: Adaptive Delayed LMS Filter (fast implemented)
expn: Exponential Base e
fir: FIR Filter
fir2: FIR2 Filter
firdec: Decimating FIR Filter
firinterp: Interpolating FIR Filter
firlat: Lattice Forward (FIR) Filter
firs: Symmetric FIR Filter
fltoq15: Floating-point to Q15 Conversion
hilb16: FIR Hilbert Transformer
iir32: Double-precision IIR Filter
iircas4: Cascaded IIR Direct Form II Using 4 Coefficients per Biquad
iircas5: Cascaded IIR Direct Form II (5 Coefficients per Biquad)
iircas51: Cascaded IIR Direct Form I (5 Coefficients per Biquad)
iirlat: Lattice Inverse (IIR) Filter
ldiv16: 32-bit by 16-bit Long Division Function
log_10: Base 10 Logarithm
log_2: Base 2 Logarithm
logn: Base e Logarithm (natural logarithm)
maxidx: Index of the Maximum Element of a Vector
maxidx34: Index of the Maximum Element of a Vector
maxval: Maximum Value of a Vector
maxvec: Index and Value of the Maximum Element of a Vector
minidx: Index of the Minimum Element of a Vector
minval: Minimum Value of a Vector
minvec: Index and Value of the Minimum Element of a Vector
mmul: Matrix Multiplication
mtrans: Matrix Transpose
mul32: 32-bit Vector Multiplication
neg: Vector Negate
neg32: Vector Negate (double-precision)
power: Vector Power
q15tofl: Q15 to Floating-point Conversion
rand16: Random Number Generation Algorithm
rand16init: Random Number Generation Initialization
recip16: 16-bit Reciprocal Function
rfft: Forward Real FFT (in-place)
rfft32: Forward 32-bit Real FFT (in-place)
rifft: Inverse Real FFT (in-place)
rifft32: Inverse 32-bit Real FFT (in-place)
sine: Sine
sqrt_16: Square Root of a 16-bit Number
sub: Vector Subtract
Chapter 5: DSPLIB Benchmarks and Performance Issues
5.1 What DSPLIB Benchmarks are Provided
5.2 Performance Considerations
Chapter 6: Software Updates and Customer Support
6.1 DSPLIB Software Updates
6.2 DSPLIB Customer Support
Appendix A: Overview of Fractional Q Formats
A.1 Q3.12 Format
A.2 Q.15 Format
A.3 Q.31 Format
Appendix B: Caluclating the Reciprocal of a Q15 Number
Index
TMS320C55x DSP Library Programmer’s Reference SPRU422I August 2006
IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment. TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily performed. TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and applications using TI components. To minimize the risks associated with customer products and applications, customers should provide adequate design and operating safeguards. TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI. Reproduction of information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation. Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements. Following are URLs where you can obtain information on other Texas Instruments products and application solutions: Products Amplifiers Data Converters DSP Interface Logic Power Mgmt Microcontrollers Low Power Wireless Mailing Address: www.ti.com/audio www.ti.com/automotive www.ti.com/broadband www.ti.com/digitalcontrol www.ti.com/military www.ti.com/opticalnetwork www.ti.com/security www.ti.com/telephony www.ti.com/video www.ti.com/wireless amplifier.ti.com dataconverter.ti.com dsp.ti.com interface.ti.com logic.ti.com power.ti.com microcontroller.ti.com www.ti.com/lpw Applications Audio Automotive Broadband Digital Control Military Optical Networking Security Telephony Video & Imaging Wireless Texas Instruments Post Office Box 655303 Dallas, Texas 75265 Copyright © 2006, Texas Instruments Incorporated
Preface Read This First About This Manual The Texas Instruments TMS320C55x DSPLIB is an optimized DSP Function Library for C programmers on TMS320C55x devices. It includes over 50 C-callable assembly-optimized general-purpose signal processing routines. These routines are typically used in computationally intensive real-time applications where optimal execution speed is critical. By using these routines you can achieve execution speeds considerable faster than equivalent code written in standard ANSI C language. In addition, by providing ready-to-use DSP functions, TI DSPLIB can shorten significantly your DSP application development time. Related Documentation - The MathWorks, Inc. Matlab Signal Processing Toolbox User’s Guide. Na- tick, MA: The MathWorks, Inc., 1996. . - Lehmer, D.H. “Mathematical Methods in large-scale computing units.” Proc. 2nd Sympos. on Large-Scale Digital Calculating Machinery, Cam- bridge, MA, 1949. Cambridge, MA: Harvard University Press, 1951. - Oppenheim, Alan V. and Ronald W Schafer. Discrete-Time Signal Proces- sing. Englewood Cliffs, NJ: Prentice Hall, 1989. - Digital Signal Processing with the TMS320 Family (SPR012) - TMS320C55x DSP CPU Reference Guide (SPRU371) - TMS320C55x Optimizing C Compiler User’s Guide (SPRU281) TMS320, TMS320C55x, and C55x are trademarks of Texas Instruments. Matlab is a trademark of Mathworks, Inc. Read This First iii Trademarks
iv
Contents Contents 1 Contents Introduction to the TMS320C55x DSP Library 1.1 1.2 1.3 DSP Routines Features and Benefits DSPLIB: Quality Freeware That You Can Build On and Contribute To . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Contents 1-2 1-2 1-2 2-2 2-3 2-3 2-3 2-4 2-4 2-4 3-2 3-2 3-2 3-3 3-3 3-3 3-4 3-4 3-6 4-2 4-3 Describes how to install the DSPLIB 2.1 2.2 DSPLIB Content How to Install DSPLIB 2.2.1 De-Archive DSPLIB 2.2.2 Relocate Library File How to Rebuild DSPLIB 2.3.1 2.3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . For Full Rebuild of 55xdsp.lib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . For Partial Rebuild of 55xdsp.lib (modification of a specific DSPLIB function, for example fir.asm) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 3 Contents Describes how to use the DSPLIB 3.1 DSPLIB Arguments and Data Types 3.1.1 DSPLIB Arguments 3.1.2 DSPLIB Data Types Calling a DSPLIB Function from C Calling a DSPLIB Function from Assembly Language Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 3.3 3.4 Where to Find Sample Code 3.5 3.6 3.7 Where DSPLIB Goes From Here How DSPLIB is Tested − Allowable Error How DSPLIB Deals with Overflow and Scaling Issues 4 Contents Provides descriptions for the TMS320C55x DSPLIB functions 4.1 4.2 Arguments and Conventions Used DSPLIB Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 DSPLIB Benchmarks and Performance Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 Describes benchmarks and performance issues for the DSPLIB functions 5.1 What DSPLIB Benchmarks are Provided . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 v
Contents 5.2 Performance Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 6 Software Updates and Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 Details the software updates and customer support issues for the TMS320C55x DSPLIB 6.1 6.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DSPLIB Software Updates DSPLIB Customer Support 6-2 6-2 7 Overview of Fractional Q Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1 Describes the fractional Q formats used by the DSPLIB functions A.1 Q3.12 Format A.2 Q.15 Format A.3 Q.31 Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2 A-2 A-2 8 Calculating the Reciprocal of a Q15 Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1 Provides the calculations used to find the inverse of a fractional Q15 number vi
Figures Figures 4−1 4−2 4−3 4−4 4−5 4−6 4−7 4−8 4−9 4−10 4−11 4−12 4−13 4−14 4−15 4−16 4−17 4−18 4−19 4−20 4−21 4−22 4−23 4−24 4−25 4−26 4−27 dbuffer Array in Memory at Time j x Array in Memory r Array in Memory x Array in Memory r Array in Memory h Array in Memory x Array in Memory r Array in Memory h Array in Memory x Array in Memory r Array in Memory h Array in Memory x Buffer dbuffer h Buffers dbuffer Array in Memory at Time j x Array in Memory r Array in Memory dbuffer Array in Memory at Time j x Array in Memory r Array in Memory dbuffer Array in Memory at Time j x Array in Memory r Array in Memory dbuffer Array in Memory at Time j x Array in Memory r Array in Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24 4-25 4-25 4-32 4-32 4-32 4-34 4-34 4-34 4-36 4-36 4-36 4-43 4-44 4-44 4-48 4-49 4-49 4-51 4-52 4-52 4-61 4-61 4-62 4-65 4-66 4-66 Contents vii
Tables Tables 4−1 4−2 A−1 A−2 A−3 A−4 Function Descriptions Summary Table Q3.12 Bit Fields Q.15 Bit Fields Q.31 Low Memory Location Bit Fields Q.31 High Memory Location Bit Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 4-3 A-2 A-2 A-2 A-2 viii
分享到:
收藏