/*****************************************************************************/ /* STDIO.H v8.2.5 */ /* */ /* Copyright (c) 1993-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* linkage.h v8.2.5 */ /* */ /* Copyright (c) 1998-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-19.4") /* macros required for implementation */ /*--------------------------------------------------------------------------*/ /* Define _CODE_ACCESS ==> how to call RTS functions */ /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* Define _DATA_ACCESS ==> how to access RTS global or static data */ /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* Define _DATA_ACCESS_NEAR ==> some C6000 RTS data must always be near */ /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* Define _IDECL ==> how inline functions are declared */ /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* If compiling with non-TI compiler (e.g. GCC), nullify any TI-specific */ /* language extensions. */ /*--------------------------------------------------------------------------*/ #pragma diag_pop /*****************************************************************************/ /* stdarg.h v8.2.5 */ /* */ /* Copyright (c) 1993-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ #pragma CHECK_MISRA("-19.7") /* macros required for implementation */ #pragma CHECK_MISRA("-19.10") /* need types as macro arguments */ typedef char *va_list; /*****************************************************************************/ /* LLVM VARARGS HANDLING - Use builtin operations. */ /*****************************************************************************/ /*****************************************************************************/ /* VA_END - Reclaim resources used by varargs handling. */ /* */ /* No action needed */ /*****************************************************************************/ /*****************************************************************************/ /* VA_COPY - Make a copy of the varargs. */ /*****************************************************************************/ /*****************************************************************************/ /* VA_START - Set up the va_list pointer. */ /*****************************************************************************/ /*---------------------------------------------------------------------------*/ /* ELF ABI convention: */ /* - va_list pointer points one byte beyond the last argument. */ /*---------------------------------------------------------------------------*/ /*****************************************************************************/ /* VA_ARG - Return the next argument, adjust va_list pointer */ /* */ /* Some arguments passed by value are turned into pass-by-reference by */ /* making a temporary object and passing a pointer to this temporary. For */ /* such an argument (indicated by __va_argref(_type)) the actual argument */ /* passed is a pointer, so it must be dealt with specially. */ /* */ /* When an argument is larger than the maximum alignment (8 bytes for double */ /* or long long), we only align to 8 bytes. */ /*****************************************************************************/ /*---------------------------------------------------------------------------*/ /* What happens on every va_arg(_ap, _type) call is: */ /* 1) Align the value of _ap (the va_list pointer) appropriately for _type */ /* (the requested type). */ /* 2) Increment _ap appropriately for _type. */ /* 3) Return the value desired by dereferencing _ap. */ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* 1) Align _ap to satisfy alignment of _type. */ /* 2) Increment _ap by sizeof(_type) */ /* 3) return *(ap-sizeof(_type)) */ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* The big- and little-endian variants are different only because we are */ /* trying to support the case of the user asking for "char" or "short", */ /* which is actually undefined behavior (See ISO/IEC 9899:1999 7.15.1.1), */ /* but we are trying to be friendly. */ /*---------------------------------------------------------------------------*/ #pragma diag_pop #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*---------------------------------------------------------------------------*/ /* Attributes are only available in relaxed ANSI mode. */ /*---------------------------------------------------------------------------*/ /****************************************************************************/ /* TYPES THAT ANSI REQUIRES TO BE DEFINED */ /****************************************************************************/ typedef unsigned size_t; typedef struct { int fd; /* File descriptor */ unsigned char* buf; /* Pointer to start of buffer */ unsigned char* pos; /* Position in buffer */ unsigned char* bufend; /* Pointer to end of buffer */ unsigned char* buff_stop; /* Pointer to last read char in buffer */ unsigned int flags; /* File status flags (see below) */ } FILE; typedef int fpos_t; /****************************************************************************/ /* DEVICE AND STREAM RELATED MACROS */ /****************************************************************************/ /****************************************************************************/ /* MACROS THAT DEFINE AND USE FILE STATUS FLAGS */ /****************************************************************************/ /****************************************************************************/ /* MACROS THAT ANSI REQUIRES TO BE DEFINED */ /****************************************************************************/ /******** END OF ANSI MACROS ************************************************/ /****************************************************************************/ /* DEVICE AND STREAM RELATED DATA STRUCTURES AND MACROS */ /****************************************************************************/ extern __far FILE _ftable[20]; extern __far char __TI_tmpnams[20][16]; /****************************************************************************/ /* FUNCTION DEFINITIONS - ANSI */ /****************************************************************************/ /****************************************************************************/ /* OPERATIONS ON FILES */ /****************************************************************************/ extern int remove(const char *_file); extern int rename(const char *_old, const char *_new); extern FILE *tmpfile(void); extern char *tmpnam(char *_s); /****************************************************************************/ /* FILE ACCESS FUNCTIONS */ /****************************************************************************/ extern int fclose(FILE * __restrict _fp); extern FILE *fopen(const char * __restrict _fname, const char * __restrict _mode); extern FILE *freopen(const char * __restrict _fname, const char * __restrict _mode, FILE * __restrict _fp); extern void setbuf(FILE * __restrict _fp, char * __restrict _buf); extern int setvbuf(FILE * __restrict _fp, char * __restrict _buf, int _type, size_t _size); extern int fflush(FILE *_fp); /****************************************************************************/ /* FORMATTED INPUT/OUTPUT FUNCTIONS */ /****************************************************************************/ extern int fprintf(FILE * __restrict _fp, const char * __restrict _format, ...) __attribute__((__format__ (__printf__, 2, 3))); extern int fscanf(FILE * __restrict _fp, const char * __restrict _fmt, ...) __attribute__((__format__ (__scanf__, 2, 3))); extern int printf(const char * __restrict _format, ...) __attribute__((__format__ (__printf__, 1, 2))); extern int scanf(const char * __restrict _fmt, ...) __attribute__((__format__ (__scanf__, 1, 2))); extern int sprintf(char * __restrict _string, const char * __restrict _format, ...) __attribute__((__format__ (__printf__, 2, 3))); extern int snprintf(char * __restrict _string, size_t _n, const char * __restrict _format, ...) __attribute__((__format__ (__printf__, 3, 4))); extern int sscanf(const char * __restrict _str, const char * __restrict _fmt, ...) __attribute__((__format__ (__scanf__, 2, 3))); extern int vfprintf(FILE * __restrict _fp, const char * __restrict _format, va_list _ap) __attribute__((__format__ (__printf__, 2, 0))); extern int vfscanf(FILE * __restrict _fp, const char * __restrict _fmt, va_list _ap) __attribute__((__format__ (__scanf__, 2, 0))); extern int vprintf(const char * __restrict _format, va_list _ap) __attribute__((__format__ (__printf__, 1, 0))); extern int vscanf(const char * __restrict _format, va_list _ap) __attribute__((__format__ (__scanf__, 1, 0))); extern int vsprintf(char * __restrict _string, const char * __restrict _format, va_list _ap) __attribute__((__format__ (__printf__, 2, 0))); extern int vsnprintf(char * __restrict _string, size_t _n, const char * __restrict _format, va_list _ap) __attribute__((__format__ (__printf__, 3, 0))); extern int vsscanf(const char * __restrict _str, const char * __restrict _fmt, va_list _ap) __attribute__((__format__ (__scanf__, 2, 0))); /****************************************************************************/ /* CHARACTER INPUT/OUTPUT FUNCTIONS */ /****************************************************************************/ extern int fgetc(FILE *_fp); extern char *fgets(char * __restrict _ptr, int _size, FILE * __restrict _fp); extern int fputc(int _c, FILE *_fp); extern int fputs(const char * __restrict _ptr, FILE * __restrict _fp); extern int getc(FILE *_p); extern int getchar(void); extern char *gets(char *_ptr); extern int putc(int _x, FILE *_fp); extern int putchar(int _x); extern int puts(const char *_ptr); extern int ungetc(int _c, FILE *_fp); /****************************************************************************/ /* DIRECT INPUT/OUTPUT FUNCTIONS */ /****************************************************************************/ extern size_t fread(void * __restrict _ptr, size_t _size, size_t _count, FILE * __restrict _fp); extern size_t fwrite(const void * __restrict _ptr, size_t _size, size_t _count, FILE * __restrict _fp); /****************************************************************************/ /* FILE POSITIONING FUNCTIONS */ /****************************************************************************/ extern int fgetpos(FILE * __restrict _fp, fpos_t * __restrict _pos); extern int fseek(FILE *_fp, long _offset, int _ptrname); extern int fsetpos(FILE * __restrict _fp, const fpos_t * __restrict _pos); extern long ftell(FILE *_fp); extern void rewind(FILE *_fp); /****************************************************************************/ /* ERROR-HANDLING FUNCTIONS */ /****************************************************************************/ extern void clearerr(FILE *_fp); extern int feof(FILE *_fp); extern int ferror(FILE *_fp); extern void perror(const char *_s); /*****************************************************************************/ /* stdlib.h v8.2.5 */ /* */ /* Copyright (c) 1993-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-6.3") /* standard types required for standard headers */ #pragma CHECK_MISRA("-8.5") /* need to define inline function */ #pragma CHECK_MISRA("-19.1") /* #includes required for implementation */ #pragma CHECK_MISRA("-19.7") /* need function-like macros */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ /*---------------------------------------------------------------------------*/ /* Attributes are only available in relaxed ANSI mode. */ /*---------------------------------------------------------------------------*/ #pragma diag_push #pragma CHECK_MISRA("-5.7") /* keep names intact */ typedef struct { int quot, rem; } div_t; typedef struct { long quot, rem; } ldiv_t; typedef struct { long long quot, rem; } lldiv_t; #pragma diag_pop typedef unsigned short wchar_t; /*---------------------------------------------------------------*/ /* NOTE - Normally, abs, labs, and fabs are expanded inline, so */ /* no formal definition is really required. However, ANSI */ /* requires that they exist as separate functions, so */ /* they are supplied in the library. The prototype is */ /* here mainly for documentation. */ /*---------------------------------------------------------------*/ #pragma diag_push #pragma CHECK_MISRA("-16.4") /* false positives due to builtin declarations */ int abs(int _val); long labs(long _val); long long llabs(long long _val); #pragma diag_pop int atoi(const char *_st); long atol(const char *_st); long long atoll(const char *_st); int ltoa(long val, char *buffer); static __inline double atof(const char *_st); long strtol(const char * __restrict _st, char ** __restrict _endptr, int _base); unsigned long strtoul(const char * __restrict _st, char ** __restrict _endptr, int _base); long long strtoll(const char * __restrict _st, char ** __restrict _endptr, int _base); unsigned long long strtoull(const char * __restrict _st, char ** __restrict _endptr, int _base); float strtof(const char * __restrict _st, char ** __restrict _endptr); double strtod(const char * __restrict _st, char ** __restrict _endptr); long double strtold(const char * __restrict _st, char ** __restrict _endptr); int rand(void); void srand(unsigned _seed); void *calloc(size_t _num, size_t _size) __attribute__((malloc)); void *malloc(size_t _size) __attribute__((malloc)); void *realloc(void *_ptr, size_t _size) __attribute__((malloc)); void free(void *_ptr); void *memalign(size_t _aln, size_t _size) __attribute__((malloc)); void abort(void); typedef void (*__TI_atexit_fn)(void); int atexit(__TI_atexit_fn _func); typedef int (*__TI_compar_fn)(const void *_a,const void *_b); void *bsearch(const void *_key, const void *_base, size_t _nmemb, size_t _size, __TI_compar_fn compar); void qsort(void *_base, size_t _nmemb, size_t _size, __TI_compar_fn compar); void exit(int _status); div_t div(int _numer, int _denom); ldiv_t ldiv(long _numer, long _denom); lldiv_t lldiv(long long _numer, long long _denom); char *getenv(const char *_string); int system(const char *_name); int mblen(const char *_s, size_t _n); size_t mbstowcs(wchar_t * __restrict _dest, const char * __restrict _src, size_t _n); int mbtowc(wchar_t * __restrict _dest, const char * __restrict _src, size_t _n); size_t wcstombs(char * __restrict _dest, const wchar_t * __restrict _src, size_t _n); int wctomb(char *_s, wchar_t _wc); static __inline double atof(const char *_st) { return strtod(_st, (char **)0); } #pragma diag_pop #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop #pragma diag_push /* C2000-specific additions to header implemented with #include */ #pragma CHECK_MISRA("-19.1") #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* string.h v8.2.5 */ /* */ /* Copyright (c) 1993-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-6.3") /* standard types required for standard headers */ #pragma CHECK_MISRA("-19.1") /* #includes required for implementation */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ #pragma diag_push #pragma CHECK_MISRA("-19.4") /* macros required for implementation */ #pragma diag_pop static __inline size_t strlen(const char *string); static __inline char *strcpy(char * __restrict dest, const char * __restrict src); static __inline char *strncpy(char * __restrict dest, const char * __restrict src, size_t n); static __inline char *strcat(char * __restrict string1, const char * __restrict string2); static __inline char *strncat(char * __restrict dest, const char * __restrict src, size_t n); static __inline char *strchr(const char *string, int c); static __inline char *strrchr(const char *string, int c); static __inline int strcmp(const char *string1, const char *string2); static __inline int strncmp(const char *string1, const char *string2, size_t n); int strcoll(const char *string1, const char *_string2); size_t strxfrm(char * __restrict to, const char * __restrict from, size_t n); char *strpbrk(const char *string, const char *chs); size_t strspn(const char *string, const char *chs); size_t strcspn(const char *string, const char *chs); char *strstr(const char *string1, const char *string2); char *strtok(char * __restrict str1, const char * __restrict str2); char *strerror(int _errno); char *strdup(const char *string); void *memmove(void *s1, const void *s2, size_t n); #pragma diag_push #pragma CHECK_MISRA("-16.4") /* false positives due to builtin declarations */ void *memcpy(void * __restrict s1, const void * __restrict s2, size_t n); #pragma diag_pop static __inline int memcmp(const void *cs, const void *ct, size_t n); static __inline void *memchr(const void *cs, int c, size_t n); void *memset(void *mem, int ch, size_t length); #pragma diag_push #pragma CHECK_MISRA("-19.4") /* macros required for implementation */ #pragma diag_pop #pragma diag_push /* functions */ /* MISRA exceptions to avoid changing inline versions of the functions that would be linked in instead of included inline at different mf levels */ /* these functions are very well-tested, stable, and efficient; it would introduce a high risk to implement new, separate MISRA versions just for the inline headers */ #pragma CHECK_MISRA("-5.7") /* keep names intact */ #pragma CHECK_MISRA("-6.1") /* false positive on use of char type */ #pragma CHECK_MISRA("-8.5") /* need to define inline functions */ #pragma CHECK_MISRA("-10.1") /* use implicit casts */ #pragma CHECK_MISRA("-10.3") /* need casts */ #pragma CHECK_MISRA("-11.5") /* casting away const required for standard impl */ #pragma CHECK_MISRA("-12.1") /* avoid changing expressions */ #pragma CHECK_MISRA("-12.2") /* avoid changing expressions */ #pragma CHECK_MISRA("-12.4") /* avoid changing expressions */ #pragma CHECK_MISRA("-12.5") /* avoid changing expressions */ #pragma CHECK_MISRA("-12.6") /* avoid changing expressions */ #pragma CHECK_MISRA("-12.13") /* ++/-- needed for reasonable implementation */ #pragma CHECK_MISRA("-13.1") /* avoid changing expressions */ #pragma CHECK_MISRA("-14.7") /* use multiple return points */ #pragma CHECK_MISRA("-14.8") /* use non-compound statements */ #pragma CHECK_MISRA("-14.9") /* use non-compound statements */ #pragma CHECK_MISRA("-17.4") /* pointer arithmetic needed for reasonable impl */ #pragma CHECK_MISRA("-17.6") /* false positive returning pointer-typed param */ static __inline size_t strlen(const char *string) { size_t n = (size_t)-1; const char *s = string; do n++; while (*s++); return n; } static __inline char *strcpy(char * __restrict dest, const char * __restrict src) { char *d = dest; const char *s = src; while (*d++ = *s++); return dest; } static __inline char *strncpy(char * __restrict dest, const char * __restrict src, size_t n) { if (n) { char *d = dest; const char *s = src; while ((*d++ = *s++) && --n); /* COPY STRING */ if (n-- > 1) do *d++ = '\0'; while (--n); /* TERMINATION PADDING */ } return dest; } static __inline char *strcat(char * __restrict string1, const char * __restrict string2) { char *s1 = string1; const char *s2 = string2; while (*s1) s1++; /* FIND END OF STRING */ while (*s1++ = *s2++); /* APPEND SECOND STRING */ return string1; } static __inline char *strncat(char * __restrict dest, const char * __restrict src, size_t n) { if (n) { char *d = dest; const char *s = src; while (*d) d++; /* FIND END OF STRING */ while (n--) if (!(*d++ = *s++)) return dest; /* APPEND SECOND STRING */ *d = 0; } return dest; } static __inline char *strchr(const char *string, int c) { char tch, ch = c; const char *s = string; for (;;) { if ((tch = *s) == ch) return (char *) s; if (!tch) return (char *) 0; s++; } } static __inline char *strrchr(const char *string, int c) { char tch, ch = c; char *result = 0; const char *s = string; for (;;) { if ((tch = *s) == ch) result = (char *) s; if (!tch) break; s++; } return result; } static __inline int strcmp(const char *string1, const char *string2) { int c1, res; for (;;) { c1 = (unsigned char)*string1++; res = c1 - (unsigned char)*string2++; if (c1 == 0 || res != 0) break; } return res; } static __inline int strncmp(const char *string1, const char *string2, size_t n) { if (n) { const char *s1 = string1; const char *s2 = string2; unsigned char cp; int result; do if (result = (unsigned char)*s1++ - (cp = (unsigned char)*s2++)) return result; while (cp && --n); } return 0; } static __inline int memcmp(const void *cs, const void *ct, size_t n) { if (n) { const unsigned char *mem1 = (unsigned char *)cs; const unsigned char *mem2 = (unsigned char *)ct; int cp1, cp2; while ((cp1 = *mem1++) == (cp2 = *mem2++) && --n); return cp1 - cp2; } return 0; } static __inline void *memchr(const void *cs, int c, size_t n) { if (n) { const unsigned char *mem = (unsigned char *)cs; unsigned char ch = c; do if ( *mem == ch ) return (void *)mem; else mem++; while (--n); } return 0; } #pragma diag_pop #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /****************************************************************************/ /* math.h v8.2.5 */ /* */ /* Copyright (c) 1997-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-6.3") /* standard types required for standard headers */ #pragma CHECK_MISRA("-19.1") /* #includes required for implementation */ #pragma CHECK_MISRA("-19.7") /* macros required for implementation */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ /****************************************************************************/ /* elfnames.h v8.2.5 */ /* */ /* Copyright (c) 1997-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-19.4") /* macros required for implementation */ #pragma CHECK_MISRA("-19.7") /* macros required for implementation */ #pragma CHECK_MISRA("-19.13") /* # and ## required for implementation */ /*****************************************************************************/ /* ABI_PREFIX.H v8.2.5 */ /* */ /* Copyright (c) 2016-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_pop /****************************************************************************/ /* TYPE GENERIC MACROS */ /****************************************************************************/ double sqrt (double x); double exp (double x); double log (double x); double log10(double x); double pow (double x, double y); double sin (double x); double cos (double x); double tan (double x); double asin (double x); double acos (double x); double atan (double x); double atan2(double y, double x); double sinh (double x); double cosh (double x); double tanh (double x); static __inline double ceil (double x); static __inline double floor(double x); #pragma diag_push #pragma CHECK_MISRA("-16.4") /* false positives due to builtin declarations */ double fabs (double x); #pragma diag_pop double ldexp(double x, int n); double frexp(double x, int *_exp); double modf (double x, double *ip); double fmod (double x, double y); double log1p(double x); double hypot(double x, double y); double copysign(double x, double y); int _signbitf(float x); int _signbit(double x); int _signbitl(long double x); /* An inline version of fmod that works for limited domain only */ /* See comments in implementation below */ static __inline double _FMOD(double x, double y); /* these present in many linked images, so we'll tell you about them. */ double __c6xabi_nround(double x); /* round-to-nearest */ double __c6xabi_trunc(double x); /* truncate towards 0 */ /* the ANSI-optional *f and *l routines */ /****************************************************************************/ /* mathf.h v8.2.5 */ /* */ /* Copyright (c) 1997-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-6.3") /* standard types required for standard headers */ #pragma CHECK_MISRA("-19.1") /* #includes required for implementation */ #pragma CHECK_MISRA("-19.7") /* macros required for implementation */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ float sqrtf (float x); float expf (float x); float logf (float x); float log10f(float x); float powf (float x, float y); float sinf (float x); float cosf (float x); float tanf (float x); float asinf (float x); float acosf (float x); float atanf (float x); float atan2f(float y, float x); float sinhf (float x); float coshf (float x); float tanhf (float x); static __inline float ceilf (float x); static __inline float floorf(float x); #pragma diag_push #pragma CHECK_MISRA("-16.4") /* false positives due to builtin declarations */ float fabsf (float x); #pragma diag_pop float ldexpf(float x, int n); float frexpf(float x, int *_exp); float modff (float x, float *ip); float fmodf (float x, float y); /* these present in many linked images, so we'll tell you about them. */ float __c6xabi_roundf(float x); /* round-to-nearest */ float __c6xabi_truncf(float x); /* truncate towards 0 */ /* ------------------------------------------------- */ /* Routines below are an addition to ANSI math.h */ /* Some (noted with "9x" in comment) will become ANSI*/ /* once C9x is approved. */ /* ------------------------------------------------- */ float rsqrtf(float x); /* == 1/sqrtf(x) but *MUCH* faster */ float exp2f (float x); /*9x mathematically equiv to powf(2.0 ,x) */ float exp10f(float x); /* mathematically equiv to powf(10.0,x) */ float log2f (float x); /*9x mathematically equiv to logf(x)/logf(2.)*/ float powif (float x, int i); /* equiv to powf(x,(float)i) */ float cotf (float x); float acotf (float x); float acot2f(float x, float y); float cothf (float x); float asinhf(float x); /* 9x */ float acoshf(float x); /* 9x */ float atanhf(float x); /* 9x */ float acothf(float x); float log1pf(float x); float hypotf(float x, float y); float copysignf(float x, float y); int __c6xabi_isinff(float x); static __inline int __c6xabi_isnanf(float x); static __inline int __c6xabi_isfinitef(float x); static __inline int __c6xabi_isnormalf(float x); int __c6xabi_fpclassifyf(float x); #pragma diag_push /* keep macros as direct #defines and not function-like macros or function names surrounded by parentheses to support all original supported use cases including taking their address through the macros and prefixing with namespace macros */ #pragma CHECK_MISRA("-19.4") #pragma diag_pop #pragma diag_push /* functions */ /* MISRA exceptions to avoid changing inline versions of the functions that would be linked in instead of included inline at different mf levels */ /* these functions are very well-tested, stable, and efficient; it would introduce a high risk to implement new, separate MISRA versions just for the inline headers */ #pragma CHECK_MISRA("-5.7") /* keep names intact */ #pragma CHECK_MISRA("-8.5") /* need to define inline functions */ #pragma CHECK_MISRA("-9.1") /* false positives on use after indirect assign */ #pragma CHECK_MISRA("-10.1") /* use implicit casts */ #pragma CHECK_MISRA("-10.2") /* use implicit casts */ #pragma CHECK_MISRA("-12.1") /* avoid changing expressions */ #pragma CHECK_MISRA("-12.2") /* avoid changing expressions */ #pragma CHECK_MISRA("-12.4") /* avoid changing expressions */ #pragma CHECK_MISRA("-12.5") /* avoid changing expressions */ #pragma CHECK_MISRA("-13.3") /* need FP compares */ #pragma CHECK_MISRA("-14.7") /* use multiple return points */ #pragma CHECK_MISRA("-14.9") /* use non-compound statements */ #pragma diag_suppress 551 /* false positives on use after indirect assign */ /****************************************************************************/ /* Inline versions of floorf, ceilf, fmodf */ /****************************************************************************/ static __inline float floorf(float x) { float y; return (modff(x, &y) < 0 ? y - 1 : y); } static __inline float ceilf(float x) { float y; return (modff(x, &y) > 0 ? y + 1 : y); } static __inline int __c6xabi_isnanf(volatile float x) { return x != x; } static __inline int __c6xabi_isfinitef(float x) { return (!__c6xabi_isinff(x) && !__c6xabi_isnanf(x)); } static __inline int __c6xabi_isnormalf(float x) { return (__c6xabi_isfinitef(x) && x != 0.0); } #pragma diag_pop #pragma diag_pop #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /****************************************************************************/ /* mathl.h v8.2.5 */ /* */ /* Copyright (c) 1997-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-6.3") /* standard types required for standard headers */ #pragma CHECK_MISRA("-19.1") /* #includes required for implementation */ #pragma CHECK_MISRA("-19.7") /* macros required for implementation */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ long double sqrtl (long double x); long double expl (long double x); long double logl (long double x); long double log10l(long double x); long double powl (long double x, long double y); long double sinl (long double x); long double cosl (long double x); long double tanl (long double x); long double asinl (long double x); long double acosl (long double x); long double atanl (long double x); long double atan2l(long double y, long double x); long double sinhl (long double x); long double coshl (long double x); long double tanhl (long double x); static __inline long double ceill (long double x); static __inline long double floorl(long double x); long double fabsl (long double x); long double ldexpl(long double x, int n); long double frexpl(long double x, int *_exp); long double modfl (long double x, long double *ip); long double fmodl (long double x, long double y); long double __c6xabi_roundl(long double x); /* round-to-nearest */ long double __c6xabi_truncl(long double x); /* truncate towards 0 */ /* ------------------------------------------------- */ /* Routines below are an addition to ANSI math.h */ /* Some (noted with "9x" in comment) will become ANSI*/ /* once C9x is approved. */ /* ------------------------------------------------- */ long double rsqrtl(long double x); /* 1/sqrtl(x) but *MUCH* faster*/ long double exp2l (long double x); /*9x math equiv to powl(2.0 ,x) */ long double exp10l(long double x); /* math equiv to powl(10.0,x) */ long double log2l (long double x);/*9x math equiv to logl(x)/logl(2)*/ long double powil (long double x, int i); /* == powl(x,(long double)i)*/ long double cotl (long double x); long double acotl (long double x); long double acot2l(long double x, long double y); long double cothl (long double x); long double asinhl(long double x); /* 9x */ long double acoshl(long double x); /* 9x */ long double atanhl(long double x); /* 9x */ long double acothl(long double x); long double log1pl(long double x); long double copysignl(long double x, long double y); long double hypotl(long double x, long double y); int __c6xabi_isinfl(long double x); static __inline int __c6xabi_isnanl(long double x); static __inline int __c6xabi_isfinitel(long double x); static __inline int __c6xabi_isnormall(long double x); int __fpclassifyl(long double x); #pragma CHECK_MISRA("-19.4") /* macro expands to unparanthesized */ #pragma CHECK_MISRA("-5.7") /* identifier name reused */ #pragma CHECK_MISRA("-8.5") /* definition of function in header file */ #pragma CHECK_MISRA("-10.1") /* SDSCM00051481 */ #pragma CHECK_MISRA("-10.2") /* SDSCM00051481 */ #pragma CHECK_MISRA("-12.2") /* doesn't actually have side effects */ #pragma CHECK_MISRA("-12.4") /* doesn't actually have side effects */ #pragma CHECK_MISRA("-12.5") /* operands of && not primary expressions */ #pragma CHECK_MISRA("-13.3") /* float exact equality comparison */ #pragma CHECK_MISRA("-14.7") /* no single point of return */ #pragma CHECK_MISRA("-14.9") /* if not followed by compound statement */ /****************************************************************************/ /* Inline versions of floorl, ceill, fmodl */ /****************************************************************************/ static __inline long double floorl(long double x) { long double y = 0; return (modfl(x, &y) < 0 ? y - 1 : y); } static __inline long double ceill(long double x) { long double y = 0; return (modfl(x, &y) > 0 ? y + 1 : y); } static __inline int __c6xabi_isnanl(volatile long double x) { return x != x; } static __inline int __c6xabi_isfinitel(long double x) { return (!__c6xabi_isinfl(x) && !__c6xabi_isnanl(x)); } static __inline int __c6xabi_isnormall(long double x) { return (__c6xabi_isfinitel(x) && (x != 0.0)); } #pragma diag_pop #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* ------------------------------------------------- */ /* Routines below are an addition to ANSI math.h */ /* Some (noted with "9x" in comment) will become ANSI*/ /* once C9x is approved. */ /* ------------------------------------------------- */ double rsqrt(double x); /* == 1/sqrt(x) but *MUCH* faster */ double exp2 (double x); /*9x mathematically equiv to pow(2.0 ,x) */ double exp10(double x); /* mathematically equiv to pow(10.0,x) */ double log2 (double x); /*9x mathematically equiv to log(x)/log(2.0)*/ double powi(double x, int i); /* equiv to pow(x,(double)i) */ double cot (double x); double acot (double x); double acot2(double x, double y); double coth (double x); double asinh(double x); /* 9x */ double acosh(double x); /* 9x */ double atanh(double x); /* 9x */ double acoth(double x); int __c6xabi_isinf(double x); static __inline int __c6xabi_isnan(volatile double x); static __inline int __c6xabi_isfinite(double x); static __inline int __c6xabi_isnormal(double x); int __c6xabi_fpclassify(double x); #pragma diag_push /* keep macros as direct #defines and not function-like macros or function names surrounded by parentheses to support all original supported use cases including taking their address through the macros and prefixing with namespace macros */ #pragma CHECK_MISRA("-19.4") #pragma diag_pop /*Definitions of classification macros used in fp_classify We do not support subnormal numbers yet, but the classification exists for when they are supported */ #pragma diag_push /* functions */ /* MISRA exceptions to avoid changing inline versions of the functions that would be linked in instead of included inline at different mf levels */ /* these functions are very well-tested, stable, and efficient; it would introduce a high risk to implement new, separate MISRA versions just for the inline headers */ #pragma CHECK_MISRA("-5.7") /* keep names intact */ #pragma CHECK_MISRA("-8.5") /* need to define inline functions */ #pragma CHECK_MISRA("-9.1") /* false positives on use after indirect assign */ #pragma CHECK_MISRA("-10.1") /* use implicit casts */ #pragma CHECK_MISRA("-10.2") /* use implicit casts */ #pragma CHECK_MISRA("-12.1") /* avoid changing expressions */ #pragma CHECK_MISRA("-12.2") /* avoid changing expressions */ #pragma CHECK_MISRA("-12.4") /* avoid changing expressions */ #pragma CHECK_MISRA("-12.5") /* avoid changing expressions */ #pragma CHECK_MISRA("-13.3") /* need FP compares */ #pragma CHECK_MISRA("-14.7") /* use multiple return points */ #pragma CHECK_MISRA("-14.9") /* use non-compound statements */ #pragma diag_suppress 551 /* false positives on use after indirect assign */ /****************************************************************************/ /* Inline versions of floor, ceil, fmod */ /****************************************************************************/ static __inline double floor(double x) { double y; return (modf(x, &y) < 0 ? y - 1 : y); } static __inline double ceil(double x) { double y; return (modf(x, &y) > 0 ? y + 1 : y); } /* The implementation below does not work correctly for all cases. Consider the case of fmod(Big, 3), for any Big > 2**(MANT_DIG+2). The correct result is one of 0,1, or 2. But the implementation below will *always* return 0 because the quotient is only an approximation. */ static __inline double _FMOD(double x, double y) { double d = fabs(x); if (d - fabs(y) == d) return (0); modf(x/y, &d); return (x - d * y); } #pragma diag_suppress 681 static __inline int __c6xabi_isnan(volatile double x) { return x != x; } #pragma diag_default 681 static __inline int __c6xabi_isfinite(double x) { return (!__c6xabi_isinf(x) && !__c6xabi_isnan(x)); } static __inline int __c6xabi_isnormal(double x) { return (__c6xabi_isfinite(x) && x != 0.0); } #pragma diag_pop /*******************************************************************************/ /* CQ35082 : Overloaded version of math functions for float and long double */ /* removed from here, and include in cmath instead (see Section 26.5 */ /* of C++ standard for details). Thus cpp_inline_math.h is now */ /* included in cmath . */ /*******************************************************************************/ #pragma diag_pop #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* C6X.H v8.2.5 */ /* */ /* Copyright (c) 1996-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* VECT.H v8.2.5 */ /* */ /* Copyright (c) 1996-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* STDINT.H v8.2.5 */ /* */ /* Copyright (c) 2002-2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /* 7.18.1.1 Exact-width integer types */ typedef signed char int8_t; typedef unsigned char uint8_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned int uint32_t; typedef __int40_t int40_t; typedef unsigned __int40_t uint40_t; typedef long long int64_t; typedef unsigned long long uint64_t; /* 7.18.1.2 Minimum-width integer types */ typedef int8_t int_least8_t; typedef uint8_t uint_least8_t; typedef int16_t int_least16_t; typedef uint16_t uint_least16_t; typedef int32_t int_least32_t; typedef uint32_t uint_least32_t; typedef int40_t int_least40_t; typedef uint40_t uint_least40_t; typedef int64_t int_least64_t; typedef uint64_t uint_least64_t; /* 7.18.1.3 Fastest minimum-width integer types */ typedef int32_t int_fast8_t; typedef uint32_t uint_fast8_t; typedef int32_t int_fast16_t; typedef uint32_t uint_fast16_t; typedef int32_t int_fast32_t; typedef uint32_t uint_fast32_t; typedef int40_t int_fast40_t; typedef uint40_t uint_fast40_t; typedef int64_t int_fast64_t; typedef uint64_t uint_fast64_t; /* 7.18.1.4 Integer types capable of holding object pointers */ typedef int intptr_t; typedef unsigned int uintptr_t; /* 7.18.1.5 Greatest-width integer types */ typedef long long intmax_t; typedef unsigned long long uintmax_t; /* According to footnotes in the 1999 C standard, "C++ implementations should define these macros only when __STDC_LIMIT_MACROS is defined before is included." */ /* 7.18.2 Limits of specified width integer types */ /* 7.18.3 Limits of other integer types */ /* 7.18.4.1 Macros for minimum-width integer constants */ /* There is a defect report filed against the C99 standard concerning how the (U)INTN_C macros should be implemented. Please refer to -- http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/dr_209.htm for more information. These macros are implemented according to the suggestion given at this web site. */ /* 7.18.4.2 Macros for greatest-width integer constants */ typedef float float32_t; struct __simd128_int32_t { int32_t _v[4]; } __attribute__((aligned(16))) __attribute__((vector_type)); typedef struct __simd128_int32_t int32x4_t; typedef int32x4_t __x128_t; /*****************************************************************************/ /* */ /* NOTICE TO THOSE WHO USE INTRINSICS AND PACKED DATA */ /* */ /* This note contains information on a new __float2_t type. */ /* It also contains recommendations on the use of the "double" type. */ /* */ /* In order to better support packed data compiler optimizations in the */ /* future, the use of the type "double" for packed data is now discouraged */ /* and its support may be discontinued in the future. */ /* */ /* There are several recommendations and changes as a result. Note that */ /* these changes do NOT break compatibility with older code (source files */ /* or object files). */ /* */ /* (1) long long should be used for 64-bit packed integer data. The double */ /* type should be used only for double-precision floating point values. */ /* */ /* (2) There is a new type, __float2_t, that holds two floats and should */ /* be used instead of double for holding two floats. For now, this new */ /* type is typedef'ed to double in c6x.h, but could be changed in the */ /* future to a structure or vector type to allow better optimization of */ /* packed data floats. We recommend the use of __float2_t for any */ /* float x2 data instead of double. */ /* */ /* (3) There are new __float2_t manipulation intrinsics (see below) that */ /* should be used to create and manipulate objects of type __float2_t. */ /* */ /* (4) C66 intrinsics that deal with packed float data are now declared */ /* using __float2_t instead of double. (Those intrinsics are declared */ /* in this file, c6x.h.) */ /* */ /* (5) When using any intrinsic that involves __float2_t, c6x.h must be */ /* included. */ /* */ /* (6) Certain intrinsics that used double to store fixed-point packed */ /* data have been deprecated. They will still be supported in the */ /* near future, but their descriptions will be removed from the */ /* compiler user's guide (spru187). Deprecated: _mpy2, _mpyhi, _mpyli, */ /* _mpysu4, _mpyu4, and _smpy2. Use the long long versions instead. */ /* */ /* Please see */ /* http://processors.wiki.ti.com/index.php/C6000_Intrinsics_and_Type_Double */ /* and the C6000 Compiler User's Guide (v7.2), spru187, for more */ /* information. */ /* */ /*****************************************************************************/ /* If not using host intrinsics, define __float2_t items. */ typedef double __float2_t; /*-------------------------------------------------------------------------*/ /* __float2_t manipulation intrinsics */ /* */ /* Since __float2_t is just a typedef to double at this time, we simply */ /* use #defines to "create" the __float2_t manipulation intrinsics. The */ /* __float2_t intrinsics are listed in this comment for convenience. */ /* */ /* __float2_t _lltof2(long long) Reinterpret long long as __float2_t */ /* long long _f2toll(__float2_t) Reinterpret __float2_t as long long */ /* __float2_t _ftof2(float, float) Create a __float2_t from 2 floats */ /* float _hif2(__float2_t) Return the hi 32 bits of a __float2_t */ /* float _lof2(__float2_t) Return the lo 32 bits of a __float2_t */ /* __int40_t _f2tol(__float2_t) Reinterpret __float2_t as 40-bit type */ /* __float2_t _ltof2(__int40_t) Reinterpret 40-bit type as __float2_t */ /* */ /* __float2_t & _amem8_f2(void *) | */ /* __float2_t & _amem8_f2_const(void *) | Allows (un)aligned loads and */ /* __float2_t & _mem8_f2(void *) | stores of 8 bytes to and from */ /* __float2_t & _mem8_f2_const(void *) | memory. */ /* */ /* __float2_t _fdmv_f2(float, float) Move two floats with one instruction */ /* __float2_t _hif2_128(__x128_t) Return hi 64 bits of __x128_t */ /* __float2_t _lof2_128(__x128_t) Return hi 64 bits of __x128_t */ /* __x128_t _f2to128(__float2_t, __float2_t) Compose __x128_t */ /* __float2_t _fdmvd_f2(float, float) Delayed move of two floats */ /*-------------------------------------------------------------------------*/ /* _mem8_f2 and _mem8_f2_const for C6400 and compatible */ /* _fdmv_f2 for C6400+ and compatible */ /* __float2_t manipulation intrinsics for __x128_t and C6600 */ unsigned _extu (unsigned, unsigned, unsigned); int _ext (int, unsigned, unsigned); unsigned _set (unsigned, unsigned, unsigned); unsigned _clr (unsigned, unsigned, unsigned); unsigned _extur (unsigned, int); int _extr (int, int); unsigned _setr (unsigned, int); unsigned _clrr (unsigned, int); int _sadd (int, int); int _ssub (int, int); int _sshl (int, unsigned); int _add2 (int, int); int _sub2 (int, int); unsigned _subc (unsigned, unsigned); unsigned _lmbd (unsigned, unsigned); int _abs (int); __int40_t _labs (__int40_t); unsigned _norm (int); int _smpy (int, int); int _smpyhl (int, int); int _smpylh (int, int); int _smpyh (int, int); int _mpy (int, int); int _mpyus (unsigned, int); int _mpysu (int, unsigned); unsigned _mpyu (unsigned, unsigned); int _mpyhl (int, int); int _mpyhuls (unsigned, int); int _mpyhslu (int, unsigned); unsigned _mpyhlu (unsigned, unsigned); int _mpylh (int, int); int _mpyluhs (unsigned, int); int _mpylshu (int, unsigned); unsigned _mpylhu (unsigned, unsigned); int _mpyh (int, int); int _mpyhus (unsigned, int); int _mpyhsu (int, unsigned); unsigned _mpyhu (unsigned, unsigned); __int40_t _lsadd (int, __int40_t); __int40_t _lssub (int, __int40_t); int _sat (__int40_t); unsigned _lnorm (__int40_t); double _fabs (double); float _fabsf (float); long long _mpyidll (int, int); int _spint (float); int _dpint (double); float _rcpsp (float); double _rcpdp (double); float _rsqrsp (float); double _rsqrdp (double); /*double _mpyid (int, int); Deprecated. Use _mpyidll instead. */ unsigned _hi(double); /* Return the hi 32 bits of a double as an int */ float _hif(double); /* Return the hi 32 bits of a double as a float */ unsigned _hill(long long); /* Return the hi 32 bits of a long long as an int */ unsigned _lo(double); /* Return the lo 32 bits of a double as an int */ float _lof(double); /* Return the lo 32 bits of a double as a float */ unsigned _loll(long long); /* Return the lo 32 bits of a long long as an int */ double _itod(unsigned, unsigned); /* Create a double from 2 ints */ double _ftod(float, float); /* Create a double from 2 floats */ long long _itoll(unsigned, unsigned); /* Create a long long from 2 ints */ float _itof(unsigned); /* Reinterpret int as float. */ unsigned _ftoi(float); /* Reinterpret float as int. */ __int40_t _dtol(double); /* Reinterpret double as 40-bit type */ double _ltod(__int40_t); /* Reinterpret 40-bit type as double */ long long _dtoll(double); /* Reinterpret double as long long */ double _lltod(long long); /* Reinterpret long long as double */ /* Define pseudo intrinsics for some pseudo instructions */ int _add4 (int, int); int _avg2 (int, int); unsigned _avgu4 (unsigned, unsigned); int _cmpeq2 (int, int); int _cmpeq4 (int, int); int _cmpgt2 (int, int); unsigned _cmpgtu4 (unsigned, unsigned); int _dotp2 (int, int); int _dotpn2 (int, int); int _dotpnrsu2 (int, unsigned); int _dotprsu2 (int, unsigned); int _dotpsu4 (int, unsigned); unsigned _dotpu4 (unsigned, unsigned); int _gmpy4 (int, int); __int40_t _ldotp2 (int, int); int _max2 (int, int); unsigned _maxu4 (unsigned, unsigned); int _min2 (int, int); unsigned _minu4 (unsigned, unsigned); long long _mpy2ll (int, int); long long _mpyhill (int, int); int _mpyhir (int, int); long long _mpylill (int, int); int _mpylir (int, int); long long _mpysu4ll (int, unsigned); long long _mpyu4ll (unsigned, unsigned); unsigned _pack2 (unsigned, unsigned); unsigned _packh2 (unsigned, unsigned); unsigned _packh4 (unsigned, unsigned); unsigned _packhl2 (unsigned, unsigned); unsigned _packl4 (unsigned, unsigned); unsigned _packlh2 (unsigned, unsigned); unsigned _rotl (unsigned, unsigned); int _sadd2 (int, int); unsigned _saddu4 (unsigned, unsigned); int _saddus2 (unsigned, int); unsigned _shlmb (unsigned, unsigned); int _shr2 (int, unsigned); unsigned _shrmb (unsigned, unsigned); unsigned _shru2 (unsigned, unsigned); long long _smpy2ll (int, int); int _spack2 (int, int); unsigned _spacku4 (int, int); int _sshvl (int, int); int _sshvr (int, int); int _sub4 (int, int); int _subabs4 (int, int); int _abs2 (int); unsigned _bitc4 (unsigned); unsigned _bitr (unsigned); unsigned _deal (unsigned); int _mvd (int); unsigned _shfl (unsigned); unsigned _swap4 (unsigned); unsigned _unpkhu4 (unsigned); unsigned _unpklu4 (unsigned); unsigned _xpnd2 (unsigned); unsigned _xpnd4 (unsigned); /*double _mpy2 (int, int); Deprecated: use _mpy2ll instead */ /*double _mpyhi (int, int); Deprecated: use _mpyhill instead */ /*double _mpysu4 (int, unsigned); Deprecated: use _mpysu4ll instead */ /*double _mpyu4 (unsigned, unsigned); Deprecated: use _mpyu4ll instead */ /*double _smpy2 (int, int); Deprecated: use _smpy2ll instead */ long long _addsub (int, int); long long _addsub2 (unsigned, unsigned); long long _cmpy (unsigned, unsigned); unsigned _cmpyr (unsigned, unsigned); unsigned _cmpyr1 (unsigned, unsigned); long long _ddotph2 (long long, unsigned); unsigned _ddotph2r (long long, unsigned); long long _ddotpl2 (long long, unsigned); unsigned _ddotpl2r (long long, unsigned); long long _ddotp4 (unsigned, unsigned); long long _dpack2 (unsigned, unsigned); long long _dpackx2 (unsigned, unsigned); long long _dmv (unsigned, unsigned); double _fdmv (float, float); unsigned _gmpy (unsigned, unsigned); long long _mpy32ll (int, int); int _mpy32 (int, int); long long _mpy32su (int, unsigned); long long _mpy32us (unsigned, int); long long _mpy32u (unsigned, unsigned); long long _mpy2ir (unsigned, int); unsigned _rpack2 (unsigned, unsigned); long long _saddsub (int, int); long long _saddsub2 (unsigned, unsigned); long long _shfl3 (unsigned, unsigned); int _smpy32 (int, int); int _ssub2 (int, int); unsigned _xormpy (unsigned, unsigned); long long _dcmpyr1 (long long, long long); long long _dccmpyr1 (long long, long long); long long _cmpy32r1 (long long, long long); long long _ccmpy32r1 (long long, long long); long long _mpyu2 (unsigned, unsigned); int _dotp4h (long long, long long); long long _dotp4hll (long long, long long); int _dotpsu4h (long long, long long); long long _dotpsu4hll (long long, long long); long long _dadd (long long, long long); long long _dadd_c (int, long long); long long _dsadd (long long, long long); long long _dadd2 (long long, long long); long long _dsadd2 (long long, long long); long long _dsub (long long, long long); long long _dssub (long long, long long); long long _dssub2 (long long, long long); long long _dapys2 (long long, long long); long long _dshr (long long, unsigned); long long _dshru (long long, unsigned); long long _dshl (long long, unsigned); long long _dshr2 (long long, unsigned); long long _dshru2 (long long, unsigned); unsigned _shl2 (unsigned , unsigned); long long _dshl2 (long long, unsigned); long long _dxpnd4 (unsigned); long long _dxpnd2 (unsigned); int _crot90 (int); long long _dcrot90 (long long); int _crot270 (int); long long _dcrot270 (long long); long long _dmax2 (long long, long long); long long _dmin2 (long long, long long); long long _dmaxu4 (long long, long long); long long _dminu4 (long long, long long); unsigned _dcmpgt2 (long long, long long); unsigned _dcmpeq2 (long long, long long); unsigned _dcmpgtu4 (long long, long long); unsigned _dcmpeq4 (long long, long long); long long _davg2 (long long, long long); long long _davgu4 (long long, long long); long long _davgnr2 (long long, long long); long long _davgnru4 (long long, long long); long long _unpkbu4 (unsigned); long long _unpkh2 (unsigned); long long _unpkhu2 (unsigned); long long _dpackl2 (long long, long long); long long _dpackh2 (long long, long long); long long _dpackhl2 (long long, long long); long long _dpacklh4 (unsigned, unsigned); long long _dpackl4 (long long, long long); long long _dpackh4 (long long, long long); long long _dspacku4 (long long, long long); void _mfence (); __float2_t _dmpysp (__float2_t, __float2_t); __float2_t _daddsp (__float2_t, __float2_t); __float2_t _dsubsp (__float2_t, __float2_t); __float2_t _dinthsp (unsigned); __float2_t _dinthspu (unsigned); __float2_t _dintsp (long long); __float2_t _dintspu (long long); unsigned _dspinth (__float2_t); long long _dspint (__float2_t); int _land (int, int); int _landn (int, int); int _lor (int, int); long long _dmvd (int, int); double _fdmvd (float, float); __float2_t _complex_mpysp (__float2_t, __float2_t); /* CMPYSP then DADDSP */ __float2_t _complex_conjugate_mpysp (__float2_t, __float2_t); /* CMPYSP then DSUBSP */ long long _xorll_c (int, long long); __x128_t __attribute__((builtin)) _dcmpy (long long, long long); __x128_t __attribute__((builtin)) _dccmpy (long long, long long); long long __attribute__((builtin)) _cmatmpyr1 (long long, __x128_t); long long __attribute__((builtin)) _ccmatmpyr1 (long long, __x128_t); __x128_t __attribute__((builtin)) _cmatmpy (long long, __x128_t); __x128_t __attribute__((builtin)) _ccmatmpy (long long, __x128_t); __x128_t __attribute__((builtin)) _qsmpy32r1 (__x128_t, __x128_t); __x128_t __attribute__((builtin)) _qmpy32 (__x128_t, __x128_t); __x128_t __attribute__((builtin)) _dsmpy2 (long long, long long); __x128_t __attribute__((builtin)) _dmpy2 (long long, long long); __x128_t __attribute__((builtin)) _dmpyu2 (long long, long long); __x128_t __attribute__((builtin)) _dmpysu4 (long long, long long); __x128_t __attribute__((builtin)) _dmpyu4 (long long, long long); __x128_t __attribute__((builtin)) _cmpysp (__float2_t, __float2_t); __x128_t __attribute__((builtin)) _qmpysp (__x128_t, __x128_t); long long __attribute__((builtin)) _ddotp4h (__x128_t, __x128_t); long long __attribute__((builtin)) _ddotpsu4h (__x128_t, __x128_t); __x128_t __attribute__((builtin)) _ito128 (unsigned, unsigned, unsigned, unsigned); __x128_t __attribute__((builtin)) _fto128 (float, float, float, float); __x128_t __attribute__((builtin)) _llto128 (long long, long long); __x128_t __attribute__((builtin)) _dto128 (double, double); long long __attribute__((builtin)) _hi128 (__x128_t); double __attribute__((builtin)) _hid128 (__x128_t); long long __attribute__((builtin)) _lo128 (__x128_t); double __attribute__((builtin)) _lod128 (__x128_t); unsigned __attribute__((builtin)) _get32_128 (__x128_t, __attribute__((constrange((0), (3)))) unsigned); float __attribute__((builtin)) _get32f_128 (__x128_t, __attribute__((constrange((0), (3)))) unsigned); __x128_t __attribute__((builtin)) _dup32_128 (unsigned); extern __cregister volatile unsigned int AMR; extern __cregister volatile unsigned int CSR; extern __cregister volatile unsigned int IFR; extern __cregister volatile unsigned int ISR; extern __cregister volatile unsigned int ICR; extern __cregister volatile unsigned int IER; extern __cregister volatile unsigned int ISTP; extern __cregister volatile unsigned int IRP; extern __cregister volatile unsigned int NRP; extern __cregister volatile unsigned int GFPGFR; extern __cregister volatile unsigned int DIER; extern __cregister volatile unsigned int FADCR; extern __cregister volatile unsigned int FAUCR; extern __cregister volatile unsigned int FMCR; extern __cregister volatile unsigned int DESR; extern __cregister volatile unsigned int DETR; extern __cregister volatile unsigned int REP; extern __cregister volatile unsigned int TSCL; extern __cregister volatile unsigned int TSCH; extern __cregister volatile unsigned int ARP; extern __cregister volatile unsigned int ILC; extern __cregister volatile unsigned int RILC; extern __cregister volatile unsigned int PCE1; extern __cregister volatile unsigned int DNUM; extern __cregister volatile unsigned int SSR; extern __cregister volatile unsigned int GPLYA; extern __cregister volatile unsigned int GPLYB; extern __cregister volatile unsigned int TSR; extern __cregister volatile unsigned int ITSR; extern __cregister volatile unsigned int NTSR; extern __cregister volatile unsigned int ECR; extern __cregister volatile unsigned int EFR; extern __cregister volatile unsigned int IERR; extern __cregister volatile unsigned int DMSG; extern __cregister volatile unsigned int CMSG; extern __cregister volatile unsigned int DT_DMA_ADDR; extern __cregister volatile unsigned int DT_DMA_DATA; extern __cregister volatile unsigned int DT_DMA_CNTL; extern __cregister volatile unsigned int TCU_CNTL; extern __cregister volatile unsigned int RTDX_REC_CNTL; extern __cregister volatile unsigned int RTDX_XMT_CNTL; extern __cregister volatile unsigned int RTDX_CFG; extern __cregister volatile unsigned int RTDX_RDATA; extern __cregister volatile unsigned int RTDX_WDATA; extern __cregister volatile unsigned int RTDX_RADDR; extern __cregister volatile unsigned int RTDX_WADDR; extern __cregister volatile unsigned int MFREG0; extern __cregister volatile unsigned int DBG_STAT; extern __cregister volatile unsigned int BRK_EN; extern __cregister volatile unsigned int HWBP0_CNT; extern __cregister volatile unsigned int HWBP0; extern __cregister volatile unsigned int HWBP1; extern __cregister volatile unsigned int HWBP2; extern __cregister volatile unsigned int HWBP3; extern __cregister volatile unsigned int OVERLAY; extern __cregister volatile unsigned int PC_PROF; extern __cregister volatile unsigned int ATSR; extern __cregister volatile unsigned int TRR; extern __cregister volatile unsigned int TCRR; /*****************************************************************************/ /* DATA_IS_ALIGNED_2, DATA_IS_ALIGNED_4, DATA_IS_ALIGNED_8 - */ /* Tell the compiler that data is already aligned to a 2-byte, 4-byte */ /* or 8-byte boundary. Note: this macro does not change the */ /* alignment of data. Use DATA_ALIGN to change alignment. */ /*****************************************************************************/ /*****************************************************************************/ /* SAVE_AMR - */ /* Define a local 'volatile unsigned int' variable in your interrupt */ /* routine. */ /* When invoking this macro, pass that local variable to save the AMR. */ /* */ /* If you interrupted an assembly coded routine that may be using */ /* circular addressing, and you interrupt into a C coded interrupt */ /* service routine, you need to set the AMR to 0 for the C code and save */ /* off the AMR register, so that it will have the correct value upon */ /* leaving the C interrupt service routine and returning to the assembly */ /* code. */ /* */ /* Add this routine immediately after your local variable definitions */ /* and before the start of your C interrupt code. */ /*****************************************************************************/ /*****************************************************************************/ /* RESTORE_AMR - */ /* When invoking this macro, pass the same local variable that was passed */ /* to the SAVE_AMR macro. This macro will restore the AMR to the value */ /* it had when interrupted out of the hand assembly routine. */ /* */ /* Add this macro immediately before exiting the C interrupt service */ /* routine. */ /*****************************************************************************/ /*****************************************************************************/ /* SAVE_SAT - */ /* Define a local 'volatile unsigned int' variable in your interrupt */ /* routine. */ /* When invoking this macro, pass that local variable to save the SAT */ /* bit. */ /* */ /* If you interrupted a routine that was performing saturated arithmetic */ /* and the interrupt service routine is also performing saturated */ /* arithmetic, then you must save and restore the SAT bit in your */ /* interrupt service routine. */ /* */ /* Add this routine immediately after your local variable definitions */ /* and before the start of your C interrupt code. */ /*****************************************************************************/ /*****************************************************************************/ /* RESTORE_SAT - */ /* When invoking this macro, pass the same local variable that was passed */ /* to the SAVE_SAT macro. This macro will restore the SAT bit to the */ /* value it had when your application was interrupted. */ /* */ /* Add this macro immediately before exiting the C interrupt service */ /* routine. */ /*****************************************************************************/ /* ======================================================================= */ /* dsplib.h -- Interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_minerr.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_minerr.h -- Vocoder Codebook Search */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_minerr */ /** @ingroup DSPF_sp_minerr */ /* @{ */ /** * Performs a dot product on 256 pairs of 9 element vectors and searches for the * pair of vectors which produces the maximum dot product result. This is a large * part of the VSELP vocoder codebook search. The function stores the index to * the first element of the 9-element vector that resulted in the maximum dot product * in the memory location Pointed by max_index. The maximum dot product * value is returned by the function. * * @param GSP0_TABLE[256*9] GSP0 terms array. * @param errCoefs[9] Array of error coefficients. Must be double-word aligned. * @param max_index Index to GSP0_TABLE[max_index], the first element of the 9-element * vector that resulted in the maximum dot product. * * @par Algorithm: * DSPF_sp_maxval_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * errCoefs must be double-word aligned
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ float DSPF_sp_minerr(const float* GSP0_TABLE, const float* errCoefs, int *restrict max_index); /* ======================================================================= */ /* End of file: DSPF_sp_minerr.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_minerr.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_mat_mul.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_mat_mul.h -- Perform Matrix Multiplication */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSP_mat_mul */ /** @ingroup DSP_mat_mul */ /* @{ */ /** * This function computes the expression “r = x * y” for the matrices * x and y. The columnar dimension of x must match the row dimension of * y. The resulting matrix has the same number of rows as x and the same * number of columns as y.
* The values stored in the matrices are assumed to be fixed-point or integer * values. All intermediate sums are retained to 32-bit precision, and no * overflow checking is performed. The results are right-shifted by a * user-specified amount, and then truncated to 16 bits.
* * @param x = Pointer to input matrix of size r1*c1 * @param r1 = Number of rows in matrix x * @param c1 = Number of columns in matrix x. Also number of rows in y * @param y = Pointer to input matrix of size c1*c2 * @param c2 = Number of columns in matrix y * @param r = Pointer to output matrix of size r1*c2 * @param qs = Final right-shift to apply to the result * * @par Algorithm: * DSP_mat_mul.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays x[], y[], and r[] are stored in distinct arrays.
* That is, in-place processing is not allowed.
* x, y and r are double word aligned.
* c1 is a multiple of 2 and >= 2.
* c2 is a multiple of 4 and >= 4.
* r1 is a multiple of 2 and >= 2.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSP_mat_mul ( const short *restrict x, int r1, int c1, const short *restrict y, int c2, short *restrict r, int qs ); /* ======================================================================== */ /* End of file: DSP_mat_mul.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_mat_mul.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_urand.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_urand.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima */ /* University and The University of Tokyo. All rights reserved. */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_urand32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima */ /* University and The University of Tokyo. All rights reserved. */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_urand32_init*/ /** @ingroup DSP_urand32_init*/ /* @{ */ /** * This function is used to seed the uniformly distributed * random number generator (RNG). It must be called prior to * using any of the 32-bit RNG's provided in DSPLIB * * @param seed = An arbitrary unsigned integer chosen by the user. * * @param polynomial = Array of 3 non-arbitrary unsigned integers, * previously generated using the included TinyMTDC program and/or * from the provided text file; numbers from different sets @b MUST * @b NOT be mixed and matched. Should the user provide a NULL * pointer instead, default values will be used instead. These * parameters ensure (mostly) statistically independent random * numbers among different generators. Users should place numbers in * the polynomial parameter in the order in which they appear in the * text file or TinyMTDC program. That is columns 0, 1, and 2 (mat1, * mat2, and tmat of TinyMTDC) correspond to positions 0, 1, and 2 of * the polynomial. * * @param state = An array of 7 unsigned 32-bit integers which need * not be initialized to any values by the user; the user is only * required to allocate such space and maintain (but @b NEVER modify) * it. * * @par Algorithm: * The random number generator is based on the Tiny Mersenne Twister (TinyMT). * Click here for more information. * * @par Assumptions: * The user has properly initialized the "polynomial" and "state" * parameters. * * @par Implementation notes: * @b Endian @b Support: The code supports both big and little endian modes.
* @b Interruptibility: The code not interruptible.
* */ void DSP_urand32_init( unsigned int seed, /*Arbitrary number used for initialization */ void* restrict polynomial,/*Array of length 3 containing polynomial data */ void* restrict state); /*Array of length 7 allocated and uninitialized*/ /** @defgroup DSP_urand32*/ /** @ingroup DSP_urand32*/ /* @{ */ /** * This function is used to fill an array with uniformly distributed * random unsigned 32-bit integers on the interval [0,(2^32)-1]. * * @param size = The size of the array to be filled. * * @param vector = The array which the user wants to fill with random * values. Again, it should be of type @b unsigned @b int. * * @param state = The array which was initialized with the * "DSP_urand32_init" function and maintained (but @b NEVER modified) * by the user between subsequent calls to this function. * * @par Algorithm: * The random number generator is based on the Tiny Mersenne Twister (TinyMT). * Click here for more information. * * @par Assumptions: * The user has previously called the "DSP_urand32_init" * function at least once, has maintained the state array, and allocated * an array of @b int types of the desired width. * * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is not interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ void DSP_urand32(unsigned int size, /* Size of the vector to be filled*/ void* vector, /* Pointer to the destination vector*/ void* state); /* State vector maintained by user*/ /*===========================================================================*/ /* Internal Code */ /*===========================================================================*/ /* All code below this disclaimer is for internal DSPLIB use only and should * not be used by the user. */ /*================================ Typedefs ================================*/ /* Internal Portable 32-bit type */ typedef unsigned int _ti_uint32; typedef int _ti_int32; /*================================ Constants ===============================*/ /*State*/ /*Polynomial*/ /*================================ Macros ==================================*/ /*================================ Functions ===============================*/ /* Function Name: DSP_urand32_get_ti_uint32 * * @Purpose: This function is used internally to generate a random number * based on the current state It should not be called by the user. It * basically concatenates the 4 status variables into one @b _ti_uint32. * It should not be called by the user. * * @Precondition: The calling function has passed valid state variable * pointers and polynomial constants and "DSP_urand32_next_state()" * was previously called * * @Postcondition: A random integer based on the current state of the RNG has * been returned * * @param s0 : Pointer to the STATUS_0 variable of type @b _ti_uint32 * @param s2 : Pointer to the STATUS_2 variable of type @b _ti_uint32 * @param s3 : Pointer to the STATUS_3 variable of type @b _ti_uint32 * * @param tmat : constant polynomial characteristic number TMAT * of type @b _ti_uint32 * * @returns A uniformly distributed random @b _ti_uint32. * */ #pragma CODE_SECTION(DSP_urand32_get_ti_uint32,".text:optimized"); #pragma FUNC_ALWAYS_INLINE(DSP_urand32_get_ti_uint32) static inline _ti_uint32 DSP_urand32_get_ti_uint32( _ti_uint32 s0, /*Status_0*/ _ti_uint32 s2, /*Status_2*/ _ti_uint32 s3, /*Status_3*/ const _ti_uint32 tmat) /*Polynomial constant tmat*/ { /* Temporary variables */ _ti_uint32 j, k; /* Compute next random integer from the state */ j = s3; k = s0 + (s2 >> 8); j ^= k; j ^= -((_ti_int32) (k & 1)) & tmat; return j; } /* DSP_urand32_get_ti_uint32 */ /* Function Name : DSP_urand32_next_state * * @Purpose : This function is used internally to modify the state so that * the next random number may be generated. It should not be called by the * user. This implementation is taken verbatim from the original algorithm. * * @Precondition : The calling function has passed valid state variable * pointers and polynomial constants. * * @Postcondition : The "state machine" of the RNG has been modified * so that the next random transition can occur. * * @param s0 : Pointer to the STATUS_0 variable of type @b _ti_uint32 * @param s1 : Pointer to the STATUS_1 variable of type @b _ti_uint32 * @param s2 : Pointer to the STATUS_2 variable of type @b _ti_uint32 * @param s3 : Pointer to the STATUS_3 variable of type @b _ti_uint32 * * @param mat1 : constant polynomial characteristic number MAT_1 * of type @b _ti_uint32 * * @param mat2 : constant polynomial characteristic number MAT_2 * of type @b _ti_uint32 * */ #pragma CODE_SECTION(DSP_urand32_next_state,".text:optimized"); #pragma FUNC_ALWAYS_INLINE(DSP_urand32_next_state) static inline void DSP_urand32_next_state( _ti_uint32 *s0, /*Status_0*/ _ti_uint32 *s1, /*Status_1*/ _ti_uint32 *s2, /*Status_2*/ _ti_uint32 *s3, /*Status_3*/ const _ti_uint32 mat1, /*Polynomial constant mat1*/ const _ti_uint32 mat2) /*Polynomial constant mat2*/ { /* Compute Next State*/ /* Temporary variables */ _ti_uint32 temp; temp = (*s0 & (0x7ffffffful)) ^ *s1 ^ *s2; temp ^= (temp << 1); *s3 ^= (*s3 >> 1) ^ temp; *s0 = *s1; *s1 = *s2; *s2 = temp ^ (*s3 << 10); *s1 ^= -((_ti_int32) (*s3 & 1)) & mat1; *s2 ^= -((_ti_int32) (*s3 & 1)) & mat2; } /* DSP_urand32_next_state */ /* Function Name : DSP_urand32_generate_random_ti_uint32 * * @Purpose : This function is used to generate and return a single * pseudo-random @b _ti_uint32 number on the interval [0,2^32-1]. * It should not be called by the user. * * @Precondition : The calling function has passed valid state variable * pointers and polynomial constants. * * @Postcondition : The "state machine" of the RNG has been modified * so that the next random transition can occur and a pseudo-random * @b _ti_uint32 has been returned. * * @param s0 : Pointer to the STATUS_0 variable of type @b _ti_uint32 * @param s1 : Pointer to the STATUS_1 variable of type @b _ti_uint32 * @param s2 : Pointer to the STATUS_2 variable of type @b _ti_uint32 * @param s3 : Pointer to the STATUS_3 variable of type @b _ti_uint32 * * @param mat1 : constant polynomial characteristic number MAT_1 * of type @b _ti_uint32 * * @param mat2 : constant polynomial characteristic number MAT_2 * of type @b _ti_uint32 * * @param tmat : constant polynomial characteristic number TMAT * of type @b _ti_uint32 * * @returns : pseudo-random @b _ti_uint32 */ #pragma CODE_SECTION(DSP_urand32_generate_random_ti_uint32,".text:optimized"); #pragma FUNC_ALWAYS_INLINE(DSP_urand32_generate_random_ti_uint32); static inline _ti_uint32 DSP_urand32_generate_random_ti_uint32( _ti_uint32 *s0, /* STATUS 0 */ _ti_uint32 *s1, /* STATUS 1 */ _ti_uint32 *s2, /* STATUS 2 */ _ti_uint32 *s3, /* STATUS 3 */ const _ti_uint32 mat1,/* Polynomial Constant MAT1 */ const _ti_uint32 mat2,/* Polynomial Constant MAT2 */ const _ti_uint32 tmat)/* Polynomial Constant TMAT */ { /*Hash the state vector*/ DSP_urand32_next_state(s0, s1, s2, s3, mat1, mat2); /*Concatenate random number from state variables */ return DSP_urand32_get_ti_uint32(*s0, *s2, *s3, tmat); } /* DSP_urand32_generate_random_ti_uint32 */ /* ======================================================================== */ /* End of file: DSP_urand32.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_urand*/ /** @ingroup DSPF_sp_urand*/ /* @{ */ /** * This function is used to fill an array with uniformly distributed * random @b floats on the interval [0, 1). * * @param size = The size of the array to be filled. * * @param vector = The array of type @b float which the user wants to * fill with random values. * * @param state = The array which was initialized with the * "DSP_urand32_init" function and maintained (but NEVER modified) by * the user between subsequent calls to this function. * * @par Algorithm: * The random number generator is based on "DSP_urand32." Random integers * are generated in the same manner and then multiplied by 1/(2^32) * (rounded to to 2.3283064e-010 for single-precision arithmetic) * and then cast to @b float to ensure a proper range of [0,1). * * @par Assumptions: * The user has previously called the "DSP_urand32_init" * function at least once, has maintained the state array, and allocated * an array of @b float types of the desired width. * * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is not interruptible.
* */ void DSPF_sp_urand(unsigned int size, /*The size of the array to be filled*/ float* vector, /*Pointer to the destination vector*/ void* state); /*State vector maintained by user*/ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ /* ======================================================================== */ /* End of file: DSPF_sp_urand.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSPF_sp_urand.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_autocor.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_autocor.h -- Autocorrelation */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup CORRELATION */ /* @{ */ /** @defgroup DSPF_sp_autocor */ /** @ingroup DSPF_sp_autocor */ /* @{ */ /** * This routine performs the autocorrelation of the input array x. * It is assumed that the length of the input array, x, is a multiple * of 4 and the length of the output array, r, is a multiple of 4. * It is assumed that input vector x is padded with nr no of zeros in the * beginning. * * @param r Pointer to output array of autocorrelation of length nr * @param x Pointer to input array of length nx+nr * Input data must be padded with nr consecutive zeros at the beginning * @param nx Length of autocorrelation vector * @param nr Length of lags * * @par Algorithm: * DSPF_sp_autocor_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * nx is a multiple of 4 and greater than or equal to 4
* nr is a multiple of 4 and greater than or equal to 4
* nx is greater than or equal to nr
* x is double-word aligned
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_autocor(float *restrict r, float *restrict x, const int nx, const int nr); /* ======================================================================= */ /* End of file: DSPF_sp_autocor.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_autocor.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_recip16.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_recip16.h -- Reciprocal Function */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_recip16 */ /** @ingroup DSP_recip16 */ /* @{ */ /** * This program performs a reciprocal on a vector of Q15 numbers. * The result is stored in two parts: a Q15 part and an exponent * (power of two) of the fraction. * First, the input is loaded, then its absolute value is taken, * then it is normalized, then divided using a loop of conditional * subtracts, and finally it is negated if the original input was * negative. * * @param x = Input data array of shorts * @param rfrac = Output data array containing fractions * @param rexp = Output data array containing exponents * @param nx = Number of elements in the arrays * * @par Algorithm: * DSP_recip16_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * Arrays x, rfrac, and rexp do not overlap.
* nx must be a multiple of 4 and greater than or equal to 4.
* x must be double-word aligned.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_recip16 ( const short *restrict x, /* Input array */ short *restrict rfrac, /* Output array containg Fractions */ short *restrict rexp, /* Output array containing Exponents */ short nx /* Number of elements in arrays */ ); /* ======================================================================= */ /* End of file: DSP_recip16.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_recip16.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft16x16.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft16x16.h -- 16x16 Mixed Radix FFT */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSP_fft16x16 */ /** @ingroup DSP_fft16x16 */ /* @{ */ /** * The following code performs a mixed radix FFT for "npoints" which * is either a multiple of 4 or 2. It uses logN4 - 1 stages of radix4 * transform and performs either a radix2 or radix4 transform on the * last stage depending on "npoints". If "npoints" is a multiple of 4 * then this last stage is also a radix4 transform, otherwise it is a * radix2 transform. * * @param ptr_w = input twiddle factors * @param npoints = number of points * @param ptr_x = transformed data reversed * @param ptr_y = linear transformed data * * @par Algorithm: * DSP_fft16x16_cn.c is the natural C equivalent of the optimized intrinsic C * code without restrictions. Note that the intrinsic C code is optimized and * restrictions may apply. * * @par Assumptions: * In-place computation is not allowed.
* Size of FFT, nx, must be power of 2 and 16<=nx<=65536.
* The arrays for the complex input data x[], complex output data y[] * and twiddle factor w[] must be double word aligned.
* The input and output data are complex, with the real/imaginary * components stored in adjacent locations in the array. The real * components are stored at even array indices, and the imaginary * components are stored at odd array indices.
* All data are in short precision or Q.15 format. Allowed maximum absolute * value of input is 2^(16 - (log2(nx)-ceil[log4(nx)-1])).
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_fft16x16 ( const short * restrict ptr_w, int npoints, short * restrict ptr_x, short * restrict ptr_y ); /* ======================================================================== */ /* End of file: DSP_fft16x16.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_fft16x16.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_cplx_hM4X4.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_cplx_hM4X4.h -- Complex FIR Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_fir_cplx_hM4X4 */ /** @ingroup DSP_fir_cplx_hM4X4 */ /* @{ */ /** * This complex FIR computes nr complex output samples using nh * complex coefficients. It operates on 16-bit data with a 32-bit * accumulate. Each array consists of an even and odd term with even * terms representing the real part of the element and the odd terms * the imaginary part. The pointer to input array x must point to the * (nh)th complex sample, i.e. element 2*(nh-1), upon entry to the * function. The coefficients are expected in normal order. * * @param x Complex input data. x must point to x[2*(nh-1)]. * @param h Complex coefficients (in normal order). h must point to h[2*nh]. * @param r Complex output data. r must point to r[2*nr]. * @param nh Number of complex coefficients. * @param nr Number of complex output samples. * * @par Algorithm: * DSP_fir_cplx_hM4X4_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions. Note that the intrinsic C code * is optimized and restrictions may apply. * * @par Assumptions: * Arrays x, h, and r do not overlap
* Arrays h and r must be aligned on double word boundaries
* nr >= 8; nr % 4 == 0
* nh >= 8; nh % 4 == 0
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes. * @b Interruptibility: The code is interruptible */ void DSP_fir_cplx_hM4X4 ( const short *restrict x, /* Input array [nr+nh-1 elements] */ const short *restrict h, /* Coeff array [nh elements] */ short *restrict r, /* Output array [nr elements] */ int nh, /* Number of coefficients */ int nr /* Number of output samples */ ); /* ======================================================================= */ /* End of file: DSP_fir_cplx_hM4X4.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fir_cplx_hM4X4.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_vecrecip.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_vecrecip.h -- Vector Reciprocal */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_vecrecip */ /** @ingroup DSPF_sp_vecrecip */ /* @{ */ /** * The sp_vecrecip module calculates the reciprocal of each element in the array * x and returns the output in array r. It uses 2 iterations of the Newton-Raphson * method to improve the accuracy of the output generated by the RCPSP instruction * generated by RCPSP is 8 bits. So after the first iteration it is 16 bits and after * the second it is the full 23 bits. The formula used is:
* r[n+1] = r[n](2 - v*r[n])
* where v = the number whose reciprocal is to be found.
* x[0], the seed value for the algorithm, is given by RCPSP.
* * @param x Pointer to input array. * @param y Pointer to output array. * @param nx Number of elements in arrays. * * @par Algorithm: * DSPF_sp_vecrecip_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * nx is a multiple of 4 and >= 4.
* x and y are double word aligned.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_vecrecip(const float * x, float *restrict y, const int nx); /* ======================================================================= */ /* End of file: DSPF_sp_vecrecip.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_vecrecip.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fltoq15.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fltoq15.h -- Float to Q15 conversion */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MISC */ /* @{ */ /** @defgroup DSP_fltoq15 */ /** @ingroup DSP_fltoq15 */ /* @{ */ /** * Convert the IEEE floating point numbers stored in vector x[ ] * into Q.15 format numbers stored in vector r[ ]. Results are * truncated toward zero. Values that exceed the size limit will * be saturated to 0x7fff if value is positive and 0x8000 if value * is negative. All values too small to be correctly represented * will be truncated to 0. * * @param flt = Pointer to floating-point input vector of size nx. * x should contain the numbers normalized between [-1,1) * @param q15 = Pointer to output data vector of size nx containing the Q.15 * equivalent of vector x. * @param nx = Length of input and output data vectors. Must be multiple of 2 * * @par Algorithm: * DSP_fltoq15_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * nx must be a multiple of 4
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_fltoq15 ( const float *restrict flt, /* Input float array */ short *restrict q15, /* Output Q15 array */ int nx /* Number of elements */ ); /* ======================================================================= */ /* End of file: DSP_fltoq15.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fltoq15.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud_sol_cmplx.h -- C source interface header file for complex */ /* linear solver by LUD, double precision */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud_sol_cmplx.h -- complex linear solver by LUD */ /* optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_lud_solver_cmplx */ /** @ingroup DSPF_dp_lud_solver_cmplx */ /* @{ */ /** * This function solves the system of linear equations A*x=b for x using the inputs produced by DSPF_dp_lud where * A*x=transpose(P)*L*U*x=b. The following procedure is performed. * * 1. Modify b using permutation matrix: b_mod = L*U*x = P*b
* 2. Use forward substitution to solve for y: y = U*x = inv(L)*b_mod
* 3. Use backward substitution for solve for x: x = inv(U)*y
* * * The values stored in the matrices are assumed to be double precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in square complex matrix A * @param P = pointer to permutation matrix P[Nrows*Nrows] * @param L = pointer to lower triangular matrix complex L[2*Nrows*Nrows] * @param U = pointer to upper triangular matrix complex U[2*Nrows*Nrows] * @param b = pointer to complex vector b[2*Nrows] * @param b_mod = pointer to modified complex vector b_mod[2*Nrows] * @param y = pointer to temporary complex vector y[2*Nrows] * @param x = pointer to final solver output complex vector x[2*Nrows] * * * @par Algorithm: * DSPF_dp_lud_solver.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays P, L, U, and inv_A are stored in distinct arrays. In-place processing is not done.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_lud_solver_cmplx(const int order,unsigned short *restrict P, double *restrict L,double *restrict U,double *restrict b, double *restrict b_mod,double *restrict y,double *restrict x); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_lud_sol_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_lud_sol_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_cholesky.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_cholesky.h -- Cholesky decomposition and solver */ /* Natural C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_cholesky */ /** @ingroup DSPF_sp_cholesky */ /* @{ */ /** * This function tests the matrix A for a symmetric positive definite and * decomposes the matrix A into a lower triangular matrix L where A=L*U and * U=transpose of L. The values stored in the matrices are assumed to be * single precision floating-point values. This code is suitable for * dense matrices. No optimizations are made for sparse matrices. * * @param enable_test = enables test for symmetric positive definite matrix * @param order = order of matrix A * @param A = pointer to matrix A * @param L = pointer to lower triangular matrix L * * @par Algorithm: * DSPF_sp_cholesky.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays A and L are stored in distinct arrays. In-place processing is not allowed.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_cholesky(const int enable_test, const int order, float *restrict A, float *restrict L); /* }@ */ /* ingroup */ /** @defgroup DSPF_sp_cholesky_in_place */ /** @ingroup DSPF_sp_cholesky_in_place */ /* @{ */ /** * This function tests the matrix A for a symmetric positive definite and * decomposes the matrix A into a lower triangular matrix L where A=L*U and * U=transpose of L. The processing is done in place of the matrix A. * The values stored in the matrices are assumed to be single precision * floating point values. This code is suitable for dense matrices. No * optimizations are made for sparse matrices. * * @param enable_test = enables test for symmetric positive definite matrix * @param order = order of matrix A * @param A = pointer to input matrix A and output matrix L * * @par Algorithm: * DSPF_sp_cholesky_in_place.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * In-place processing is done on the matrix A.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_cholesky_in_place(const int enable_test, const int order, float *restrict A); /* }@ */ /* ingroup */ /** @defgroup DSPF_sp_solver */ /** @ingroup DSPF_sp_solver */ /* @{ */ /** * This function solves A*x=b for x using forward and backward substitution * using the decomposed lower triangular matrix L as shown in the following * steps. The values stored in the matrices are assumed to be single precision * floating point values. * 1. A*x = L*U*b = L*L_transpose*x = b * 2. y = inverse(L)*b - done using forward substitution * 3. x = inverse(L_transpose)*y - done using backward substitution * * @param order = order of matrix A * @param L = pointer to input matrix * @param y = pointer to intermediate vector * @param b = pointer to input vector * @param x = pointer to output vector * * @par Algorithm: * DSPF_sp_solver.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The decomposed lower triangular matrix L is available as input.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_cholesky_solver(const int order,float *restrict L,float *restrict y,float *restrict b,float *restrict x); /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_cholesky.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_cholesky.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_trans.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_trans.h -- Matrix Transpose */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_mat_trans */ /** @ingroup DSPF_sp_mat_trans */ /* @{ */ /** * This function transposes the input matrix x[] and writes the * result to matrix y[]. * * @param x[r1*c1] Input matrix containing r1*c1 floating-point numbers * @param rows Number of rows in matrix x. Also number of columns in matrix y. * @param cols Number of columns in matrix x. Also number of rows in matrix y. * @param y[c1*r1] Output matrix containing c1*r1 floating-point numbers * * @par Algorithm: * DSPF_sp_mat_trans.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The number of rows and columns is multiple of 2 and >=2.
* x and y are double-word aligned.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSPF_sp_mat_trans(const float *restrict x, const int rows, const int cols, float *restrict y); /* ======================================================================= */ /* End of file: DSPF_sp_mat_trans.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_mat_trans.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_cholesky_cmplx.h -- C source interface header file for */ /* single precision complex Cholesky */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_cholesky_cmplx.h -- Cholesky decomposition and solver */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_cholesky_cmplx */ /** @ingroup DSPF_sp_cholesky_cmplx */ /* @{ */ /** * This function tests the square complex matrix A for a symmetric positive definite and * decomposes the matrix A into a lower triangular matrix L where A=L*U and * U=Hermitian of L. The values stored in the matrices are assumed to be * single precision floating point values. This code is suitable for * dense matrices. No optimizations are made for sparse matrices. * * @param enable_test = enables test for symmetric positive definite matrix * @param Nrows = Nrows of square matrix A * @param A = pointer to square matrix A[Nrows*2*Nrows] * @param L = pointer to lower triangular matrix L[Nrows*2*Nrows] * * @par Algorithm: * DSPF_sp_cholesky_cmplx_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1 .The arrays A and L are stored in distinct arrays. In-place processing is not allowed.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_cholesky_cmplx(const int enable_test, const int Nrows, float *restrict A, float *restrict L); /* }@ */ /* ingroup */ /** @defgroup DSPF_sp_cholesky_in_place_cmplx */ /** @ingroup DSPF_sp_cholesky_in_place_cmplx */ /* @{ */ /** * This function tests the square matrix A for a symmetric positive definite and * decomposes the square matrix A into a lower triangular matrix L where A=L*U and * U=transpose of L. The processing is done in place of the matrix A. * The values stored in the matrices are assumed to be float precision * floating point values. This code is suitable for dense matrices. No * optimizations are made for sparse matrices. * * @param enable_test = enables test for symmetric positive definite matrix * @param Nrows = Nrows of square matrix A * @param A = pointer to input square matrix A[Nrows*2*Nrows] and output matrix L[Nrows*2*Nrows] * * @par Algorithm: * DSPF_sp_cholesky_cmplx_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. In-place processing is done on the matrix A.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_cholesky_in_place_cmplx(const int enable_test, const int Nrows, float *restrict A); /* }@ */ /* ingroup */ /** @defgroup DSPF_sp_cholesky_solver_cmplx */ /** @ingroup DSPF_sp_cholesky_solver_cmplx */ /* @{ */ /** * This function solves A*x=b for x using forward and backward substitution * using the decomposed lower triangular matrix L as shown in the following * steps. The values stored in the matrices are assumed to be float precision * floating point values. * 1. A*x = L*U*b = L*L_transpose*x = b * 2. y = inverse(L)*b - done using forward substitution * 3. x = inverse(L_transpose)*y - done using backward substitution * * @param Nrows = Nrows of square matrix A * @param L = pointer to input square matrix A[Nrows*2*Nrows] * @param y = pointer to intermediate vector y[2*Nrows] * @param b = pointer to input vector b[2*Nrows] * @param x = pointer to output vector x[2*Nrows] * * @par Algorithm: * DSPF_sp_cholesky_cmplx_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The decomposed lower triangular matrix L is available as input.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_cholesky_solver_cmplx(const int Nrows,float *restrict L,float *restrict y,float *restrict b,float *restrict x); /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_cholesky_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_cholesky_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_w_vec.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_w_vec.h -- Vector Weighted Add */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_w_vec */ /** @ingroup DSPF_sp_w_vec */ /* @{ */ /** * This routine is used to obtain the weighted vector sum. Both the inputs and output * are single-precision floating-point numbers. * * @param x1 Pointer to first input array. * @param x2 Pointer to second input array. * @param m Weight factor. * @param y Output array pointer. * @param nx Number of elements in arrays. * * @par Algorithm: * DSPF_sp_w_vec_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * The x and y arrays must be double-word aligned
* The value of nx must be a multiple of 4 and > 0
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_w_vec(const float *x1, const float *x2, const float m, float *restrict y, const int nx); /* ======================================================================= */ /* End of file: DSPF_sp_w_vec.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_w_vec.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_dotprod.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_dotprod.h -- Dot Product */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_dotprod */ /** @ingroup DSPF_sp_dotprod */ /* @{ */ /** * This routine calculates the dot product of 2 single-precision float vectors * * @param x Pointer to array holding the first floating-point vector * @param y Pointer to array holding the second floating-point vector * @param nx Number of values in the x and y vectors * * @par Algorithm: * DSPF_sp_dotprod_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * The x and y arrays must be double-word aligned.
* nx is a multple of 8 and >=8.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ float DSPF_sp_dotprod(const float * x, const float * y, const int nx); /* ======================================================================= */ /* End of file: DSPF_sp_dotprod.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_dotprod.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud_sol.h -- C source interface header file for LUD solver */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud_sol.h -- linear solver by LUD */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_lud_solver */ /** @ingroup DSPF_sp_lud_solver */ /* @{ */ /** * This function solves the system of linear equations A*x=b for x using the inputs produced by DSPF_sp_lud where * A*x=transpose(P)*L*U*x=b. The following procedure is performed. * * 1. Modify b using permutation matrix: b_mod = L*U*x = P*b
* 2. Use forward substitution to solve for y: y = U*x = inv(L)*b_mod
* 3. Use backward substitution for solve for x: x = inv(U)*y
* * * The values stored in the matrices are assumed to be single precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param order = order of matrix A * @param P = pointer to permutation matrix P[order*order] * @param L = pointer to lower triangular matrix L[order*order] * @param U = pointer to upper triangular matrix U[order*order] * @param b = pointer to vector b[order] * @param b_mod = pointer to modified vector b_mod[order] * @param y = pointer to temporary vector y[order] * @param x = pointer to final solver output vector x[order] * * * @par Algorithm: * DSPF_sp_lud_solver.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays P, L, U, and inv_A are stored in distinct arrays. * In-place processing is not done.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_lud_solver(const int order,unsigned short *restrict P,float *restrict L, float *restrict U,float *restrict b,float *restrict b_mod, float *restrict y,float *restrict x); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_sol.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_sol.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_cholesky.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_cholesky.h -- Cholesky decomposition and solver */ /* Natural C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_cholesky */ /** @ingroup DSPF_dp_cholesky */ /* @{ */ /** * This function tests the matrix A for a symmetric positive definite and * decomposes the matrix A into a lower triangular matrix L where A=L*U and * U=transpose of L. The values stored in the matrices are assumed to be * double precision floating point values. This code is suitable for * dense matrices. No optimizations are made for sparse matrices. * * @param enable_test = enables test for symmetric positive definite matrix * @param order = order of matrix A * @param A = pointer to matrix A * @param L = pointer to lower triangular matrix L * * @par Algorithm: * DSPF_dp_cholesky.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays A and L are stored in distinct arrays. In-place processing is not allowed.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_cholesky(const int enable_test, const int order, double *restrict A, double *restrict L); /* }@ */ /* ingroup */ /** @defgroup DSPF_dp_cholesky_in_place */ /** @ingroup DSPF_dp_cholesky_in_place */ /* @{ */ /** * This function tests the matrix A for a symmetric positive definite and * decomposes the matrix A into a lower triangular matrix L where A=L*U and * U=transpose of L. The processing is done in place of the matrix A. * The values stored in the matrices are assumed to be double precision * floating point values. This code is suitable for dense matrices. No * optimizations are made for sparse matrices. * * @param enable_test = enables test for symmetric positive definite matrix * @param order = order of matrix A * @param A = pointer to input matrix A and output matrix L * * @par Algorithm: * DSPF_dp_cholesky_in_place.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * In-place processing is done on the matrix A.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_cholesky_in_place(const int enable_test, const int order, double *restrict A); /* }@ */ /* ingroup */ /** @defgroup DSPF_dp_cholesky_solver */ /** @ingroup DSPF_dp_cholesky_solver */ /* @{ */ /** * This function solves A*x=b for x using forward and backward substitution * using the decomposed lower triangular matrix L as shown in the following * steps. The values stored in the matrices are assumed to be double precision * floating point values. * 1. A*x = L*U*b = L*L_transpose*x = b * 2. y = inverse(L)*b - done using forward substitution * 3. x = inverse(L_transpose)*y - done using backward substitution * * @param order = order of matrix A * @param L = pointer to input matrix * @param y = pointer to intermediate vector * @param b = pointer to input vector * @param x = pointer to output vector * * @par Algorithm: * DSPF_dp_cholesky_solver.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The decomposed lower triangular matrix L is available as input.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_cholesky_solver(const int order,double *restrict L,double *restrict y,double *restrict b,double *restrict x); /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_cholesky.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_cholesky.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_blk_eswap32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_blk_eswap32.h -- Endian-swap a block of 32-bit values */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MISC */ /* @{ */ /** @defgroup DSP_blk_eswap32 */ /** @ingroup DSP_blk_eswap32 */ /* @{ */ /** * The data in the x[] array is endian swapped, meaning that the * byte-order of the bytes within each word of the r[] array is * reversed. This facilitates moving big-endian data to a * little-endian system or vice-versa. * When the r pointer is non-NULL, the endian-swap occurs out-of-place, * similar to a block move. When the r pointer is NULL, the endian-swap * occurs in-place, allowing the swap to occur without using any * additional storage. * * @param src = Source data, must be double-word aligned. * @param dst = Destination data, must be double-word aligned. * @param n_words = Number of 32-bit elements to swap. * * @par Algorithm: * DSP_blk_eswap32_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions note that the intrinsic C code * is optimized and restrictions may apply. * * @par Assumptions: * Input and output arrays do not overlap, except when “dst == NULL” so that * the operation occurs in-place.
* The input array and output array are double-word aligned.
* nx is a multiple of 4.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ void DSP_blk_eswap32 ( void *restrict src, void *restrict dst, int n_words ); /* ======================================================================== */ /* End of file: DSP_blk_eswap32.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_blk_eswap32.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lms.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lms.h -- LMS Adaptive Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup ADAPTIVEFILTER */ /* @{ */ /** @defgroup DSPF_sp_lms2 */ /** @ingroup DSPF_sp_lms2 */ /* @{ */ /** * The DSPF_sp_lms implements an LMS adaptive filter. Given an actual input * signal and a desired input signal, the filter produces an output signal, * the final coefficient values, and returns the final output error signal. * * @param x Pointer to input samples * @param h Pointer to the coefficient array * @param y_i Pointer to the desired output array * @param y_o Pointer to filtered output array * @param ar Adaptation rate * @param error Initial error * @param nh Number of coefficients * @param nx Number of output samples * * @par Algorithm: * DSPF_sp_lms2_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions note that the intrinsic * C code is optimized and restrictions may apply. * * @par Assumptions: * nh must be a multiple of 4 and >= 4.
* The coefficient array is assumed to be in reverse order; i.e., h(nh-1), * h(nh-2), ..., h(0) will hold coefficients h0, h1, ..., hnh-1, repectively.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ float DSPF_sp_lms(const float *x, float *restrict h, const float *y_i, float *restrict y_o, const float ar, float error, const int nh, const int nx); /* ======================================================================= */ /* End of file: DSPF_sp_lms.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_lms.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud_cmplx.h -- C source interface header file for complex LUD */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud_cmplx.h -- complex lower/upper decompostion */ /* optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_lud_cmplx */ /** @ingroup DSPF_dp_lud_cmplx */ /* @{ */ /** * This function decomposes the square complex matrix A into a lower triangular matrix L, * upper triangular matrix U, and a permutation matrix P where A=transpose(P)*L*U. * The band Gaussian elimination outer product algorithm is used. The permutation * matrix P keeps track of the reordering of rows in the A matrix such that the * first element of the permuted matrix is maximum and nonzero. The values stored * in the matrices are assumed to be double precision floating point values. This * code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of square complex matrix A * @param A = pointer to complex matrix A[2*Nrows*Nrows] * @param L = pointer to lower triangular complex matrix L[2*Nrows*Nrows] * @param U = pointer to upper triangular complex matrix U[2*Nrows*Nrows] * @param P = pointer to permutation complex matrix P[2*Nrows*Nrows] * * * @par Algorithm: * DSPF_dp_lud.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays A, L, U, and P are stored in distinct arrays. In-place processing is not allowed.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_lud_cmplx(const int order,double *restrict A,double *restrict L,double *restrict U,unsigned short *restrict P); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_lud_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_lud_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_biquad.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_biquad.h -- Biquad Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSPF_sp_biquad */ /** @ingroup DSPF_sp_biquad */ /* @{ */ /** * This routine implements a DF 2 transposed structure of the biquad filter * * @param x Pointer to input samples * @param b Pointer to Nr coefs b0, b1, b2 * @param a Pointer to Dr coefs a1, a2 * @param delay Pointer to filter delays * @param y Pointer to output samples * @param nx Number of input/output samples * * @par Algorithm: * DSPF_sp_biquad_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * The value of nx is >= 2.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_biquad(float *restrict x, float *b, float *a, float *delay, float *restrict y, const int nx); /* ======================================================================= */ /* End of file: DSPF_sp_biquad.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_biquad.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud_cmplx.h -- C source interface header file for complex LUD */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud_cmplx.h -- complex lower/upper decompostion */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_lud_cmplx */ /** @ingroup DSPF_sp_lud_cmplx */ /* @{ */ /** * This function decomposes the square complex matrix A into a lower triangular matrix L, * upper triangular matrix U, and a permutation matrix P where A=transpose(P)*L*U. * The band Gaussian elimination outer product algorithm is used. The permutation * matrix P keeps track of the reordering of rows in the A matrix such that the * first element of the permuted matrix is maximum and nonzero. The values stored * in the matrices are assumed to be float precision floating point values. This * code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of square complex matrix A * @param A = pointer to complex matrix A[2*Nrows*Nrows] * @param L = pointer to lower triangular complex matrix L[2*Nrows*Nrows] * @param U = pointer to upper triangular complex matrix U[2*Nrows*Nrows] * @param P = pointer to permutation complex matrix P[2*Nrows*Nrows] * * * @par Algorithm: * DSPF_sp_lud.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays A, L, U, and P are stored in distinct arrays. In-place processing is not allowed.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_lud_cmplx(const int order,float *restrict A,float *restrict L,float *restrict U,unsigned short *restrict P); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_maxval.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_maxval.h -- Max Value */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_maxval */ /** @ingroup DSPF_sp_maxval */ /* @{ */ /** * This routine finds out the maximum number in the input array. This code returns * the maximum value in the array. * * @param x Pointer to input array. * @param nx Number of inputs in the input array. * * @par Algorithm: * DSPF_sp_maxval_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * nx should be multiple of 4 and >= 4
* x should be double-word aligned
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ float DSPF_sp_maxval(const float* x, int nx); /* ======================================================================= */ /* End of file: DSPF_sp_maxval.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_maxval.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud_sol_cmplx.h -- C source interface header file for complex */ /* linear solver by LUD, single precision */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud_sol_cmplx.h -- complex linear solver by LUD single precision*/ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_lud_solver_cmplx */ /** @ingroup DSPF_sp_lud_solver_cmplx */ /* @{ */ /** * This function solves the system of linear equations A*x=b for x using the * inputs produced by DSPF_sp_lud where * A*x=transpose(P)*L*U*x=b. The following procedure is performed. * * 1. Modify b using permutation matrix: b_mod = L*U*x = P*b
* 2. Use forward substitution to solve for y: y = U*x = inv(L)*b_mod
* 3. Use backward substitution for solve for x: x = inv(U)*y
* * * The values stored in the matrices are assumed to be float precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in square complex matrix A * @param P = pointer to permutation matrix P[Nrows*Nrows] * @param L = pointer to lower triangular matrix complex L[2*Nrows*Nrows] * @param U = pointer to upper triangular matrix complex U[2*Nrows*Nrows] * @param b = pointer to complex vector b[2*Nrows] * @param b_mod = pointer to modified complex vector b_mod[2*Nrows] * @param y = pointer to temporary complex vector y[2*Nrows] * @param x = pointer to final solver output complex vector x[2*Nrows] * * * @par Algorithm: * DSPF_sp_lud_sol_cmplx_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays P, L, U, and inv_A are stored in distinct arrays. In-place processing is not done.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_lud_solver_cmplx(const int order,unsigned short *restrict P,float *restrict L, float *restrict U,float *restrict b,float *restrict b_mod, float *restrict y,float *restrict x); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_sol_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_sol_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_iir.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_iir.h -- IIR Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSPF_sp_iir */ /** @ingroup DSPF_sp_iir */ /* @{ */ /** * The IIR performs an auto-regressive moving-average (ARMA) filter with 4 * auto-regressive filter coefficients and 5 moving-average filter coefficients * for nr output samples. The output vector is stored in two locations. This * routine is used as a high pass filter in the VSELP vocoder. The 4 values * in the r1 vector store the initial values of the delays. * * @param y1[nr+4] Delay element values (i/p and o/p). * @param x[nr] Pointer to the input array. * @param y2[nr+4] Pointer to the output array. * @param hb[5] Moving average filter coefficients. * @param ha[5] Auto-regressive filter coefficients. * @param nr Number of output samples. * * @par Algorithm: * DSPF_sp_iir_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * The value of ‘nr’ must be a multiple of 2.
* Extraneous loads are allowed in the program.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible. * @b Endian Support: The code supports both big and little endian modes. * */ void DSPF_sp_iir (float* restrict y1, const float* x, float* restrict y2, const float* hb, const float* ha, int nr); /* ======================================================================= */ /* End of file: DSPF_sp_iir.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_iir.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_svd.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_svd.h -- Singular Value Decomposition */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ //#define ENABLE_REDUCED_FORM 1 /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_svd */ /** @ingroup DSPF_sp_svd */ /* @{ */ /** * This routine decomposes an Nrows x Ncols matrix A into a product of three * matrices: A = U * D * V' where U and V are orthogonal matrices, V' is the * transpose of V, and D is a diagonal matrix. If the define constant * ENABLE_REDUCED_FORM is defined then the reduced form is generated else * the full form is generated as shown below for the case Nrows>=Ncols. * * full form
* U [Nrows x Nrows]
* D [Nrows x Ncols]
* V'[Ncols x Ncols]
* reduced form
* U [Nrows x Ncols]
* D [Ncols x Ncols]
* V'[Ncols x Ncols]
* * The singular values are the diagonal elements of D and correspond to the * positive square roots of the eigenvalues of the matrix A' * A. This code * is suitable for dense matrices. No optimizations are made for sparse matrices. * This routine calls the following routines. * * 1. DSPF_dp_convert_to_bidiag: converts A to bidiagonal matrix using Householder * transformations.
* 2. DSPF_dp_bidiag_to_diag: converts bidiagonal matrix to diagonal using Givens * transformations (works only for Nrows>=Ncols).
* 3. DSPF_dp_sort_singular_values: sorts singular values in descending order and * modifies U and V matrices accordingly.
* * If Nrows * @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_svd(const int Nrows,const int Ncols,float *restrict A,float *restrict U,float *restrict V,float *restrict U1,float *restrict diag,float *restrict superdiag); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_svd.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_svd.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_w_vec.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_w_vec.h -- Weighted Vector Sum */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_w_vec */ /** @ingroup DSP_w_vec */ /* @{ */ /** * This routine is used to obtain the weighted vector sum. * Both the inputs and output are 16-bit numbers * * @param x = Vector being weighted * @param y = Summation vector * @param m = Weighting factor * @param r = Output vector * @param nr = Dimensions of the vectors * * @par Algorithm: * DSP_vecsumsq_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * nr must be a multiple of 8 and >= 8.
* Vectors x[ ] y[ ] and r[ ] must be double-word aligned.
* m is not -32768.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_w_vec ( const short * restrict x, /* Vector being weighted */ const short * restrict y, /* Non-weighted vector */ short m, /* weighting factor */ short * restrict r, /* Result vector */ int nr /* Number of samples. */ ); /* ======================================================================== */ /* End of file: DSP_w_vec.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_w_vec.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_dotprod.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_dotprod.h -- Dot product implementation */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_dotprod */ /** @ingroup DSP_dotprod */ /* @{ */ /** * This routine takes two vectors and calculates their dot product. * The inputs are 16-bit short data and the output is a 32-bit number. * * @param x = First vector array * @param y = Second vector array * @param nx = Number of elements * * @par Algorithm: * DSP_dotprod_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The input length must be a multiple of 4.
* The input data x[] and y[] are stored on double-word aligned boundaries.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ int DSP_dotprod ( short * restrict x, /* Pointer to first vector */ short * restrict y, /* Pointer to second vector */ int nx /* Length of vectors. */ ); /* ======================================================================== */ /* End of file: DSP_dotprod.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_dotprod.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_autocor.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* NAME */ /* DSP_autocor -- Autocorrelation */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup CORRELATION */ /* @{ */ /** @defgroup DSP_autocor */ /** @ingroup DSP_autocor */ /* @{ */ /** * This routine performs an autocorrelation of an input vector * x. The length of the autocorrelation is nx samples. Since nr * such autocorrelations are performed, input vector x needs to be * of length nx + nr. This produces nr output results which are * stored in an output array r. * * The following diagram illustrates how the correlations are * obtained. * * Example for nr=8, nx=24:
* 0 nr nx+nr-1
* |-------|----------------------| <- x[]
* | |----------------------| -> r[0]
* | |----------------------| -> r[1]
* | |----------------------| -> r[2]
* | |----------------------| -> r[3]
* | |----------------------| -> r[4]
* | |----------------------| -> r[5]
* | |----------------------| -> r[6]
* * Note that x[0] is never used, but is required for padding to make * x[nr] double-word aligned. * * @param r = Output data array of shorts * @param x = Input data array of shorts * @param nx = Length of autocorrelation * @param nr = Number of lags * * @par Algorithm: * DSP_autocor_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The first nr elements are assumed to be zero.
* NX >= 8; NX % 8 == 0
* NR >= 4; NR % 4 == 0
* x[] must be double word alligned
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ void DSP_autocor ( short *restrict r, const short *restrict x, int nx, int nr ); /* ======================================================================== */ /* End of file: DSP_autocor.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_autocor.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r8.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r8.h -- FIR Filter (Radix 8) */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_fir_r8 */ /** @ingroup DSP_fir_r8 */ /* @{ */ /** * Computes a real FIR filter (direct-form) using coefficients * stored in vector h. The real data input is stored in vector x. * The filter output result is stored in vector r. Input data and * filter taps are 16-bit, with intermediate values kept at 32-bit * precision. Filter taps are expected in Q15 format. * * @param x = Input array [nr+nh-1 elements] * @param h = Coeff array [nh elements] * @param r = Output array [nr elements] * @param nh = Number of coefficients * @param nr = Number of output samples * * @par Algorithm: * DSP_fir_r8_cn.c is the natural C equivalent of the optimized intrinsic C * code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply.
* * Performance Note: For better cycle performance when using Radix 8 * coefficients nh <= 24 please use * DSP_fir_r8_h8, DSP_fir_r8_h16, DSP_fir_r8_h24 module * * @par Assumptions: * Arrays x, h, and r do not overlap.
* x, h and r must be double word aligned.
* nr >= 4; nr % 4 == 0.
* nh >= 8; nh % 8 == 0.
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes. * @b Interruptibility: The code is interruptible * */ void DSP_fir_r8 ( const short *restrict x, /* Input array [nr+nh-1 elements] */ const short *restrict h, /* Coeff array [nh elements] */ short *restrict r, /* Output array [nr elements] */ int nh, /* Number of coefficients */ int nr /* Number of output samples */ ); /* ======================================================================= */ /* End of file: DSP_fir_r8.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fir_r8.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_add16.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_add16.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_add16 */ /** @ingroup DSP_add16 */ /* @{ */ /** * This program performs a addition on a vector. * The result is stored in a vector. * * @param x = Input data array of shorts * @param y = Input data array of shorts * @param r = Output data array of shorts * @param nx = Number of elements in the arrays * * @par Algorithm: * DSP_add16_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions note that the intrinsic * C code is optimized and restrictions may apply. * * @par Assumptions: * Arrays x, y, r do not overlap.
* Arrays x, y, r are aligned on double word boundaries.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ void DSP_add16 ( short * restrict x, /* Input array of length nx */ short * restrict y, /* Input array of length nx */ short * restrict r, /* Output array of length nx */ int nx /* Number of elements. */ ); /* ======================================================================== */ /* End of file: DSP_add16.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_add16.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_q15tofl.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_q15tofl.h -- Q15 to Float conversion */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MISC */ /* @{ */ /** @defgroup DSP_q15tofl */ /** @ingroup DSP_q15tofl */ /* @{ */ /** * Converts the values stored in vector x[ ] in Q.15 format to * IEEE floating point numbers in output vector r[ ] * * @param q15 = Pointer to Q.15 input vector of size nx * @param flt = Pointer to floating-point output data vector of size nx * containing the floating-point equivalent of vector x * @param nx = Length of input and output data vectors * * @par Algorithm: * DSP_q15tofl_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * nx must be a multiple of 4.
* q15 and flt are double word aligned.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ void DSP_q15tofl ( const short *restrict q15, /* Input Q15 array */ float *restrict flt, /* Output float array */ int nx /* Number of elements */ ); /* ======================================================================= */ /* End of file: DSP_q15tofl.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_q15tofl.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_erand.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_erand.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima */ /* University and The University of Tokyo. All rights reserved. */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_erand */ /** @ingroup DSPF_sp_erand */ /* @{ */ /** * This function is used to fill an array with exponentially distributed * random numbers.These numbers are distributed assuming a rate * parameter (lambda) = 1; * * The output vector can be modified for an arbitrary lambda by * dividing its contents by the desired value of lambda (or, preferably * for speed, multiplying its contents by the precomputed value of * 1/lambda) as shown in the histogram below. * * @param size = The size of the array to be filled. * * @param vector = The array which the user wants to fill with random * values. Again, it should be of type @b float. * * @param state = The array which was initialized with the * "DSP_urand32_init" function and maintained (but NEVER modified) by * the user between subsequent calls to this function. * * @par Algorithm: * The RNG utilizes the Tiny Mersene Twister (TinyMT) as its underlying RNG * and an optimized version of George Marsaglia's Ziggurat algorithm as a * wrapper RNG to generate an exponential distribution from the uniformly * distributed TinyMT. * * @par Assumptions: * The user has previously called the "DSP_urand32_init" * function at least once, has maintained the state array, and allocated * an array of @b float types of the desired width. * * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is not interruptible.
* * @image html DSPF_sp_erand_histogram.png * */ void DSPF_sp_erand(int size, void *vector, void *state); /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ /* ======================================================================== */ /* End of file: DSPF_sp_erand.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSPF_sp_erand.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_urand32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_urand32.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_minval.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_minval.h -- Minimum Value */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_minval */ /** @ingroup DSPF_sp_minval */ /* @{ */ /** * This routine finds out the minimum number in the input array. This code returns * the minimum value in the array. * * @param x Pointer to input array. * @param nx Number of inputs in the input array. * * @par Algorithm: * DSPF_sp_minval_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * nx should be multiple of 4 and >= 4
* x should be double-word aligned
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ float DSPF_sp_minval(const float* x, int nx); /* ======================================================================= */ /* End of file: DSPF_sp_minval.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_minval.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_mul_cplx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_mul_cplx.h -- Complex Matrix Multiply */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_mat_mul_cplx */ /** @ingroup DSPF_sp_mat_mul_cplx */ /* @{ */ /** * This function computes the expression “y = x1*x2" for the matrices * x1 and x2. The columnar dimension of x1 must match the row dimension * of x2. The resulting matrix has the same number of rows as x1 and the * same number of columns as x2. Each element of Matrices are assumed to * be complex numbers with real values are stored in even word positions * and imaginary values in odd positions. * * @param x1[2*r1*c1] Input matrix containing r1*c1 complex floating-point numbers * @param r1 Number of rows in matrix x1. * @param c1 Number of columns in matrix x1. Also number of rows in matrix x2. * @param x2[2*c1*c2] Input matrix containing c1*c2 complex floating-point * @param c2 Number of columns in matrix x2. * @param y[2*r1*c2] Output matrix of c1*c2 complex floating-point numbers * * @par Algorithm: * DSPF_sp_mat_mul_cplx.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * r1, c1, c2 are multiple of 2.
* x1, x2 and y should be double-word aligned.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSPF_sp_mat_mul_cplx(const float* x1, int r1, int c1, const float* x2, int c2, float* restrict y); /* ======================================================================= */ /* End of file: DSPF_sp_mat_mul_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_mat_mul_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_iir_lat.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_irr_lat.h -- IIR Lattice Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_iir_lat */ /** @ingroup DSP_iir_lat */ /* @{ */ /** * This routine implements a real all-pole IIR filter in lattice * structure (AR lattice). The filter consists of nk lattice stages. * Each stage requires one reflection coefficient k and one delay * element b. The routine takes an input vector x[] and returns the * filter output in r[]. Prior to the first call of the routine the * delay elements in b[] should be set to zero. The input data may * have to be pre-scaled to avoid overflow or achieve better SNR. The * reflections coefficients lie in the range -1.0 < k < 1.0. The * order of the coefficients is such that k[nk-1] corresponds to the * first lattice stage after the input and k[0] corresponds to the * last stage. * * * @param x[nx] = Input vector (16-bit) * @param nx = Length of input vector. * @param k[nk] = Reflection coefficients in Q.15 format * @param nk = Number of reflection coefficients/lattice stages * @param b[nk+1] = Delay line elements from previous call. Should be * initialized to all zeros prior to the first call. * @param r[nx] = Output vector (16-bit) * * @par Algorithm: * DSP_iir_lat_cn.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * There are no assumptions.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSP_iir_lat ( short *x, int nx, const short *restrict k, int nk, int *restrict b, short *r ); /* ======================================================================= */ /* End of file: DSP_iir_lat.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_iir_lat.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_svd_cmplx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_svd_cmplx.h -- Singular Value Decomposition */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_svd_cmplx */ /** @ingroup DSPF_sp_svd_cmplx */ /* @{ */ /** * This routine decomposes a complex matrix A into a product of three * matrices: A = U * D * V' where U and V are orthogonal matrices, V' is the * Hermitian of V, and D is a diagonal matrix. If the define constant * ENABLE_REDUCED_FORM is defined then the reduced form is generated else * the full form is generated as shown below for the case Nrows>=Ncols. Note * that the symbol ' is the Hermitian or complex conjugate transpose. * * full form
* U [Nrows x 2*Nrows]
* D [Nrows x 2*Ncols]
* V'[Ncols x 2*Ncols]
* reduced form
* U [Nrows x 2*Ncols]
* D [Ncols x 2*Ncols]
* V'[Ncols x2*Ncols]
* * The singular values are the diagonal elements of D and correspond to the * positive square roots of the eigenvalues of the matrix A' * A. This code * is suitable for dense matrices. No optimizations are made for sparse matrices. * This routine calls the following routines. * * 1. DSPF_sp_convert_to_bidiag: converts A to bidiagonal matrix using Householder * transformations.
* 2. DSPF_sp_bidiag_to_diag: converts bidiagonal matrix to diagonal using Givens * transformations (works only for Nrows>=Ncols).
* 3. DSPF_sp_sort_singular_values: sorts singular values in descending order and * modifies U and V matrices accordingly.
* * If Nrows * 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_svd_cmplx(const int Nrows,const int Ncols,float *restrict A,float *restrict U,float *restrict V,float *restrict U1,float *restrict diag,float *restrict superdiag); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_svd_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_svd_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud.h -- C source interface header file for LUD */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud.h -- lower/upper decompostion */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_lud */ /** @ingroup DSPF_sp_lud */ /* @{ */ /** * This function decomposes the square matrix A into a lower triangular matrix L, * upper triangular matrix U, and a permutation matrix P where A=transpose(P)*L*U. * The band Gaussian elimination outer product algorithm is used. The permutation * matrix P keeps track of the reordering of rows in the A matrix such that the * first element of the permuted matrix is maximum and nonzero. The values stored * in the matrices are assumed to be single precision floating point values. This * code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param order = order of matrix A * @param A = pointer to matrix A[order*order] * @param L = pointer to lower triangular matrix L[order*order] * @param U = pointer to upper triangular matrix U[order*order] * @param P = pointer to permutation matrix P[order*order] * * * @par Algorithm: * DSPF_sp_lud_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays A, L, U, and P are stored in distinct arrays. In-place processing is not allowed.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_lud(const int order,float *restrict A,float *restrict L,float *restrict U,unsigned short *restrict P); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_lud.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_lud.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_bexp.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_bexp.h -- Block exponent of a vector */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MISC */ /* @{ */ /** @defgroup DSP_bexp */ /** @ingroup DSP_bexp */ /* @{ */ /** * The bexp function, performs a determination of the block * exponent of the vector of elements and returns the maximum * exponent. This information can then be used to re-normalize * the vector. This operation is useful when auto-scaling is * required as in a FFT. The bexp operation returns the minimum * norm of the vector. The minimum norm corresponds to the * maximum exponent. * * @param x = Input data array of integers * @param nx = Number of elements in the input data * * @par Algorithm: * DSP_bexp_cn.c is the natural C equivalent of the optimized intrinsic C code without restrictions * note that the intrinsic C code is optimized and restrictions may apply. * * @par Assumptions: * Arrays x and r cannot overlap.
* x must be double word alligned.
* nx is a multiple of 8.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ int DSP_bexp ( const int *x, /* Input data */ short nx /* Number of elements */ ); /* ======================================================================= */ /* End of file: DSP_bexp.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_bexp.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_ifft32x32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_ifft32x32.h -- 32x32 Mixed Radix Inverse FFT */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSP_ifft32x32 */ /** @ingroup DSP_ifft32x32 */ /* @{ */ /** * This routine computes an extended precision complex * inverse mixed radix FFT with rounding and digit reversal. * Input data x[ ], output data y[ ], and coefficients w[ ] * are 32-bit. The output is returned in the separate array * y[ ] in normal order. Each complex value is stored with * interleaved real and imaginary parts. * * @param ptr_w = input twiddle factors * @param npoints = number of points * @param ptr_x = transformed data reversed * @param ptr_y = linear transformed data * * @par Algorithm: * DSP_ifft32x32_cn.c is the natural C equivalent of the optimized intrinsic C code without * restrictions. Note that the intrinsic C code is optimized and restrictions may * apply. * * @par Assumptions: * In-place computation is not allowed.
* Size of FFT, nx, must be power of 2 and 16<=nx<=65536.
* The arrays for the complex input data x[], complex output data y[] * and twiddle factor w[] must be double word aligned.
* The input and output data are complex, with the real/imaginary * components stored in adjacent locations in the array. The real * components are stored at even array indices, and the imaginary * components are stored at odd array indices.
* * @par Implementation Notes: * @b Endian Support: * The intrinsic optimized C code supports both big and little endian modes.
* The linear assembly code supports little endian mode only.
* @b Interruptibility: The code is interruptible.
* */ void DSP_ifft32x32 ( const int * restrict ptr_w, int npoints, int * restrict ptr_x, int * restrict ptr_y ); /* ======================================================================== */ /* End of file: DSP_ifft32x32.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_ifft32x32.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_minval.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_minval.h -- Minimum Value of a Vector */ /* Intrisic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_minval */ /** @ingroup DSP_minval */ /* @{ */ /** * This routine finds the element with minimum value in the input * vector and returns that value. * * @param x = Pointer to input vector of size nx * @param nx = Length of input data vector. Must be multiple of 8 and >=32 * * @par Algorithm: * DSP_minval_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * nx must be a multiple of 8 and greater than or equal to 32.
* The input vector x[ ] must be double-word aligned.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ short DSP_minval ( const short * restrict x, /* x[nx] = input vector */ int nx /* nx = number of elements */ ); /* ======================================================================== */ /* End of file: DSP_minval.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_minval.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_fir_gen.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_fir_gen.h -- FIR Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSPF_sp_fir_gen */ /** @ingroup DSPF_sp_fir_gen */ /* @{ */ /** * This routine implements a block FIR filter. There are “nh” filter * coefficients, “nr” output samples, and “nh+nr-1” input samples. The * coefficients need to be placed in the “h” array in reverse order * {h(nh-1), ... , h(1), h(0)} and the array “x” starts at x(-nh+1) and * ends at x(nr-1). The routine calculates y(0) through y(nr-1) using * the following formula:
* y(n) = h(0)*x(n) + h(1)*x(n-1) + ... + h(nh-1)*x(n-nh+1)
* where n = {0, 1, ... , nr-1}.
* * @param x Pointer to array holding the input floating-point array * @param h Pointer to array holding the coefficient floating-point array * @param r Pointer to output array * @param nh Number of coefficents * @param nr Number of output values * * @par Algorithm: * DSPF_sp_fir_gen_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * nr is a multiple of 4 and greater than or equal to 4.
* nh is a multiple of 4 and greater than or equal to 4.
* x, h and r are double-word aligned.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_fir_gen(const float * restrict x, const float * restrict h, float * restrict r, int nh, int nr); /* ======================================================================= */ /* End of file: DSPF_sp_fir_gen.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_fir_gen.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_dotp_cplx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_dotp_cplx.h -- Complex Dot Product */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_dotp_cplx */ /** @ingroup DSPF_sp_dotp_cplx */ /* @{ */ /** * This routine calculates the dot product of 2 single-precision complex * float vectors. The even numbered locations hold the real parts of the * complex numbers while the odd numbered locations contain the imaginary * portions. * * @param x Pointer to array holding the first floating-point vector * @param y Pointer to array holding the second floating-point vector * @param nx Number of values in the x and y vectors * @param re Pointer to the location storing the real part of the result * @param im Pointer to the location storing the imaginary part of the result * * @par Algorithm: * DSPF_sp_dotp_cplx_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * Loop counter must be multiple of 4 and > 0.
* The x and y arrays must be double-word aligned.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_dotp_cplx(const float * x, const float * y, int nx, float * restrict re, float * restrict im); /* ======================================================================= */ /* End of file: DSPF_sp_dotp_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_dotp_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft32x32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft32x32.h -- 32x32 Mixed Radix FFT */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSP_fft32x32 */ /** @ingroup DSP_fft32x32 */ /* @{ */ /** * This routine computes an extended precision complex * forward mixed radix FFT with rounding and digit reversal. * Input data x[ ], output data y[ ], and coefficients w[ ] * are 32-bit. The output is returned in the separate array * y[ ] in normal order. Each complex value is stored with * interleaved real and imaginary parts. * * @param ptr_w = input twiddle factors * @param npoints = number of points * @param ptr_x = transformed data reversed * @param ptr_y = linear transformed data * * @par Algorithm: * DSP_fft32x32_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * In-place computation is not allowed.
* Size of FFT, nx, must be power of 2 and 16<=nx<=65536.
* The arrays for the complex input data x[], complex output data y[] * and twiddle factor w[] must be double word aligned.
* The input and output data are complex, with the real/imaginary * components stored in adjacent locations in the array. The real * components are stored at even array indices, and the imaginary * components are stored at odd array indices.
* Allowed maximum absolute value of input is 2^(32 - log2(nx)).
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_fft32x32 ( const int * restrict ptr_w, int npoints, int * restrict ptr_x, int * restrict ptr_y ); /* ======================================================================== */ /* End of file: DSP_fft32x32.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_fft32x32.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_sym.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_sym.h -- Symmetric FIR Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_fir_sym */ /** @ingroup DSP_fir_sym */ /* @{ */ /** * This function applies a symmetric filter to the input samples. * The filter tap array h[] provides ‘nh+1’ total filter taps. * The filter tap at h[nh] forms the center point of the filter. * The taps at h[nh - 1] through h[0] form a symmetric filter * about this central tap. The effective filter length is thus * 2*nh+1 taps. The filter is performed on 16-bit data with 16-bit * coefficients, accumulating intermediate results to 40-bit precision. * The accumulator is rounded and truncated according to the value * provided in ‘s’. This allows a variety of Q-points to be used. * * @param x = Input array [nr+2*nh elements] * @param h = Coeff array [nh+1 elements] * @param r = Output array [nr elements] * @param nh = Number of coefficients * @param nr = Number of output samples * @param s = Number of insignificant digits to truncate * e.g., 15 for Q.15 input data and coefficients * * @par Algorithm: * DSP_fir_sym_cn.c is the natural C equivalent of the optimized intrinsic C * code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * Arrays x, h, and r do not overlap.
* x, h and r must be double word aligned.
* nr >= 4; nr % 4 == 0.
* nh >= 4; nh % 4 == 0.
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes. * @b Interruptibility: The code is interruptible * */ void DSP_fir_sym ( const short *restrict x, /* Input samples */ const short *restrict h, /* Filter taps */ short *restrict r, /* Output samples */ int nh, /* Number of symmetric filter taps */ int nr, /* Number of output samples */ int s /* Final output shift */ ); /* ======================================================================= */ /* End of file: DSP_fir_sym.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fir_sym.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_mul_gemm_cplx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_mul_gemm_cplx.h -- Comeplex Matrix Multiply y = a*x1*x2+y */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_mat_mul_gemm_cplx */ /** @ingroup DSPF_sp_mat_mul_gemm_cplx */ /* @{ */ /** * This function computes the expression y = a*x1*x2+y. The column * dimension of x1 must match the row dimension of x2. * The values stored in the matrices are assumed to be double-precision * floating-point values. This code is suitable for * dense matrices. No optimizations are made for sparse matrices. * * @param x1 Pointer to r1 by c1 input matrix. * @param a Scalar value. * @param r1 Number of rows in x1. * @param c1 Number of columns in x1. Also number of rows in x2. * @param x2 Pointer to c1 by c2 input matrix. * @param c2 Number of columns in x2. * @param y Pointer to r1 by c2 output matrix. * * @par Algorithm: * DSPF_dp_mat_mul_gemm.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays x1, x2 and y are stored in distinct arrays. * That is, in-place processing is not allowed.
* r1, c2 are assumed to be even. c1 is assumed to be an interger multiple of 4.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSPF_sp_mat_mul_gemm_cplx(float *restrict x1, float const a, const int r1, const int c1, float *restrict x2, const int c2, float *restrict y); /* ======================================================================= */ /* End of file: DSPF_sp_mat_mul_gemm_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_mat_mul_gemm_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_mat_mul_gemm.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_mul.h -- Matrix Multiply "y = a*x1*x2+y" */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_mat_mul_gemm */ /** @ingroup DSPF_dp_mat_mul_gemm */ /* @{ */ /** * This function computes the expression y = a*x1*x2+y. The column * dimension of x1 must match the row dimension of x2. * The values stored in the matrices are assumed to be double-precision * floating-point values. This code is suitable for * dense matrices. No optimizations are made for sparse matrices. * * @param x1 = Pointer to r1 by c1 input matrix. * @param a = Scalar value. * @param r1 = Number of rows in x1. * @param c1 = Number of columns in x1. Also number of rows in x2. * @param x2 = Pointer to c1 by c2 input matrix. * @param c2 = Number of columns in x2. * @param y = Pointer to r1 by c2 output matrix. * * @par Algorithm: * DSPF_dp_mat_mul_gemm.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays x1, x2 and y are stored in distinct arrays. In-place processing is not allowed.
* r1, c1 and c2 are assumed to be even.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSPF_dp_mat_mul_gemm(double *x1, double const a, const int r1, const int c1, double *x2, const int c2, double *restrict y); /* ======================================================================= */ /* End of file: DSPF_dp_mat_mul_gemm.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_mat_mul_gemm.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_blk_eswap64.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_blk_eswap64.h -- Endian-swap a block of 64-bit values */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MISC */ /* @{ */ /** @defgroup DSP_blk_eswap64 */ /** @ingroup DSP_blk_eswap64 */ /* @{ */ /** * The data in the x[] array is endian swapped, meaning that the * byte-order of the bytes within each double-word of the r[] array * is reversed. This facilitates moving big-endian data to a * little-endian system or vice-versa. * When the r pointer is non-NULL, the endian-swap occurs out-of-place, * similar to a block move. When the r pointer is NULL, the endian-swap * occurs in-place, allowing the swap to occur without using any * additional storage. * * @param src = Source data, must be double-word aligned. * @param dst = Destination data, must be double-word aligned. * @param n_dbls = Number of 64-bit elements to swap. * * @par Algorithm: * DSP_blk_eswap64_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions note that the intrinsic C code * is optimized and restrictions may apply. * * @par Assumptions: * Input and output arrays do not overlap, except when “dst == NULL” so that * the operation occurs in-place.
* The input array and output array are double-word aligned.
* nx is a multiple of 2.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ void DSP_blk_eswap64 ( void *restrict src, void *restrict dst, int n_dbls ); /* ======================================================================== */ /* End of file: DSP_blk_eswap64.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_blk_eswap64.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r8_h8.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r8_h8.c -- FIR 8 Coefficient Filter (Radix 8) */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_fir_r8_h8 */ /** @ingroup DSP_fir_r8_h8 */ /* @{ */ /** * Computes a real FIR filter (direct-form) using 8 coefficients * stored in vector h. The real data input is stored in vector x. * The filter output result is stored in vector r. Input data and * filter taps are 16-bit, with intermediate values kept at 32-bit * precision. Filter taps are expected in Q15 format. * * @param x = Input array [nr+8-1 elements] * @param h = Coeff array [8 elements] * @param r = Output array [nr elements] * @param nr = Number of output samples * * @par Algorithm: * DSP_fir_r8_h8_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions. Note that the intrinsic C code * is optimized and restrictions may apply. * * @par Assumptions: * Arrays x, h, and r do not overlap.
* x, h and r must be double word aligned.
* nr >= 4; nr % 4 == 0.
* nh == 8.
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
*/ void DSP_fir_r8_h8 ( const short *restrict x, const short *restrict h, short *restrict r, int nr ); /* ======================================================================= */ /* End of file: DSP_fir_r8_h8.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fir_r8_h8.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_vecadd.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_vecadd.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_vecadd */ /** @ingroup DSPF_sp_vecadd */ /* @{ */ /** * This program performs a addition on a vector. * The result is stored in a vector. * * @param x = Input data array of float * @param y = Input data array of float * @param r = Output data array of float * @param nx = Number of elements in the arrays * * @par Algorithm: * DSPF_sp_vecadd_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions note that the intrinsic * C code is optimized and restrictions may apply. * * @par Assumptions: * Arrays x, y, r do not overlap
* nx is a multiple of 4 and >= 4
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
*/ void DSPF_sp_vecadd ( float * restrict x, /* Input array of length nx */ float * restrict y, /* Input array of length nx */ float * restrict r, /* Output array of length nx */ int nx /* Number of elements. */ ); /* ======================================================================== */ /* End of file: DSPF_sp_vecadd.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSPF_sp_vecadd.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_qrd_cmplx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_qrd_cmplx.h -- complex QR decompostion */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_qrd_cmplx */ /** @ingroup DSPF_sp_qrd_cmplx */ /* @{ */ /** * This function decomposes the rectangular complex matrix A into an orthogonal Q matrix and * an upper right triangular matrix R such that A=Q*R. The Householder algorithm is * used to zero columns below the diagonal in the original A matrix to produce the R * matrix. The Q matrix is generated during the process. The values stored in the * matrices are assumed to be float precision floating point values. This code is * suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows of matrix A * @param Ncols = number of columns of matrix A * @param A = pointer to matrix A[Nrows*2*Ncols] * @param Q = pointer to matrix Q[Nrows*2*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*2*Ncols] * @param u = pointer to temporary vector u[max(2*Nrows,2*Ncols)] * * * @par Algorithm: * DSPF_sp_qrd_complex_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays A, Q, R, and u are stored in distinct arrays. In-place processing is not done.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_qrd_cmplx(const int Nrows,const int Ncols,float *restrict A,float *restrict Q,float *restrict R,float *restrict u); /* @} */ /* ingroup */ /** @defgroup DSPF_sp_qrd_inverse */ /** @ingroup DSPF_sp_qrd_inverse */ /* @{ */ /** * This function processes an orthogonal matrix Q, and an upper triangular matrix R generated * by DSPF_sp_qrd_cmplx and generates the inverse of the A matrix where inv_A=inv(R)*inv(Q). * In place processing is performed on the R matrix such that its original contents are * modified. The values stored in the matrices are assumed to be float precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in matrix A * @param Ncols = number of columns in matrix A * @param Q = pointer to lower triangular matrix Q[Nrows*2*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*2*Ncols] * @param inv_A = pointer to inverse of matrix A[Nrows*Ncols] * * * @par Algorithm: * DSPF_sp_qrd_complex_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays Q, R, and inv_A are stored in distinct arrays. In-place processing of R is done.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_qrd_inverse_cmplx(const int Nrows,const int Ncols,float *restrict Q,float *restrict R,float *restrict inv_A); /* @} */ /* ingroup */ /** @defgroup DSPF_sp_qrd_solver */ /** @ingroup DSPF_sp_qrd_solver */ /* @{ */ /** * This function solves the system of linear equations A*x=b for x using the inputs produced by * DSPF_sp_qrd_cmplx where A*x=Q*R*x=b. The following procedure is performed. * * 1. Use matrix multiplication to generate y: y = transpose(Q)*b
* 2. Use backward substitution for solve for x: x = inv(R)*y
* * The values stored in the matrices are assumed to be float precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in matrix A * @param Ncols = number of columns in matrix A * @param Q = pointer to lower triangular matrix Q[Nrows*2*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*2*Ncols] * @param b = pointer to vector b[Nrows] * @param y = pointer to temporary vector y[Nrows] * @param x = pointer to final solver output vector x[Ncols] * * * @par Algorithm: * DSPF_sp_qrd_complex_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays P, L, U, and inv_A are stored in distinct arrays. In-place processing is not done.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_qrd_solver_cmplx(const int Nrows,const int Ncols,float *restrict Q,float *restrict R,float *restrict b,float *restrict y,float *restrict x); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_qrd_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_qrd_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_fircirc.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_fircirc.h -- Circular FIR Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSPF_sp_fircirc */ /** @ingroup DSPF_sp_fircirc */ /* @{ */ /** * This routine implements a circularly addressed FIR filter. ‘nh’ is the * number of filter coefficients. ‘nr’ is the number of the output samples. * * @param x[] Input array (circular buffer of 2^(csize+1) bytes). * @param h[nh] Filter coefficients array. Must be double-word aligned. * @param y[ny] Output array * @param index Offset by which to start reading from the input array. * @param csize Size of circular buffer x[] is 2^(csize+1) bytes. * @param nh Number of filter coefficients. * @param ny Number of output samples * * @par Algorithm: * DSPF_sp_fircirc_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * The circular input buffer x[] must be aligned at a 2^(csize+1) byte boundary.
* h and y must be aligned at double word boundary.
* csize must lie in the range 2 <= csize <= 31.
* The number of coefficients (nh) must be a multiple of 2 and >= 2.
* The number of outputs (nr) must be a multiple of 4 and >= 4.
* The 'index' (offset to start reading input array) must be mutiple of 2.
* The coefficient array is assured to be in reverse order; i.e., h(nh-1) to h(0).
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_fircirc(const float *x, float *h, float *restrict y, int index, int csize, int nh, int ny); /* ======================================================================= */ /* End of file: DSPF_sp_fircirc.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_fircirc.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_qrd.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_qrd.h -- QR decompostion */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_qrd */ /** @ingroup DSPF_dp_qrd */ /* @{ */ /** * This function decomposes the rectangular matrix A into an orthogonal Q matrix and * an upper right triangular matrix R such that A=Q*R. The Householder algorithm is * used to zero columns below the diagonal in the original A matrix to produce the R * matrix. The Q matrix is generated during the process. The values stored in the * matrices are assumed to be double precision floating point values. This code is * suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows of matrix A * @param Ncols = number of columns of matrix A * @param A = pointer to matrix A[Nrows*Ncols] * @param Q = pointer to matrix Q[Nrows*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*Ncols] * @param u = pointer to temporary vector u[max(Nrows,Ncols)] * * * @par Algorithm: * DSPF_dp_qrd_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays A, Q, R, and u are stored in distinct arrays. In-place processing is not done.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_qrd(const int Nrows,const int Ncols,double *restrict A,double *restrict Q, double *restrict R,double *restrict u); /* @} */ /* ingroup */ /** @defgroup DSPF_dp_qrd_inverse */ /** @ingroup DSPF_dp_qrd_inverse */ /* @{ */ /** * This function processes an orthogonal matrix Q, and an upper triangular matrix R generated * by DSPF_dp_qrd and generates the inverse of the A matrix where inv_A=inv(R)*inv(Q). * In place processing is performed on the R matrix such that its original contents are * modified. The values stored in the matrices are assumed to be double precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in matrix A * @param Ncols = number of columns in matrix A * @param Q = pointer to lower triangular matrix Q[Nrows*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*Ncols] * @param inv_A = pointer to inverse of matrix A[Nrows*Ncols] * * * @par Algorithm: * DSPF_dp_qrd_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays Q, R, and inv_A are stored in distinct arrays. In-place processing of R is done.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_qrd_inverse(const int Nrows,const int Ncols,double *restrict Q, double *restrict R,double *restrict inv_A); /* @} */ /* ingroup */ /** @defgroup DSPF_dp_qrd_solver */ /** @ingroup DSPF_dp_qrd_solver */ /* @{ */ /** * This function solves the system of linear equations A*x=b for x using the inputs produced by * DSPF_dp_qrd where A*x=Q*R*x=b. The following procedure is performed. * * 1. Use matrix multiplication to generate y: y = transpose(Q)*b
* 2. Use backward substitution for solve for x: x = inv(R)*y
* * The values stored in the matrices are assumed to be double precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in matrix A * @param Ncols = number of columns in matrix A * @param Q = pointer to lower triangular matrix Q[Nrows*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*Ncols] * @param b = pointer to vector b[Nrows] * @param y = pointer to temporary vector y[Nrows] * @param x = pointer to final solver output vector x[Ncols] * * * @par Algorithm: * DSPF_dp_qrd_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays P, L, U, and inv_A are stored in distinct arrays. In-place processing is not done.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_qrd_solver(const int Nrows,const int Ncols,double *restrict Q, double *restrict R,double *restrict b,double *restrict y, double *restrict x); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_qrd.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_qrd.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_ifft16x32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_ifft16x32.h -- 16x32 Mixed Radix Inverse FFT */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSP_ifft16x32 */ /** @ingroup DSP_ifft16x32 */ /* @{ */ /** * This routine computes an extended precision complex * inverse mixed radix FFT with rounding and digit reversal. * Input data x[ ] and output data y[ ] are 32-bit, coefficients * w[ ] are 16-bit. The output is returned in the separate array * y[ ] in normal order. Each complex value is stored with * interleaved real and imaginary parts. * * @param ptr_w = input twiddle factors * @param npoints = number of points * @param ptr_x = transformed data reversed * @param ptr_y = linear transformed data * * @par Algorithm: * DSP_ifft16x32_cn.c is the natural C equivalent of the optimized intrinsic C code without * restrictions. Note that the intrinsic C code is optimized and restrictions may * apply. * * @par Assumptions: * In-place computation is not allowed.
* Size of FFT, nx, must be power of 2 and 16<=nx<=65536.
* The arrays for the complex input data x[], complex output data y[] * and twiddle factor w[] must be double word aligned.
* The input and output data are complex, with the real/imaginary * components stored in adjacent locations in the array. The real * components are stored at even array indices, and the imaginary * components are stored at odd array indices.
* * @par Implementation Notes: * @b Endian Support: * The intrinsic optimized C code supports both big and little endian modes.
* The linear assembly code supports little endian mode only.
* @b Interruptibility: The code is interruptible.
* */ void DSP_ifft16x32 ( const short * restrict ptr_w, int npoints, int * restrict ptr_x, int * restrict ptr_y ); /* ======================================================================== */ /* End of file: DSP_ifft16x32.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_ifft16x32.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_iir_ss.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_iir_ss.h -- IIR Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_iir_ss */ /** @ingroup DSP_iir_ss */ /* @{ */ /** * This function implements an IIR filter, with a number of biquad * stages given by nCoefs / 4. It accepts a single sample of * input and returns a single sample of output. Coefficients are * expected to be in the range [-2.0, 2.0) with Q14 precision. * * @param Input = Single sample input * @param Coefs = Coefficients with Q14 precision * @param nCoefs = Number of coefficients * @param State = State * * @par Algorithm: * DSP_iir_ss_cn.c is the natural C equivalent of the optimized intrinsic C code without * restrictions. Note that the intrinsic C code is optimized and restrictions may * apply. * * @par Assumptions: * Coefs and State are double word aligned.
* nCoefs is a multiple of 4 and >= 4.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ short DSP_iir_ss ( short Input, const short *restrict Coefs, int nCoefs, short *restrict State ); /* ======================================================================= */ /* End of file: DSP_iir_ss.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_iir_ss.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft16x16_imre.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft16x16_imre.h -- 16x16 Mixed Radix FFT */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSP_fft16x16_imre */ /** @ingroup DSP_fft16x16_imre */ /* @{ */ /** * This routine computes a complex forward mixed radix FFT * with rounding and digit reversal. Input data x[ ], output * data y[ ], and coefficients w[ ] are 16-bit. The output is * returned in the separate array y[ ] in normal order. Each complex * value is stored with interleaved imaginary and real parts. * * @param ptr_w = input twiddle factors * @param npoints = number of points * @param ptr_x = transformed data reversed * @param ptr_y = linear transformed data * * @par Algorithm: * DSP_fft16x16_imre_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * In-place computation is not allowed.
* Size of FFT, nx, must be power of 2 and 16<=nx<=65536.
* The arrays for the complex input data x[], complex output data y[] * and twiddle factor w[] must be double word aligned.
* The input and output data are complex, with the imaginary/real * components stored in adjacent locations in the array. The imaginary * components are stored at even array indices, and the real components are * stored at odd array indices.
* All data are in short precision or Q.15 format. Allowed maximum absolute * value of input is 2^(16 - log2(nx)).
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_fft16x16_imre ( const short * restrict ptr_w, int npoints, short * restrict ptr_x, short * restrict ptr_y ); /* ======================================================================== */ /* End of file: fft16x16_imre.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_fft16x16_imre.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_vecmul.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_vecmul.h -- Vector Multiply */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_vecmul */ /** @ingroup DSPF_sp_vecmul */ /* @{ */ /** * This routine performs an element by element floating-point multiply of the vectors * x1[] and x2[] and returns the values in y[]. * * @param x1 Pointer to first input array. * @param x2 Pointer to second input array. * @param y Pointer to output array. * @param nx Number of elements in arrays. * * @par Algorithm: * DSPF_sp_vecmul_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * The x1, x2 and y arrays must be double-word aligned
* nx is a multiple of 4 and >= 4
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_vecmul(const float * x1, const float * x2, float *restrict y, const int nx); /* ======================================================================= */ /* End of file: DSPF_sp_vecmul.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_vecmul.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_ifftSPxSP.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* TEXAS INSTRUMENTS, INC. */ /* */ /* NAME */ /* DSPF_sp_ifftSPXSP.h -- Optimized Implementation */ /* */ /* USAGE */ /* single precision floating point Forward FFT with mixed radix */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSPF_sp_ifftSPXSP */ /** @ingroup DSPF_sp_ifftSPXSP */ /* @{ */ /** * The benchmark performs a mixed radix inverse fft. * * @param N length of FFT in complex samples * @param ptr_x pointer to complex data input * @param ptr_w pointer to complex twiddle factor * @param ptr_y pointer to complex output data * @param brev pointer to bit reverse table containing 64 entries * @param n_min should be 4 if N can be represented as Power of 4 else, n_min should be 2 * @param offset index in complex samples of sub-fft from start of main fft * @param n_max size of main fft in complex samples * * @par Algorithm: * DSPF_sp_ifftSPxSP_cn.c is the natural C equivalent of the optimized linear assembly code without * restrictions. Note that the linear assembly code is optimized and restrictions may * apply. * * @par Assumptions: * N needs to be power of 2
* 8 <= N <= 131072, 32 <= N for linear assembly implementation
* Arrays pointed by ptr_x, ptr_w, and ptr_y should not overlap
* Arrays pointed by ptr_x, ptr_w, and ptr_y should align on the double words boundary
* * @par Implementation Notes: * @b Interruptibility: The code is interrupt-tolerant but not interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_ifftSPxSP (int N, float *ptr_x, float *ptr_w, float *ptr_y, unsigned char *brev, int n_min, int offset, int n_max); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_ifftSPxSP.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud.h -- interface header file for LUD double precision */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud.h -- lower/upper decompostion */ /* optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_lud */ /** @ingroup DSPF_dp_lud */ /* @{ */ /** * This function decomposes the square matrix A into a lower triangular matrix L, * upper triangular matrix U, and a permutation matrix P where A=transpose(P)*L*U. * The band Gaussian elimination outer product algorithm is used. The permutation * matrix P keeps track of the reordering of rows in the A matrix such that the * first element of the permuted matrix is maximum and nonzero. The values stored * in the matrices are assumed to be double precision floating point values. This * code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param order = order of matrix A * @param A = pointer to matrix A[order*order] * @param L = pointer to lower triangular matrix L[order*order] * @param U = pointer to upper triangular matrix U[order*order] * @param P = pointer to permutation matrix P[order*order] * * * @par Algorithm: * DSPF_dp_lud_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays A, L, U, and P are stored in distinct arrays. In-place processing is not allowed.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_lud(const int order,double *restrict A,double *restrict L,double *restrict U,unsigned short *restrict P); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_lud.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_lud.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_bitrev_cplx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_bitrev_cplx.h -- Complex Bit Reversal */ /* Assembly Implementation */ /* */ /* Rev 0.0.2 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSPF_sp_bitrev_cplx */ /** @ingroup DSPF_sp_bitrev_cplx */ /* @{ */ /** * This routine performs the bit-reversal of the input array x[], where x[] is a float * array of length 2*nx containing single-precision floating-point complex pairs of * data. This routine requires the index array provided by the program below. This * index should be generated at compile time, not by the DSP. TI retains all rights, * title and interest in this code and only authorizes the use of the bit-reversal * code and related table generation code with TMS320 family DSPs manufactured * by TI. * * @param x Complex input array to be bit reversed. Contains 2*nx floats * @param index Array of size ~sqrt(nx) created by the routine bitrev_index to allow the fast implementation of the bit reversal * @param nx Number of elements in array x[] * * @par Algorithm: * DSPF_sp_bitrev_cplx_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * nx must be a power of 2.
* The table from bitrev_index is already created.
* The array x is actually an array of 2*nx floats.
* Array x is assumed to be double word aligned.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_bitrev_cplx (double *restrict x, short *restrict index, int nx); /* ======================================================================= */ /* End of file: DSPF_sp_bitrev_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_bitrev_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud_sol.h -- interface header file for linear solver by LUD */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud_sol.h -- Linear equation solver by LUD */ /* optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_lud_sol.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_sol.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_dotp_sqr.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_dotp_sqr.h -- Vector Dot Product and Square implementation */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_dotp_sqr */ /** @ingroup DSP_dotp_sqr */ /* @{ */ /** * This routine performs an nx element dot product of x[ ] and y[ ] * and stores it in r. It also squares each element of y[ ] and * accumulates it in G. This computation of G is used in the VSELP coder. * * @param G = Calculated value of G (used in the VSELP coder) * @param x = First vector array * @param y = Second vector array * @param r = Result of vector dot product of x and y * @param nx = Number of elements * * @par Algorithm: * DSP_dotp_sqr_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * nx must be a multiple of 4 and greater than or equal to 12.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ int DSP_dotp_sqr ( int G, /* Sum-of-y-squared initial value */ const short *x, /* First input array */ const short *y, /* Second input array. */ int *restrict r, /* Accumulation of x[] * y[]. */ int nx /* Length of the input vector. */ ); /* ======================================================================== */ /* End of file: DSP_dotp_sqr.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_dotp_sqr.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_qrd.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_qrd.h -- QR decomposition single precision */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_qrd */ /** @ingroup DSPF_sp_qrd */ /* @{ */ /** * This function decomposes the rectangular matrix A into an orthogonal Q matrix and * an upper right triangular matrix R such that A=Q*R. The Householder algorithm is * used to zero columns below the diagonal in the original A matrix to produce the R * matrix. The Q matrix is generated during the process. The values stored in the * matrices are assumed to be single precision floating point values. This code is * suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows of matrix A * @param Ncols = number of columns of matrix A * @param A = pointer to matrix A[Nrows*Ncols] * @param Q = pointer to matrix Q[Nrows*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*Ncols] * @param u = pointer to temporary vector u[max(Nrows,Ncols)] * * * @par Algorithm: * DSPF_sp_qrd_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays A, Q, R, u, and Q1 are stored in distinct arrays. In-place processing is not done.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_qrd(const int Nrows,const int Ncols,float *restrict A,float *restrict Q,float *restrict R,float *restrict u); /* @} */ /* ingroup */ /** @defgroup DSPF_sp_qrd_inverse */ /** @ingroup DSPF_sp_qrd_inverse */ /* @{ */ /** * This function processes an orthogonal matrix Q, and an upper triangular matrix R generated * by DSPF_sp_qrd and generates the inverse of the A matrix where inv_A=inv(R)*inv(Q). * In place processing is performed on the R matrix such that its original contents are * modified. The values stored in the matrices are assumed to be single precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in matrix A * @param Ncols = number of columns in matrix A * @param Q = pointer to lower triangular matrix Q[Nrows*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*Ncols] * @param inv_A = pointer to inverse of matrix A[Nrows*Ncols] * * * @par Algorithm: * DSPF_sp_qrd_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays Q, R, and inv_A are stored in distinct arrays. In-place processing of R is done.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_qrd_inverse(const int Nrows,const int Ncols,float *restrict Q,float *restrict R,float *restrict inv_A); /* @} */ /* ingroup */ /** @defgroup DSPF_sp_qrd_solver */ /** @ingroup DSPF_sp_qrd_solver */ /* @{ */ /** * This function solves the system of linear equations A*x=b for x using the inputs produced by * DSPF_sp_qrd where A*x=Q*R*x=b. The following procedure is performed. * * 1. Use matrix multiplication to generate y: y = transpose(Q)*b
* 2. Use backward substitution for solve for x: x = inv(R)*y
* * * The values stored in the matrices are assumed to be single precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in matrix A * @param Ncols = number of columns in matrix A * @param Q = pointer to lower triangular matrix Q[Nrows*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*Ncols] * @param b = pointer to vector b[Nrows] * @param y = pointer to temporary vector y[Nrows] * @param x = pointer to final solver output vector x[Ncols] * * * @par Algorithm: * DSPF_sp_qrd_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays P, L, U, and inv_A are stored in distinct arrays. In-place processing is not done.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_qrd_solver(const int Nrows,const int Ncols,float *restrict Q,float *restrict R,float *restrict b,float *restrict y,float *restrict x); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_qrd.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_qrd.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_mat_submat_copy.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_mat_submat_copy.h -- Sub-Matrix Copy */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_mat_submat_copy */ /** @ingroup DSPF_dp_mat_submat_copy */ /* @{ */ /** * If dir = 0, this function copies n rows starting from st row of matrix x to form matrix y; * If dir != 0, this function copies n rows of y to matrix x; * The values stored in x and y is double-precision floating values. * * @param x Pointer to r1 by c1 input matrix. * @param rows Number of rows in x. * @param cols Number of columns in x. * @param st start index of rows in x to be copied. * @param n Number of rows to be copied. * @param y Pointer to the output matrix. * @param dir data flow direction. * * @par Algorithm: * DSPF_dp_mat_submat_copy_cn.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays x and y are stored in distinct arrays. In-place processing is not allowed.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSPF_dp_mat_submat_copy(double *restrict x, int rows, int cols, int st, int n, double *restrict y, int dir); /* ======================================================================= */ /* End of file: DSPF_dp_mat_submat_copy.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_mat_submat_copy.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud_inv.h -- interface header file for matrix inversion by LUD */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud_inv.h -- matrix inversion by LUD */ /* optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_lud_inv.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_inv.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_neg32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_neg32.h -- Intrinsic C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_neg32 */ /** @ingroup DSP_neg32 */ /* @{ */ /** * This function negates the elements of a vector (32-bit elements). * The input and output arrays must not be overlapped except for where * the input and output pointers are exactly equal * * @param x = Pointer to input data vector of size nx with 32-bit elements * @param r = Pointer to output data vector of size nx with 32-bit elements * @param nx = Number of elements of input and output vectors * * @par Algorithm: * DSP_neg32_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * nx must be a multiple of 4 and greater than or equal to 4.
* The arrays x[ ] and r[ ] must be double-word aligned.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_neg32 ( const int * restrict x, /* Input data array */ int * restrict r, /* Output data array */ int nx /* Number of elements */ ); /* ======================================================================== */ /* End of file: dsp_neg32.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_neg32.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_ifftSPxSP_c2r.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* TEXAS INSTRUMENTS, INC. */ /* */ /* NAME */ /* DSPF_sp_ifftSPXSP_c2r.h -- Optimized Implementation */ /* */ /* USAGE */ /* single precision floating point Forward FFT with mixed radix */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSPF_sp_ifftSPXSP_c2r */ /** @ingroup DSPF_sp_ifftSPXSP_c2r */ /* @{ */ /** * The benchmark performs a mixed radix inverse fft. * * @param N length of FFT in complex samples * @param ptr_x pointer to complex data input * @param ptr_w pointer to complex twiddle factor * @param ptr_y pointer to real output data * @param brev pointer to bit reverse table containing 64 entries * @param n_min should be 4 if N can be represented as Power of 4 else, n_min should be 2 * @param offset index in complex samples of sub-fft from start of main fft * @param n_max size of main fft in complex samples * * @par Algorithm: * DSPF_sp_ifftSPxSP_c2r_cn.c is the natural C equivalent of the optimized linear assembly code without * restrictions. Note that the linear assembly code is optimized and restrictions may * apply. * * @par Assumptions: * N needs to be power of 2
* 8 <= N <= 131072
* Arrays pointed by ptr_x, ptr_w, and ptr_y should not overlap
* Arrays pointed by ptr_x, ptr_w, and ptr_y should align on the double words boundary
* * @par Implementation Notes: * @b Interruptibility: The code is interrupt-tolerant but not interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_ifftSPxSP_c2r (int N, float *ptr_x, float *ptr_w, float *ptr_y, unsigned char *brev, int n_min, int offset, int n_max); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_ifftSPxSP_c2r.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_maxval.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_maxval.h -- Maximum Value of a Vector */ /* Intrinsic C source */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_maxval */ /** @ingroup DSP_maxval */ /* @{ */ /** * This routine finds the element with maximum value in the input * vector and returns that value. * * @param x = Pointer to input vector of size nx * @param nx = Length of input data vector. Must be multiple of 8 and >=32 * * @par Algorithm: * DSP_maxval_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * nx must be a multiple of 8 and greater than or equal to 32.
* The input vector x[ ] must be double-word aligned.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ short DSP_maxval ( const short * restrict x, /* x[nx] = input vector */ int nx /* nx = number of elements */ ); /* ======================================================================== */ /* End of file: DSP_maxval.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_maxval.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_nrand.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_nrand.c -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima */ /* University and The University of Tokyo. All rights reserved. */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_nrand */ /** @ingroup DSPF_sp_nrand */ /* @{ */ /** * This function is used to fill an array with Gaussian normal distributed * random numbers.These numbers are distributed assuming mean (mu) = 0 and * standard deviation (sigma) = 1. * * The output vector can be modified for an arbitrary mu and sigma by * adding its contents by the desired value of mu and multiplying its * contents by the desired value of sigma respectively as shown in the * histogram below. * * @param size The size of the array to be filled. * * @param vector The array of type @b float which the user wants * to fill with random values. * * @param state The array which was initialized with the * "DSP_urand32_init" function and maintained (but NEVER modified) by * the user between subsequent calls to this function. * * @par Algorithm: * The RNG utilizes the Tiny Mersene Twister (TinyMT) as its underlying RNG * and an optimized version of George Marsaglia's Ziggurat algorithm as a * wrapper RNG to generate a Gaussian normal distribution from the uniformly * distributed TinyMT. * * @par Assumptions: * The user has previously called the "DSP_urand32_init" * function at least once, has maintained the state array, and allocated * an array of @b float types of the desired width. * * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is not interruptible.
* * @image html DSPF_sp_nrand_histogram.png */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ void DSPF_sp_nrand(int size, float *vector, void *state); /* ======================================================================== */ /* End of file: DSPF_sp_nrand.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSPF_sp_nrand.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_vecsum_sq.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_vecsum_sq.h -- Vector Sum Squared */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_vecsum_sq */ /** @ingroup DSPF_sp_vecsum_sq */ /* @{ */ /** * This routine performs a sum of squares of the elements of the array x and returns the sum. * * @param x Pointer to input array. * @param nx Number of elements in arrays. * * @par Algorithm: * DSPF_sp_vecsum_sq_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * The x array must be double-word aligned
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ float DSPF_sp_vecsum_sq(const float * x, const int nx); /* ======================================================================= */ /* End of file: DSPF_sp_vecsum_sq.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_vecsum_sq.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_fir_cplx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_fir_cplx.h -- Complex FIR Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSPF_sp_fir_cplx */ /** @ingroup DSPF_sp_fir_cplx */ /* @{ */ /** * This function implements the FIR filter for complex input data. * The filter has nr output samples and nh coefficients. Each array * consists of an even and odd term with even terms representing the * real part and the odd terms the imaginary part of the element. * The coefficients are expected in normal order. * * @param x[2*(nr+nh-1)] Pointer to complex input array. * The input data pointer x must point to * the (nh)th complex element. * @param h[2*nh] Pointer to complex coefficient array. * @param r[2*nr] Pointer to complex output array. * @param nh Number of complex coefficients in vector h. * @param nr Number of complex output samples to calculate. * * @par Algorithm: * DSPF_sp_fir_cplx_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * nr is a multiple of 4 and greater than or equal to 4.
* nh is a multiple of 2 and greater than or equal to 2.
* x, h and r are double-word aligned.
* x points to 2*(nh-1)th input element.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_fir_cplx(const float * x, const float * h, float * restrict y, int nh, int nr); /* ======================================================================= */ /* End of file: DSPF_sp_fir_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_fir_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft16x16r.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft16x16r.h -- 16x16r Mixed Radix FFT */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSP_fft16x16r */ /** @ingroup DSP_fft16x16r */ /* @{ */ /** * This routine implements a complex forward mixed radix FFT * with scaling, rounding and digit reversal. Input data x[ ], * output data y[ ], and coefficients w[ ] are 16-bit. The output * is returned in the separate array y[ ] in normal order. Each * complex value is stored as interleaved 16-bit real and imaginary * parts. * * @param n = length of fft in complex samples * @param ptr_x = pointer to complex data input * @param ptr_w = pointer to complex twiddle factor * @param ptr_y = pointer to complex data output * @param radix = smallest fft butterfly used in computation * @param offset = index in complex samples of sub-fft from start of main fft * @param n_max = size of main fft in complex samples * * @par Algorithm: * DSP_fft16x16r_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * In-place computation is not allowed.
* Size of FFT, nx, must be power of 2 and 16<=nx<=65536.
* The arrays for the complex input data x[], complex output data y[] * and twiddle factor w[] must be double word aligned.
* The input and output data are complex, with the real/imaginary * components stored in adjacent locations in the array. The real * components are stored at even array indices, and the imaginary * components are stored at odd array indices.
* All data are in short precision or Q.15 format. Allowed maximum absolute * value of input is 2^(16 - (log2(nx)-ceil[log4(nx)-1])).
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_fft16x16r ( int n, short * restrict ptr_x, const short * restrict ptr_w, short * restrict ptr_y, int radix, int offset, int n_max ); /* ======================================================================== */ /* End of file: DSP_fft16x16r.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_fft16x16r.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_convol.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_convol.h -- Convolution */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup CORRELATION */ /* @{ */ /** @defgroup DSPF_sp_convol */ /** @ingroup DSPF_sp_convol */ /* @{ */ /** * This function calculates the full-length convolution of real vectors * x and h using time-domain techniques. The result is placed in real * vector y. It is assumed that input vector x is padded with nh-1 no of * zeros in the beginning and end. * * @param x Pointer to real input vector of size = nr+nh-1. * @param h pointer to real input vector of size nh in forward order. * @param y Pointer to real output vector of size ny. * @param nh Number of elements in vector h. * @param ny Number of elements in vector y. * * @par Algorithm: * DSPF_sp_convol_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * nh is a multiple of 2 and greater than or equal to 4.
* ny is a multiple of 4.
* x, h and y are assumed to be aligned on a double-word boundary.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_convol(const float *x, const float *h, float *restrict y, const short nh, const short ny); /* ======================================================================= */ /* End of file: DSPF_sp_convol.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_convol.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud_inv.h -- C source interface header file for LUD inversion */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud_inv.h -- matrix inversion by LUD */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_lud_inverse */ /** @ingroup DSPF_sp_lud_inverse */ /* @{ */ /** * This function processes a permutation matrix P, a lower triangular matrix L, and an upper triangular * matrix U generated by DSPF_sp_lud_inv and generates the inverse of the A matrix where inv_A=inv(U)*inv(L)*P. * In place processing is performed on the L and U matrices such that their original contents are * modified. The values stored in the matrices are assumed to be single precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param order = order of matrix A * @param P = pointer to permutation matrix P[order*order] * @param L = pointer to lower triangular matrix L[order*order] * @param U = pointer to upper triangular matrix U[order*order] * @param inv_A = pointer to inverse of A matrix[order*order] * * * @par Algorithm: * DSPF_sp_lud_inverse.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays P, L, U, and inv_A are stored in distinct arrays. In-place processing of L and U is done.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_lud_inverse(const int order,unsigned short *restrict P,float *restrict L,float *restrict U,float *restrict inv_A); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_inv.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_inv.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud_inv_cmplx.h - C source interface header file for complex */ /* matrix inversion by LUD, single precision */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_lud_inv_cmplx.h - complex matrix inversion by LUD single precision */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_lud_inverse_cmplx */ /** @ingroup DSPF_sp_lud_inverse_cmplx */ /* @{ */ /** * This function processes a permutation matrix P, a lower triangular matrix L, and an upper triangular * matrix U generated by DSPF_sp_lud and generates the inverse of the A matrix where inv_A=inv(U)*inv(L)*P. * In place processing is performed on the L and U matrices such that their original contents are * modified. The values stored in the matrices are assumed to be float precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in square complex matrix A * @param P = pointer to permutation matrix P[2*Nrows*Nrows] * @param L = pointer to lower triangular matrix L[2*Nrows*Nrows] * @param U = pointer to upper triangular matrix U[2*Nrows*Nrows] * @param inv_A = pointer to inverse of A matrix[2*Nrows*Nrows] * * * @par Algorithm: * DSPF_sp_lud_inverse.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays P, L, U, and inv_A are stored in distinct arrays. In-place processing of L and U is done.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_sp_lud_inverse_cmplx(const int order,unsigned short *restrict P,float *restrict L,float *restrict U,float *restrict inv_A); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_inv_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_lud_inv_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_gen.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_gen.h -- FIR Filter (General) */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_fir_gen */ /** @ingroup DSP_fir_gen */ /* @{ */ /** * Computes a real FIR filter (direct-form) using coefficients * stored in vector h. The real data input is stored in vector x. * The filter output result is stored in vector r. Input data and * filter taps are 16-bit, with intermediate values kept at 32-bit * precision. Filter taps are expected in Q15 format. * * @param x = Input array [nr+nh-1 elements] * @param h = Coeff array [nh elements] * @param r = Output array [nr elements] * @param nh = Number of coefficients * @param nr = Number of output samples * * @par Algorithm: * DSP_fir_gen_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * Arrays x, h, and r do not overlap.
* nr >= 4; nr % 4 == 0.
* x, h and r must be double word aligned.
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes. * @b Interruptibility: The code is interruptible */ void DSP_fir_gen ( const short *restrict x, /* Input array [nr+nh-1 elements] */ const short *restrict h, /* Coeff array [nh elements] */ short *restrict r, /* Output array [nr elements] */ int nh, /* Number of coefficients */ int nr /* Number of output samples */ ); /* ======================================================================= */ /* End of file: DSP_fir_gen.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fir_gen.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_maxidx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_maxidx.h -- Maximum Vector Value */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_maxidx */ /** @ingroup DSP_maxidx */ /* @{ */ /** * This routine finds the max value of a vector and returns the * index of that value. The input array is treated as 16 separate * columns that are interleaved throughout the array. If values in * different columns are equal to the maximum value, then the * element in the leftmost column is returned. If two values within * a column are equal to the maximum, then the one with the lower * index is returned. Column takes precedence over index. * return int Index for vector element with maximum value. * * @param x = Pointer to input vector of size nx. Must be double-word aligned * @param nx = Length of input data vector. Must be multiple of 16 and >=48 * * @par Algorithm: * DSP_maxidx_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * nx must be a multiple of 16 and greater than or equal to 32.
* The input vector x[ ] must be double-word aligned.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes..
* @b Interruptibility: The code is interruptible..
* */ int DSP_maxidx ( const short *x, int nx ); /* ======================================================================== */ /* End of file: DSP_maxidx.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_maxidx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_ifft16x16_imre.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_ifft16x16_imre.h -- 16x16 Mixed Radix Inverse FFT */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSP_ifft16x16_imre */ /** @ingroup DSP_ifft16x16_imre */ /* @{ */ /** * This routine computes a complex inverse mixed radix * IFFT with rounding and digit reversal. Input data x[ ], * output data y[ ], and coefficients w[ ] are 16-bit. * The output is returned in the separate array y[ ] in * normal order. Each complex value is stored with * interleaved imaginary and real parts. * * @param ptr_w = input twiddle factors * @param npoints = number of points * @param ptr_x = transformed data reversed * @param ptr_y = linear transformed data * * @par Algorithm: * DSP_ifft16x16_imre_cn.c is the natural C equivalent of the optimized intrinsic * C code without * restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * In-place computation is not allowed.
* Size of FFT, nx, must be power of 2 and 16<=nx<=65536.
* The arrays for the complex input data x[], complex output data y[] * and twiddle factor w[] must be double word aligned.
* The input and output data are complex, with the imaginary/real * components stored in adjacent locations in the array. The * imaginary components are stored at even array indices, and * the real components are stored at odd array indices.
* * @par Implementation Notes: * @b Endian Support: * The intrinsic optimized C code supports both big and little endian modes.
* The linear assembly code supports little endian mode only.
* @b Interruptibility: The code is interruptible.
* */ void DSP_ifft16x16_imre ( const short * restrict ptr_w, int npoints, short * restrict ptr_x, short * restrict ptr_y ); /* ======================================================================== */ /* End of file: DSP_ifft16x16_imre.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_ifft16x16_imre.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_fftSPxSP_r2c.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* TEXAS INSTRUMENTS, INC. */ /* */ /* NAME */ /* DSPF_sp_fftSPXSP_r2c.c -- Optimized C Implementation */ /* */ /* USAGE */ /* single precision floating point Forward FFT with mixed radix */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* TEXAS INSTRUMENTS, INC. */ /* */ /* NAME */ /* DSPF_sp_fftSPXSP.sa -- Optimized linear assembly Implementation */ /* */ /* USAGE */ /* single precision floating point Forward FFT with mixed radix */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSPF_sp_fftSPXSP */ /** @ingroup DSPF_sp_fftSPXSP */ /* @{ */ /** * The benchmark performs a mixed radix forwards fft. * * @param N length of FFT in complex samples * @param ptr_x pointer to complex data input * @param ptr_w pointer to complex twiddle factor * @param ptr_y pointer to complex output data * @param brev pointer to bit reverse table containing 64 entries * @param n_min should be 4 if N can be represented as Power of 4 else, n_min should be 2 * @param offset index in complex samples of sub-fft from start of main fft * @param n_max size of main fft in complex samples * * @par Algorithm: * DSPF_sp_fftSPxSP_cn.c is the natural C equivalent of the optimized linear assembly code without * restrictions. Note that the linear assembly code is optimized and restrictions may * apply. * * @par Assumptions: * N needs to be power of 2
* 8 <= N <= 131072, 32 <= N for linear assembly implementation
* Arrays pointed by ptr_x, ptr_w, and ptr_y should not overlap
* Arrays pointed by ptr_x, ptr_w, and ptr_y should align on the double words boundary
* * @par Implementation Notes: * @b Interruptibility: The code is interrupt-tolerant but not interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_fftSPxSP(int N, float *ptr_x, float *ptr_w, float *ptr_y, unsigned char *brev, int n_min, int offset, int n_max); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSPF_sp_fftSPXSP_r2c */ /** @ingroup DSPF_sp_fftSPXSP_r2c */ /* @{ */ /** * The benchmark performs a mixed radix forwards fft. * * @param N length of FFT in complex samples * @param ptr_x pointer to real data input * @param ptr_w pointer to complex twiddle factor * @param ptr_y pointer to complex output data * @param brev pointer to bit reverse table containing 64 entries * @param n_min should be 4 if N can be represented as Power of 4 else, n_min should be 2 * @param offset index in complex samples of sub-fft from start of main fft * @param n_max size of main fft in complex samples * * @par Algorithm: * DSPF_sp_fftSPxSP_r2c_cn.c is the natural C equivalent of the optimized linear assembly code without * restrictions. Note that the linear assembly code is optimized and restrictions may * apply. * * @par Assumptions: * N needs to be power of 2
* 32 <= N <= 131072
* Arrays pointed by ptr_x, ptr_w, and ptr_y should not overlap
* Arrays pointed by ptr_x, ptr_w, and ptr_y should align on the double words boundary
* * @par Implementation Notes: * @b Interruptibility: The code is interrupt-tolerant but not interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_fftSPxSP_r2c(int N, float *ptr_x, float *ptr_w, float *ptr_y, unsigned char *brev, int n_min, int offset, int n_max); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_sp_fftSPxSP_r2c.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r4.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r4.h -- FIR Filter (Radix 4) */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_fir_r4 */ /** @ingroup DSP_fir_r4 */ /* @{ */ /** * This function implements an IIR filter, with a number of biquad * stages given by nCoefs / 4. It accepts a single sample of * input and returns a single sample of output. Coefficients are * expected to be in the range [-2.0, 2.0) with Q14 precision. * * @param x = Input array [nr+nh-1 elements] * @param h = Coeff array [nh elements] * @param r = Output array [nr elements] * @param nh = Number of coefficients * @param nr = Number of output samples * * @par Algorithm: * DSP_fir_r4_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions. Note that the intrinsic * C code is optimized and restrictions may apply. * * @par Assumptions: * Arrays x, h, and r do not overlap.
* x, h and r are double word aligned.
* nr >= 4; nr % 4 == 0.
* nh >= 4; nh % 4 == 0.
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes. * @b Interruptibility: The code is interruptible * */ void DSP_fir_r4 ( const short *restrict x, /* Input array [nr+nh-1 elements] */ const short *restrict h, /* Coeff array [nh elements] */ short *restrict r, /* Output array [nr elements] */ int nh, /* Number of coefficients */ int nr /* Number of output samples */ ); /* ======================================================================= */ /* End of file: DSP_fir_r4.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fir_r4.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_mat_trans.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_mat_trans.h -- Matrix Transpose */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSP_mat_trans */ /** @ingroup DSP_mat_trans */ /* @{ */ /** * This function transposes the input matrix x[ ] and writes the result * to matrix r[ ] * * @param x = Pointer to input matrix * @param rows = Number of rows in the input matrix * @param columns = Number of columns in the input matrix * @param r = Pointer to output matrix * * @par Algorithm: * DSP_mat_trans.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * Rows and columns must be a multiple of 4.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSP_mat_trans ( const short *restrict x, /* Input matrix */ short rows, /* Height of input matrix */ short columns, /* Width of input matrix */ short *restrict r /* Output matrix */ ); /* ======================================================================= */ /* End of file: DSP_mat_trans.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_mat_trans.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_ifftDPxDP.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* TEXAS INSTRUMENTS, INC. */ /* */ /* NAME */ /* DSPF_dp_ifftDPXDP.h -- Optimized Implementation */ /* */ /* USAGE */ /* double precision floating point Forward FFT with mixed radix */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSPF_dp_ifftDPXDP */ /** @ingroup DSPF_dp_ifftDPXDP */ /* @{ */ /** * The benchmark performs a mixed radix inverse fft. * * @param N length of FFT in complex samples * @param ptr_x pointer to complex data input * @param ptr_w pointer to complex twiddle factor * @param ptr_y pointer to complex output data * @param n_min: should be 4 if N can be represented as Power of 4 else, n_min should be 2 * @param offset index in complex samples of sub-fft from start of main fft * @param n_max size of main fft in complex samples * * @par Algorithm: * DSPF_sp_ifftSPxSP_cn.c is the natural C equivalent of the optimized linear assembly code without * restrictions. Note that the linear assembly code is optimized and restrictions may * apply. * * @par Assumptions: * N needs to be power of 2
* 8 <= N <= 131072
* Arrays pointed by ptr_x, ptr_w, and ptr_y should not overlap
* Arrays pointed by ptr_x, ptr_w, and ptr_y should align on the double words boundary
* * @par Implementation Notes: * @b Interruptibility: The code is interrupt-tolerant but not interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_dp_ifftDPxDP (int N, double *restrict ptr_x, double *restrict ptr_w, double *restrict ptr_y, int n_min, int offset, int n_max); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_ifftDPxDP.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_iir.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_iir.h -- Real IIR Filter */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_iir */ /** @ingroup DSP_iir */ /* @{ */ /** * This real IIR computes nr real output samples using 4 Autoregressive * filter coefficients and 5 Moving-average filter coefficients. * It operates on 16-bit data with a 32-bit accumulate. The implementation * is done in Direct Form I, for the below difference equation.
* * r1(n) = h2(0) * x(n)
* + h2(1) * x(n-1) - h1(1) * r1(n-1)
* + h2(2) * x(n-2) - h1(2) * r1(n-2)
* + h2(3) * x(n-3) - h1(3) * r1(n-3)
* + h2(4) * x(n-4) - h1(4) * r1(n-4)
* * @param r1 Pointer to real output data used. * @param x Pointer to real input data. * @param r2 Pointer to real output data stored. * @param h2 Pointer to 5 Moving-average real filter coefficients. * @param h1 Pointer to 4 Autoregressive real filter coefficients. * @param nr Holds the value of number of real output samples. * * @par Algorithm: * DSP_iir_cn.c is the natural C equivalent of the optimized intrinsic C code without * restrictions. Note that the intrinsic C code is optimized and restrictions may * apply. * * @par Assumptions: * Arrays x, h1, h2, r1 and r2 do not overlap
* x must point to x[nr-4]
* h1 points to h1[0], h1[0] is not used, all the coefficients are real
* h2 points to h2[0], all the coefficietns are real
* r1 must point to r1[nr-4], current response depends on previous 4 responses
* r2 must point to r2[0], such that r1[4+i] = r2[nr], for i = 0 to nr;
* nr >= 1;
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible. * @b Endian support : supports both Little and Big endian modes. * */ void DSP_iir ( short *r1, /* Pointer to real output data used/stored */ const short *x, /* Pointer to real input data */ short *r2, /* Pointer to real output data stored */ const short *h2, /* Pointer to 5 Moving-average real filter coefficients */ const short *h1, /* Pointer to 4 Autoregressive real filter coefficients */ int nr /* Holds the value of number of real output samples */ ); /* ======================================================================= */ /* End of file: DSP_iir.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_iir.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_mul_gemm.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_mul_gemm.h -- Matrix Multiply "y = a*x1*x2+y" */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_mat_mul_gemm */ /** @ingroup DSPF_sp_mat_mul_gemm */ /* @{ */ /** * This function computes the expression y = a*x1*x2+y. The column * dimension of x1 must match the row dimension of x2. * The values stored in the matrices are assumed to be single-precision * floating-point values. This code is suitable for * dense matrices. No optimizations are made for sparse matrices. * * @param x1 = Pointer to r1 by c1 input matrix. * @param a = Scalar value. * @param r1 = Number of rows in x1. * @param c1 = Number of columns in x1. Also number of rows in x2. * @param x2 = Pointer to c1 by c2 input matrix. * @param c2 = Number of columns in x2. * @param y = Pointer to r1 by c2 output matrix. * * @par Algorithm: * DSPF_sp_mat_mul_gemm.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays x1, x2 and y are stored in distinct arrays. In-place processing is not allowed.
* r1, c2 are assumed to be an interger multiple of 4. c1 is assumed to be even.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSPF_sp_mat_mul_gemm(float *x1, float const a, const int r1, const int c1, float *x2, const int c2, float *restrict y); /* ======================================================================= */ /* End of file: DSPF_sp_mat_mul_gemm.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_mat_mul_gemm.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_cholesky_cmplx.h -- C source interface header file for */ /* double precision complex Cholesky */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_cholesky_cmplx.h -- Cholesky decomposition and solver */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_cholesky_cmplx */ /** @ingroup DSPF_dp_cholesky_cmplx */ /* @{ */ /** * This function tests the square complex matrix A for a symmetric positive definite and * decomposes the matrix A into a lower triangular matrix L where A=L*U and * U=Hermitian of L. The values stored in the matrices are assumed to be * double precision floating point values. This code is suitable for * dense matrices. No optimizations are made for sparse matrices. * * @param enable_test = enables test for symmetric positive definite matrix * @param Nrows = Nrows of square matrix A * @param A = pointer to square matrix A[Nrows*2*Nrows] * @param L = pointer to lower triangular matrix L[Nrows*2*Nrows] * * @par Algorithm: * DSPF_dp_cholesky_cmplx_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays A and L are stored in distinct arrays. In-place processing is not allowed.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_cholesky_cmplx(const int enable_test, const int Nrows, double *restrict A, double *restrict L); /* @} */ /* ingroup */ /** @defgroup DSPF_dp_cholesky_in_place_cmplx */ /** @ingroup DSPF_dp_cholesky_in_place_cmplx */ /* @{ */ /** * This function tests the square complex matrix A for a symmetric positive definite and * decomposes the square matrix A into a lower triangular matrix L where A=L*U and * U=transpose of L. The processing is done in place of the matrix A. * The values stored in the matrices are assumed to be double precision * floating point values. This code is suitable for dense matrices. No * optimizations are made for sparse matrices. * * @param enable_test = enables test for symmetric positive definite matrix * @param Nrows = Nrows of square matrix A * @param A = pointer to input square matrix A[Nrows*2*Nrows] and output matrix L[Nrows*2*Nrows] * * @par Algorithm: * DSPF_dp_cholesky_cmplx_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. In-place processing is done on the matrix A.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_cholesky_in_place_cmplx(const int enable_test, const int Nrows, double *restrict A); /* @} */ /* ingroup */ /** @defgroup DSPF_dp_cholesky_solver_cmplx */ /** @ingroup DSPF_dp_cholesky_solver_cmplx */ /* @{ */ /** * This function solves A*x=b for x using forward and backward substitution * using the decomposed lower triangular matrix L as shown in the following * steps. The values stored in the matrices are assumed to be double precision * floating point values. * 1. A*x = L*U*b = L*L_transpose*x = b * 2. y = inverse(L)*b - done using forward substitution * 3. x = inverse(L_transpose)*y - done using backward substitution * * @param Nrows = Nrows of square matrix A * @param L = pointer to input square matrix L[Nrows*Nrows] * @param y = pointer to intermediate vector y[Nrows] * @param b = pointer to input vector b[Nrows] * @param x = pointer to output vector x[Nrows] * * @par Algorithm: * DSPF_dp_cholesky_cmplx_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The decomposed lower triangular matrix L is available as input.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_cholesky_solver_cmplx(const int Nrows,double *restrict L,double *restrict y,double *restrict b,double *restrict x); /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_cholesky_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_cholesky_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_qrd_cmplx.h -- C source interface header file for double */ /* precision complex QRD decomposition */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_qrd_cmplx.h -- complex QRD decompostion */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_qrd_cmplx */ /** @ingroup DSPF_dp_qrd_cmplx */ /* @{ */ /** * This function decomposes the rectangular complex matrix A into an orthogonal Q matrix and * an upper right triangular matrix R such that A=Q*R. The Householder algorithm is * used to zero columns below the diagonal in the original A matrix to produce the R * matrix. The Q matrix is generated during the process. The values stored in the * matrices are assumed to be double precision floating point values. This code is * suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows of matrix A * @param Ncols = number of columns of matrix A * @param A = pointer to matrix A[Nrows*2*Ncols] * @param Q = pointer to matrix Q[Nrows*2*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*2*Ncols] * @param u = pointer to temporary vector u[max(2*Nrows,2*Ncols)] * * * @par Algorithm: * DSPF_dp_qrd_cmplx_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays A, Q, R, and u are stored in distinct arrays. In-place processing is not done.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_qrd_cmplx(const int Nrows,const int Ncols,double *restrict A,double *restrict Q,double *restrict R,double *restrict u); /* @} */ /* ingroup */ /** @defgroup DSPF_dp_qrd_inverse */ /** @ingroup DSPF_dp_qrd_inverse */ /* @{ */ /** * This function processes an orthogonal matrix Q, and an upper triangular matrix R generated * by DSPF_dp_qrd and generates the inverse of the A matrix where inv_A=inv(R)*inv(Q). * In place processing is performed on the R matrix such that its original contents are * modified. The values stored in the matrices are assumed to be double precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in matrix A * @param Ncols = number of columns in matrix A * @param Q = pointer to lower triangular matrix Q[Nrows*2*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*2*Ncols] * @param inv_A = pointer to inverse of matrix A[Nrows*2*Ncols] * * * @par Algorithm: * DSPF_dp_qrd_cmplx_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays Q, R, and inv_A are stored in distinct arrays. In-place processing of R is done.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_qrd_inverse_cmplx(const int Nrows,const int Ncols,double *restrict Q,double *restrict R,double *restrict inv_A); /* @} */ /* ingroup */ /** @defgroup DSPF_dp_qrd_solver */ /** @ingroup DSPF_dp_qrd_solver */ /* @{ */ /** * This function solves the system of linear equations A*x=b for x using the inputs produced by * DSPF_dp_qrd where A*x=Q*R*x=b. The following procedure is performed. * * 1. Use matrix multiplication to generate y: y = transpose(Q)*b
* 2. Use backward substitution for solve for x: x = inv(R)*y
* * The values stored in the matrices are assumed to be double precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in matrix A * @param Ncols = number of columns in matrix A * @param Q = pointer to lower triangular matrix Q[Nrows*2*Nrows] * @param R = pointer to upper triangular matrix R[Nrows*2*Ncols] * @param b = pointer to vector b[2*Nrows] * @param y = pointer to temporary vector y[2*Nrows] * @param x = pointer to final solver output vector x[2*Ncols] * * * @par Algorithm: * DSPF_dp_qrd_cmplx_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays P, L, U, and inv_A are stored in distinct arrays. In-place processing is not done.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_qrd_solver_cmplx(const int Nrows,const int Ncols,double *restrict Q,double *restrict R,double *restrict b,double *restrict y,double *restrict x); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_qrd_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_qrd_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r8_h24.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r8_h24.c -- FIR 24 Coefficient Filter (Radix 8) */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_fir_r8_h24 */ /** @ingroup DSP_fir_r8_h24 */ /* @{ */ /** * Computes a real FIR filter (direct-form) using 24 coefficients * stored in vector h. The real data input is stored in vector x. * The filter output result is stored in vector r. Input data and * filter taps are 16-bit, with intermediate values kept at 32-bit * precision. Filter taps are expected in Q15 format. * * @param x = Input array [nr+24-1 elements] * @param h = Coeff array [24 elements] * @param r = Output array [nr elements] * @param nr = Number of output samples * * @par Algorithm: * DSP_fir_r8_h24_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions. Note that the intrinsic C code * is optimized and restrictions may apply. * * @par Assumptions: * Arrays x, h, and r do not overlap.
* x, h and r must be double word aligned.
* nr >= 4; nr % 4 == 0.
* nh == 24.
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes. * @b Interruptibility: The code is interruptible */ void DSP_fir_r8_h24 ( const short *restrict x, const short *restrict h, short *restrict r, int nr ); /* ======================================================================= */ /* End of file: DSP_fir_r8_h24.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fir_r8_h24.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_fir_r2.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_fir_r2.h -- FIR Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSPF_sp_fir_r2 */ /** @ingroup DSPF_sp_fir_r2 */ /* @{ */ /** * Computes a real FIR filter (direct-form) using coefficients stored in * vector h[]. The real data input is stored in vector x[]. The filter * output result is stored in vector r[]. The filter calculates nr output * samples using nh coefficients. The coefficients are expected to be in * reverse order. * * @param x[nr+nh-1] Pointer to input array of size nr+nh-1. * @param h[nh] Pointer to coefficient array of size nh (in reverse order). * @param r[nr] Pointer to output array of size nr. * @param nh Number of coefficents * @param nr Number of output samples * * @par Algorithm: * DSPF_sp_fir_r2_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * nr is a multiple of 2 and greater than or equal to 2.
* nh is a multiple of 2 and greater than or equal to 4.
* x, h and r are double-word aligned.
* Coefficients in array h are expected to be in reverse order.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_fir_r2(const float * x, const float * h, float *restrict r, const int nh, const int nr); /* ======================================================================= */ /* End of file: DSPF_sp_fir_r2.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_fir_r2.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_iirlat.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_iirlat.h -- Lattice IIR Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSPF_sp_iirlat */ /** @ingroup DSPF_sp_iirlat */ /* @{ */ /** * This routine implements a real all-pole IIR filter in lattice structure * (AR lattice). The filter consists of nk lattice stages. Each stage requires * one reflection coefficient k and one delay element b. The routine takes an * input vector x[] and returns the filter output in y[]. Prior to the first * call of the routine the delay elements in b[] should be set to zero. The * input data may have to be pre-scaled to avoid overflow or achieve better SNR. * The reflections coefficients lie in the range -1.0 < k < 1.0. The order of * the coefficients is such that k[nk-1] corresponds to the first lattice stage * after the input and k[0] corresponds to the last stage. * * @param x[nx] Input vector. * @param nx Length of input vector. * @param k[nk] Reflection coefficients. * @param nk Number of reflection coefficients/lattice stages. * @param b[nk+1] Delay line elements from previous call. * Should be initialized to all zeros prior to the first call. * @param y[nx] Output vector. * * @par Algorithm: * DSPF_sp_iirlat_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * nx > 0, nk is a multiple of 4 and >= 4.
* The arrays k and b are double-word aligned.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_sp_iirlat(const float *x, int nx, const float *restrict k, int nk, float *restrict b, float *restrict y); /* ======================================================================= */ /* End of file: DSPF_sp_iirlat.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_iirlat.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_gen_hM17_rA8X8.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_gen_hM17_rA8X8.h -- FIR Filter (Radix 8) */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_fir_gen_hM17_rA8X8 */ /** @ingroup DSP_fir_gen_hM17_rA8X8 */ /* @{ */ /** * Computes a real FIR filter (direct-form) using coefficients * stored in vector h. The real data input is stored in vector x. * The filter output result is stored in vector r. Input data and * filter taps are 16-bit, with intermediate values kept at 32-bit * precision. Filter taps are expected in Q15 format. * * @param x = Input array [nr+nh-1 elements] * @param h = Coeff array [nh elements] * @param r = Output array [nr elements] * @param nh = Number of coefficients * @param nr = Number of output samples * * @par Algorithm: * DSP_fir_gen_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * Arrays x, h, and r do not overlap.
* nr >= 8; nr % 8 == 0.
* x, h and r must be double word aligned.
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes. * @b Interruptibility: The code is interruptible */ void DSP_fir_gen_hM17_rA8X8 ( const short *restrict x, /* Input array [nr+nh-1 elements] */ const short *restrict h, /* Coeff array [nh elements] */ short *restrict r, /* Output array [nr elements] */ int nh, /* Number of coefficients */ int nr /* Number of output samples */ ); /* ======================================================================= */ /* End of file: DSP_fir_gen_hM17_rA8X8.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fir_gen_hM17_rA8X8.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft32x32s.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft32x32s.h -- 32x32s Mixed Radix FFT */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSP_fft32x32s */ /** @ingroup DSP_fft32x32s */ /* @{ */ /** * This routine computes an extended precision complex * forward mixed radix FFT with scaling, rounding and * digit reversal. Input data x[ ], output data y[ ], * and coefficients w[ ] are 32-bit. The output is returned * in the separate array y[ ] in normal order. Each complex * value is stored with interleaved real and imaginary parts. * * @param ptr_w = input twiddle factors * @param npoints = number of points * @param ptr_x = transformed data reversed * @param ptr_y = linear transformed data * * @par Algorithm: * DSP_fft32x32s_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions. Note that the intrinsic * C code is optimized and restrictions may apply. * * @par Assumptions: * In-place computation is not allowed.
* Size of FFT, nx, must be power of 2 and 16<=nx<=65536.
* The arrays for the complex input data x[], complex output data y[] * and twiddle factor w[] must be double word aligned.
* The input and output data are complex, with the real/imaginary * components stored in adjacent locations in the array. The real * components are stored at even array indices, and the imaginary * components are stored at odd array indices.
* Allowed maximum absolute value of input is 2^(32 - (log2(nx)-ceil[log4(nx)-1])).
* * @par Implementation Notes: * Scaling is performed at each stage by shifting the results right by 1, * preventing overflow.
* * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_fft32x32s ( const int * restrict ptr_w, int npoints, int * restrict ptr_x, int * restrict ptr_y ); /* ======================================================================== */ /* End of file: DSP_fft32x32s.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_fft32x32s.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_svd.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_svd.h -- Singular Value Decomposition */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ //#define ENABLE_REDUCED_FORM 1 /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_svd */ /** @ingroup DSPF_dp_svd */ /* @{ */ /** * This routine decomposes an Nrows x Ncols matrix A into a product of three * matrices: A = U * D * V' where U and V are orthogonal matrices, V' is the * transpose of V, and D is a diagonal matrix. If the define constant * ENABLE_REDUCED_FORM is defined then the reduced form is generated else * the full form is generated as shown below for the case Nrows>=Ncols. * * full form
* U [Nrows x Nrows]
* D [Nrows x Ncols]
* V'[Ncols x Ncols]
* reduced form
* U [Nrows x Ncols]
* D [Ncols x Ncols]
* V'[Ncols x Ncols]
* * The singular values are the diagonal elements of D and correspond to the * positive square roots of the eigenvalues of the matrix A' * A. This code * is suitable for dense matrices. No optimizations are made for sparse matrices. * This routine calls the following routines. * * 1. DSPF_dp_convert_to_bidiag: converts A to bidiagonal matrix using Householder * transformations.
* 2. DSPF_dp_bidiag_to_diag: converts bidiagonal matrix to diagonal using Givens * transformations (works only for Nrows>=Ncols).
* 3. DSPF_dp_sort_singular_values: sorts singular values in descending order and * modifies U and V matrices accordingly.
* * If Nrows * @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_svd(const int Nrows,const int Ncols,double *restrict A,double *restrict U,double *restrict V,double *restrict U1,double *restrict diag,double *restrict superdiag); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_svd.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_svd.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_trans_cplx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_trans_cplx.h -- Complex Matrix Transpose */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_mat_trans_cplx */ /** @ingroup DSPF_sp_mat_trans_cplx */ /* @{ */ /** * This function transposes the input matrix x[] and writes the * result to matrix y[]. * * @param x[r1*c1] Input matrix containing r1*c1 double floating-point numbers * @param rows Number of rows in matrix x. Also number of columns in matrix y * @param cols Number of columns in matrix x. Also number of rows in matrix y * @param y[2*c1*r1] Output matrix containing 2*c1*r1 floating floating-point numbers * * @par Algorithm: * DSPF_sp_mat_trans_cplx.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The number of rows and columns is >=2.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSPF_sp_mat_trans_cplx(const float *restrict x, const int rows, const int cols, float *restrict y); /* ======================================================================= */ /* End of file: DSPF_sp_mat_trans_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_mat_trans_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_mul.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_mul.h -- Matrix Multiply */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_mat_mul */ /** @ingroup DSPF_sp_mat_mul */ /* @{ */ /** * This function computes the expression “y = x1*x2” for the matrices x1 * and x2. The column dimension of x1 must match the row dimension of x2. * The resulting matrix has the same number of rows as x1 and the same * number of columns as x2. The values stored in the matrices are assumed * to be single-precision floating-point values. This code is suitable for * dense matrices. No optimizations are made for sparse matrices. * * @param x1 = Pointer to r1 by c1 input matrix. * @param r1 = Number of rows in x1. * @param c1 = Number of columns in x1. Also number of rows in x2. * @param x2 = Pointer to c1 by c2 input matrix. * @param c2 = Number of columns in x2. * @param y = Pointer to r1 by c2 output matrix. * * @par Algorithm: * DSPF_sp_mat_mul.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays ‘x1’, ‘x2’, and ‘y’ are stored in distinct arrays. * That is, in-place processing is not allowed.
* All r1, c1, c2 are assumed to be multiple of 2 and >=2.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSPF_sp_mat_mul(float *x1, const int r1, const int c1, float *x2, const int c2, float *restrict y); /* ======================================================================= */ /* End of file: DSPF_sp_mat_mul.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_mat_mul.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r8_h16.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r8_h16.c -- FIR 16 Coefficient Filter (Radix 8) */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_fir_r8_h16 */ /** @ingroup DSP_fir_r8_h16 */ /* @{ */ /** * Computes a real FIR filter (direct-form) using 16 coefficients * stored in vector h. The real data input is stored in vector x. * The filter output result is stored in vector r. Input data and * filter taps are 16-bit, with intermediate values kept at 32-bit * precision. Filter taps are expected in Q15 format. * * @param x = Input array [nr+16-1 elements] * @param h = Coeff array [16 elements] * @param r = Output array [nr elements] * @param nr = Number of output samples * * @par Algorithm: * DSP_fir_r8_h16_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions. Note that the intrinsic C code * is optimized and restrictions may apply. * * @par Assumptions: * Arrays x, h, and r do not overlap.
* x, h and r must be double word aligned.
* nr >= 4; nr % 4 == 0.
* nh == 16.
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes. * @b Interruptibility: The code is interruptible */ void DSP_fir_r8_h16 ( const short *restrict x, const short *restrict h, short *restrict r, int nr ); /* ======================================================================= */ /* End of file: DSP_fir_r8_h16.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fir_r8_h16.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_mat_mul_cplx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_mat_mul_cplx.h -- Perform Matrix Multiplication */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSP_mat_mul_cplx */ /** @ingroup DSP_mat_mul_cplx */ /* @{ */ /** * This function computes the expression “r = x * y” for complex matrices * x and y. The columnar dimension of x must match the row dimension of * y. The resulting matrix has the same number of rows as x and the same * number of columns as y. * * The values stored in the matrices are assumed to be type _CPLX16. * Each array consists of an even and odd term with even terms representing * the real part of the element and the odd terms the imaginary part. All * intermediate sums are retained to 32-bit precision. The results are * right-shifted by a user-specified amount, and then truncated to 16 bits. * * @param x = Pointer to input matrix of size r1*c1 * @param r1 = Number of rows in matrix x * @param c1 = Number of columns in matrix x. Also number of rows in y * @param y = Pointer to input matrix of size c1*c2 * @param c2 = Number of columns in matrix y * @param r = Pointer to output matrix of size r1*c2 * @param qs = Final right-shift to apply to the result * * @par Algorithm: * DSP_mat_mul_cplx.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays x[], y[], and r[] are stored in distinct arrays.
* That is, in-place processing is not allowed.
* The arrays x[], y[], and r[] are aligned on double word boundaries.
* r1, c1, c2 are multiples of 2 and >= 4.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSP_mat_mul_cplx ( const short *restrict x, int r1, int c1, const short *restrict y, int c2, short *restrict r, int qs ); /* ======================================================================== */ /* End of file: DSP_mat_mul_cplx.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_mat_mul_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_add32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_add32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_add32 */ /** @ingroup DSP_add32 */ /* @{ */ /** * This program performs a addition on a vector. * The result is stored in a vector. * * @param x = Input data array of int * @param y = Input data array of int * @param r = Output data array of int * @param nx = Number of elements in the arrays * * @par Algorithm: * DSP_add32_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions note that the intrinsic * C code is optimized and restrictions may apply. * * @par Assumptions: * Arrays x, y, r do not overlap.
* Arrays x, y, r are aligned on double word boundaries.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ void DSP_add32 ( const int * restrict x, /* Input array of length nx */ const int * restrict y, /* Input array of length nx */ int * restrict r, /* Output array of length nx */ int nx /* Number of elements. */ ); /* ======================================================================== */ /* End of file: DSP_add32.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_add32.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_minerror.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_minerror.h -- Minimum Energy Error Search */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MISC */ /* @{ */ /** @defgroup DSP_minerror */ /** @ingroup DSP_minerror */ /* @{ */ /** * Returns Maximum dot product result * * @param GSP0_TABLE[9*256] = GSP0 terms array. Must be double-word aligned * @param errCoefs[9] = Array of error coefficients * @param max_index = Pointer to GSP0_TABLE[max_index] found * * @par Algorithm: * DSP_minerror_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * Array GSP0_TABLE[] must be double-word aligned.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ int DSP_minerror ( const short *restrict GSP0_TABLE, /* Pointer to GSP0 terms array */ const short *restrict errCoefs, /* Array of error coefficients */ int *restrict max_index /* Index to the 9-element vector that */ /* resulted in the maximum dot product */ ); /* ======================================================================= */ /* End of file: DSP_minerror.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_minerror.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_blk_move.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_blk_move.h -- Move a block of memory */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MISC */ /* @{ */ /** @defgroup DSP_blk_move */ /** @ingroup DSP_blk_move */ /* @{ */ /** * This routine moves nx 16-bit elements from one memory location pointed to * by x to another pointed to by r. The source and destination blocks can be * overlapped. * * @param x = Block of data to be moved * @param r = Destination of block of data * @param nx = Number of elements in block * * @par Algorithm: * DSP_blk_move.c is the natural C equivalent of the optimized intrinsic C code * without restrictions note that the intrinsic C code is optimized and * restrictions may apply. * * @par Assumptions: * nx must be a multiple of 8 and greater than or equal to 8.
* x and r must be double word aligned.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ void DSP_blk_move ( short *restrict x, short *restrict r, int nx ); /* ======================================================================== */ /* End of file: DSP_blk_move.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_blk_move.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_firlms2.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_firlms2.h -- Least Mean Square Adaptive Filter */ /* Intrinsic C source */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup ADAPTIVEFILTER */ /* @{ */ /** @defgroup DSP_firlms2 */ /** @ingroup DSP_firlms2 */ /* @{ */ /** * The Least Mean Square Adaptive Filter computes an update of all nh * coefficients by adding the weighted error times the inputs to the original * coefficients. The input array includes the last nh inputs followed by a new * single sample input. The coefficient array includes nh coefficients. * * @param h = Coefficient Array * @param x = Input array * @param b = Error from previous FIR * @param nh = Number of coefficients. Must be multiple of 4 * * @par Algorithm: * DSP_firlms2_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions note that the intrinsic * C code is optimized and restrictions may apply. * * @par Assumptions: * This routine assumes 16-bit input and output.
* The number of coefficients nh must be a multiple of 4.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ int DSP_firlms2 ( short *restrict h, /* Filter Coefficients */ short *restrict x, /* Input Data */ short b, /* Error from previous FIR */ int nh /* Number of Coefficients */ ); /* ======================================================================== */ /* End of file: DSP_firlms2.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_firlms2.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_ifft16x16.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_ifft16x16.h -- 16x16 Mixed Radix Inverse FFT */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSP_ifft16x16 */ /** @ingroup DSP_ifft16x16 */ /* @{ */ /** * This code performs a Radix-4 IFFT with digit reversal. The code * uses a special ordering of twiddle factors and memory accesses * to improve performance in the presence of cache. It operates * largely in-place, but the final digit-reversed output is written * out-of-place. * * @param ptr_w: Pointer to vector of Q.15 FFT coefficients of size 2*nx elements. * @param npoints: Number of complex elements in vector x. * @param ptr_x: Pointer to input vector of size 2*nx elements. * @param ptr_y: Pointer to output vector of size 2*nx elements. * * @par Algorithm: * DSP_ifft16x16_cn.c is the natural C equivalent of the optimized intrinsic C code without * restrictions. Note that the intrinsic C code is optimized and restrictions may * apply. * * @par Assumptions: * In-place computation is not allowed.
* Size of FFT, nx, must be power of 2 and 16<=nx<=32768.
* The arrays for the complex input data x[], complex output data y[] * and twiddle factor w[] must be double word aligned.
* The input and output data are complex, with the real/imaginary * components stored in adjacent locations in the array. The real * components are stored at even array indices, and the imaginary * components are stored at odd array indices.
* * @par Implementation Notes: * @b Endian Support: * The intrinsic optimized C code supports both big and little endian modes.
* The linear assembly code supports little endian mode only.
* @b Interruptibility: The code is interruptible.
* */ void DSP_ifft16x16 ( const short * restrict ptr_w, int npoints, short * restrict ptr_x, short * restrict ptr_y ); /* ======================================================================== */ /* End of file: DSP_ifft16x16.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_ifft16x16.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_cplx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_cplx.h -- Complex FIR Filter */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_fir_cplx */ /** @ingroup DSP_fir_cplx */ /* @{ */ /** * This complex FIR computes nr complex output samples using nh * complex coefficients. It operates on 16-bit data with a 32-bit * accumulate. Each array consists of an even and odd term with even * terms representing the real part of the element and the odd terms * the imaginary part. The pointer to input array x must point to the * (nh)th complex sample, i.e. element 2*(nh-1), upon entry to the * function. The coefficients are expected in normal order. * * @param x Complex input data. x must point to x[2*(nh-1)]. * @param h Complex coefficients (in normal order). h must point to h[2*nh]. * @param r Complex output data. r must point to r[2*nr]. * @param nh Number of complex coefficients. * @param nr Number of complex output samples. * * @par Algorithm: * DSP_fir_cplx_cn.c is the natural C equivalent of the optimized intrinsic C code without * restrictions. Note that the intrinsic C code is optimized and restrictions may * apply. * * @par Assumptions: * Arrays x, h, and r do not overlap
* Arrays h and r must be aligned on double word boundaries
* nr >= 8; nr % 4 == 0
* nh >= 4; nh % 2 == 0
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes. * @b Interruptibility: The code is interruptible */ void DSP_fir_cplx ( const short *restrict x, /* Input array [nr+nh-1 elements] */ const short *restrict h, /* Coeff array [nh elements] */ short *restrict r, /* Output array [nr elements] */ int nh, /* Number of coefficients */ int nr /* Number of output samples */ ); /* ======================================================================= */ /* End of file: DSP_fir_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fir_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_fftSPxSP.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_fftSPxSP.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_mul32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_mul32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_mul32 */ /** @ingroup DSP_mul32 */ /* @{ */ /** * The function performs a Q.31 x Q.31 multiply and returns the upper * 32 bits of the result. The result of the intermediate multiplies are * accumulated into a 40-bit long register pair, as there could be * potential overflow. The contribution of the multiplication of the two * lower 16-bit halves are not considered. The output is in Q.30 format. * Results are accurate to least significant bit. * * @param x = Pointer to input data vector 1 of size nx * @param y = Pointer to input data vector 2 of size nx * @param r = Pointer to output data vector of size nx * @param nx = Number of elements in input and output vectors * * @par Algorithm: * DSP_mul32_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * nx must be a multiple of 4 and greater than or equal to 4.
* Input and output vectors must be double-word aligned.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_mul32 ( const int * restrict x, /* Input array of length nx */ const int * restrict y, /* Input array of length nx */ int * restrict r, /* Output array of length nx */ int nx /* Number of elements. */ ); /* ======================================================================== */ /* End of file: DSP_mul32.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_mul32.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_fftDPxDP.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* TEXAS INSTRUMENTS, INC. */ /* */ /* */ /* USAGE */ /* double precision floating point Forward FFT with mixed radix */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSPF_dp_fftDPXDP */ /** @ingroup DSPF_dp_fftDPXDP */ /* @{ */ /** * The benchmark performs a mixed radix forwards fft. * * @param N length of FFT in complex samples * @param ptr_x pointer to complex data input * @param ptr_w pointer to complex twiddle factor * @param ptr_y pointer to complex output data * @param n_min should be 4 if N can be represented as Power of 4 else, n_min should be 2 * @param offset index in complex samples of sub-fft from start of main fft * @param n_max size of main fft in complex samples * * @par Algorithm: * DSPF_dp_fftDPxDP.c is the natural C equivalent of the optimized linear assembly code without * restrictions. Note that the linear assembly code is optimized and restrictions may * apply. * * @par Assumptions: * N needs to be power of 2
* 8 <= N <= 131072
* Arrays pointed by ptr_x, ptr_w, and ptr_y should not overlap
* Arrays pointed by ptr_x, ptr_w, and ptr_y should align on the double words boundary
* * @par Implementation Notes: * @b Interruptibility: The code is interrupt-tolerant but not interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ void DSPF_dp_fftDPxDP(int N, double *ptr_x, double *ptr_w, double *ptr_y, int n_min, int offset, int n_max); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_fftDPxDP.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_maxidx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_maxidx.h -- Max Value Index */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSPF_sp_maxidx */ /** @ingroup DSPF_sp_maxidx */ /* @{ */ /** * This routine finds out the index of maximum number in the input array. This * function returns the index of the greatest value. * * @param x Pointer to input array. * @param nx Number of inputs in the input array. * * @par Algorithm: * DSPF_sp_maxidx_cn.c is the natural C equivalent of the optimized * linear assembly code without restrictions. Note that the linear * assembly code is optimized and restrictions may apply. * * @par Assumptions: * nx is a multiple of 4 and >= 4.
* * @par Implementation Notes: * @b Interruptibility: The code is interruptible.
* @b Endian Support: The code supports both big and little endian modes.
* */ int DSPF_sp_maxidx(const float* x, const int nx); /* ======================================================================= */ /* End of file: DSPF_sp_maxidx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_maxidx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud_inv_cmplx.h -- C source interface header file for complex */ /* matrix inversion, double precision */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_lud_inv_cmplx.h - complex matrix inversion by LUD double precision*/ /* optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /*===========================================================================*/ /* External Function Prototypes and Documentation */ /*===========================================================================*/ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_lud_inverse_cmplx */ /** @ingroup DSPF_dp_lud_inverse_cmplx */ /* @{ */ /** * This function processes a permutation matrix P, a lower triangular matrix L, and an upper triangular * matrix U generated by DSPF_dp_lud and generates the inverse of the A matrix where inv_A=inv(U)*inv(L)*P. * In place processing is performed on the L and U matrices such that their original contents are * modified. The values stored in the matrices are assumed to be double precision floating point values. * This code is suitable for dense matrices. No optimizations are made for sparse matrices. * * @param Nrows = number of rows in square complex matrix A * @param P = pointer to permutation matrix P[2*Nrows*Nrows] * @param L = pointer to lower triangular matrix L[2*Nrows*Nrows] * @param U = pointer to upper triangular matrix U[2*Nrows*Nrows] * @param inv_A = pointer to inverse of A matrix[2*Nrows*Nrows] * * * @par Algorithm: * DSPF_dp_lud_inverse.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * 1. The arrays P, L, U, and inv_A are stored in distinct arrays. In-place processing of L and U is done.
* 2. The arrays consist of complex number entries with alternating real and imaginary parts: * real0,imag0,real1,imag1,...
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_lud_inverse_cmplx(const int order,unsigned short *restrict P,double *restrict L,double *restrict U,double *restrict inv_A); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_lud_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_lud_inv_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_svd_cmplx.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_svd_cmplx.h -- Singular Value Decomposition */ /* Optimized C Implementation */ /* */ /* Rev 1.0.0 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_svd_cmplx */ /** @ingroup DSPF_dp_svd_cmplx */ /* @{ */ /** * This routine decomposes a complex matrix A into a product of three * matrices: A = U * D * V' where U and V are orthogonal matrices, V' is the * Hermitian of V, and D is a diagonal matrix. If the define constant * ENABLE_REDUCED_FORM is defined then the reduced form is generated else * the full form is generated as shown below for the case Nrows>=Ncols. Note * that the symbol ' is the Hermitian or complex conjugate transpose. * * full form
* U [Nrows x 2*Nrows]
* D [Nrows x 2*Ncols]
* V'[Ncols x 2*Ncols]
* reduced form
* U [Nrows x 2*Ncols]
* D [Ncols x 2*Ncols]
* V'[Ncols x 2*Ncols]
* * The singular values are the diagonal elements of D and correspond to the * positive square roots of the eigenvalues of the matrix A' * A. This code * is suitable for dense matrices. No optimizations are made for sparse matrices. * This routine calls the following routines. * * 1. DSPF_dp_convert_to_bidiag: converts A to bidiagonal matrix using Householder * transformations.
* 2. DSPF_dp_bidiag_to_diag: converts bidiagonal matrix to diagonal using Givens * transformations (works only for Nrows>=Ncols).
* 3. DSPF_dp_sort_singular_values: sorts singular values in descending order and * modifies U and V matrices accordingly.
* * If Nrows * * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ int DSPF_dp_svd_cmplx(const int Nrows,const int Ncols,double *restrict A,double *restrict U,double *restrict V,double *restrict U1,double *restrict diag,double *restrict superdiag); /* @} */ /* ingroup */ /* @} */ /* ingroup */ /* ======================================================================= */ /* End of file: DSPF_dp_svd_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_svd_cmplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_mat_trans.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_dp_mat_trans.h -- Matrix Transpose */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_dp_mat_trans */ /** @ingroup DSPF_dp_mat_trans */ /* @{ */ /** * This function transposes the input matrix x[] and writes the * result to matrix y[]. * * @param x[r1*c1] Input matrix containing r1*c1 double floating-point numbers * @param rows Number of rows in matrix x. Also number of columns in matrix y. * @param cols Number of columns in matrix x. Also number of rows in matrix y. * @param y[c1*r1] Output matrix containing c1*r1 double floating-point numbers * * @par Algorithm: * DSPF_dp_mat_trans_cn.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The number of rows and columns is >=2.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSPF_dp_mat_trans(const double *restrict x, const int rows, const int cols, double *restrict y); /* ======================================================================= */ /* End of file: DSPF_dp_mat_trans.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_dp_mat_trans.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r8_hM16_rM8A8X8.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fir_r8_hM16_rM8A8X8.h -- FIR Filter (Radix 8) */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FILTCONV */ /* @{ */ /** @defgroup DSP_fir_r8_hM16_rM8A8X8 */ /** @ingroup DSP_fir_r8_hM16_rM8A8X8 */ /* @{ */ /** * Computes a real FIR filter (direct-form) using coefficients * stored in vector h. The real data input is stored in vector x. * The filter output result is stored in vector r. Input data and * filter taps are 16-bit, with intermediate values kept at 32-bit * precision. Filter taps are expected in Q15 format. * * @param x = Input array [nr+nh-1 elements] * @param h = Coeff array [nh elements] * @param r = Output array [nr elements] * @param nh = Number of coefficients * @param nr = Number of output samples * * @par Algorithm: * DSP_fir_r8_hM16_rM8A8X8_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions. Note that the intrinsic C code is * optimized and restrictions may apply. * * @par Assumptions: * Arrays x, h, and r do not overlap
* x, h and r must be double word aligned.
* nr >= 8; nr % 8 == 0
* nh >= 8; nh % 8 == 0
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_fir_r8_hM16_rM8A8X8 ( const short *restrict x, /* Input array [nr+nh-1 elements] */ const short *restrict h, /* Coeff array [nh elements] */ short *restrict r, /* Output array [nr elements] */ int nh, /* Number of coefficients */ int nr /* Number of output samples */ ); /* ======================================================================= */ /* End of file: DSP_fir_r8_hM16_rM8A8X8.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSP_fir_r8_hM16_rM8A8X8.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft16x32.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_fft16x32.h -- 16x32 Mixed Radix FFT */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup FFT */ /* @{ */ /** @defgroup DSP_fft16x32 */ /** @ingroup DSP_fft16x32 */ /* @{ */ /** * This routine computes an extended precision complex forward * mixed radix FFT with rounding and digit reversal. Input data * x[ ] and output data y[ ] are 32-bit, coefficients w[ ] are * 16-bit. The output is returned in the separate array y[ ] in * normal order. Each complex value is stored with interleaved * real and imaginary parts. * * @param ptr_w = input twiddle factors * @param npoints = number of points * @param ptr_x = transformed data reversed * @param ptr_y = linear transformed data * * @par Algorithm: * DSP_fft16x32_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * In-place computation is not allowed.
* Size of FFT, nx, must be power of 2 and 16<=nx<=65536.
* The arrays for the complex input data x[], complex output data y[] * and twiddle factor w[] must be double word aligned.
* The input and output data are complex, with the real/imaginary * components stored in adjacent locations in the array. The real * components are stored at even array indices, and the imaginary * components are stored at odd array indices.
* Allowed maximum absolute value of input is 2^(32 - log2(nx)).
* * @par Implementation Notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ void DSP_fft16x32 ( const short * restrict ptr_w, int npoints, int * restrict ptr_x, int * restrict ptr_y ); /* ======================================================================== */ /* End of file: DSP_fft16x32.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_fft16x32.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_submat_copy.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_submat_copy.h -- Sub-Matrix Copy */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_mat_submat_copy */ /** @ingroup DSPF_sp_mat_submat_copy */ /* @{ */ /** * If dir = 0, this function copies n rows starting from st row of matrix x to form matrix y; * If dir != 0, this function copies n rows of y to matrix x; * The values stored in x and y is single-precision floating values. * * @param x = Pointer to r1 by c1 input matrix. * @param rows = Number of rows in x. * @param cols = Number of columns in x. * @param st = start index of rows in x to be copied. * @param n = Number of rows to be copied. * @param y = Pointer to the output matrix. * @param dir = data flow direction. * * @par Algorithm: * DSPF_sp_mat_submat_copy_cn.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays x and y are stored in distinct arrays. In-place processing is not allowed.
* Rows, cols, st and n are assumed to be even.
* x and y are aligned on double-word boundaries.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSPF_sp_mat_submat_copy(float* x, int rows, int cols, int st, int n, float *restrict y, int dir); /* ======================================================================= */ /* End of file: DSPF_sp_mat_submat_copy.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_mat_submat_copy.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_vecsumsq.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_vecsumsq.h -- Sum of Squares */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_vecsumsq */ /** @ingroup DSP_vecsumsq */ /* @{ */ /** * This routine returns the sum of squares of the elements contained * in the vector x[ ]. return Sum of the squares. * * @param x = Pointer to input data vector * @param nx = Number of elements of input and output vectors * * @par Algorithm: * DSP_vecsumsq_cn.c is the natural C equivalent of the optimized intrinsic * C code without restrictions note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * nx must be a multiple of 4 and greater than or equal to 4.
* x must be double-word aligned.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ int DSP_vecsumsq ( const short * x, int nx ); /* ======================================================================== */ /* End of file: DSP_vecsumsq.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_vecsumsq.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_urand16.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_urand16.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATH */ /* @{ */ /** @defgroup DSP_urand16 */ /** @ingroup DSP_urand16 */ /* @{ */ /** * This program stores 16-bit fixed-point random values in * the provided vector. * * @param seed = Pointer to an arbitrary seed (number) of * type @b unsigned @b short. * * @param size = The size of the vector to be filled with * random values. * * @param vector = The vector to be filled with random values. * * @par Algorithm: * A linear congruential 16-bit random number generator is used. * The equation is as follows

* seed = (seed * 46341 + 1) % 65536

* See Numerical Recipes in C * * @par Assumptions: * The size of the vector to be filled is at least 16 and a multiple of 2
* For optimal randomness, it is best that the user not seed the RNG with * a value of zero. * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is not interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ void DSP_urand16(unsigned short* restrict seed, int size, void* restrict vector); /* ======================================================================== */ /* End of file: DSP_urand16.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_urand16.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2013 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_submat_copy_cplx.h -- Optimized C source header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSPF_sp_mat_submat_copy_cplx.h -- Complex Sub-Matrix Copy */ /* Optimized C Implementation (w/ Intrinsics) */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MATRIX */ /* @{ */ /** @defgroup DSPF_sp_mat_submat_copy_cplx */ /** @ingroup DSPF_sp_mat_submat_copy_cplx */ /* @{ */ /** * If dir = 0, this function copies n rows starting from st row of matrix x to form matrix y; * If dir != 0, this function copies n rows of y to matrix x; * The values stored in x and y is double-precision floating values. * * @param x Pointer to r1 by c1 input matrix. * @param rows Number of rows in x. * @param cols Number of columns in x. * @param st start index of rows in x to be copied. * @param n Number of rows to be copied. * @param y Pointer to the output matrix. * @param dir data flow direction. * * @par Algorithm: * DSPF_dp_row_copy.c is the natural C equivalent of the optimized intrinsic * C code withoutrestrictions. Note that the intrinsic C code is optimized * and restrictions may apply. * * @par Assumptions: * The arrays x and y are stored in distinct arrays.
* That is, in-place processing is not allowed.
* Rows, cols and n are assumed to be even.
* * @par Implementation Notes: * @b Interruptibility : The code is interruptible.
* @b Endian support : supports both Little and Big endian modes.
* */ void DSPF_sp_mat_submat_copy_cplx(float *restrict x, int rows, int cols, int st, int n, float *restrict y, int dir); /* ======================================================================= */ /* End of file: DSPF_sp_mat_submat_copy_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* End of file: DSPF_sp_mat_submat_copy_cplx.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_blk_eswap16.h -- Optimized C source interface header file */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /* ======================================================================= */ /* DSP_blk_eswap16.h -- Endian-swap a block of 16-bit values */ /* Intrinsic C Implementation */ /* */ /* Rev 0.0.1 */ /* */ /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */ /* */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names of */ /* its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* ======================================================================= */ /** @ingroup MISC */ /* @{ */ /** @defgroup DSP_blk_eswap16 */ /** @ingroup DSP_blk_eswap16 */ /* @{ */ /** * The data in the x[] array is endian swapped, meaning that * the byte-order of the bytes within each half-word of the r[] * array is reversed. This facilitates moving big-endian data * to a little-endian system or vice-versa. * When the r pointer is non-NULL, the endian-swap occurs out-of-place, * similar to a block move. When the r pointer is NULL, the endian-swap * occurs in-place, allowing the swap to occur without using any * additional storage. * * @param src = Source data, must be double-word aligned. * @param dst = Destination data, must be double-word aligned. * @param n_hwords = Number of 16-bit elements to swap. * * @par Algorithm: * DSP_blk_eswap16_cn.c is the natural C equivalent of the optimized * intrinsic C code without restrictions note that the intrinsic C code * is optimized and restrictions may apply. * * @par Assumptions: * Input and output arrays do not overlap, except when “dst == NULL” so that * the operation occurs in-place.
* The input array and output array are double-word aligned.
* nx is a multiple of 8.
* * @par Implementation notes: * @b Endian Support: The code supports both big and little endian modes.
* @b Interruptibility: The code is interruptible.
* */ /* }@ */ /* ingroup */ /* }@ */ /* ingroup */ void DSP_blk_eswap16 ( void *restrict src, void *restrict dst, int n_hwords ); /* ======================================================================== */ /* End of file: DSP_blk_eswap16.h */ /* ------------------------------------------------------------------------ */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================== */ /* ======================================================================= */ /* End of file: DSP_blk_eswap16.h */ /* ----------------------------------------------------------------------- */ /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ /* ============================================================================ * Copyright (c) Texas Instruments Incorporated 2008, 2009 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /** * @file csl_tsc.h * * @brief * Header file for functional layer of TSC CSL * * \par * ============================================================================ * @n (C) Copyright 2008, 2009, Texas Instruments, Inc. * @n Use of this software is controlled by the terms and conditions found * @n in the license agreement under which this software has been supplied. * =========================================================================== * \par */ /** @defgroup CSL_TSC_API TSC * * @section Introduction * * @subsection xxx Overview * * Time Stamp Counter is a free running 64-bit CPU counter that advances each CPU * clock after counting is enabled. The counter is accessed using two 32-bit * read-only control registers, Time Stamp Counter Registers – Low (TSCL) and * Time Stamp Counter Registers – High (TSCH). The counter is enabled by writing to * TSCL. The value written is ignored. Once enabled, counting cannot be disabled under * program control. Counting is disabled in the following cases: * a. After exiting the reset state. * b. When the CPU is fully powered down. * * @subsection References * -# Joule CPU Architecture Spec * * @subsection Assumptions * The abbreviations TSC, tsc and Tsc have been used throughout this * document to refer to C64+ Time Stamp Counter */ /** * @file soc.h * * @brief * This file contains SOC specific defintions. * * \par * ============================================================================ * @n (C) Copyright 2009-2017, Texas Instruments, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* ============================================================================ * Copyright (c) Texas Instruments Incorporated 2002, 2003, 2004, 2005, 2006, 2008 2016 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /** ============================================================================ * \file cslr.h * * \brief This file contains the macro definations for Register layer * */ /* Register layer central -- contains field-manipulation macro definitions */ /* * Copyright (C) 2005-2017 Texas Instruments Incorporated. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * ======== tistdtypes.h ======== */ /* * These types are also defined by other TI components. They are bracketed * with _TI_STD_TYPES to avoid warnings for duplicate definition. * * You may get warnings about duplicate type definitions when using this * header file with earlier versions of DSP/BIOS and CSL. * * You can use the '-pds303' compiler option to suppress these warnings. */ /* If the CSL header files are getting included through the MAKEFILE builds we don’t want * to include XDC TARGETS at all. */ /* * This '#ifndef STD_' is needed to protect from duplicate definitions * of Int, Uns, etc. in DSP/BIOS v4.x (e.g. 4.90, 4.80) since these versions * of DSP/BIOS or linux/include/ti/ipc/Std.h did not contain the * '#ifndef_TI_STD_TYPES' logic. */ /* * Aliases for standard C types */ typedef int Int; typedef unsigned Uns; typedef char Char; /* pointer to null-terminated character sequence */ typedef char *String; typedef void *Ptr; /* pointer to arbitrary type */ typedef unsigned short Bool; /* boolean */ /* Define TRUE/FALSE to go with Bool */ /* Unsigned integer definitions (32bit, 16bit, 8bit) follow... */ typedef uint32_t Uint32; typedef uint16_t Uint16; typedef uint8_t Uint8; /* Signed integer definitions (32bit, 16bit, 8bit) follow... */ typedef int32_t Int32; typedef int16_t Int16; typedef int8_t Int8; /* Below typedefs aliases are needed for VPS Lib */ typedef uint32_t UInt32; typedef uint16_t UInt16; typedef uint8_t UInt8; typedef uint64_t UInt64; typedef float Float32; typedef double Double; /* SOC Alias Defines for backward compatibility */ /* the "expression" macros */ /* the Field MaKe macro */ /* the Field EXTract macro */ /* the Field INSert macro */ /* the "token" macros */ /* the Field MaKe (Token) macro */ /* the Field INSert (Token) macro */ /* the "raw" macros */ /* the Field MaKe (Raw) macro */ /* the Field EXTract (Raw) macro */ /* the Field INSert (Raw) macro */ /** * \brief This macro reads a pointer from a provided address * and returns the value. The access type is implicit based on * the pointer declaration. * * \param p Pointer to the memory or hardware register. * * \return Value read from the pointer. */ /** * \brief This macro writes a value to the pointer. The access type is * implicit based on the pointer declaration. * * \param p Pointer to the memory or hardware register. * \param v Value which has to be written to the pointer. */ /** * \brief This macro reads a 32-bit value from a hardware register * and returns the value. * * \param p Address of the memory mapped hardware register. * * \return Unsigned 32-bit value read from a register. */ /** * \brief This macro writes a 32-bit value to a hardware register. * * \param p Address of the memory mapped hardware register. * \param v Unsigned 32-bit value which has to be written to the * register. */ /** * \brief This macro reads a 16-bit value from a hardware register * and returns the value. * * \param p Address of the memory mapped hardware register. * * \return Unsigned 16-bit value read from a register. */ /** * \brief This macro writes a 16-bit value to a hardware register. * * \param p Address of the memory mapped hardware register. * \param v Unsigned 16-bit value which has to be written to the * register. */ /** * \brief This macro reads a 8-bit value from a hardware register * and returns the value. * * \param p Address of the memory mapped hardware register. * * \return Unsigned 8-bit value read from a register. */ /** * \brief This macro writes a 8-bit value to a hardware register. * * \param p Address of the memory mapped hardware register. * \param v Unsigned 8-bit value which has to be written to the * register. */ /** * \brief This macro reads a 32-bit value from a hardware register * with an offset and returns the value. * * \param p Address of the memory mapped hardware register. * \param off Offset in bytes. * * \return Unsigned 32-bit value read from a register. */ /** * \brief This macro writes a 32-bit value to a hardware register with * an offset. * * \param p Address of the memory mapped hardware register. * \param v Unsigned 32-bit value which has to be written to the * register. */ /** * \brief This macro calls read field API for 32 bit register. It also * frames the mask and shift from register field macro. * * \param p Address of the memory mapped hardware register. * \param fld Peripheral register bit field name, from which * specified bit-field value has to be read. * * \return Value of the bit-field (absolute value - shifted to LSB position) */ /** * \brief This macro calls read field API for 16 bit register. It also * frames the mask and shift from register field macro. * * \param p Address of the memory mapped hardware register. * \param fld Peripheral register bit field name, from which * specified bit-field value has to be read. * * \return Value of the bit-field (absolute value - shifted to LSB position) */ /** * \brief This macro calls read field API for 8 bit register. It also * frames the mask and shift from register field macro. * * \param p Address of the memory mapped hardware register. * \param fld Peripheral register bit field name, from which * specified bit-field value has to be read. * * \return Value of the bit-field (absolute value - shifted to LSB position) */ /** * \brief This macro calls read-modify-write API for 32 bit register. It also * frames the mask and shift from register field macro. * * \param p Address of the memory mapped hardware register. * \param fld Peripheral register bit field name, from which * specified bit-field value has to be set. * \param v Value of the field which has to be set. */ /** * \brief This macro calls read-modify-write API for 16 bit register. It also * frames the mask and shift from register field macro. * * \param p Address of the memory mapped hardware register. * \param fld Peripheral register bit field name, from which * specified bit-field value has to be set. * \param v Value of the field which has to be set. */ /** * \brief This macro calls read-modify-write API for 8 bit register. It also * frames the mask and shift from register field macro. * * \param p Address of the memory mapped hardware register. * \param fld Peripheral register bit field name, from which * specified bit-field value has to be set. * \param v Value of the field which has to be set. */ /* ========================================================================== */ /* Function Declarations */ /* ========================================================================== */ /** * \brief This function reads a 32-bit value from a hardware register * and returns the value. * * \param p Address of the memory mapped hardware register. * * \return Unsigned 32-bit value read from a register. */ static inline uint32_t CSL_REG32_RD_RAW(volatile const uint32_t * const p); static inline uint32_t CSL_REG32_RD_RAW(volatile const uint32_t * const p) { return (*p); } /** * \brief This function writes a 32-bit value to a hardware register. * * \param p Address of the memory mapped hardware register. * \param v Unsigned 32-bit value which has to be written to the * register. */ static inline void CSL_REG32_WR_RAW(volatile uint32_t * const p, uint32_t v); static inline void CSL_REG32_WR_RAW(volatile uint32_t * const p, uint32_t v) { *p = v; return; } /** * \brief This function reads a 16-bit value from a hardware register * and returns the value. * * \param p Address of the memory mapped hardware register. * * \return Unsigned 16-bit value read from a register. */ static inline uint16_t CSL_REG16_RD_RAW(volatile const uint16_t * const p); static inline uint16_t CSL_REG16_RD_RAW(volatile const uint16_t * const p) { return (*p); } /** * \brief This function writes a 16-bit value to a hardware register. * * \param p Address of the memory mapped hardware register. * \param v Unsigned 16-bit value which has to be written to the * register. */ static inline void CSL_REG16_WR_RAW(volatile uint16_t * const p, uint16_t v); static inline void CSL_REG16_WR_RAW(volatile uint16_t * const p, uint16_t v) { *p = v; return; } /** * \brief This function reads a 8-bit value from a hardware register * and returns the value. * * \param p Address of the memory mapped hardware register. * * \return Unsigned 8-bit value read from a register. */ static inline uint8_t CSL_REG8_RD_RAW(volatile const uint8_t * const p); static inline uint8_t CSL_REG8_RD_RAW(volatile const uint8_t * const p) { return (*p); } /** * \brief This function writes a 8-bit value to a hardware register. * * \param p Address of the memory mapped hardware register. * \param v Unsigned 8-bit value which has to be written to the * register. */ static inline void CSL_REG8_WR_RAW(volatile uint8_t * const p, uint8_t v); static inline void CSL_REG8_WR_RAW(volatile uint8_t * const p, uint8_t v) { *p = v; return; } /** * \brief This function reads a 32-bit value from a hardware register * with an offset and returns the value. * * \param p Address of the memory mapped hardware register. * \param off Offset in bytes. * * \return Unsigned 32-bit value read from a register. */ static inline uint32_t CSL_REG32_RD_OFF_RAW(volatile const uint32_t *p, uint32_t off); static inline uint32_t CSL_REG32_RD_OFF_RAW(volatile const uint32_t *p, uint32_t off) { return ((*(volatile const uint32_t *)(((const char *)(p)) + off))); } /** * \brief This function writes a 32-bit value to a hardware register with * an offset. * * \param p Address of the memory mapped hardware register. * \param off Offset in bytes. * \param v Unsigned 32-bit value which has to be written to the * register. */ static inline void CSL_REG32_WR_OFF_RAW(volatile uint32_t *p, uint32_t off, uint32_t v); static inline void CSL_REG32_WR_OFF_RAW(volatile uint32_t *p, uint32_t off, uint32_t v) { (*(volatile uint32_t *)(((char *)(p)) + off)) = (v); return; } /** * \brief This function reads a 32 bit register, masks specific set of bits * and returns the left shifted value. * * \param p Address of the memory mapped hardware register. * \param mask Mask for the bit field. * \param shift Bit field shift from LSB. * * \return Bit-field value (absolute value - shifted to LSB position) */ static inline uint32_t CSL_REG32_FEXT_RAW(volatile const uint32_t * const p, uint32_t mask, uint32_t shift); static inline uint32_t CSL_REG32_FEXT_RAW(volatile const uint32_t * const p, uint32_t mask, uint32_t shift) { uint32_t regVal = (CSL_REG32_RD_RAW((volatile uint32_t *) (p))); regVal = (regVal & mask) >> shift; return (regVal); } /** * \brief This function reads a 16 bit register, masks specific set of bits * and returns the left shifted value. * * \param p Address of the memory mapped hardware register. * \param mask Mask for the bit field. * \param shift Bit field shift from LSB. * * \return Bit-field value (absolute value - shifted to LSB position) */ static inline uint16_t CSL_REG16_FEXT_RAW(volatile const uint16_t * const p, uint16_t mask, uint32_t shift); static inline uint16_t CSL_REG16_FEXT_RAW(volatile const uint16_t * const p, uint16_t mask, uint32_t shift) { uint16_t regVal = (CSL_REG16_RD_RAW((volatile uint16_t *) (p))); regVal = (regVal & mask) >> shift; return (regVal); } /** * \brief This function reads a 8 bit register, masks specific set of bits * and returns the left shifted value. * * \param p Address of the memory mapped hardware register. * \param mask Mask for the bit field. * \param shift Bit field shift from LSB. * * \return Bit-field value (absolute value - shifted to LSB position) */ static inline uint8_t CSL_REG8_FEXT_RAW(volatile const uint8_t * const p, uint8_t mask, uint32_t shift); static inline uint8_t CSL_REG8_FEXT_RAW(volatile const uint8_t * const p, uint8_t mask, uint32_t shift) { uint8_t regVal = (CSL_REG8_RD_RAW((volatile uint8_t *) (p))); regVal = (regVal & mask) >> shift; return (regVal); } /** * \brief This function reads a 32 bit register, modifies specific set of * bits and writes back to the register. * * \param p Address of the memory mapped hardware register. * \param mask Mask for the bit field. * \param shift Bit field shift from LSB. * \param v Value to be written to bit-field. */ static inline void CSL_REG32_FINS_RAW(volatile uint32_t * const p, uint32_t mask, uint32_t shift, uint32_t v); static inline void CSL_REG32_FINS_RAW(volatile uint32_t * const p, uint32_t mask, uint32_t shift, uint32_t v) { uint32_t regVal = (CSL_REG32_RD_RAW((volatile uint32_t *) (p))); regVal = (regVal & ~(mask)); regVal |= (v << shift) & mask; (CSL_REG32_WR_RAW( (volatile uint32_t *) (p), (uint32_t) (regVal))); return; } /** * \brief This function reads a 16 bit register, modifies specific set of * bits and writes back to the register. * * \param p Address of the memory mapped hardware register. * \param mask Mask for the bit field. * \param shift Bit field shift from LSB. * \param v Value to be written to bit-field. */ static inline void CSL_REG16_FINS_RAW(volatile uint16_t * const p, uint16_t mask, uint32_t shift, uint16_t v); static inline void CSL_REG16_FINS_RAW(volatile uint16_t * const p, uint16_t mask, uint32_t shift, uint16_t v) { uint16_t regVal = (CSL_REG16_RD_RAW((volatile uint16_t *) (p))); regVal = (regVal & ~(mask)); regVal |= (v << shift) & mask; (CSL_REG16_WR_RAW( (volatile uint16_t *) (p), (uint16_t) (regVal))); return; } /** * \brief This function reads a 8 bit register, modifies specific set of * bits and writes back to the register. * * \param p Address of the memory mapped hardware register. * \param mask Mask for the bit field. * \param shift Bit field shift from LSB. * \param v Value to be written to bit-field. */ static inline void CSL_REG8_FINS_RAW(volatile uint8_t * const p, uint8_t mask, uint32_t shift, uint8_t v); static inline void CSL_REG8_FINS_RAW(volatile uint8_t * const p, uint8_t mask, uint32_t shift, uint8_t v) { uint8_t regVal = (CSL_REG8_RD_RAW((volatile uint8_t *) (p))); regVal = (regVal & ~(mask)); regVal |= (v << shift) & mask; (CSL_REG8_WR_RAW( (volatile uint8_t *) (p), (uint8_t) (regVal))); return; } /** * \mainpage Chip Support Library * * \par IMPORTANT NOTE * * The interfaces defined in this package are bound to change. * Kindly treat the interfaces as work in progress. * Release notes/user guide list the additional limitation/restriction * of this module/interfaces. * See also \ref TI_DISCLAIMER. * * * Chip Support Library(CSL) provides a no-OS platform support for * multi-core SoCs. CSL provides CSL Functional Layer (CSL-FL) libraries and * CSL Register Layer (CSL-R) along with peripheral/board level sample/demo * examples that demonstrate the capabilities of the peripherals. * * * Also refer to top level user guide for detailed features, * limitations and usage description. * * * The CSL-FL includes the following modules/drivers * - HW Type Defines (See \ref HW_TYPES)
* In-line functions required to read/write values from/to the hardware registers * * - IP's
* - Video Module
* - DSS (See \ref CSL_DSS)
* - System Module
* - EDMA (See \ref CSL_EDMA)
* - EPWM (See \ref CSL_EPWM)
* - GPIO (See \ref CSL_GPIO)
* - Mailbox (See \ref CSL_MAILBOX)
* - MMU (See \ref CSL_MMU)
* - Spinlock (See \ref CSL_SPINLOCK)
* - Timer (See \ref CSL_TIMER)
* - WD Timer (See \ref CSL_WD_TIMER)
* - Safety/Security Module
* - ADC (See \ref CSL_ADC)
* - CRC (See \ref CSL_CRC)
* - DCC (See \ref CSL_DCC)
* - ESM (See \ref CSL_ESM)
* - L4 Firewall (See \ref CSL_L3_FIREWALL)
* - L4 Firewall (See \ref CSL_L4_FIREWALL)
* - Tesoc (See \ref CSL_TESOC)
* - RTI (See \ref CSL_RTI)
* - Serial Module
* - DCAN (See \ref CSL_DCAN)
* - I2C (See \ref CSL_I2C)
* - MCAN (See \ref CSL_MCAN)
* - McSPI (See \ref CSL_MCSPI)
* - QSPI (See \ref CSL_QSPI)
* - UART (See \ref CSL_UART)
* - PCIe (See \ref CSL_PCIE)
* - Memory Controller
* - EMIF (See \ref CSL_EMIF)
* - GPMC (See \ref CSL_GPMC)
* - OCMC (See \ref CSL_IP_MODULE_OCMC)
* - Memory/Storage
* - MMCSD (See \ref CSL_MMCSD)
* * - SOC Module
* This Module contain the SOC level configuration API's such as cross bar configuration, cross bar defines, SOC defines * - Device Common API's (See \ref CSL_DEVICE_COMMON)
* - TDA2EX (See \ref SOC_TDA2EX)
* - TDA2PX (See \ref SOC_TDA2PX)
* - TDA2XX (See \ref SOC_TDA2XX)
* - TDA3XX (See \ref SOC_TDA3XX)
* * - ARCH Module
* This Module contain the core specific configuration API's such as Interrupt, Cache, ECC * - A15 (See \ref CSL_ARCH_A15)
* - DSP-C66x (See \ref CSL_ARCH_C66X)
* - M4 (See \ref CSL_ARCH_M4)
* - EVE (See \ref CSL_ARCH_ARP32)
*/ /** * \page TI_DISCLAIMER TI Disclaimer * * \htmlinclude ti_disclaim.htm */ /* * Copyright (C) 2005-2017 Texas Instruments Incorporated. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * ======== tistdtypes.h ======== */ /* * These types are also defined by other TI components. They are bracketed * with _TI_STD_TYPES to avoid warnings for duplicate definition. * * You may get warnings about duplicate type definitions when using this * header file with earlier versions of DSP/BIOS and CSL. * * You can use the '-pds303' compiler option to suppress these warnings. */ /****************************************************************************** Static inline definition \*****************************************************************************/ /* * * Copyright (C) 2011-2018 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * Auto-generated CSL section */ /* * Auto-generated CSL section */ /* * Auto-generated CSL section */ /* * Auto-generated CSL section */ /* * Auto-generated CSL section */ /* * Auto-generated CSL section */ /* * Auto-generated CSL section */ /* * Auto-generated CSL section */ /* * Auto-generated CSL section */ /* * Auto-generated CSL section */ /* =========================================================================== * Copyright (c) Texas Instruments Incorporated 2002, 2003, 2004, 2005, 2006, 2008 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /** ============================================================================ * @file csl.h * * @path $(CSLPATH)\inc * * @desc This file contains the Register Desciptions for CSL * */ /* ============================================================================ * Copyright (c) Texas Instruments Incorporated 2002, 2003, 2004, 2005, 2006, 2008 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /** * \file csl_types.h * * \brief This file contains the Register Desciptions for CSL types */ /* * Copyright (C) 2005-2017 Texas Instruments Incorporated. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * ======== tistdtypes.h ======== */ /* * These types are also defined by other TI components. They are bracketed * with _TI_STD_TYPES to avoid warnings for duplicate definition. * * You may get warnings about duplicate type definitions when using this * header file with earlier versions of DSP/BIOS and CSL. * * You can use the '-pds303' compiler option to suppress these warnings. */ /** * \anchor CSL_Type_t * \name CSL Types * * CSL data types. * * @{ */ typedef Int16 CSL_Uid; typedef Int16 CSL_ModuleId; typedef Uint32 CSL_Xio; typedef Uint8 CSL_BitMask8; typedef Uint16 CSL_BitMask16; typedef Uint32 CSL_BitMask32; typedef volatile Uint8 CSL_Reg8; typedef volatile Uint16 CSL_Reg16; typedef volatile Uint32 CSL_Reg32; typedef Int16 CSL_Status; typedef Int16 CSL_InstNum; typedef Int16 CSL_ChaNum; typedef unsigned long long int CSL_Uint64; /* @} */ /** \brief CSL open mode */ typedef enum { CSL_EXCLUSIVE = 0, CSL_SHARED = 1 } CSL_OpenMode; /** \brief CSL error type */ typedef int32_t CSL_ErrType_t; /** * \anchor CSL_ErrType_t * \name CSL Error Types * * CSL function return error codes. * * @{ */ /* @} */ /** \brief Define NULL if not defined */ /** * \anchor STW_ErrType_t * \name STW Error Types * * CSL function return error codes meant for backward compatibility. * * @{ */ /* @} */ /* ============================================================================ * Copyright (c) Texas Instruments Incorporated 2002, 2003, 2004, 2005, 2006, 2008 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /** ============================================================================ * @file csl_error.h * * @path $(CSLPATH)\inc * * @desc This file contains the Register Desciptions for ERRORs * */ /* ---- File: ---- */ /* Below Error codes are Global across all CSL Modules. */ /* Peripheral IDs */ /* Error codes individual to various modules. */ /* Error code for DMA, individual error would be assigned as * eg: #define CSL_E_ CSL_EDMA_FIRST - 1 */ /****************************************************************************** Static inline definition \*****************************************************************************/ void CSL_sysInit ( void ); /** @defgroup CSL_TSC_FUNCTION TSC Functions @ingroup CSL_TSC_API */ /** @addtogroup CSL_TSC_FUNCTION @{ */ /** =========================================================================== * @n@b CSL_tscEnable * * @b Description * @n This API enables the 64 bit time stamp counter. The Time Stamp Counter * (TSC) stops only upon Reset or powerdown. When time stamp counter is * enabled (following a reset or powerdown of the CPU) it will initialize * to 0 and begin incrementing once per CPU cycle. You cannot reset the * time stamp counter. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n Time Stamp Counter value starts incrementing * * @b Writes * @n TSCL=0, * TSCH=0 * * @b Example * @verbatim CSL_tscEnable (); * @endverbatim * ============================================================================ */ extern void CSL_tscEnable(void); /** ============================================================================ * @n@b CSL_tscRead * * @b Description * @n Reads the 64 bit timer stamp conter and return the 64-bit counter value. * * @b Arguments None * * Return Value CSL_Uint64 * @li 64 Bit Time Stamp Counter value * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * TSCL, * TSCH * * @b Example * @verbatim CSL_Uint64 counterVal; ... CSL_tscStart(); ... counterVal = CSL_tscRead(); * @endverbatim * ============================================================================ */ extern CSL_Uint64 CSL_tscRead (void); /** @} */ /** * @file csl_cache.h * * @brief * This is the CACHE Auxilary Header File which exposes the various * CSL Functional Layer API's to configure the CACHE Module. * * \par * ============================================================================ * @n (C) Copyright 2002, 2003, 2004, 2005, 2008, 2009, 2016 Texas Instruments, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /** @defgroup CSL_CACHE_API CACHE * * @section Introduction * * @subsection xxx Overview * This page describes the Functions, Data Structures, Enumerations and Macros * within CACHE module. * * This module uses three cache architectures, Level 1 Program (L1P), Level 1 * Data (L1D) and Level 2 CACHE architectures, The L1P and L1D can be * configured as 0K, 4K, 8K, 16K, or 32K CACHE size. The L2 can be configured * as 32KB, 64KB, 128KB, or 256KB CACHE size. This CACHE module supports the * Block and Global Coherence Operations. * * @subsection References * -# TMS320TCI6484 Data Sheet SPRS438 (Dec 2007) * */ /******************************************************************** * Copyright (C) 2013-2017 Texas Instruments Incorporated. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * Copyright (C) 2005-2017 Texas Instruments Incorporated. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * ======== tistdtypes.h ======== */ /* * These types are also defined by other TI components. They are bracketed * with _TI_STD_TYPES to avoid warnings for duplicate definition. * * You may get warnings about duplicate type definitions when using this * header file with earlier versions of DSP/BIOS and CSL. * * You can use the '-pds303' compiler option to suppress these warnings. */ /******************************************************************** * Copyright (C) 2013-2016 Texas Instruments Incorporated. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * Copyright (C) 2005-2017 Texas Instruments Incorporated. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * ======== tistdtypes.h ======== */ /* * These types are also defined by other TI components. They are bracketed * with _TI_STD_TYPES to avoid warnings for duplicate definition. * * You may get warnings about duplicate type definitions when using this * header file with earlier versions of DSP/BIOS and CSL. * * You can use the '-pds303' compiler option to suppress these warnings. */ /************************************************************************** * Register Overlay Structure for CGEMaddressBlockTable **************************************************************************/ typedef struct { volatile Uint32 EVTFLAG[4]; volatile Uint8 RSVD0[16]; volatile Uint32 EVTSET[4]; volatile Uint8 RSVD1[16]; volatile Uint32 EVTCLR[4]; volatile Uint8 RSVD2[48]; volatile Uint32 EVTMASK[4]; volatile Uint8 RSVD3[16]; volatile Uint32 MEVTFLAG[4]; volatile Uint8 RSVD4[16]; volatile Uint32 EXPMASK[4]; volatile Uint8 RSVD5[16]; volatile Uint32 MEXPFLAG[4]; volatile Uint8 RSVD6[20]; volatile Uint32 INTMUX1; volatile Uint32 INTMUX2; volatile Uint32 INTMUX3; volatile Uint8 RSVD7[48]; volatile Uint32 AEGMUX0; volatile Uint32 AEGMUX1; volatile Uint8 RSVD8[56]; volatile Uint32 INTXSTAT; volatile Uint32 INTXCLR; volatile Uint32 INTDMASK; volatile Uint8 RSVD9[52]; volatile Uint32 EVTASRT; volatile Uint8 RSVD10[65084]; volatile Uint32 PDCCMD; volatile Uint8 RSVD11[4348]; volatile Uint32 EDCINTMASK; volatile Uint8 RSVD12[3836]; volatile Uint32 MM_REVID; volatile Uint8 RSVD13[57340]; volatile Uint32 IDMA0_STAT; volatile Uint32 IDMA0_MASK; volatile Uint32 IDMA0_SOURCE; volatile Uint32 IDMA0_DEST; volatile Uint32 IDMA0_COUNT; volatile Uint8 RSVD14[236]; volatile Uint32 IDMA1_STAT; volatile Uint8 RSVD15[4]; volatile Uint32 IDMA1_SOURCE; volatile Uint32 IDMA1_DEST; volatile Uint32 IDMA1_COUNT; volatile Uint8 RSVD16[236]; volatile Uint32 CPUARBE; volatile Uint32 IDMAARBE; volatile Uint32 SDMAARBE; volatile Uint8 RSVD17[4]; volatile Uint32 ECFGARBE; volatile Uint8 RSVD18[236]; volatile Uint32 ICFGMPFAR; volatile Uint32 ICFGMPFSR; volatile Uint32 ICFGMPFCR; volatile Uint8 RSVD19[252]; volatile Uint32 ECFGERR; volatile Uint32 ECFGERRCLR; volatile Uint8 RSVD20[240]; volatile Uint32 PAMAP0; volatile Uint32 PAMAP1; volatile Uint32 PAMAP2; volatile Uint32 PAMAP3; volatile Uint32 PAMAP4; volatile Uint32 PAMAP5; volatile Uint32 PAMAP6; volatile Uint32 PAMAP7; volatile Uint32 PAMAP8; volatile Uint32 PAMAP9; volatile Uint32 PAMAP10; volatile Uint32 PAMAP11; volatile Uint32 PAMAP12; volatile Uint32 PAMAP13; volatile Uint32 PAMAP14; volatile Uint32 PAMAP15; volatile Uint8 RSVD21[3012]; volatile Uint32 EDCINTFLG; volatile Uint32 L1DEDCMD; volatile Uint32 L1DDCSTAT; volatile Uint32 L1DDNCSTAT; volatile Uint32 L1DTCSTAT; volatile Uint32 L1DTNCSTAT; volatile Uint32 L1DDEDADDR; volatile Uint32 L1DTEDADDR; volatile Uint32 L1DEDCNT; volatile Uint32 L2TEDCMD; volatile Uint32 L2TCSTAT; volatile Uint32 L2TNCSTAT; volatile Uint32 L2TEDADDR; volatile Uint32 L2MCSTAT; volatile Uint32 L2MNCSTAT; volatile Uint32 L2MEDADDR; volatile Uint32 L2SCSTAT; volatile Uint32 L2SNCSTAT; volatile Uint32 L2SEDADDR; volatile Uint32 L2LCSTAT; volatile Uint32 L2LNCSTAT; volatile Uint32 L2LEDADDR; volatile Uint32 L2TEDCNT; volatile Uint32 L1PTEDCMD; volatile Uint32 L1PTEDSTAT; volatile Uint32 L1PTEDADDR; volatile Uint32 L1DTEDCNT; volatile Uint8 RSVD22[126608]; volatile Uint32 L2CFG; volatile Uint8 RSVD23[28]; volatile Uint32 L1PCFG; volatile Uint32 L1PCC; volatile Uint8 RSVD24[24]; volatile Uint32 L1DCFG; volatile Uint32 L1DCC; volatile Uint8 RSVD25[4024]; volatile Uint32 CPUARBU; volatile Uint32 IDMAARBU; volatile Uint32 SDMAARBU; volatile Uint32 UCARBU; volatile Uint32 MDMAARBU; volatile Uint8 RSVD26[44]; volatile Uint32 CPUARBD; volatile Uint32 IDMAARBD; volatile Uint32 SDMAARBD; volatile Uint32 UCARBD; volatile Uint8 RSVD27[12208]; volatile Uint32 L2WBAR; volatile Uint32 L2WWC; volatile Uint8 RSVD28[8]; volatile Uint32 L2WIBAR; volatile Uint32 L2WIWC; volatile Uint32 L2IBAR; volatile Uint32 L2IWC; volatile Uint32 L1PIBAR; volatile Uint32 L1PIWC; volatile Uint8 RSVD29[8]; volatile Uint32 L1DWIBAR; volatile Uint32 L1DWIWC; volatile Uint8 RSVD30[8]; volatile Uint32 L1DWBAR; volatile Uint32 L1DWWC; volatile Uint32 L1DIBAR; volatile Uint32 L1DIWC; volatile Uint8 RSVD31[4016]; volatile Uint32 L2WB; volatile Uint32 L2WBINV; volatile Uint32 L2INV; volatile Uint8 RSVD32[28]; volatile Uint32 L1PINV; volatile Uint8 RSVD33[20]; volatile Uint32 L1DWB; volatile Uint32 L1DWBINV; volatile Uint32 L1DINV; volatile Uint8 RSVD34[4024]; volatile Uint32 L2EDSTAT; volatile Uint32 L2EDCMD; volatile Uint32 L2EDADDR; volatile Uint8 RSVD35[8]; volatile Uint32 L2EDCPEC; volatile Uint32 L2EDCNEC; volatile Uint32 MDMAERR; volatile Uint32 MDMAERRCLR; volatile Uint8 RSVD36[8]; volatile Uint32 L2EDCEN; volatile Uint8 RSVD37[976]; volatile Uint32 L1PEDSTAT; volatile Uint32 L1PEDCMD; volatile Uint32 L1PEDADDR; volatile Uint8 RSVD38[7152]; volatile Uint32 MAR[256]; volatile Uint8 RSVD39[7168]; volatile Uint32 L2MPFAR; volatile Uint32 L2MPFSR; volatile Uint32 L2MPFCR; volatile Uint8 RSVD40[500]; volatile Uint32 L2MPPA[32]; volatile Uint8 RSVD41[384]; volatile Uint32 L1PMPFAR; volatile Uint32 L1PMPFSR; volatile Uint32 L1PMPFCR; volatile Uint8 RSVD42[564]; volatile Uint32 L1PMPPA[16]; volatile Uint8 RSVD43[1408]; volatile Uint32 L1DMPFAR; volatile Uint32 L1DMPFSR; volatile Uint32 L1DMPFCR; volatile Uint8 RSVD44[244]; volatile Uint32 MPLK[4]; volatile Uint32 MPLKCMD; volatile Uint32 MPLKSTAT; volatile Uint8 RSVD45[296]; volatile Uint32 L1DMPPA[16]; volatile Uint8 RSVD46[2147291]; } CSL_CgemRegs; /************************************************************************** * Register Macros **************************************************************************/ /************************************************************************** * Field Definition Macros **************************************************************************/ /* EVTFLAG */ /* EVTSET */ /* EVTCLR */ /* EVTMASK */ /* MEVTFLAG */ /* EXPMASK */ /* MEXPFLAG */ /* INTMUX1 */ /* INTMUX2 */ /* INTMUX3 */ /* AEGMUX0 */ /* AEGMUX1 */ /* INTXSTAT */ /* INTXCLR */ /* INTDMASK */ /* EVTASRT */ /* PDCCMD */ /* EDCINTMASK */ /* MM_REVID */ /* IDMA0_STAT */ /* IDMA0_MASK */ /* IDMA0_SOURCE */ /* IDMA0_DEST */ /* IDMA0_COUNT */ /* IDMA1_STAT */ /* IDMA1_SOURCE */ /* IDMA1_DEST */ /* IDMA1_COUNT */ /* CSL_MODIFICATION: Update from Autogen output */ /* CPUARBE */ /* IDMAARBE */ /* SDMAARBE */ /* ECFGARBE */ /* ICFGMPFAR */ /* ICFGMPFSR */ /* ICFGMPFCR */ /* ECFGERR */ /* ECFGERRCLR */ /* PAMAP0 */ /* PAMAP1 */ /* PAMAP2 */ /* PAMAP3 */ /* PAMAP4 */ /* PAMAP5 */ /* PAMAP6 */ /* PAMAP7 */ /* PAMAP8 */ /* PAMAP9 */ /* PAMAP10 */ /* PAMAP11 */ /* PAMAP12 */ /* PAMAP13 */ /* PAMAP14 */ /* PAMAP15 */ /* EDCINTFLG */ /* L1DEDCMD */ /* L1DDCSTAT */ /* L1DDNCSTAT */ /* L1DTCSTAT */ /* L1DTNCSTAT */ /* L1DDEDADDR */ /* L1DTEDADDR */ /* L1DEDCNT */ /* L2TEDCMD */ /* L2TCSTAT */ /* L2TNCSTAT */ /* L2TEDADDR */ /* L2MCSTAT */ /* L2MNCSTAT */ /* L2MEDADDR */ /* L2SCSTAT */ /* L2SNCSTAT */ /* L2SEDADDR */ /* L2LCSTAT */ /* L2LNCSTAT */ /* L2LEDADDR */ /* L2TEDCNT */ /* L1PTEDCMD */ /* L1PTEDSTAT */ /* L1PTEDADDR */ /* L1DTEDCNT */ /* L2CFG */ /* L1PCFG */ /* L1PCC */ /* L1DCFG */ /* L1DCC */ /* CPUARBU */ /* IDMAARBU */ /* SDMAARBU */ /* UCARBU */ /* MDMAARBU */ /* CPUARBD */ /* IDMAARBD */ /* SDMAARBD */ /* UCARBD */ /* L2WBAR */ /* L2WWC */ /* L2WIBAR */ /* L2WIWC */ /* L2IBAR */ /* L2IWC */ /* L1PIBAR */ /* L1PIWC */ /* L1DWIBAR */ /* L1DWIWC */ /* L1DWBAR */ /* L1DWWC */ /* L1DIBAR */ /* L1DIWC */ /* L2WB */ /* L2WBINV */ /* L2INV */ /* L1PINV */ /* L1DWB */ /* L1DWBINV */ /* L1DINV */ /* L2EDSTAT */ /* L2EDCMD */ /* L2EDADDR */ /* L2EDCPEC */ /* L2EDCNEC */ /* MDMAERR */ /* MDMAERRCLR */ /* L2EDCEN */ /* L1PEDSTAT */ /* L1PEDCMD */ /* L1PEDADDR */ /* MAR0 */ /* MAR */ /* L2MPFAR */ /* L2MPFSR */ /* L2MPFCR */ /* L2MPPA */ /* L1PMPFAR */ /* L1PMPFSR */ /* L1PMPFCR */ /* L1PMPPA */ /* L1DMPFAR */ /* L1DMPFSR */ /* L1DMPFCR */ /* MPLK */ /* MPLKCMD */ /* MPLKSTAT */ /* L1DMPPA */ /** @defgroup CSL_CACHE_SYMBOL CACHE Symbols Defined @ingroup CSL_CACHE_API */ /** @defgroup CSL_CACHE_ENUM CACHE Enumerated Data Types @ingroup CSL_CACHE_API */ /** @defgroup CSL_CACHE_FUNCTION CACHE Functions @ingroup CSL_CACHE_API */ /** @addtogroup CSL_CACHE_SYMBOL @{ */ /** L2 Line Size */ /** L1D Line Size */ /** L1P Line Size */ /** Handle to the CGEM Register Layer */ /** Cache Round to Line size */ /** @} */ /******************************************************************************* global macro declarations \******************************************************************************/ /** @addtogroup CSL_CACHE_ENUM @{ */ /** @brief Enumeration for Cache wait flags * * This is used for specifying whether the cache operations should block till * the desired operation is complete. */ typedef enum { /** No blocking, the call exits after programmation of the * control registers */ CACHE_NOWAIT = 0, /** Blocking Call, the call exits after the relevant cache * status registers indicate completion. For block coherence * this waits on the Word count register to be come 0 along * with invalidating the prefetch buffer. */ CACHE_WAIT = 1, /** Blocking Call, For block coherence this uses the MFENCE to * wait for completion, along with invalidating the prefetch * buffer. */ CACHE_FENCE_WAIT = 2, /** Blocking Call, the call exits after the relevant cache * status registers indicate completion. For block coherence * this waits on the Word count register to be come 0. */ CACHE_ONLY_WAIT = 3, /** Blocking Call, For block coherence this uses the MFENCE only to * wait for completion */ CACHE_FENCE_ONLY_WAIT = 4 }CACHE_Wait; /** @brief Enumeration for L1 (P or D) Sizes */ typedef enum { /** No Cache */ CACHE_L1_0KCACHE = 0, /** 4KB Cache */ CACHE_L1_4KCACHE = 1, /** 8KB Cache */ CACHE_L1_8KCACHE = 2, /** 16KB Cache */ CACHE_L1_16KCACHE = 3, /** 32KB Cache */ CACHE_L1_32KCACHE = 4, /** MAX Cache Size */ CACHE_L1_MAXIM1 = 5, /** MAX Cache Size */ CACHE_L1_MAXIM2 = 6, /** MAX Cache Size */ CACHE_L1_MAXIM3 = 7 } CACHE_L1Size; /** @brief Enumeration for L2 Sizes */ /** For devices that have maximum caches less * than the defined values, setting a higher value * will map to maximum cache */ typedef enum { /** No Cache */ CACHE_0KCACHE = 0, /** 32KB Cache */ CACHE_32KCACHE = 1, /** 64KB Cache */ CACHE_64KCACHE = 2, /** 128KB Cache */ CACHE_128KCACHE = 3, /** 256KB Cache */ CACHE_256KCACHE = 4, /** 512KB Cache */ CACHE_512KCACHE = 5, /* 1024KB Cache */ CACHE_1024KCACHE = 6 } CACHE_L2Size; /** @} */ /** * @file csl_cacheAux.h * * @brief * This is the CACHE Auxilary Header File which exposes the various * CSL Functional Layer API's to configure the CACHE Module. * * \par * ============================================================================ * @n (C) Copyright 2002, 2003, 2004, 2005, 2008, 2009, 2016 Texas Instruments, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* ============================================================================ * Copyright (c) Texas Instruments Incorporated 2008, 2009 2016 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /** * @file csl_xmcAux.h * * @brief * API Auxilary header file for XMC CSL. It gives the definitions of the * status query & control functions. * * \par * ============================================================================ * @n (C) Copyright 2008, 2009, Texas Instruments, Inc. * @n Use of this software is controlled by the terms and conditions found * @n in the license agreement under which this software has been supplied. * =========================================================================== * \par */ /* ============================================================================ * Copyright (c) Texas Instruments Incorporated 2008, 2009 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /** * @file csl_xmc.h * * @brief * XMC CSL Implementation on DSP side * * \par * ============================================================================ * @n (C) Copyright 2008, 2009, Texas Instruments, Inc. * @n Use of this software is controlled by the terms and conditions found * @n in the license agreement under which this software has been supplied. * =========================================================================== * \par */ /** @defgroup CSL_XMC_API XMC * * @section Introduction * * @subsection xxx Overview * * The XMC takes on the following roles: * a) UMC to VBusM conversion * b) Shared memory access path * c) Prefetch support * d) Address extension/translation * e) Memory protection for addresses outside CGEM eg. MSMC RAM or EMIF * * @subsection References * -# XMC User's Guide * * @subsection Assumptions * The abbreviations XMC, xmc and Xmc have been used throughout this * document to refer to CGEM eXtended Memory Controller */ /******************************************************************** * Copyright (C) 2013- 2016 Texas Instruments Incorporated. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* CSL Modification: * The file has been modified from the AUTOGEN file for the following * reasons:- * a) Modified the 'CSL_XmcRegs' register overlay structure. Merged * the XMPAXL0, XMPAXH0, XMPAXL1, XMPAXH1 into the XMPAX array * and made XMPAX[] array an array of 16 such register pairs. This * was done because all the XMPAXL/H register pairs 0-15 had the * exact same bit fields and masks and only diferred in the * reset values (which we do not use programatically). This * simplifies the code and use of the APIs lot more simpler and * more consistent. * b) Modified the header file includes to be RTSC compliant */ /* * Copyright (C) 2005-2017 Texas Instruments Incorporated. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * ======== tistdtypes.h ======== */ /* * These types are also defined by other TI components. They are bracketed * with _TI_STD_TYPES to avoid warnings for duplicate definition. * * You may get warnings about duplicate type definitions when using this * header file with earlier versions of DSP/BIOS and CSL. * * You can use the '-pds303' compiler option to suppress these warnings. */ /* Minimum unit = 1 byte */ /*************************************************************************** Register Overlay Structure for XMPAX \**************************************************************************/ typedef struct { volatile Uint32 XMPAXL; volatile Uint32 XMPAXH; } CSL_XmcXmpaxRegs; /************************************************************************** * Register Overlay Structure **************************************************************************/ typedef struct { CSL_XmcXmpaxRegs XMPAX[16]; volatile Uint8 RSVD0[384]; volatile Uint32 XMPFAR; volatile Uint32 XMPFSR; volatile Uint32 XMPFCR; volatile Uint8 RSVD1[116]; volatile Uint32 MDMAARBX; volatile Uint8 RSVD2[124]; volatile Uint32 XPFCMD; volatile Uint32 XPFACS; volatile Uint8 RSVD3[8]; volatile Uint32 XPFAC0; volatile Uint32 XPFAC1; volatile Uint32 XPFAC2; volatile Uint32 XPFAC3; volatile Uint8 RSVD4[224]; volatile Uint32 XPFADDR[8]; volatile Uint8 RSVD5[64476]; volatile Uint32 XEDIAX; } CSL_XmcRegs; /************************************************************************** * Register Macros **************************************************************************/ /* Field Definition Macros \**************************************************************************/ /* XMPAXL */ /* XMPAXH */ /* XMPAXL0 */ /* XMPAXH0 */ /* XMPAXL1 */ /* XMPAXH1 */ /* XMPFAR */ /* XMPFSR */ /* XMPFCR */ /* MDMAARBX */ /* XPFCMD */ /* XPFACS */ /* XPFAC0 */ /* XPFAC1 */ /* XPFAC2 */ /* XPFAC3 */ /* XPFADDR */ /** @defgroup CSL_XMC_SYMBOL XMC Symbols Defined @ingroup CSL_XMC_API */ /** @defgroup CSL_XMC_DATASTRUCT XMC Data Structures @ingroup CSL_XMC_API */ /** @defgroup CSL_XMC_FUNCTION XMC Functions @ingroup CSL_XMC_API */ /** @addtogroup CSL_XMC_DATASTRUCT @{ */ /** @brief This is the definition of CSL_XMC_XMPAXH */ typedef struct CSL_XMC_XMPAXH_s { /** Base Address */ Uint32 bAddr; /** Encoded Segment Size */ Uint8 segSize; }CSL_XMC_XMPAXH; /** @brief This is the definition of CSL_XMC_XMPAXL */ typedef struct CSL_XMC_XMPAXL_s { /** Replacement Address */ Uint32 rAddr; /** When set, supervisor may read from segment */ Uint32 sr; /** When set, supervisor may write to segment */ Uint32 sw; /** When set, supervisor may execute from segment */ Uint32 sx; /** When set, user may read from segment */ Uint32 ur; /** When set, user may write to segment */ Uint32 uw; /** When set, user may execute from segment */ Uint32 ux; }CSL_XMC_XMPAXL; /** @brief This is the definition of CSL_XMC_MPFSR */ typedef struct CSL_XMC_MPFSR_s { /** Local Access ? */ Uint32 local; /** When set, indicates a Supervisor Read Request */ Uint32 sr; /** When set, indicates a Supervisor Write Request */ Uint32 sw; /** When set, indicates a Supervisor program fetch Request */ Uint32 sx; /** When set, indicates a User Read Request */ Uint32 ur; /** When set, indicates a User Write Request */ Uint32 uw; /** When set, indicates a User program fetch Request */ Uint32 ux; }CSL_XMC_MPFSR; /** @brief This is the definition of CSL_XMC_XPFADDR */ typedef struct CSL_XMC_XPFADDR_s { /** Stream address (128-bit aligned) */ Uint32 addr; /** Sign bit of stream direction (0=fwd, 1=rev) */ Uint32 dir; /** Data pending for upper ("high") half */ Uint32 dph; /** Data valid for upper half */ Uint32 dvh; /** Address valid for upper half */ Uint32 avh; /** Data pending for lower half */ Uint32 dpl; /** Data valid for lower half */ Uint32 dvl; /** Address valid for lower half */ Uint32 avl; }CSL_XMC_XPFADDR; /** @brief This is the definition of CSL_XMC_ACEN_MODE */ typedef enum { /** Disable analysis counters. */ CSL_XMC_ACEN_MODE_COUNT_DISABLE = 0, /** Count Program events only. */ CSL_XMC_ACEN_MODE_COUNT_PROGEVENTS = 1, /** Count Data events only. */ CSL_XMC_ACEN_MODE_COUNT_DATAEVENTS = 2, /** Count both program and data events. */ CSL_XMC_ACEN_MODE_COUNT_ALL = 3 }CSL_XMC_ACEN_MODE; /** * Handle to access XMC registers accessible through config bus. */ /** @} */ /** @addtogroup CSL_XMC_FUNCTION @{ */ /** ============================================================================ * @n@b CSL_XMC_setXMPAXH * * @b Description * @n This function sets the contents of XMPAXH register indicated by the * index here. * please see section 7.3 on MPAX unit http://www.ti.com/lit/sprugw0 * for details on the sample arguments and example values to set * XMPAXH register as provided under table 7-2 * * @b Arguments @verbatim index Index into the set of 16 registers (0-15) mpaxh CSL_XMC_XMPAXH structure that needs to be set into the register @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n Corresponding XMPAXH register configured with the value passed. * * @b Writes * @n XMC_XMPAXH_SEGSZ, XMC_XMPAXH_BADDR * * @b Example * @verbatim Uint32 index = 0; CSL_XMC_XMPAXH mpaxh; mpaxh.segSize = 4; mpaxh.baseAddress = 0x1000; CSL_XMC_setXMPAXH (index, &mpaxh); @endverbatim * ============================================================================= */ static inline void CSL_XMC_setXMPAXH ( Uint32 index, const CSL_XMC_XMPAXH* mpaxh ); static inline void CSL_XMC_setXMPAXH ( Uint32 index, const CSL_XMC_XMPAXH* mpaxh ) { ((CSL_XmcRegs*)(0x08000000))->XMPAX[index].XMPAXH = (((mpaxh->segSize) << ((uint32_t)0x00000000u)) & ((uint32_t)0x0000001Fu)) | (((mpaxh->bAddr) << ((uint32_t)0x0000000Cu)) & ((uint32_t)0xFFFFF000u)); } /** ============================================================================ * @n@b CSL_XMC_setXMPAXL * * @b Description * @n This function sets the contents of XMPAXL register corresponding to the * index specified. * please see section 7.3 on MPAX unit http://www.ti.com/lit/sprugw0 * for details on the sample arguments and example values to set * XMPAXL register as provided under table 7-2 * * @b Arguments @verbatim index Index into the set of 16 registers (0-15) mpaxl CSL_XMC_XMPAXL structure that needs to be set into the register @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n Corresponding XMPAXL register configured with the value passed. * * @b Writes * @n XMC_XMPAXL_RADDR, * XMC_XMPAXL_UX, * XMC_XMPAXL_UW, * XMC_XMPAXL_UR, * XMC_XMPAXL_SX, * XMC_XMPAXL_SW, * XMC_XMPAXL_SR * * @b Example * @verbatim Uint32 index = 0; CSL_XMC_XMPAXL mpaxl; mpaxl.ux = 1; mpaxl.uw = 1; mpaxl.ur = 1; mpaxl.sx = 1; mpaxl.sw = 1; mpaxl.sr = 1; mpaxl.rAddr = 0x4000 ; CSL_XMC_setXMPAXL (index, &mpaxl); @endverbatim * ============================================================================= */ static inline void CSL_XMC_setXMPAXL ( Uint32 index, const CSL_XMC_XMPAXL* mpaxl ); static inline void CSL_XMC_setXMPAXL ( Uint32 index, const CSL_XMC_XMPAXL* mpaxl ) { Uint32 value = 0; /* Configure the XMPAXL register specified by the index. */ ((value) = ((value) & ~((uint32_t)0x00000001u)) | (((mpaxl->ux) << ((uint32_t)0x00000000u)) & ((uint32_t)0x00000001u))); ((value) = ((value) & ~((uint32_t)0x00000002u)) | (((mpaxl->uw) << ((uint32_t)0x00000001u)) & ((uint32_t)0x00000002u))); ((value) = ((value) & ~((uint32_t)0x00000004u)) | (((mpaxl->ur) << ((uint32_t)0x00000002u)) & ((uint32_t)0x00000004u))); ((value) = ((value) & ~((uint32_t)0x00000008u)) | (((mpaxl->sx) << ((uint32_t)0x00000003u)) & ((uint32_t)0x00000008u))); ((value) = ((value) & ~((uint32_t)0x00000010u)) | (((mpaxl->sw) << ((uint32_t)0x00000004u)) & ((uint32_t)0x00000010u))); ((value) = ((value) & ~((uint32_t)0x00000020u)) | (((mpaxl->sr) << ((uint32_t)0x00000005u)) & ((uint32_t)0x00000020u))); ((value) = ((value) & ~((uint32_t)0xFFFFFF00u)) | (((mpaxl->rAddr) << ((uint32_t)0x00000008u)) & ((uint32_t)0xFFFFFF00u))); ((CSL_XmcRegs*)(0x08000000))->XMPAX[index].XMPAXL = value; } /** ============================================================================ * @n@b CSL_XMC_getXMPAXH * * @b Description * @n This function gets the contents of XMPAXH register. * * please see section 7.3 on MPAX unit http://www.ti.com/lit/sprugw0 * for details on the sample arguments and example values to set * XMPAXH register as provided under table 7-2 * * @b Arguments @verbatim index Index into the set of 16 XMPAXH registers mpaxh CSL_XMC_XMPAXH structure that needs to be populated with XMPAXH register contents. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n XMC_XMPAXH_SEGSZ, XMC_XMPAXH_BADDR * * @b Example * @verbatim Uint32 index = 0; CSL_XMC_XMPAXH mpaxh; CSL_XMC_getXMPAXH (index, &mpaxh); @endverbatim * ============================================================================= */ static inline void CSL_XMC_getXMPAXH ( Uint32 index, CSL_XMC_XMPAXH* mpaxh ); static inline void CSL_XMC_getXMPAXH ( Uint32 index, CSL_XMC_XMPAXH* mpaxh ) { Uint32 value = ((CSL_XmcRegs*)(0x08000000))->XMPAX[index].XMPAXH; /* Retrieve contents of XMPAXH register specified by the index */ mpaxh->segSize = (((value) & ((uint32_t)0x0000001Fu)) >> ((uint32_t)0x00000000u)); mpaxh->bAddr = (((value) & ((uint32_t)0xFFFFF000u)) >> ((uint32_t)0x0000000Cu)); } /** ============================================================================ * @n@b CSL_XMC_getXMPAXL * * @b Description * @n This function gets the contents of XMPAXL register. * * please see section 7.3 on MPAX unit http://www.ti.com/lit/sprugw0 * for details on the sample arguments and example values to set * XMPAXL register as provided under table 7-2 * * @b Arguments @verbatim index Index into the set of 16 registers mpaxl CSL_XMC_XMPAXL structure that needs to be populated with XMPAXL register contents. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n XMC_XMPAXL_RADDR, * XMC_XMPAXL_UX, * XMC_XMPAXL_UW, * XMC_XMPAXL_UR, * XMC_XMPAXL_SX, * XMC_XMPAXL_SW, * XMC_XMPAXL_SR * * @b Example * @verbatim Uint32 index = 0; CSL_XMC_XMPAXL mpaxl; CSL_XMC_getXMPAXL (index, &mpaxl); @endverbatim * ============================================================================= */ static inline void CSL_XMC_getXMPAXL ( Uint32 index, CSL_XMC_XMPAXL * mpaxl ); static inline void CSL_XMC_getXMPAXL ( Uint32 index, CSL_XMC_XMPAXL * mpaxl ) { Uint32 value = ((CSL_XmcRegs*)(0x08000000))->XMPAX[index].XMPAXL; /* Retrieve contents of XMPAXL register using the index specified */ mpaxl->rAddr = (((value) & ((uint32_t)0xFFFFFF00u)) >> ((uint32_t)0x00000008u)); mpaxl->sr = (((value) & ((uint32_t)0x00000020u)) >> ((uint32_t)0x00000005u)); mpaxl->sw = (((value) & ((uint32_t)0x00000010u)) >> ((uint32_t)0x00000004u)); mpaxl->sx = (((value) & ((uint32_t)0x00000008u)) >> ((uint32_t)0x00000003u)); mpaxl->ur = (((value) & ((uint32_t)0x00000004u)) >> ((uint32_t)0x00000002u)); mpaxl->uw = (((value) & ((uint32_t)0x00000002u)) >> ((uint32_t)0x00000001u)); mpaxl->ux = (((value) & ((uint32_t)0x00000001u)) >> ((uint32_t)0x00000000u)); } /** ============================================================================ * @n@b CSL_XMC_getFaultAddress * * @b Description * @n This function gets the access address causing the fault. * * @b Arguments * @n None * * Return Value Uint32 * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n XMC_XMPFAR_FADDR * * @b Example * @verbatim Uint32 faultAddr; faultAddr = CSL_XMC_getFaultAddress (); @endverbatim * ============================================================================= */ static inline Uint32 CSL_XMC_getFaultAddress (void); static inline Uint32 CSL_XMC_getFaultAddress (void) { return (((((CSL_XmcRegs*)(0x08000000))->XMPFAR) & ((uint32_t)0xFFFFFFFFu)) >> ((uint32_t)0x00000000u)); } /** ============================================================================ * @n@b CSL_XMC_clearFault * * @b Description * @n This function clears the fault information. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n XMPFCR register configured with the value passed. Fault * address and status registers are cleared. * * @b Writes * @n XMC_XMPFCR_MPFCLR=1 * * @b Affects * @n XMC_XMPFAR_FADDR=0, * XMC_XMPFSR_LOCAL=0, * XMC_XMPFSR_SR=0, * XMC_XMPFSR_SX=0, * XMC_XMPFSR_UR=0, * XMC_XMPFSR_UW=0, * XMC_XMPFSR_UW=0 * * @b Example * @verbatim CSL_XMC_clearFault (); @endverbatim * ============================================================================= */ static inline void CSL_XMC_clearFault (void); static inline void CSL_XMC_clearFault (void) { ((CSL_XmcRegs*)(0x08000000))->XMPFCR = ((((uint32_t)1U) << ((uint32_t)0x00000000u)) & ((uint32_t)0x00000001u)); } /** ============================================================================ * @n@b CSL_XMC_getFaultStatus * * @b Description * @n This function gets the contents of Fault Status Register XMPFSR. * * @b Arguments @verbatim xmpfsr CSL_XMC_MPFSR structure that needs to be filled in from XMPFSR register @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n XMC_XMPFSR_LOCAL, * XMC_XMPFSR_SR, * XMC_XMPFSR_SX, * XMC_XMPFSR_UR, * XMC_XMPFSR_UW, * XMC_XMPFSR_UW * * @b Example * @verbatim CSL_XMC_MPFSR xmpfsr; CSL_XMC_getFaultStatus (&xmpfsr); @endverbatim * ============================================================================= */ static inline void CSL_XMC_getFaultStatus (CSL_XMC_MPFSR * xmpfsr); static inline void CSL_XMC_getFaultStatus (CSL_XMC_MPFSR * xmpfsr) { Uint32 value = ((CSL_XmcRegs*)(0x08000000))->XMPFSR; xmpfsr->local = (((value) & ((uint32_t)0x00000100u)) >> ((uint32_t)0x00000008u)); xmpfsr->sr = (((value) & ((uint32_t)0x00000020u)) >> ((uint32_t)0x00000005u)); xmpfsr->sw = (((value) & ((uint32_t)0x00000010u)) >> ((uint32_t)0x00000004u)); xmpfsr->sx = (((value) & ((uint32_t)0x00000008u)) >> ((uint32_t)0x00000003u)); xmpfsr->ur = (((value) & ((uint32_t)0x00000004u)) >> ((uint32_t)0x00000002u)); xmpfsr->uw = (((value) & ((uint32_t)0x00000002u)) >> ((uint32_t)0x00000001u)); xmpfsr->ux = (((value) & ((uint32_t)0x00000001u)) >> ((uint32_t)0x00000000u)); } /** ============================================================================ * @n@b CSL_XMC_invalidatePrefetchBuffer * * @b Description * @n This function when called marks all slots in the data prefetch buffer and program * prefetch buffer invalid by writing 1 in the XPFCMD register's INV bit. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n CSL_XMC_XPFCMD_INV bit set to 1 and data and program prefetch buffers are * invalidated. * * @b Writes * @n XMC_XPFCMD_INV=1 * * @b Affects * @n XMC_XPFADDR_DVH=0, * XMC_XPFADDR_DVL=0 * * * @b Example * @verbatim * CSL_XMC_invalidatePrefetchBuffer (); @endverbatim * ============================================================================= */ static inline void CSL_XMC_invalidatePrefetchBuffer (void); /* for misra warnings */ static inline void CSL_XMC_invalidatePrefetchBuffer (void) { ((CSL_XmcRegs*)(0x08000000))->XPFCMD = ((((uint32_t)1U) << ((uint32_t)0x00000000u)) & ((uint32_t)0x00000001u)); } /** ============================================================================ * @n@b CSL_XMC_loadAnalysisCounterEnable * * @b Description * @n This function when called sets the 'ACENL' bit of the XPFCMD register, thus * triggering a copy/load of ACEN bits (Analysis counter enable mode) into * ACEN bits of XPFACS register. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n CSL_XMC_XPFCMD_ACENL bit set to 1 and ACEN bits value is loaded into the * ACEN bits of XPFACS register. * * @b Writes * @n XMC_XPFCMD_ACENL=1 * * @b Affects * @n XMC_XPFACS_ACEN * * @b Example * @verbatim * CSL_XMC_loadAnalysisCounterEnable (); @endverbatim * ============================================================================= */ static inline void CSL_XMC_loadAnalysisCounterEnable (void); static inline void CSL_XMC_loadAnalysisCounterEnable (void) { ((CSL_XmcRegs*)(0x08000000))->XPFCMD = ((((uint32_t)1U) << ((uint32_t)0x00000001u)) & ((uint32_t)0x00000002u)); } /** ============================================================================ * @n@b CSL_XMC_setAnalysisCounterEnableMode * * @b Description * @n This function when called sets up the Event counting mode by writing to * the 'ACEN' bits of the XPFCMD register. * * @b Arguments @verbatim acenMode Analyis counter mode. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n CSL_XMC_XPFCMD_ACEN bits written with the Analysis counter mode specified. * * @b Writes * @n XMC_XPFCMD_ACEN * * @b Example * @verbatim // Enable both program and data events CSL_XMC_setAnalysisCounterEnableMode (CSL_XMC_ACEN_MODE_COUNT_ALL); @endverbatim * ============================================================================= */ static inline void CSL_XMC_setAnalysisCounterEnableMode (CSL_XMC_ACEN_MODE acenMode); static inline void CSL_XMC_setAnalysisCounterEnableMode (CSL_XMC_ACEN_MODE acenMode) { uint32_t acen; acen = (((acenMode) << ((uint32_t)0x00000002u)) & ((uint32_t)0x0000000Cu)); acen |= ((((uint32_t)1U) << ((uint32_t)0x00000001u)) & ((uint32_t)0x00000002u)); /* Set all the information for enabling the ACEN at one shot */ ((CSL_XmcRegs*)(0x08000000))->XPFCMD = acen; } /** ============================================================================ * @n@b CSL_XMC_resetAnalysisCounters * * @b Description * @n This function when called sets the 'ACRST' bit of the XPFCMD register, thus * triggering a clear/reset operation on the prefetch analysis counter registers. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n CSL_XMC_XPFCMD_ACRST bit set to 1 and prefetch analysis counter registers * are cleared. * * @b Writes * @n XMC_XPFCMD_ACRST=1 * * @b Affects * @n XMC_XPFAC0_SENT=0, * XMC_XPFAC1_CANCELED=0, * XMC_XPFAC2_HIT=0, * XMC_XPFAC3_MISS=0 * * * @b Example * @verbatim * CSL_XMC_resetAnalysisCounters (); @endverbatim * ============================================================================= */ static inline void CSL_XMC_resetAnalysisCounters (void); static inline void CSL_XMC_resetAnalysisCounters (void) { ((CSL_XmcRegs*)(0x08000000))->XPFCMD = ((((uint32_t)1U) << ((uint32_t)0x00000004u)) & ((uint32_t)0x00000010u)); } /** ============================================================================ * @n@b CSL_XMC_setPrefetchCommand * * @b Description * @n This function sets up the contents of the XPFCMD register based on the * inputs specified. * * @b Arguments @verbatim inv Invalidate Prefetch Buffer command flag. When set to 1, data and program prefetch buffers are invalidated. acEnLoad Analysis Counter Enable Load flag. When set to 1, the Analysis Counter Enable mode is loaded into the XPFACS status register. acEnMode Analyis counter enable mode. Specifies the event counting mode for the prefetcher. acRst Analysis counter Reset flag. When set to 1, resets all the prefetch event counters. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n CSL_XMC_XPFCMD written with the settings specified. * * @b Writes * @n XMC_XPFCMD_INV, * XMC_XPFCMD_ACENL, * XMC_XPFCMD_ACEN, * XMC_XPFCMD_ACRST * * @b Example * @verbatim // Issue the following prefetch commands: // - Dont invalidate prefetch buffers // - Enable Analysis Counter Enable load // - Enable both program and data event counting // - Dont reset the prefetch counters CSL_XMC_setPrefetchCommand (0, 1, CSL_XMC_ACEN_MODE_COUNT_ALL, 0); @endverbatim * ============================================================================= */ static inline void CSL_XMC_setPrefetchCommand ( Uint8 inv, Uint8 acEnLoad, CSL_XMC_ACEN_MODE acenMode, Uint8 acRst ); static inline void CSL_XMC_setPrefetchCommand ( Uint8 inv, Uint8 acEnLoad, CSL_XMC_ACEN_MODE acenMode, Uint8 acRst ) { ((CSL_XmcRegs*)(0x08000000))->XPFCMD = ((((Uint32)inv) << ((uint32_t)0x00000000u)) & ((uint32_t)0x00000001u)) | ((((Uint32)acEnLoad) << ((uint32_t)0x00000001u)) & ((uint32_t)0x00000002u)) | (((acenMode) << ((uint32_t)0x00000002u)) & ((uint32_t)0x0000000Cu)) | ((((Uint32)acRst) << ((uint32_t)0x00000004u)) & ((uint32_t)0x00000010u)); } /** ============================================================================ * @n@b CSL_XMC_getAnalysisCounterEnableStatus * * @b Description * @n This function returns the Analysis counter enable mode by reading the * contents of 'ACEN' bits from the XPFACS register. * * @b Arguments * @n None * * Return Value CSL_XMC_ACEN_MODE - Event counting mode * * Pre Condition * @n None * * Post Condition * @n CSL_XMC_XPFACS_ACEN bits read and returned * * @b Reads * @n XMC_XPFACS_ACEN * * @b Example * @verbatim CSL_XMC_ACEN_MODE acenMode; // Read ACEN Mode Status acenMode = CSL_XMC_getAnalysisCounterEnableStatus (); if (acenMode == CSL_XMC_ACEN_MODE_COUNT_DISABLE) { ... } @endverbatim * ============================================================================= */ static inline CSL_XMC_ACEN_MODE CSL_XMC_getAnalysisCounterEnableStatus (void); static inline CSL_XMC_ACEN_MODE CSL_XMC_getAnalysisCounterEnableStatus (void) { return (CSL_XMC_ACEN_MODE) (((((CSL_XmcRegs*)(0x08000000))->XPFACS) & ((uint32_t)0x0000000Cu)) >> ((uint32_t)0x00000002u)); } /** ============================================================================ * @n@b CSL_XMC_getNumPrefetchSent * * @b Description * @n This function returns the contents of XPFAC0 register, i.e., the number * of prefetch requests sent into the system. * * @b Arguments * @n None * * Return Value Uint32 * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n XMC_XPFAC0_SENT * * @b Example * @verbatim Uint32 numPrefetchSent; // Read Prefetch request sent count numPrefetchSent = CSL_XMC_getNumPrefetchSent (); @endverbatim * ============================================================================= */ static inline Uint32 CSL_XMC_getNumPrefetchSent (void); static inline Uint32 CSL_XMC_getNumPrefetchSent (void) { return (((((CSL_XmcRegs*)(0x08000000))->XPFAC0) & ((uint32_t)0x000FFFFFu)) >> ((uint32_t)0x00000000u)); } /** ============================================================================ * @n@b CSL_XMC_getNumPrefetchCanceled * * @b Description * @n This function returns the contents of XPFAC1 register, i.e., the number * of prefetch requests canceled (prefetch requests that returned a non-zero * rstatus or other error). * * @b Arguments * @n None * * Return Value Uint32 * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n XMC_XPFAC1_CANCELED * * @b Example * @verbatim Uint32 numPrefetchCanceled; // Read Prefetch request canceled numPrefetchCanceled = CSL_XMC_getNumPrefetchCanceled (); @endverbatim * ============================================================================= */ static inline Uint32 CSL_XMC_getNumPrefetchCanceled (void); static inline Uint32 CSL_XMC_getNumPrefetchCanceled (void) { return (((((CSL_XmcRegs*)(0x08000000))->XPFAC1) & ((uint32_t)0x000FFFFFu)) >> ((uint32_t)0x00000000u)); } /** ============================================================================ * @n@b CSL_XMC_getNumPrefetchHits * * @b Description * @n This function returns the contents of XPFAC2 register, i.e., the number * of demand prefetch requests that resulted in a successful prefetch. * * @b Arguments * @n None * * Return Value Uint32 * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n XMC_XPFAC2_HIT * * @b Example * @verbatim Uint32 numPrefetchHits; // Read Number of Prefetch request hits numPrefetchHits = CSL_XMC_getNumPrefetchHits (); @endverbatim * ============================================================================= */ static inline Uint32 CSL_XMC_getNumPrefetchHits (void); static inline Uint32 CSL_XMC_getNumPrefetchHits (void) { return (((((CSL_XmcRegs*)(0x08000000))->XPFAC2) & ((uint32_t)0x000FFFFFu)) >> ((uint32_t)0x00000000u)); } /** ============================================================================ * @n@b CSL_XMC_getNumPrefetchMisses * * @b Description * @n This function returns the contents of XPFAC3 register, i.e., the number * of prefetch requests that resulted in a miss and had to be submitted as * a demand prefetch request into the system. * * @b Arguments * @n None * * Return Value Uint32 * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n XMC_XPFAC3_MISS * * @b Example * @verbatim Uint32 numPrefetchMisses; // Read Number of Prefetch request misses numPrefetchMisses = CSL_XMC_getNumPrefetchMisses (); @endverbatim * ============================================================================= */ static inline Uint32 CSL_XMC_getNumPrefetchMisses (void); static inline Uint32 CSL_XMC_getNumPrefetchMisses (void) { return (((((CSL_XmcRegs*)(0x08000000))->XPFAC3) & ((uint32_t)0x000FFFFFu)) >> ((uint32_t)0x00000000u)); } /** ============================================================================ * @n@b CSL_XMC_getPrefetchAddress * * @b Description * @n This function gets the contents of XPFADDR register. * * @b Arguments @verbatim index Index into the set of 8 registers xpfaddr CSL_XMC_XPFADDR structure that needs to be filled from XPFADDR register @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n XMC_XPFADDR_ADDR, * XMC_XPFADDR_DIR, * XMC_XPFADDR_DPH, * XMC_XPFADDR_DVH, * XMC_XPFADDR_AVH, * XMC_XPFADDR_DPL, * XMC_XPFADDR_DVL, * XMC_XPFADDR_AVL * * @b Example * @verbatim Uint32 index = 0; CSL_XMC_XPFADDR xpfaddr; CSL_XMC_getPrefetchAddress (index, &xpfaddr); @endverbatim * ============================================================================= */ static inline void CSL_XMC_getPrefetchAddress ( Uint32 index, CSL_XMC_XPFADDR* xpfaddr ); static inline void CSL_XMC_getPrefetchAddress ( Uint32 index, CSL_XMC_XPFADDR* xpfaddr ) { Uint32 value = ((CSL_XmcRegs*)(0x08000000))->XPFADDR[index]; xpfaddr->addr = (((value) & ((uint32_t)0xFFFFFF80u)) >> ((uint32_t)0x00000007u)); xpfaddr->dir = (((value) & ((uint32_t)0x00000040u)) >> ((uint32_t)0x00000006u)); xpfaddr->dph = (((value) & ((uint32_t)0x00000020u)) >> ((uint32_t)0x00000005u)); xpfaddr->dvh = (((value) & ((uint32_t)0x00000010u)) >> ((uint32_t)0x00000004u)); xpfaddr->avh = (((value) & ((uint32_t)0x00000008u)) >> ((uint32_t)0x00000003u)); xpfaddr->dpl = (((value) & ((uint32_t)0x00000004u)) >> ((uint32_t)0x00000002u)); xpfaddr->dvl = (((value) & ((uint32_t)0x00000002u)) >> ((uint32_t)0x00000001u)); xpfaddr->avl = (((value) & ((uint32_t)0x00000001u)) >> ((uint32_t)0x00000000u)); } /** ============================================================================ * @n@b CSL_XMC_setMDMAPriority * * @b Description * @n This function configures the priority of transaction submissions to * Master DMA (MDMA). * * @b Arguments @verbatim priority Priority value to set for MDMA transactions. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Writes * @n XMC_MDMAARBX_PRI * * @b Example * @verbatim Uint32 priority = 4; CSL_XMC_setMDMAPriority (priority); @endverbatim * ============================================================================= */ static inline void CSL_XMC_setMDMAPriority (Uint32 priority); static inline void CSL_XMC_setMDMAPriority (Uint32 priority) { ((((CSL_XmcRegs*)(0x08000000))->MDMAARBX) = ((((CSL_XmcRegs*)(0x08000000))->MDMAARBX) & ~((uint32_t)0x00070000u)) | (((priority) << ((uint32_t)0x00000010u)) & ((uint32_t)0x00070000u))); } /** ============================================================================ * @n@b CSL_XMC_getMDMAPriority * * @b Description * @n This function retrieves the priority of transaction submissions to * Master DMA (MDMA). * * @b Arguments * @n None * * Return Value Uint32 * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n XMC_MDMAARBX_PRI * * @b Example * @verbatim Uint32 priority; priority = CSL_XMC_getMDMAPriority (); @endverbatim * ============================================================================= */ static inline Uint32 CSL_XMC_getMDMAPriority (void); static inline Uint32 CSL_XMC_getMDMAPriority (void) { return (((((CSL_XmcRegs*)(0x08000000))->MDMAARBX) & ((uint32_t)0x00070000u)) >> ((uint32_t)0x00000010u)); } /* @} */ /** @addtogroup CSL_CACHE_FUNCTION @{ */ static inline void CACHE_AsmNop (void);/* for misra warnings*/ static inline void CACHE_AsmNop (void) { asm (" nop 4"); asm (" nop 4"); asm (" nop 4"); asm (" nop 4"); } /** ============================================================================ * @n@b CACHE_setMemRegionWritethrough * * @b Description * @n This function sets write through mode for a specific memory region. * * @b Arguments @verbatim mar Memory region for which cache is to be set to writethrough mode. arg TRUE to set to write through mode, otherwise to wribeback mode. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n Memory region is now set to writethrough mode. * * @b Writes * @n CGEM_MAR0_WTE=1, when arg == TRUE, zero otherwise * * @b Example * @verbatim CACHE_setMemRegionWritethrough (20, TRUE); @endverbatim * ============================================================================= */ /*for Misra warnings */ static inline void CACHE_setMemRegionWritethrough (Uint8 mar, Bool arg);/* for misra warnings*/ static inline void CACHE_setMemRegionWritethrough (Uint8 mar, Bool arg) { uint32_t temp = 0; ((temp) = ((temp) & ~((uint32_t)0x00000002u)) | ((((uint32_t)1U) << ((uint32_t)0x00000001u)) & ((uint32_t)0x00000002u))); if (arg == (Bool)((Bool) 1)) { ((CSL_CgemRegs *)(0x01800000))->MAR[mar] |= temp; } else { ((CSL_CgemRegs *)(0x01800000))->MAR[mar] &= ~temp; } } /** ============================================================================ * @n@b CACHE_getMemRegionWritethrough * * @b Description * @n This function gets write through mode for a specific memory region. * * @b Arguments @verbatim mar Memory region for which WTE bit information to be read. wte Address of WTE value @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n WTE bit value reflecting the write through mode is returned. * * @b Writes * @n None * * @b Example * @verbatim CACHE_getMemRegionWritethrough (20, &wte); @endverbatim * ============================================================================= */ static inline void CACHE_getMemRegionWritethrough (Uint8 mar, Uint8 *wte);/* for misra warnings*/ static inline void CACHE_getMemRegionWritethrough (Uint8 mar, Uint8 *wte) { Uint32 value = ((CSL_CgemRegs *)(0x01800000))->MAR[mar]; *wte = (Uint8)(((value) & ((uint32_t)0x00000002u)) >> ((uint32_t)0x00000001u)); } /** ============================================================================ * @n@b CACHE_enableCaching * * @b Description * @n This function enables caching for a specific memory region. * * @b Arguments @verbatim mar Memory region for which cache is to be enabled. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n Memory region is now cacheable. * * @b Writes * @n CGEM_MAR0_PC=1 * * @b Example * @verbatim CACHE_enableCaching (20); @endverbatim * ============================================================================= */ static inline void CACHE_enableCaching (Uint8 mar);/* for misra warnings*/ static inline void CACHE_enableCaching (Uint8 mar) { ((((CSL_CgemRegs *)(0x01800000))->MAR[mar]) = ((((CSL_CgemRegs *)(0x01800000))->MAR[mar]) & ~((uint32_t)0x00000001u)) | ((((uint32_t)1U) << ((uint32_t)0x00000000u)) & ((uint32_t)0x00000001u))); } /** ============================================================================ * @n@b CACHE_disableCaching * * @b Description * @n This function disables caching for a specific memory region. * * @b Arguments @verbatim mar Memory region for which cache is to be disabled. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n Memory region is now *not* cacheable. * * @b Writes * @n CGEM_MAR0_PC=0 * * @b Example * @verbatim CACHE_disableCaching (20); @endverbatim * ============================================================================= */ static inline void CACHE_disableCaching (Uint8 mar);/* for misra warnings*/ static inline void CACHE_disableCaching (Uint8 mar) { ((((CSL_CgemRegs *)(0x01800000))->MAR[mar]) = ((((CSL_CgemRegs *)(0x01800000))->MAR[mar]) & ~((uint32_t)0x00000001u)) | ((((uint32_t)0) << ((uint32_t)0x00000000u)) & ((uint32_t)0x00000001u))); } /** ============================================================================ * @n@b CACHE_getMemRegionInfo * * @b Description * @n This function is used to get memory region information. * * @b Arguments @verbatim mar Memory region for which the information is required. pcx Is address cacheable in external cache (MSMC) pfx Is address prefetchable @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n CGEM_MAR0_PCX, CGEM_MAR0_PFX * * @b Example * @verbatim Uint8 pcx; Uint8 pfx; // Get the memory region information for 20 CACHE_getMemRegionInfo (20, &pcx, &pfx); @endverbatim * ============================================================================= */ static inline void CACHE_getMemRegionInfo (Uint8 mar, Uint8* pcx, Uint8* pfx);/* for misra warnings*/ static inline void CACHE_getMemRegionInfo (Uint8 mar, Uint8* pcx, Uint8* pfx) { Uint32 value = ((CSL_CgemRegs *)(0x01800000))->MAR[mar]; *pcx = (Uint8)(((value) & ((uint32_t)0x00000004u)) >> ((uint32_t)0x00000002u)); *pfx = (Uint8)(((value) & ((uint32_t)0x00000008u)) >> ((uint32_t)0x00000003u)); } /** ============================================================================ * @n@b CACHE_setMemRegionInfo * * @b Description * @n This function is used to set memory region information. * * @b Arguments @verbatim mar Memory region for which the information is required. pcx Is address cacheable in external cache (MSMC) pfx Is address prefetchable @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Writes * @n CGEM_MAR0_PCX, CGEM_MAR0_PFX * * @b Example * @verbatim Uint8 pcx; Uint8 pfx; // Get the memory region information for 20 CACHE_getMemRegionInfo (20, &pcx, &pfx); ... // Ensure Memory Region 20 is not prefetchable. CACHE_setMemRegionInfo(20, pcx, 0); @endverbatim * ============================================================================= */ static inline void CACHE_setMemRegionInfo (Uint8 mar, Uint8 pcx, Uint8 pfx);/* for misra warnings*/ static inline void CACHE_setMemRegionInfo (Uint8 mar, Uint8 pcx, Uint8 pfx) { ((((CSL_CgemRegs *)(0x01800000))->MAR[mar]) = ((((CSL_CgemRegs *)(0x01800000))->MAR[mar]) & ~((uint32_t)0x00000004u)) | ((((Uint32)pcx) << ((uint32_t)0x00000002u)) & ((uint32_t)0x00000004u))); ((((CSL_CgemRegs *)(0x01800000))->MAR[mar]) = ((((CSL_CgemRegs *)(0x01800000))->MAR[mar]) & ~((uint32_t)0x00000008u)) | ((((Uint32)pfx) << ((uint32_t)0x00000003u)) & ((uint32_t)0x00000008u))); } /** ============================================================================ * @n@b CACHE_setL1DSize * * @b Description * @n This function is used to set the L1 Data Cache Size. * * @b Arguments @verbatim newSize Cache Size to be configured. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Writes * @n CGEM_L1DCFG_L1DMODE * * @b Example * @verbatim CACHE_setL1DSize(1); // Configure 4K Cache Size @endverbatim * ============================================================================= */ static inline void CACHE_setL1DSize (CACHE_L1Size newSize);/* for misra warnings*/ static inline CACHE_L1Size CACHE_getL1DSize (void);/* for misra warnings*/ static inline void CACHE_setL1DSize (CACHE_L1Size newSize) { ((((CSL_CgemRegs *)(0x01800000))->L1DCFG) = ((((CSL_CgemRegs *)(0x01800000))->L1DCFG) & ~((uint32_t)0x00000007u)) | (((newSize) << ((uint32_t)0u)) & ((uint32_t)0x00000007u))); /* Read back L1DCFG. This stalls the DSP until the mode change completes */ CACHE_getL1DSize(); } /** ============================================================================ * @n@b CACHE_getL1DSize * * @b Description * @n This function is used to get the L1 Data Cache Size. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n CGEM_L1DCFG_L1DMODE * * @b Example * @verbatim CACHE_L1Size cacheSize; cacheSize = CACHE_getL1DSize(); @endverbatim * ============================================================================= */ static inline CACHE_L1Size CACHE_getL1DSize (void) { return (CACHE_L1Size)(((((CSL_CgemRegs *)(0x01800000))->L1DCFG) & ((uint32_t)0x00000007u)) >> ((uint32_t)0u)); } /** ============================================================================ * @n@b CACHE_freezeL1D * * @b Description * @n This function is used to freeze the L1D cache. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Writes * @n CGEM_L1DCC_OPER=1 * * @b Example * @verbatim CACHE_freezeL1D(); @endverbatim * ============================================================================= */ static inline void CACHE_freezeL1D(void);/* for misra warnings*/ static inline void CACHE_freezeL1D(void) { /* Set the Freeze Mode Enabled bit. */ ((((CSL_CgemRegs *)(0x01800000))->L1DCC) = ((((CSL_CgemRegs *)(0x01800000))->L1DCC) & ~((uint32_t)0x00000007u)) | ((((uint32_t)1U) << ((uint32_t)0u)) & ((uint32_t)0x00000007u))); } /** ============================================================================ * @n@b CACHE_unfreezeL1D * * @b Description * @n This function is used to unfreeze the L1D cache. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Writes * @n CGEM_L1DCC_OPER=0 * * @b Example * @verbatim CACHE_unfreezeL1D(); @endverbatim * ============================================================================= */ static inline void CACHE_unfreezeL1D(void);/* for misra warnings*/ static inline void CACHE_unfreezeL1D(void) { /* Reset the Freeze Mode Enabled bit. */ ((((CSL_CgemRegs *)(0x01800000))->L1DCC) = ((((CSL_CgemRegs *)(0x01800000))->L1DCC) & ~((uint32_t)0x00000007u)) | ((((uint32_t)0) << ((uint32_t)0u)) & ((uint32_t)0x00000007u))); } /** ============================================================================ * @n@b CACHE_getPrevL1DMode * * @b Description * @n This function is used get the previous operating state of the L1D cache * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n CGEM_L1DCC_POPER * * @b Example * @verbatim Uint32 prev; prev = CACHE_getPrevL1DMode(); @endverbatim * ============================================================================= */ static inline Uint32 CACHE_getPrevL1DMode(void);/* for misra warnings*/ static inline Uint32 CACHE_getPrevL1DMode(void) { return (((((CSL_CgemRegs *)(0x01800000))->L1DCC) & ((uint32_t)0x00070000u)) >> ((uint32_t)16u)); } /** ============================================================================ * @n@b CACHE_invAllL1dWait * * @b Description * @n This function is used to wait for the L1D global invalidate operation * to complete. This API should be used only if the CACHE_invAllL1d was called * with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_invAllL1d(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n None * * @b Reads * @n CGEM_L1DINV_I=0 * * @b Example * @verbatim CACHE_invAllL1d(CACHE_NOWAIT); // Invalidate the L1D cache ... CACHE_invAllL1dWait(); // Wait for the invalidate operation to complete. @endverbatim * ============================================================================= */ static inline void CACHE_invAllL1dWait (void);/* for misra warnings*/ static inline void CACHE_invAllL1dWait (void) { /* Wait for the Invalidate operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L1DINV) & ((uint32_t)0xFFFFFFFFu)) >> ((uint32_t)0u)) == (Uint32)1U) {} } /** ============================================================================ * @n@b CACHE_invAllL1d * * @b Description * @n This function is used to globally invalidate the L1D cache. * * @b Arguments @verbatim wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The L1D Cache is being invalidated. * * @b Writes * @n CGEM_L1DINV_I=1 * * @b Example * @verbatim CACHE_invAllL1d(CACHE_WAIT); // Invalidate the L1D cache @endverbatim * ============================================================================= */ static inline void CACHE_invAllL1d (CACHE_Wait wait);/* for misra warnings*/ static inline void CACHE_invAllL1d (CACHE_Wait wait) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); CSL_XMC_invalidatePrefetchBuffer(); } /* Invalidate the Cache Line. */ ((((CSL_CgemRegs *)(0x01800000))->L1DINV) = ((((CSL_CgemRegs *)(0x01800000))->L1DINV) & ~((uint32_t)0xFFFFFFFFu)) | ((((uint32_t)1U) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu))); /* Determine if we need to wait for the operation to complete. */ if (wait) { CACHE_invAllL1dWait(); } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** ============================================================================ * @n@b CACHE_wbAllL1dWait * * @b Description * @n This function is used to wait for the L1D writeback operation * to complete. This API should be used only if the CACHE_wbAllL1d was called * with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_wbAllL1d(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n The L1D Dirty lines are written back * * @b Reads * @n CGEM_L1DWB_C=0 * * @b Example * @verbatim CACHE_wbAllL1d(CACHE_NOWAIT); // Writeback the L1D cache ... CACHE_wbAllL1dWait(); // Wait for the writeback operation to complete. @endverbatim * ============================================================================= */ static inline void CACHE_wbAllL1dWait (void);/* for misra warnings*/ static inline void CACHE_wbAllL1dWait (void) { /* Wait for the Writeback operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L1DWB) & ((uint32_t)0xFFFFFFFFu)) >> ((uint32_t)0u)) == (uint32_t)1U) {} } /** ============================================================================ * @n@b CACHE_wbAllL1d * * @b Description * @n This function is used to writeback the dirty lines of the L1D Cache * * @b Arguments @verbatim wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The dirty lines of the L1D Cache are being written back * * @b Writes * @n CGEM_L1DWB_C=1 * * @b Example * @verbatim CACHE_wbAllL1d(CACHE_WAIT); // Writeback the Dirty Lines of the L1D cache @endverbatim * ============================================================================= */ static inline void CACHE_wbAllL1d (CACHE_Wait wait);/* for misra warnings*/ static inline void CACHE_wbAllL1d (CACHE_Wait wait) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); } /* Writeback the Cache Line. */ ((((CSL_CgemRegs *)(0x01800000))->L1DWB) = ((((CSL_CgemRegs *)(0x01800000))->L1DWB) & ~((uint32_t)0xFFFFFFFFu)) | ((((uint32_t)1U) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu))); /* Determine if we need to wait for the operation to complete. */ if (wait) { CACHE_wbAllL1dWait(); } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** ============================================================================ * @n@b CACHE_wbInvAllL1dWait * * @b Description * @n This function is used to wait for the L1D writeback invalidate operation * to complete. This API should be used only if the CACHE_wbInvAllL1d was called * with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_wbInvAllL1d(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n The L1D Dirty lines are written back * * @b Reads * @n CGEM_L1DWBINV_C=0 * * @b Example * @verbatim CACHE_wbInvAllL1d(CACHE_NOWAIT); // Invalidate/Writeback the L1D cache ... CACHE_wbInvAllL1dWait(); // Wait for the Invalidate/Writeback operation to complete. @endverbatim * ============================================================================= */ static inline void CACHE_wbInvAllL1dWait (void);/* for misra warnings*/ static inline void CACHE_wbInvAllL1dWait (void) { /* Wait for the Invalidate Writeback operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L1DWBINV) & ((uint32_t)0xFFFFFFFFu)) >> ((uint32_t)0u)) == (uint32_t)1U) {} } /** ============================================================================ * @n@b CACHE_wbInvAllL1d * * @b Description * @n This function is used to invalidate and writeback the dirty lines of the * L1D Cache * * @b Arguments @verbatim wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n Invalidates and Writebacks the dirty lines of the L1D Cache * * @b Writes * @n CGEM_L1DWBINV_C=1 * * @b Example * @verbatim CACHE_wbInvAllL1d(CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_wbInvAllL1d (CACHE_Wait wait);/* for misra warnings*/ static inline void CACHE_wbInvAllL1d (CACHE_Wait wait) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); CSL_XMC_invalidatePrefetchBuffer(); } /* Invalidate and writeback the cache line. */ ((((CSL_CgemRegs *)(0x01800000))->L1DWBINV) = ((((CSL_CgemRegs *)(0x01800000))->L1DWBINV) & ~((uint32_t)0xFFFFFFFFu)) | ((((uint32_t)1U) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu))); /* Determine if we need to wait for the operation to complete. */ if (wait) { CACHE_wbInvAllL1dWait(); } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** ============================================================================ * @n@b CACHE_invL1dWait * * @b Description * @n This function is used to wait for the L1D invalidate block operation to * complete. This API should be used only if the CACHE_invL1d was called * with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_invL1d(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n The L1D Block Cache is invalidated. * * @b Reads * @n CGEM_L1DIWC_WC=0 * * @b Example * @verbatim CACHE_invL1d((void *)ptr_buffer, 128, CACHE_NOWAIT); ... CACHE_invL1dWait(); // Wait for the Invalidate/Writeback operation to complete. @endverbatim * ============================================================================= */ static inline void CACHE_invL1dWait (void);/* for misra warnings*/ static inline void CACHE_invL1dWait (void) { /* Wait for the Invalidate operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L1DIWC) & ((uint32_t)0x0000FFFFu)) >> ((uint32_t)0u)) != 0) {} } /** ============================================================================ * @n@b CACHE_invL1d * * @b Description * @n This function is used to invalidate a block in the L1D Cache. Although * the block size can be specified in the number of bytes, the cache * controller operates on whole cache lines. To prevent unintended behavior * "blockPtr" should be aligned on the cache line size and "byteCnt" should * be a multiple of the cache line size. * * @b Arguments @verbatim blockPtr Address of the block which is to be invalidated byteCnt Size of the block to be invalidated. wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The contents of the blockPtr are being invalidated * * @b Writes * @n CGEM_L1DIBAR_ADDR,CGEM_L1DIWC_WC * * @b Example * @verbatim Uint8* ptr_buffer; // Invalidate 128 bytes of the buffer. CACHE_invL1d((void *)ptr_buffer, 128, CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_invL1d ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ); /*for misra warnings*/ static inline void CACHE_invL1d ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); CSL_XMC_invalidatePrefetchBuffer(); } /* Setup the block address and length */ ((CSL_CgemRegs *)(0x01800000))->L1DIBAR = ((((Uint32)blockPtr) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu)); ((CSL_CgemRegs *)(0x01800000))->L1DIWC = ((((Uint32)((byteCnt+((uint32_t)3U))>>2)) << ((uint32_t)0u)) & ((uint32_t)0x0000FFFFu)); /* Determine if we need to wait for the operation to complete. */ if ( (wait == CACHE_WAIT) || (wait == CACHE_ONLY_WAIT) ) { CACHE_invL1dWait(); } else { if ( (wait == CACHE_FENCE_WAIT) || (wait == CACHE_FENCE_ONLY_WAIT ) ) { _mfence(); /* Add another mfence to address single mfence issue * Under very particular circumstances, MFENCE may allow * the transaction after the MFENCE to proceed before * the preceding STORE completes */ _mfence(); } } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** ============================================================================ * @n@b CACHE_wbL1dWait * * @b Description * @n This function is used to wait for the L1D writeback block operation to * complete. This API should be used only if the CACHE_wbL1d was called * with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_wbL1d(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n The dirty lines of the L1D Block Cache have been written back. * * @b Reads * @n CGEM_L1DWWC_WC=0 * * @b Example * @verbatim CACHE_wbL1d((void *)ptr_buffer, 128, CACHE_NOWAIT); ... CACHE_wbL1dWait(); // Wait for the writeback operation to complete. @endverbatim * ============================================================================= */ static inline void CACHE_wbL1dWait (void);/* for misra warnings*/ static inline void CACHE_wbL1dWait (void) { /* Wait for the Writeback operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L1DWWC) & ((uint32_t)0x0000FFFFu)) >> ((uint32_t)0u)) != 0) {} } /** ============================================================================ * @n@b CACHE_wbL1d * * @b Description * @n This function is used to writeback the dirty lines of the block address. * Although the block size can be specified in the number of bytes, the cache * controller operates on whole cache lines. To prevent unintended behavior * "blockPtr" should be aligned on the cache line size and "byteCnt" should * be a multiple of the cache line size. * * @b Arguments @verbatim blockPtr Address of the block which is to be written back byteCnt Size of the block to be written back. wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The contents of the blockPtr are being written back * * @b Writes * @n CGEM_L1DWBAR_ADDR,CGEM_L1DWWC_WC * * @b Example * @verbatim Uint8* ptr_buffer; // Writeback 128 bytes of the buffer. CACHE_wbL1d((void *)ptr_buffer, 128, CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_wbL1d ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ); /*for misra warnings*/ static inline void CACHE_wbL1d ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); } /* Setup the block address and length */ ((CSL_CgemRegs *)(0x01800000))->L1DWBAR = ((((Uint32)blockPtr) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu)); ((CSL_CgemRegs *)(0x01800000))->L1DWWC = ((((Uint32)((byteCnt+((uint32_t)3U))>>2)) << ((uint32_t)0u)) & ((uint32_t)0x0000FFFFu)); /* Determine if we need to wait for the operation to complete. */ if ( (wait == CACHE_WAIT) || (wait == CACHE_ONLY_WAIT ) ) { CACHE_wbL1dWait(); } else { if ( (wait == CACHE_FENCE_WAIT) || (wait == CACHE_FENCE_ONLY_WAIT) ) { _mfence(); /* Add another mfence to address single mfence issue * Under very particular circumstances, MFENCE may allow * the transaction after the MFENCE to proceed before * the preceding STORE completes */ _mfence(); } } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** ============================================================================ * @n@b CACHE_wbInvL1dWait * * @b Description * @n This function is used to wait for the L1D invalidate/writeback block * operation to complete. This API should be used only if the CACHE_wbInvL1d * was called with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_wbInvL1d(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n The dirty lines of the L1D Block Cache have been written back and the cache * contents pointed to by the block address are also invalidated. * * @b Reads * @n CGEM_L1DWIWC_WC=0 * * @b Example * @verbatim CACHE_wbInvL1d((void *)ptr_buffer, 128, CACHE_NOWAIT); ... CACHE_wbInvL1dWait(); // Wait for the operation to complete. @endverbatim * ============================================================================= */ static inline void CACHE_wbInvL1dWait (void);/* for misra warnings*/ static inline void CACHE_wbInvL1dWait (void) { /* Wait for the Block Writeback/Invalidate operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L1DWIWC) & ((uint32_t)0x0000FFFFu)) >> ((uint32_t)0u)) != 0) {} } /** ============================================================================ * @n@b CACHE_wbInvL1d * * @b Description * @n This function is used to invalidate and writeback the dirty lines * of the block address. Although the block size can be specified in * the number of bytes, the cache controller operates on whole cache lines. * To prevent unintended behavior "blockPtr" should be aligned on the * cache line size and "byteCnt" should be a multiple of the cache line size. * * @b Arguments @verbatim blockPtr Address of the block which is to be invalidated/written back byteCnt Size of the block to be invalidated/written back. wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The contents of the blockPtr are being invalidated and the dirty lines are * written back * * @b Writes * @n CGEM_L1DWIBAR_ADDR,CGEM_L1DWIWC_WC * * @b Example * @verbatim Uint8* ptr_buffer; // Writeback/Invalidate 128 bytes of the buffer. CACHE_wbInvL1d((void *)ptr_buffer, 128, CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_wbInvL1d ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ); /*for misra warnings*/ static inline void CACHE_wbInvL1d ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); CSL_XMC_invalidatePrefetchBuffer(); } /* Setup the block address and length */ ((CSL_CgemRegs *)(0x01800000))->L1DWIBAR = ((((Uint32)blockPtr) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu)); ((CSL_CgemRegs *)(0x01800000))->L1DWIWC = ((((Uint32)((byteCnt+((uint32_t)3U))>>2)) << ((uint32_t)0u)) & ((uint32_t)0x0000FFFFu)); /* Determine if we need to wait for the operation to complete. */ if ( (wait == CACHE_WAIT) || (wait == CACHE_ONLY_WAIT) ) { CACHE_wbInvL1dWait(); } else { if ( (wait == CACHE_FENCE_WAIT) || (wait == CACHE_FENCE_ONLY_WAIT) ) { _mfence(); /* Add another mfence to address single mfence issue * Under very particular circumstances, MFENCE may allow * the transaction after the MFENCE to proceed before * the preceding STORE completes */ _mfence(); } } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** ============================================================================ * @n@b CACHE_setL1PSize * * @b Description * @n This function is used to set the L1P Cache Size. * * @b Arguments @verbatim newSize Cache Size to be configured. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Writes * @n CGEM_L1PCFG_L1PMODE * * @b Example * @verbatim CACHE_setL1PSize(1); // Configure 4K Cache Size @endverbatim * ============================================================================= */ /* for misra warnings*/ static inline void CACHE_setL1PSize (CACHE_L1Size newSize); static inline CACHE_L1Size CACHE_getL1PSize (void); static inline void CACHE_setL1PSize (CACHE_L1Size newSize) { ((((CSL_CgemRegs *)(0x01800000))->L1PCFG) = ((((CSL_CgemRegs *)(0x01800000))->L1PCFG) & ~((uint32_t)0x00000007u)) | (((newSize) << ((uint32_t)0u)) & ((uint32_t)0x00000007u))); /* Read back L1PCFG. This stalls the DSP until the mode change completes */ CACHE_getL1PSize(); } /** ============================================================================ * @n@b CACHE_getL1PSize * * @b Description * @n This function is used to get the L1P Cache Size. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n CGEM_L1PCFG_L1PMODE * * @b Example * @verbatim CACHE_L1Size cacheSize; cacheSize = CACHE_getL1PSize(); @endverbatim * ============================================================================= */ static inline CACHE_L1Size CACHE_getL1PSize (void) { return (CACHE_L1Size)(((((CSL_CgemRegs *)(0x01800000))->L1PCFG) & ((uint32_t)0x00000007u)) >> ((uint32_t)0u)); } /** ============================================================================ * @n@b CACHE_freezeL1P * * @b Description * @n This function is used to freeze the L1P cache. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Writes * @n CGEM_L1PCC_OPER=1 * * @b Example * @verbatim CACHE_freezeL1P(); @endverbatim * ============================================================================= */ static inline void CACHE_freezeL1P(void);/* for misra warnings*/ static inline void CACHE_freezeL1P(void) { /* Set the Freeze Mode Enabled bit. */ ((((CSL_CgemRegs *)(0x01800000))->L1PCC) = ((((CSL_CgemRegs *)(0x01800000))->L1PCC) & ~((uint32_t)0x00000007u)) | ((((uint32_t)1U) << ((uint32_t)0u)) & ((uint32_t)0x00000007u))); } /** ============================================================================ * @n@b CACHE_unfreezeL1P * * @b Description * @n This function is used to unfreeze the L1D cache. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Writes * @n CGEM_L1PCC_OPER=0 * * @b Example * @verbatim CACHE_unfreezeL1D(); @endverbatim * ============================================================================= */ static inline void CACHE_unfreezeL1P(void);/* for misra warnings*/ static inline void CACHE_unfreezeL1P(void) { /* Reset the Freeze Mode Enabled bit. */ ((((CSL_CgemRegs *)(0x01800000))->L1PCC) = ((((CSL_CgemRegs *)(0x01800000))->L1PCC) & ~((uint32_t)0x00000007u)) | ((((uint32_t)0) << ((uint32_t)0u)) & ((uint32_t)0x00000007u))); } /** ============================================================================ * @n@b CACHE_getPrevL1PMode * * @b Description * @n This function is used get the previous operating state of the L1P cache * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n CGEM_L1PCC_POPER * * @b Example * @verbatim Uint32 prev; prev = CACHE_getPrevL1PMode(); @endverbatim * ============================================================================= */ static inline Uint32 CACHE_getPrevL1PMode(void);/* for misra warnings*/ static inline Uint32 CACHE_getPrevL1PMode(void) { return (((((CSL_CgemRegs *)(0x01800000))->L1PCC) & ((uint32_t)0x00070000u)) >> ((uint32_t)16u)); } /** ============================================================================ * @n@b CACHE_invL1pWait * * @b Description * @n This function is used to wait for the L1D invalidate block operation to * complete. This API should be used only if the CACHE_invL1p was called * with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_invL1p(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n The L1D Block Cache is invalidated. * * @b Reads * @n CGEM_L1PIWC_WC=0 * * @b Example * @verbatim CACHE_invL1p((void *)&foo, 128, CACHE_NOWAIT); ... CACHE_invL1pWait(); // Wait for the Invalidate operation to complete. @endverbatim * ============================================================================= */ static inline void CACHE_invL1pWait (void);/* for misra warnings*/ static inline void CACHE_invL1pWait (void) { /* Wait for the Invalidate operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L1PIWC) & ((uint32_t)0x0000FFFFu)) >> ((uint32_t)0u)) != 0) {} } /** ============================================================================ * @n@b CACHE_invL1p * * @b Description * @n This function is used to invalidate the L1P Cache pointed by the block * address. Although the block size can be specified in the number of bytes, * the cache controller operates on whole cache lines. To prevent unintended * behavior "blockPtr" should be aligned on the cache line size and "byteCnt" * should be a multiple of the cache line size. * * @b Arguments @verbatim blockPtr Address of the block which is to be invalidated byteCnt Size of the block to be invalidated. wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The contents of the blockPtr are being invalidated * * @b Writes * @n CGEM_L1PIBAR_ADDR,CGEM_L1PIWC_WC * * @b Example * @verbatim // Invalidate the 128 bytes of the function 'foo' CACHE_invL1p((void *)&foo, 128, CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_invL1p ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ); /*for misra warnings*/ static inline void CACHE_invL1p ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ) { /* Setup the block address and length which is to be invalidated */ ((CSL_CgemRegs *)(0x01800000))->L1PIBAR = ((((Uint32)blockPtr) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu)); ((CSL_CgemRegs *)(0x01800000))->L1PIWC = ((((Uint32)((byteCnt+((uint32_t)3U))>>2)) << ((uint32_t)0u)) & ((uint32_t)0x0000FFFFu)); /* Determine if we need to wait for the operation to complete. */ if (wait == CACHE_WAIT) { CACHE_invL1pWait(); } else { if (wait == CACHE_FENCE_WAIT) { _mfence(); /* Add another mfence to address single mfence issue * Under very particular circumstances, MFENCE may allow * the transaction after the MFENCE to proceed before * the preceding STORE completes */ _mfence(); } } } /** ============================================================================ * @n@b CACHE_invAllL1pWait * * @b Description * @n This function is used to wait for the L1P invalidate operation to complete. * This API should be used only if the CACHE_invAllL1p was called with the * CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_invAllL1p(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n The L1P Cache is invalidated. * * @b Reads * @n CGEM_L1PINV_I=0 * * @b Example * @verbatim CACHE_invAllL1p(CACHE_NOWAIT); ... CACHE_invAllL1pWait(); // Wait for the Invalidate operation to complete. @endverbatim * ============================================================================= */ static inline void CACHE_invAllL1pWait (void);/* for misra warnings*/ static inline void CACHE_invAllL1pWait (void) { /* Wait for the Invalidate operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L1PINV) & ((uint32_t)0xFFFFFFFFu)) >> ((uint32_t)0u)) == (uint32_t)1U) {} } /** ============================================================================ * @n@b CACHE_invAllL1p * * @b Description * @n This function is used to invalidate the entire L1P Cache * * @b Arguments @verbatim wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The entire L1P cache is being invalidated. * * @b Writes * @n CGEM_L1PINV_I=1 * * @b Example * @verbatim CACHE_invAllL1p(CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_invAllL1p (CACHE_Wait wait);/* for misra warnings*/ static inline void CACHE_invAllL1p (CACHE_Wait wait) { /* Invalidate the L1P Cache. */ ((((CSL_CgemRegs *)(0x01800000))->L1PINV) = ((((CSL_CgemRegs *)(0x01800000))->L1PINV) & ~((uint32_t)0xFFFFFFFFu)) | ((((uint32_t)1U) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu))); /* Determine if we need to wait for the operation to complete. */ if (wait) { CACHE_invAllL1pWait(); } } /** ============================================================================ * @n@b CACHE_setL2Size * * @b Description * @n This function is used to set the new size of the L2 Cache. * * @b Arguments @verbatim newSize New Size of the L2 Cache to be set. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The L2 Cache is configured to use the new size. * * @b Writes * @n CGEM_L2CFG_L2MODE * * @b Example * @verbatim CACHE_setL2Size(CACHE_32KCACHE); // Use 32K L2 Cache. @endverbatim * ============================================================================= */ static inline void CACHE_setL2Size (CACHE_L2Size newSize);/* for misra warnings*/ static inline CACHE_L2Size CACHE_getL2Size (void);/* for misra warnings*/ static inline void CACHE_setL2Size (CACHE_L2Size newSize) { /* Set the new L2 cache size. */ ((((CSL_CgemRegs *)(0x01800000))->L2CFG) = ((((CSL_CgemRegs *)(0x01800000))->L2CFG) & ~((uint32_t)0x00000007u)) | (((newSize) << ((uint32_t)0u)) & ((uint32_t)0x00000007u))); /* Read back L2CFG. This stalls the DSP until the mode change completes */ CACHE_getL2Size(); } /** ============================================================================ * @n@b CACHE_getL2Size * * @b Description * @n This function is used to get the L2 cache size. * * @b Arguments * @n None * * Return Value * @n CACHE_L2Size * * Pre Condition * @n None * * Post Condition * @n None * * @b Reads * @n CGEM_L2CFG_L2MODE * * @b Example * @verbatim CACHE_L2Size size; size = CACHE_getL2Size(); @endverbatim * ============================================================================= */ static inline CACHE_L2Size CACHE_getL2Size (void) { return (CACHE_L2Size) (((((CSL_CgemRegs *)(0x01800000))->L2CFG) & ((uint32_t)0x00000007u)) >> ((uint32_t)0u)); } /** ============================================================================ * @n@b CACHE_freezeL2 * * @b Description * @n This function is used to freeze the L2 Cache * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The L2 Cache is frozen. * * @b Example * @verbatim CACHE_freezeL2(); @endverbatim * ============================================================================= */ static inline void CACHE_freezeL2 (void);/* for misra warnings*/ static inline void CACHE_freezeL2 (void) { /* The RL File does not define the L2CC bit so we used the RAW macro to * configure the corresponding bit. */ ((((CSL_CgemRegs *)(0x01800000))->L2CFG) = ((((CSL_CgemRegs *)(0x01800000))->L2CFG) & (~(((((uint32_t)1U) << (((uint32_t)3U) - ((uint32_t)3U) + ((uint32_t)1U))) - ((uint32_t)1U)) << ((uint32_t)3U)))) | (((((uint32_t)1U)) & ((((uint32_t)1U) << ((((uint32_t)3U)) - (((uint32_t)3U)) + ((uint32_t)1U))) - ((uint32_t)1U))) << (((uint32_t)3U)))); } /** ============================================================================ * @n@b CACHE_unfreezeL2 * * @b Description * @n This function is used to unfreeze the L2 Cache * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The L2 Cache is unfrozen * * @b Example * @verbatim CACHE_unfreezeL2(); @endverbatim * ============================================================================= */ static inline void CACHE_unfreezeL2 (void);/* for misra warnings*/ static inline void CACHE_unfreezeL2 (void) { /* The RL File does not define the L2CC bit so we used the RAW macro to * configure the corresponding bit. */ ((((CSL_CgemRegs *)(0x01800000))->L2CFG) = ((((CSL_CgemRegs *)(0x01800000))->L2CFG) & (~(((((uint32_t)1U) << (((uint32_t)3U) - ((uint32_t)3U) + ((uint32_t)1U))) - ((uint32_t)1U)) << ((uint32_t)3U)))) | (((((uint32_t)0)) & ((((uint32_t)1U) << ((((uint32_t)3U)) - (((uint32_t)3U)) + ((uint32_t)1U))) - ((uint32_t)1U))) << (((uint32_t)3U)))); } /** ============================================================================ * @n@b CACHE_wbL2Wait * * @b Description * @n This function is used to wait for the L2 writeback block operation to * complete. This API should be used only if the CACHE_wbL2 was called * with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_wbL2(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n The dirty lines of the L1D Block Cache have been written back. * * @b Reads * @n CGEM_L2WWC_WC=0 * * @b Example * @verbatim CACHE_wbL2((void *)ptr_buffer, 128, CACHE_NOWAIT); ... CACHE_wbL2Wait(); // Wait for the writeback operation to complete. @endverbatim * ============================================================================= */ static inline void CACHE_wbL2Wait (void);/* for misra warnings*/ static inline void CACHE_wbL2Wait (void) { /* Wait for the Writeback operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L2WWC) & ((uint32_t)0x0000FFFFu)) >> ((uint32_t)0u)) != 0) {} } /** ============================================================================ * @n@b CACHE_wbL2 * * @b Description * @n This function is used to writeback the contents of the L2 Cache. Although * the block size can be specified in the number of bytes, the cache * controller operates on whole cache lines. To prevent unintended behavior * "blockPtr" should be aligned on the cache line size and "byteCnt" * should be a multiple of the cache line size. * * @b Arguments @verbatim blockPtr Address of the block which is to be written back byteCnt Size of the block to be written block. wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The dirty lines of the L2 Cache are being written back. * * @b Writes * @n CGEM_L2WBAR_ADDR,CGEM_L2WWC_WC * * @b Example * @verbatim Uint8* ptr_buffer; // Writeback the contents of the buffer. CACHE_wbL2(ptr_buffer, 100, CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_wbL2 ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ); /*for misra warnings*/ static inline void CACHE_wbL2 ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); } /* Setup the block address and length */ ((CSL_CgemRegs *)(0x01800000))->L2WBAR = ((((Uint32)blockPtr) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu)); ((CSL_CgemRegs *)(0x01800000))->L2WWC = ((((Uint32)((byteCnt+((uint32_t)3))>>2)) << ((uint32_t)0u)) & ((uint32_t)0x0000FFFFu)); /* Determine if we need to wait for the operation to complete. */ if ( (wait == CACHE_WAIT) || (wait == CACHE_ONLY_WAIT) ) { CACHE_wbL2Wait(); } else { if ( (wait == CACHE_FENCE_WAIT) || (wait == CACHE_FENCE_ONLY_WAIT) ) { _mfence(); /* Add another mfence to address single mfence issue * Under very particular circumstances, MFENCE may allow * the transaction after the MFENCE to proceed before * the preceding STORE completes */ _mfence(); } } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** ============================================================================ * @n@b CACHE_invL2Wait * * @b Description * @n This function is used to wait for the L2 invalidate block operation to * complete. This API should be used only if the CACHE_invL2 was called * with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_invL2(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n Invalidate the contents of the L2 Cache. * * @b Reads * @n CGEM_L2IWC_WC=0 * * @b Example * @verbatim CACHE_invL2((void *)ptr_buffer, 128, CACHE_NOWAIT); ... CACHE_invL2Wait(); // Wait for the Invalidate operation to complete. @endverbatim * ============================================================================= */ static inline void CACHE_invL2Wait (void);/* for misra warnings*/ static inline void CACHE_invL2Wait (void) { /* Wait for the Invalidate operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L2IWC) & ((uint32_t)0x0000FFFFu)) >> ((uint32_t)0u)) != 0) {} } /** ============================================================================ * @n@b CACHE_invL2 * * @b Description * @n This function is used to invalidate the contents of the L2 Cache. * Although the block size can be specified in the number of bytes, * the cache controller operates on whole cache lines. To prevent unintended * behavior "blockPtr" should be aligned on the cache line size and "byteCnt" * should be a multiple of the cache line size. * * @b Arguments @verbatim blockPtr Address of the block which is to be invalidated byteCnt Size of the block to be invalidated. wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The contents of the L2 Cache are being invalidated. * * @b Writes * @n CGEM_L2IBAR_ADDR,CGEM_L2IWC_WC * * @b Example * @verbatim Uint8* ptr_buffer; // Invalidate the contents of the buffer. CACHE_invL2(ptr_buffer, 100, CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_invL2 ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ); /*for misra warnings*/ static inline void CACHE_invL2 ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); CSL_XMC_invalidatePrefetchBuffer(); } /* Setup the block address and length */ ((CSL_CgemRegs *)(0x01800000))->L2IBAR = ((((Uint32)blockPtr) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu)); ((CSL_CgemRegs *)(0x01800000))->L2IWC = ((((Uint32)((byteCnt+((uint32_t)3U))>>2)) << ((uint32_t)0u)) & ((uint32_t)0x0000FFFFu)); /* Determine if we need to wait for the operation to complete. */ if ( (wait == CACHE_WAIT) || (wait == CACHE_ONLY_WAIT) ) { CACHE_invL2Wait(); } else { if ((wait == CACHE_FENCE_WAIT) || (wait == CACHE_FENCE_ONLY_WAIT)) { _mfence(); /* Add another mfence to address single mfence issue * Under very particular circumstances, MFENCE may allow * the transaction after the MFENCE to proceed before * the preceding STORE completes */ _mfence(); } } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** ============================================================================ * @n@b CACHE_wbInvL2Wait * * @b Description * @n This function is used to wait for the L2 Writeback & invalidate block * operation to complete. This API should be used only if the CACHE_wbInvL2 * was called with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_wbInvL2(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n Invalidate the contents of the L2 Cache. * * @b Reads * @n CGEM_L2WIWC_WC=0 * * @b Example * @verbatim CACHE_wbInvL2((void *)ptr_buffer, 128, CACHE_NOWAIT); ... CACHE_wbInvL2Wait(); // Wait for the Writeback-Invalidate operation to complete. @endverbatim * ============================================================================= */ static inline void CACHE_wbInvL2Wait (void);/* for misra warnings*/ static inline void CACHE_wbInvL2Wait (void) { /* Wait for the Writeback & Invalidate operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L2WIWC) & ((uint32_t)0x0000FFFFu)) >> ((uint32_t)0u)) != 0) {} } /** ============================================================================ * @n@b CACHE_wbInvL2 * * @b Description * @n This function is used to write back and invalidate the contents of the L2 Cache. * Although the block size can be specified in the number of bytes, * the cache controller operates on whole cache lines. To prevent unintended * behavior "blockPtr" should be aligned on the cache line size and "byteCnt" * should be a multiple of the cache line size. * * @b Arguments @verbatim blockPtr Address of the block which is to be written back & invalidated byteCnt Size of the block to be written back & invalidated. wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The contents of the L2 Cache are being written back & invalidated. * * @b Writes * @n CGEM_L2WIBAR_ADDR,CGEM_L2WIWC_WC * * @b Example * @verbatim Uint8* ptr_buffer; // Invalidate the contents of the buffer. CACHE_wbInvL2(ptr_buffer, 100, CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_wbInvL2 ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ); /* for misra warnings */ static inline void CACHE_wbInvL2 ( const void* blockPtr, Uint32 byteCnt, CACHE_Wait wait ) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); CSL_XMC_invalidatePrefetchBuffer(); } /* Setup the block address and length */ ((CSL_CgemRegs *)(0x01800000))->L2WIBAR = ((((Uint32)blockPtr) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu)); ((CSL_CgemRegs *)(0x01800000))->L2WIWC = ((((Uint32)((byteCnt+((uint32_t)3U))>>2)) << ((uint32_t)0u)) & ((uint32_t)0x0000FFFFu)); /* Determine if we need to wait for the operation to complete. */ if ( (wait == CACHE_WAIT) || (wait == CACHE_ONLY_WAIT) ) { CACHE_wbInvL2Wait(); } else { if ( (wait == CACHE_FENCE_WAIT) || (wait == CACHE_FENCE_ONLY_WAIT) ) { _mfence(); /* Add another mfence to address single mfence issue * Under very particular circumstances, MFENCE may allow * the transaction after the MFENCE to proceed before * the preceding STORE completes */ _mfence(); } } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** ============================================================================ * @n@b CACHE_wbAllL2Wait * * @b Description * @n This function is used to wait for the L2 Writeback & invalidate operation * to complete. This API should be used only if the CACHE_wbAllL2 was called * with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_wbAllL2(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n The contents of the L2 Cache have been written back * * @b Reads * @n CGEM_L2WB_C=0 * * @b Example * @verbatim // Writeback the contents of the L2 Cache. CACHE_wbAllL2(CACHE_NOWAIT); // Wait for the operation to complete. CACHE_wbAllL2Wait(); @endverbatim * ============================================================================= */ static inline void CACHE_wbAllL2Wait (void);/* for misra warnings*/ static inline void CACHE_wbAllL2Wait (void) { /* Wait for the writeback operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L2WB) & ((uint32_t)0xFFFFFFFFu)) >> ((uint32_t)0u)) == (uint32_t)1U) {} } /** ============================================================================ * @n@b CACHE_wbAllL2 * * @b Description * @n This function is used to write back all the contents of the L2 Cache. * * @b Arguments @verbatim wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The contents of the L2 Cache are being written back. * * @b Writes * @n CGEM_L2WB_C=1 * * @b Example * @verbatim // Writeback the contents of the L2 Cache. CACHE_wbAllL2(CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_wbAllL2 (CACHE_Wait wait);/* for misra warnings*/ static inline void CACHE_wbAllL2 (CACHE_Wait wait) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); } ((((CSL_CgemRegs *)(0x01800000))->L2WB) = ((((CSL_CgemRegs *)(0x01800000))->L2WB) & ~((uint32_t)0xFFFFFFFFu)) | ((((uint32_t)1U) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu))); /* Determine if we need to wait for the operation to complete. */ if (wait) { CACHE_wbAllL2Wait(); } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** ============================================================================ * @n@b CACHE_invAllL2Wait * * @b Description * @n This function is used to wait for the L2 Invalidate operation to complete. * This API should be used only if the CACHE_invAllL2 was called with the * CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_invAllL2(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n The contents of the L2 Cache have been invalidated * * @b Reads * @n CGEM_L2INV_I=0 * * @b Example * @verbatim // Invalidate the contents of the L2 Cache. CACHE_invAllL2(CACHE_NOWAIT); // Wait for the operation to complete. CACHE_invAllL2Wait(); @endverbatim * ============================================================================= */ static inline void CACHE_invAllL2Wait (void);/* for misra warnings*/ static inline void CACHE_invAllL2Wait (void) { /* Wait for the invalidate operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L2INV) & ((uint32_t)0xFFFFFFFFu)) >> ((uint32_t)0u)) == (uint32_t)1U) {} } /** ============================================================================ * @n@b CACHE_invAllL2 * * @b Description * @n This function is used to invalidate all the contents of the L2 Cache. * * @b Arguments @verbatim wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The contents of the L2 Cache are being invalidated. * * @b Writes * @n CGEM_L2INV_I=1 * * @b Example * @verbatim // Invalidate the contents of the L2 Cache. CACHE_invAllL2(CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_invAllL2 (CACHE_Wait wait);/* for misra warnings*/ static inline void CACHE_invAllL2 (CACHE_Wait wait) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); CSL_XMC_invalidatePrefetchBuffer(); } ((((CSL_CgemRegs *)(0x01800000))->L2INV) = ((((CSL_CgemRegs *)(0x01800000))->L2INV) & ~((uint32_t)0xFFFFFFFFu)) | ((((uint32_t)1U) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu))); /* Determine if we need to wait for the operation to complete. */ if (wait) { CACHE_invAllL2Wait(); } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** ============================================================================ * @n@b CACHE_wbInvAllL2Wait * * @b Description * @n This function is used to wait for the L2 Writeback and Invalidate * operation to complete. This API should be used only if the CACHE_wbInvAllL2 was * called with the CACHE_NOWAIT argument. * * @b Arguments * @n None * * Return Value * @n None * * Pre Condition * @n @a CACHE_wbInvAllL2(wait=CACHE_NOWAIT) must be called. * * Post Condition * @n The contents of the L2 Cache have been invalidated and written back * * @b Reads * @n CGEM_L2WBINV_C=0 * * @b Example * @verbatim // Writeback & Invalidate the contents of the L2 Cache. CACHE_wbInvAllL2(CACHE_NOWAIT); // Wait for the operation to complete. CACHE_wbInvAllL2Wait(); @endverbatim * ============================================================================= */ static inline void CACHE_wbInvAllL2Wait (void);/* for misra warnings*/ static inline void CACHE_wbInvAllL2Wait (void) { /* Wait for the writeback-invalidate operation to complete. */ while ((((((CSL_CgemRegs *)(0x01800000))->L2WBINV) & ((uint32_t)0xFFFFFFFFu)) >> ((uint32_t)0u)) == (uint32_t)1U) {} } /** ============================================================================ * @n@b CACHE_wbInvAllL2 * * @b Description * @n This function is used to writeback and invalidate all the contents of the L2 Cache. * * @b Arguments @verbatim wait Indicates if the call should block or not. @endverbatim * * Return Value * @n None * * Pre Condition * @n None * * Post Condition * @n The contents of the L2 Cache are being written back & invalidated. * * @b Writes * @n CGEM_L2WBINV_C=1 * * @b Example * @verbatim // Invalidate the contents of the L2 Cache. CACHE_wbInvAllL2(CACHE_WAIT); @endverbatim * ============================================================================= */ static inline void CACHE_wbInvAllL2 (CACHE_Wait wait);/* for misra warnings*/ static inline void CACHE_wbInvAllL2 (CACHE_Wait wait) { uint32_t gie, advisory6; if ( (wait == CACHE_WAIT ) || (wait == CACHE_FENCE_WAIT) ) { advisory6 = (uint32_t)1U; } else { advisory6 = 0; } if ( advisory6 ) { /* disable the interrupts */ gie = _disable_interrupts (); CSL_XMC_invalidatePrefetchBuffer(); } ((((CSL_CgemRegs *)(0x01800000))->L2WBINV) = ((((CSL_CgemRegs *)(0x01800000))->L2WBINV) & ~((uint32_t)0xFFFFFFFFu)) | ((((uint32_t)1U) << ((uint32_t)0u)) & ((uint32_t)0xFFFFFFFFu))); /* Determine if we need to wait for the operation to complete. */ if (wait) { CACHE_wbInvAllL2Wait(); } if (advisory6) { CACHE_AsmNop(); _restore_interrupts (gie); } } /** @} */ /* Kepler Architecture */ /* Define in DDR3 Initialization */ /* TEST OPTIONS */ /* extern declaration */ extern Uint32 *ptab0; /* API reference */ /** * @brief memory mapping initialization * @param void */ void memory_init (void); void memory_init (void) { int k=0; Uint8 pcx; // Reserved bit, do not touch Uint8 pfx; // prefetchability if (1 == 1) { /* * MAR 128: DDR3 start @ : 0x8000 0000 * MAR 255: DDR3 end @ : 0xFFFF FFFF * * DDR3 cacheabilty is enable on the entire DDR3 memory space. */ for (k=128; k<=255; k++) { // Set PC at '1' CACHE_enableCaching(k); // Get the memory region information for MAR k CACHE_getMemRegionInfo (k, &pcx, &pfx); // prefetch, 0 disable, 1 enable pfx = 1; CACHE_setMemRegionInfo(k, pcx, pfx); } } else if (1 == 0) { /* * MAR 128: DDR3 start @ : 0x8000 0000 * MAR 255: DDR3 end @ : 0xFFFF FFFF * * DDR3 cacheability is disabled on the entire DDR3 memory space. */ for (k=128; k<=255; k++) { // Set PC at '0' CACHE_disableCaching(k); // Get the memory region information for MAR k CACHE_getMemRegionInfo (k, &pcx, &pfx); // prefetch, 0 disable, 1 enable pfx = 1; CACHE_setMemRegionInfo(k, pcx, pfx); } } else { printf("MAR INITIALIZATION FAILED\n"); } /* cache initialization */ CACHE_setL2Size(CACHE_0KCACHE); CACHE_setL1DSize(CACHE_L1_32KCACHE); CACHE_setL1PSize(CACHE_L1_32KCACHE); }