FFTLIB User Guide
c7120/FFTLIB_utility.cpp
Go to the documentation of this file.
1 /******************************************************************************/
5 /* Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com/
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution.
18  *
19  * Neither the name of Texas Instruments Incorporated nor the names of
20  * its contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35  ******************************************************************************/
36 
37 
38 /*******************************************************************************
39  *
40  * INCLUDES
41  *
42  ******************************************************************************/
43 #include "FFTLIB_utility.h"
44 
45 
46 /**************************************************************************************
47  *
48  * Storage for emulating the dynamic range min/max feature of the MMA
49  *
50  **************************************************************************************/
51 
54 
55 
56 /**************************************************************************************
57  *
58  * Functions for emulating the dynamic range min/max feature of the MMA
59  *
60  **************************************************************************************/
61 
62 template <typename accumulateType>
63 void FFTLIB_CN_initDynamicRange(FFTLIB_initDynamicRange_type initDynamicRange, accumulateType temp)
64 {
65  if( initDynamicRange == FFTLIB_DYNAMIC_RANGE_NOINIT ){
66  // do nothing
67  } else {
68  FFTLIB_CN_dynamicRangeMin = 0x7FFFFFFFFFFFFFFF;
69  FFTLIB_CN_dynamicRangeMax = 0x8000000000000000;
70  }
71 
72  return;
73 }
74 
75 template void FFTLIB_CN_initDynamicRange(FFTLIB_initDynamicRange_type initDynamicRange, int32_t temp);
76 template void FFTLIB_CN_initDynamicRange(FFTLIB_initDynamicRange_type initDynamicRange, int64_t temp);
77 
78 
79 
80 template <>
81 void FFTLIB_CN_initDynamicRange(FFTLIB_initDynamicRange_type initDynamicRange, uint32_t temp)
82 {
83  if( initDynamicRange == FFTLIB_DYNAMIC_RANGE_NOINIT ){
84  // do nothing
85  } else {
86  FFTLIB_CN_dynamicRangeMin = 0x00000000FFFFFFFF;
87  FFTLIB_CN_dynamicRangeMax = 0x0000000000000000;
88  }
89 
90  return;
91 }
92 
93 template <>
94 void FFTLIB_CN_initDynamicRange(FFTLIB_initDynamicRange_type initDynamicRange, uint64_t temp)
95 {
96  if( initDynamicRange == FFTLIB_DYNAMIC_RANGE_NOINIT ){
97  // do nothing
98  } else {
99  FFTLIB_CN_dynamicRangeMin = 0xFFFFFFFFFFFFFFFF;
100  FFTLIB_CN_dynamicRangeMax = 0x0000000000000000;
101  }
102 
103  return;
104 }
FFTLIB_initDynamicRange_type_e
The enumeration of possible dynamic range reset options.
@ FFTLIB_DYNAMIC_RANGE_NOINIT
Do not reset dynamic range min/max at start of computation.
int64_t FFTLIB_CN_dynamicRangeMax
int64_t FFTLIB_CN_dynamicRangeMin
void FFTLIB_CN_initDynamicRange(FFTLIB_initDynamicRange_type initDynamicRange, accumulateType temp)