Texas Instruments C28 Series User Manual
Texas Instruments C28 Series User Manual

Texas Instruments C28 Series User Manual

Floating point unit dsp library
Hide thumbs Also See for C28 Series:
Table of Contents

Advertisement

C28x Floating Point Unit DSP Library
USER'S GUIDE
FPU-DSP-LIB-UG-V131
Copyright © 2012 Texas Instruments Incorporated.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the C28 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Texas Instruments C28 Series

  • Page 1 C28x Floating Point Unit DSP Library USER’S GUIDE FPU-DSP-LIB-UG-V131 Copyright © 2012 Texas Instruments Incorporated.
  • Page 2: Copyright

    Copyright Copyright © 2012 Texas Instruments Incorporated. All rights reserved. ControlSUITE is a registered trademark of Texas Instruments. Other names and brands may be claimed as the property of others. Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of Texas Instruments semicon- ductor products and disclaimers thereto appears at the end of this document.
  • Page 3: Table Of Contents

    Table of Contents Table of Contents Copyright ........... . . Revision Information .
  • Page 4 Table of Contents Revision History ..........IMPORTANT NOTICE .
  • Page 5: Introduction

    Introduction Introduction The Texas Instruments TMS320C28x Floating Point Unit (FPU) Library is collection of highly opti- mized application functions written for the C28x+FPU. These functions enable C/C++ programmers to take full advantage of the performance potential of the C28x+FPU. This document provides a description of each function included within the library.
  • Page 6: Library Structure

    Library Structure Library Structure Build Options used to build the library ..............7 Header Files .
  • Page 7: Build Options Used To Build The Library

    Library Structure Folder Description base Base install directory. default this C:/TI/controlSUITE/libs/dsp/FPU/VERSION For the rest of this document base will be omitted from the directory names base /cmd Linker command files used in the examples base /doc Documentation for the current revision of the library including re- vision history base /examples Examples that illustrate the library functions.
  • Page 8: A Note About C Functions And Iqmath

    Library Structure 2.3 A Note about C functions and IQMath Most of the functions contained in the C28x FPU library are c-callable assembly. A few functions may be written in C. These C functions are written using the IQMath pre-processor notation. This allows these functions to be easily ported from fixed point to floating-point math.
  • Page 9: Function Descriptions

    Function Descriptions Function Descriptions DSP Routines Complex Fast Fourier Transform ................12 Complex Fast Fourier Transform (Unaligned) .
  • Page 10 Function Descriptions The following functions are included in this release of the FPU Library. The source code for these functions can be found in the source/C28x_FPU_LIB folder. CFFT_f32 void CFFT_f32(CFFT_F32_STRUCT *); CFFT_f32u void CFFT_f32u(CFFT_F32_STRUCT *); CFFT_f32_mag void CFFT_f32_mag(CFFT_F32_STRUCT *); CFFT_f32s_mag void CFFT_f32s_mag(CFFT_F32_STRUCT *);...
  • Page 11 Function Descriptions Table 3.1 – continued from previous page mpy_SP_RVxRV_2 void mpy_SP_RVxRV_2(float32 *, const float32 *, const float32 *, const Uint16); qsort_SP_RV void qsort_SP_RV(void *, Uint16); rnd_SP_RS float32 rnd_SP_RS(float32); sub_SP_CSxCV void sub_SP_CSxCV(complex_float *, const complex_float *, const complex_float, const Uint16); sub_SP_CVxCV void sub_SP_CVxCV(complex_float *, const complex_float *, const complex_float *, const Uint16);...
  • Page 12: Complex Fast Fourier Transform

    Function Descriptions 3.1 Complex Fast Fourier Transform Description: This module computes a 32-bit floating-point complex FFT including input bit reversing. This version of the function requires input buffer memory alignment. If you do not wish to align the input buffer, then use the CFFT_f32u function. Header File: FPU.h Declaration:...
  • Page 13 Function Descriptions Item Description Format Comment InPtr Input data Pointer to 32-bit float array Input buffer alignment is required. Refer to the alignment section. OutPtr Output buffer Pointer to 32-bit float array CoefPtr Twiddle factors Pointer to 32-bit float array Calculate using CFFT_f32_cossintable ( ).
  • Page 14 Function Descriptions Notes: 1. This function is not re-entrant as it uses global variables to store arguments; these will be overwritten if the function is invoked while it is currently processing. 2. If the input buffer is not properly aligned, then the output will be unpredictable. 3.
  • Page 15: Complex Fast Fourier Transform (Unaligned)

    Function Descriptions 3.2 Complex Fast Fourier Transform (Unaligned) Description: This module computes a 32-bit floating-point complex FFT including input bit reversing. This version of the function does not have any buffer alignment requirements. If you can align the input buffer, then use the CFFT_f32 function for improved performance Header File: FPU.h Declaration:...
  • Page 16 Function Descriptions Example: The following sample code obtains the complex FFT of the input. #include "FPU.h" #define CFFT_STAGES #define CFFT_SIZE (1 << CFFT_STAGES) float CFFTin1Buff[CFFT_SIZE * 2]; float CFFTin2Buff[CFFT_SIZE * 2]; float CFFToutBuff[CFFT_SIZE * 2]; float CFFTF32Coef[CFFT_SIZE]; CFFT_F32_STRUCT cfft; main() cfft.InPtr = CFFTin1Buff;...
  • Page 17: Complex Fast Fourier Transform Magnitude

    Function Descriptions 3.3 Complex Fast Fourier Transform Magnitude Description: This module computes the complex FFT magnitude. The output from CFFT_f32_mag matches the magnitude output from the FFT found in common mathematics software and Code Com- poser Studio FFT graphs. If instead a normalized magnitude like that performed by the fixed-point TMS320C28x IQmath FFT library is required, then the CFFT_f32s_mag function can be used.
  • Page 18 Function Descriptions Example: The following sample code obtains the complex FFT magnitude. #include "FPU.h" #define CFFT_STAGES #define CFFT_SIZE (1 << CFFT_STAGES) / * CFFTin1Buff section to 4 * FFT_SIZE in the linker file * / #pragma DATA_SECTION(CFFTin1Buff,"CFFTdata1"); float CFFTin1Buff[CFFT_SIZE * 2]; #pragma DATA_SECTION(CFFTin2Buff,"CFFTdata2");...
  • Page 19: Complex Fast Fourier Transform Magnitude (Scaled)

    Function Descriptions 3.4 Complex Fast Fourier Transform Magnitude (Scaled) Description: This module computes the scaled complex FFT magnitude. The scaling is F F T ST AGES and is done to match the normalization performed by the fixed-point TMS320C28x IQmath FFT library for overflow avoidance. Floating-point calculations do not need this scaling to avoid overflow and therefore the CFFT_f32_mag function can be used instead.
  • Page 20 Function Descriptions Example: The following sample code obtains the scaled FFT magnitude. #include "FPU.h" #define CFFT_STAGES #define CFFT_SIZE (1 << CFFT_STAGES) / * CFFTin1Buff section to 4 * FFT_SIZE in the linker file * / #pragma DATA_SECTION(CFFTin1Buff,"CFFTdata1"); float CFFTin1Buff[CFFT_SIZE * 2]; #pragma DATA_SECTION(CFFTin2Buff,"CFFTdata2");...
  • Page 21: Complex Fast Fourier Transform Phase

    Function Descriptions 3.5 Complex Fast Fourier Transform Phase Description: This module computes FFT Phase. Header File: FPU.h Declaration: void CFFT_f32_phase (CFFT_F32_STRUCT * ) Usage: A pointer to the following structure is passed to the CFFT_f32_phase function.It is the same structure described in the CFFT_f32 section: typedef struct { float32 * InPtr;...
  • Page 22 Function Descriptions Example: The following sample code obtains the Complex FFT phase. #include "FPU.h" #define CFFT_STAGES #define CFFT_SIZE (1 << CFFT_STAGES) / * CFFTin1Buff section to 4 * FFT_SIZE in the linker file * / #pragma DATA_SECTION(CFFTin1Buff,"CFFTdata1"); float CFFTin1Buff[CFFT_SIZE * 2]; #pragma DATA_SECTION(CFFTin2Buff,"CFFTdata2");...
  • Page 23: Complex Fast Fourier Transform Twiddle Factors

    Function Descriptions 3.6 Complex Fast Fourier Transform Twiddle Factors Description: This module generates the twiddle factors used by the complex FFT. Header File: FPU.h Declaration: void CFFT_f32_sincostable (CFFT_F32_STRUCT * ) Usage: A pointer to the following structure is passed to the CFFT_f32_sincostable function.It is the same structure described in the CFFT_f32 section: typedef struct { float32...
  • Page 24 Function Descriptions Example: The following sample code obtains the scaled FFT magnitude. #include "FPU.h" #define CFFT_STAGES #define CFFT_SIZE (1 << CFFT_STAGES) / * CFFTin1Buff section to 4 * FFT_SIZE in the linker file #pragma DATA_SECTION(CFFTin1Buff,"CFFTdata1"); float CFFTin1Buff[CFFT_SIZE * 2]; #pragma DATA_SECTION(CFFToutBuff,"CFFTdata3"); float CFFToutBuff[CFFT_SIZE * 2];...
  • Page 25: Inverse Complex Fast Fourier Transform

    Function Descriptions 3.7 Inverse Complex Fast Fourier Transform Description: This module computes a 32-bit floating-point Inverse complex FFT . This version of the function requires input buffer memory alignment. Header File: FPU.h Declaration: void ICFFT_f32 (CFFT_F32_STRUCT * ) Usage: A pointer to the following structure is passed to the CFFT_f32 function: typedef struct { float32 * InPtr;...
  • Page 26 Function Descriptions to switch the pointer cfft.CurrentInPtr with cfft.CurrentOutPtr so that the output from the stage becomes the input to the stage while the previous ( ) stage’s input buffer will be used as the output for the stage. In this manner the CurrentInPtr and CurrentOutPtr are switched successively for each IFFT stage.Therefore, If the number of stages is odd then at the end of all the coputation we get: currentInPtr=InPtr, currentOutPtr=OutPtr.
  • Page 27 Function Descriptions Example: The following sample code obtains the complex FFT of the input. #include "FPU.h" #define CFFT_STAGES #define CFFT_SIZE (1 << CFFT_STAGES) / * CFFTin1Buff section to 4 * FFT_SIZE in the linker file #pragma DATA_SECTION(CFFTin1Buff,"CFFTdata1"); float CFFTin1Buff[CFFT_SIZE * 2]; #pragma DATA_SECTION(CFFToutBuff,"CFFTdata2");...
  • Page 28: Real Fast Fourier Transform

    Function Descriptions 3.8 Real Fast Fourier Transform Description: This module computes a 32-bit floating-point real FFT including input bit reversing. This version of the function requires input buffer memory alignment. If you do not wish to align the input buffer, then use the RFFT_f32u function. Header File: FPU.h Declaration:...
  • Page 29 Function Descriptions Item Description Format Comment InBuf Input data Pointer to 32-bit float array Input buffer alignment is required. Re- fer to the alignment section. OutBuf Output buffer Pointer to 32-bit float array Result of RFFT_f32. This buffer can then be used as the input to the magni- tude and phase calculations.
  • Page 30 Function Descriptions Example: The following sample code obtains the FFT of the real input. #include "FPU.h" #define RFFT_STAGES #define RFFT_SIZE (1 << RFFT_STAGES) / * RFFTin1Buff section to 2 * FFT_SIZE in the linker file #pragma DATA_SECTION(RFFTin1Buff,"RFFTdata1"); float32 RFFTin1Buff[RFFT_SIZE]; #pragma DATA_SECTION(RFFToutBuff,"RFFTdata2"); float32 RFFToutBuff[RFFT_SIZE];...
  • Page 31: Real Fast Fourier Transform (Unaligned)

    Function Descriptions 3.9 Real Fast Fourier Transform (Unaligned) Description: This module computes a 32-bit floating-point real FFT including input bit reversing. This version of the function does not have any buffer alignment requirements. If you can align the input buffer, then use the RFFT_f32 function for improved performance. Header File: FPU.h Declaration:...
  • Page 32 Function Descriptions Example: The following sample code obtains the FFT of the real input. #include "FPU.h" #define RFFT_STAGES #define RFFT_SIZE (1 << RFFT_STAGES) / * RFFTin1Buff section to 2 * FFT_SIZE in the linker file #pragma DATA_SECTION(RFFTin1Buff,"RFFTdata1"); float32 RFFTin1Buff[RFFT_SIZE]; #pragma DATA_SECTION(RFFToutBuff,"RFFTdata2"); float32 RFFToutBuff[RFFT_SIZE];...
  • Page 33: Real Fast Fourier Transform With Adc Input

    Function Descriptions 3.10 Real Fast Fourier Transform with ADC Input Description: This module computes a 32-bit floating-point real FFT with 12-bit ADC input including input bit reversing. This version of the function requires input buffer memory alignment. If you do not wish to align the input buffer, then use the RFFT_adc_f32u function.
  • Page 34 Function Descriptions Item Description Format Comment InBuf Input data Pointer to 32-bit float array Not Used. OutBuf Output buffer Pointer to 32-bit float array Result of RFFT_adc_f32. This buffer is then used as the input to the magni- tude and phase calculations. The out- put order for FFTSize = N is: OutBuf[0] = real[0] OutBuf[1] = real[1]...
  • Page 35 Function Descriptions Example: The following sample code obtains the FFT of the real input. #include "FPU.h" #define RFFT_STAGES #define RFFT_SIZE (1 << RFFT_STAGES) RFFT_ADC_F32_STRUCT rfft_adc; RFFT_F32_STRUCT rfft; / * RFFTin1Buff section to 2 * FFT_SIZE in the linker file #pragma DATA_SECTION(RFFTin1Buff,"RFFTdata1"); float32 RFFTin1Buff[RFFT_SIZE];...
  • Page 36: Real Fast Fourier Transform With Adc Input (Unaligned)

    Function Descriptions 3.11 Real Fast Fourier Transform with ADC Input (Unaligned) Description: This module computes a 32-bit floating-point real FFT with 12-bit ADC input including input bit reversing. This version of the function does not have any buffer alignment requirements. If you can align the input buffer, then use the RFFT_adc_f32 function for improved performance.
  • Page 37 Function Descriptions Example: The following sample code obtains the FFT of the real input. #include "FPU.h" #define RFFT_STAGES #define RFFT_SIZE (1 << RFFT_STAGES) RFFT_ADC_F32_STRUCT rfft_adc; RFFT_F32_STRUCT rfft; / * RFFTin1Buff section to 2 * FFT_SIZE in the linker file #pragma DATA_SECTION(RFFTin1Buff,"RFFTdata1"); float32 RFFTin1Buff[RFFT_SIZE];...
  • Page 38: Real Fast Fourier Transform Magnitude

    Function Descriptions 3.12 Real Fast Fourier Transform Magnitude Description: This module computes the real FFT magnitude. The output from RFFT_f32_mag matches the magnitude output from the FFT found in common mathematics software and Code Composer Studio FFT graphs. If instead a normalized magnitude like that performed by the fixed-point TMS320C28x IQmath FFT library is required, then the RFFT_f32s_mag function can be used.
  • Page 39 Function Descriptions Example: The following sample code obtains the FFT magnitude. include "FPU.h" #define RFFT_STAGES #define RFFT_SIZE (1 << RFFT_STAGES) / * RFFTin1Buff section to 2 * FFT_SIZE in the linker file #pragma DATA_SECTION(RFFTin1Buff,"RFFTdata1"); float32 RFFTin1Buff[RFFT_SIZE]; #pragma DATA_SECTION(RFFToutBuff,"RFFTdata2"); float32 RFFToutBuff[RFFT_SIZE]; #pragma DATA_SECTION(RFFTmagBuff,"RFFTdata3");...
  • Page 40: Real Fast Fourier Transform Magnitude (Scaled)

    Function Descriptions 3.13 Real Fast Fourier Transform Magnitude (Scaled) Description: This module computes the scaled real FFT magnitude. The scaling is , and F F T ST AGES is done to match the normalization performed by the fixed-point TMS320C28x IQmath FFT library for overflow avoidance.
  • Page 41 Function Descriptions Example: The following sample code obtains the FFT magnitude. include "FPU.h" #define RFFT_STAGES #define RFFT_SIZE (1 << RFFT_STAGES) / * RFFTin1Buff section to 2 * FFT_SIZE in the linker file #pragma DATA_SECTION(RFFTin1Buff,"RFFTdata1"); float32 RFFTin1Buff[RFFT_SIZE]; #pragma DATA_SECTION(RFFToutBuff,"RFFTdata2"); float32 RFFToutBuff[RFFT_SIZE]; #pragma DATA_SECTION(RFFTmagBuff,"RFFTdata3");...
  • Page 42: Real Fast Fourier Transform Phase

    Function Descriptions 3.14 Real Fast Fourier Transform Phase Description: This module computes FFT Phase. Header File: FPU.h Declaration: void RFFT_f32_phase (RFFT_F32_STRUCT * ) Usage: A pointer to the following structure is passed to the RFFT_f32_phase function. It is the same structure described in the RFFT_f32 section: typedef struct { float32...
  • Page 43 Function Descriptions Example: The following sample code obtains the FFT phase. include "FPU.h" #define RFFT_STAGES #define RFFT_SIZE (1 << RFFT_STAGES) / * RFFTin1Buff section to 2 * FFT_SIZE in the linker file #pragma DATA_SECTION(RFFTin1Buff,"RFFTdata1"); float32 RFFTin1Buff[RFFT_SIZE]; #pragma DATA_SECTION(RFFToutBuff,"RFFTdata2"); float32 RFFToutBuff[RFFT_SIZE]; #pragma DATA_SECTION(RFFTmagBuff,"RFFTdata3");...
  • Page 44: Real Fast Fourier Transform Twiddle Factors

    Function Descriptions 3.15 Real Fast Fourier Transform Twiddle Factors Description: This module generates the twiddle factors used by the real FFT. Header File: FPU.h Declaration: void RFFT_f32_sincostable (RFFT_F32_STRUCT * ) Usage: A pointer to the following structure is passed to the RFFT_f32_sincostable function. It is the same structure described in the RFFT_f32 section: typedef struct { float32...
  • Page 45 Function Descriptions Example: The following sample code obtains the FFT phase. #include "FPU.h" #define RFFT_STAGES #define RFFT_SIZE (1 << RFFT_STAGES) / * RFFTin1Buff section to 2 * FFT_SIZE in the linker file #pragma DATA_SECTION(RFFTin1Buff,"RFFTdata1"); float32 RFFTin1Buff[RFFT_SIZE]; #pragma DATA_SECTION(RFFToutBuff,"RFFTdata2"); float32 RFFToutBuff[RFFT_SIZE]; #pragma DATA_SECTION(RFFTmagBuff,"RFFTdata3");...
  • Page 46: Finite Impulse Response Filter

    Function Descriptions 3.16 Finite Impulse Response Filter Description: This routine implements the non-recursive difference equation of an all-zero filter (FIR), of order N. All the coefficients of all-zero filter are assumed to be less than 1 in magnitude. Header File: FPU.h Declaration: void FIR_FP_calc(FIR_FP_handle)
  • Page 47 Function Descriptions Alignment Requirements: The delay and coefficients buffer must be aligned to a minimum of 2 x (order + 1) words. For example, if the filter order is 31, it will have 32 taps or coefficients each a 32-bit floating point value.
  • Page 48 Function Descriptions Example: The following sample code obtains the FIR response to a sample input. #include FPU.h #define FIR_ORDER #define SIGNAL_LENGTH (FIR_ORDER + 1) * 2 * 2 #pragma DATA_SECTION(firFP, "firfilt") FIR_FP firFP = FIR_FP_DEFAULTS; #pragma DATA_SECTION(dbuffer, "firldb") float dbuffer[FIR_ORDER+1]; #pragma DATA_SECTION(sigIn, "sigIn");...
  • Page 49 Function Descriptions Benchmark Information: The number of cycles is given by the following equation: + 52 The following table provides benchmark numbers for the function. Note that these include the cycles used in the call/return from the function. FIR order C-Callable ASM (Cycle Count) Table 3.22: Benchmark Information Sep 10, 2012...
  • Page 50: Absolute Value Of A Complex Vector

    Function Descriptions 3.17 Absolute Value of a Complex Vector Description: This module computes the absolute value of a complex vector. If N is even, use abs_SP_CV_2() for better performance. [ ] = Header File: FPU.h Declaration: void abs_SP_CV(float32 * y, const complex_float * x, const Uint16 N) Usage: abs_SP_CV(x, y, N);...
  • Page 51: Absolute Value Of An Even Length Complex Vector

    Function Descriptions 3.18 Absolute Value of an Even Length Complex Vector Description: This module computes the absolute value of an even length complex vector. [ ] = Header File: FPU.h Declaration: void abs_SP_CV_2(float32 * y, const complex_float * x, const Uint16 N) Usage: abs_SP_CV_2(x, y, N);...
  • Page 52: Addition (Element-Wise) Of A Complex Scalar To A Complex Vector

    Function Descriptions 3.19 Addition (Element-Wise) of a Complex Scalar to a Complex Vector Description: This module adds a complex scalar element-wise to a complex vector. [ ] = [ ] + [ ] = [ ] + Header File: FPU.h Declaration: void add_SP_CSxCV(complex_float * y, const complex_float * x, const complex_float c, const Uint16 N)
  • Page 53: Addition Of Two Complex Vectors

    Function Descriptions 3.20 Addition of Two Complex Vectors Description: This module adds two complex vectors. [ ] = [ ] + [ ] = [ ] + Header File: FPU.h Declaration: void add_SP_CVxCV(complex_float * y, const complex_float * w, const complex_float * x, const Uint16 N) Usage: add_SP_CVxCV(y, w, x, N);...
  • Page 54: Inverse Absolute Value Of A Complex Vector

    Function Descriptions 3.21 Inverse Absolute Value of a Complex Vector Description: This module computes the inverse absolute value of a complex vector. [ ] = Header File: FPU.h Declaration: void iabs_SP_CV(float32 * y, const complex_float * x, const Uint16 N) Usage: iabs_SP_CV(y, x, N);...
  • Page 55: Inverse Absolute Value Of An Even Length Complex Vector

    Function Descriptions 3.22 Inverse Absolute Value of an Even Length Complex Vector Description: This module calculates the inverse absolute value of an even length complex vector. [ ] = Header File: FPU.h Declaration: void iabs_SP_CV_2(float32 * y, const complex_float * x, const Uint16 N) Usage: iabs_SP_CV_2(y, x, N);...
  • Page 56: Index Of Maximum Value Of An Even Length Real Array

    Function Descriptions 3.23 Index of Maximum Value of an Even Length Real Array Description: This module finds the index of the maximum value of an even length real array. Header File: FPU.h Declaration: Uint16 maxidx_SP_RV_2(float32 * x, Uint16 N) Usage: index = maxidx_SP_RV_2(x, N);...
  • Page 57: Mean Of Real And Imaginary Parts Of A Complex Vector

    Function Descriptions 3.24 Mean of Real and Imaginary Parts of a Complex Vector Description: This module calculates the mean of real and imaginary parts of a complex vector. Σ Σ Header File: FPU.h Declaration: complex_float mean_SP_CV_2(const complex_float * x, const Uint16 N) Usage: y = mean_SP_CV_2(x, N);...
  • Page 58: Median Of A Real Valued Array Of Floats (Preserved Inputs)

    Function Descriptions 3.25 Median of a Real Valued Array of Floats (Preserved Inputs) Description: This module computes the median of a real valued array of floats. The input array is preserved. If input array preservation is not required, use median_SP_RV() for better performance. This function calls median_SP_RV() and memcpy_fast().
  • Page 59 Function Descriptions Example: #include "FPU.h" #define float32 x[N]; float32 main() y = median_noreorder_SP_RV(x, N); Benchmark Information: The cycles for this function are data dependent and therefore the benchmark cannot be pro- vided. Sep 10, 2012...
  • Page 60: Median Of A Real Array Of Floats

    Function Descriptions 3.26 Median of a real array of floats Description: This module computes the median of a real array of floats. The Input array is NOT preserved. If input array preservation is required, use median_noreorder_SP_RV(). Header File: FPU.h Declaration: float32 median_SP_RV(float32 * , Uint16) Usage: z = median_SP_RV(x, N);...
  • Page 61: Complex Multiply Of Two Floating Point Numbers

    Function Descriptions 3.27 Complex Multiply of Two Floating Point Numbers Description: This module multiplies two floating point complex values. Header File: FPU.h Declaration: complex_float mpy_SP_CSxCS(complex_float w, complex_float x) Usage: y = mpy_SP_CSxCS(w,x); complex_float w input 1 complex_float x input 2 complex_float y result The type “complex_float”...
  • Page 62: Complex Multiply Of Two Complex Vectors

    Function Descriptions 3.28 Complex Multiply of Two Complex Vectors Description: This module performs complex multiplication on two input complex vectors. [ ] = [ ] = [ ] + Header File: FPU.h Declaration: void mpy_SP_CVxCV(complex_float * y, const complex_float * w, const complex_float * x, const Uint16 N) Usage: mpy_SP_CVxCV(y, w, x, N);...
  • Page 63: Multiplication Of A Complex Vector And The Complex Conjugate Of Another Vector

    Function Descriptions 3.29 Multiplication of a Complex Vector and the Complex Conjugate of another Vector Description: This module multiplies a complex vector (w) and the complex conjugate of another complex vector (x). [ ] = [ ] = [ ] = [ ] = [ ] + Header File:...
  • Page 64: Multiplication Of A Real Scalar And A Real Vector

    Function Descriptions 3.30 Multiplication of a Real scalar and a Real Vector Description: This module multiplies a real scalar and a real vector. [ ] = Header File: FPU.h Declaration: void mpy_SP_RSxRV_2(float32 * y, const float32 * x, const float32 c, const Uint16 N) Usage: mpy_SP_RSxRV_2(y, x, c, N);...
  • Page 65: Multiplication Of A Real Scalar, A Real Vector, And Another Real Vector

    Function Descriptions 3.31 Multiplication of a Real Scalar, a Real Vector, and another Real Vector Description: This module multiplies a real scalar with a real vector. and another real vector. [ ] = Header File: FPU.h Declaration: void mpy_SP_RSxRVxRV_2(float32 * y, const float32 * w, const float32 * x, const float32 c, const Uint16 N) Usage: mpy_SP_RSxRVxRV_2(y, w, x, c, N);...
  • Page 66: Multiplication Of A Real Vector And A Complex Vector

    Function Descriptions 3.32 Multiplication of a Real Vector and a Complex Vector Description: This module multiplies a real vector and a complex vector. [ ] = [ ] = Header File: FPU.h Declaration: void mpy_SP_RVxCV(complex_float * y, const complex_float * w, const float32 * x, const Uint16 N) Usage: mpy_SP_RVxCV(y, x, c, N);...
  • Page 67: Multiplication Of A Real Vector And A Real Vector

    Function Descriptions 3.33 Multiplication of a Real Vector and a Real Vector Description: This module multiplies two real vectors. [ ] = Header File: FPU.h Declaration: void mpy_SP_RVxRV_2(float32 * y, const float32 * w, const float32 * x, const Uint16 N) Usage: mpy_SP_RVxRV_2(y, w, x, N);...
  • Page 68: Sort An Array Of Floats

    Function Descriptions 3.34 Sort an Array of Floats Description: This module sorts an array of floats. This function is a partially optmized version of qsort.c from the C28x cgtools lib qsort() v6.0.1. Header File: FPU.h Declaration: void qsort_SP_RV(void * x, Uint16 N) Usage: qsort_SP_RV(x, N);...
  • Page 69: Rounding (Unbiased) Of A Floating Point Scalar

    Function Descriptions 3.35 Rounding (Unbiased) of a Floating Point Scalar Description: This module performs the unbiased rounding of a floating point scalar. Header File: FPU.h Declaration: float32 rnd_SP_RS(float32 x) Usage: y = rnd_SP_RS(x); float32 x input value float32 y result Alignment Requirements: None Notes:...
  • Page 70: Subtraction Of A Complex Scalar From A Complex Vector

    Function Descriptions 3.36 Subtraction of a Complex Scalar from a Complex Vector Description: This module subtracts a complex scalar from a complex vector. [ ] = [ ] = Header File: FPU.h Declaration: void sub_SP_CSxCV(complex_float * y, const complex_float * x, const complex_float c, const Uint16 N) Usage: sub_SP_CSxCV(y, w, c, N);...
  • Page 71: Subtraction Of A Complex Vector And Another Complex Vector

    Function Descriptions 3.37 Subtraction of a Complex Vector and another Complex Vector Description: This module subtracts a complex vector from another complex vector. [ ] = [ ] = Header File: FPU.h Declaration: void sub_SP_CVxCV(complex_float * y, const complex_float * w, const complex_float * x, const Uint16 N) Usage: sub_SP_CVxCV(y, w, x, N);...
  • Page 72: Fast Square Root

    Function Descriptions 3.38 Fast Square Root Description: This function is an inline optmized fast square root function using two iterations of the newton raphson method to achieve an accurate result. Header File: FPU.h Declaration: inline static float32 __ffsqrtf(float32 x) Usage: __ffsqrtf(x);...
  • Page 73: Optimized Memory Copy

    Function Descriptions 3.39 Optimized Memory Copy Description: Header File: FPU.h Declaration: This module performs optimized memory copies. void memcpy_fast(void * dst, const void * src, Uint16 N) Usage: memcpy_fast(dst, src, N); void* dst pointer to destination const void* src pointer to source Uint16 N number of 16-bit words to copy Alignment Requirements:...
  • Page 74: Optimized Memory Set

    Function Descriptions 3.40 Optimized Memory Set Description: This module performs optimized memory sets. Header File: FPU.h Declaration: void memset_fast(void * dst, int16 value, Uint16 N) Usage: memset_fast(dst, value, N); void* dst pointer to destination int16 value initialization value Uint16 N number of 16-bit words to initialize Alignment Requirements: None...
  • Page 75 Revision History Revision History V1.31: Minor Update Revised documentation Updated median_SP_RV() routine V1.30: Moderate Update Added vector and matrix functions and examples Added Inverse complex FFT and example Revised benchmark numbers Revised alignment requirements for FFT’s V1.20: Moderate Update Added equiripple FIR filter function V1.10: Moderate Update Includes the complex FFT and real FFT with 12-bit ADC fixed-point input supporting functions.
  • Page 76 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.

This manual is also suitable for:

Tms320c28 series

Table of Contents