Arianna autonomous DAQ firmware
Dependencies: mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW
SnSigProcDataTable.h@110:d1da040a0cf2, 2015-11-24 (annotated)
- Committer:
- uci1
- Date:
- Tue Nov 24 21:52:27 2015 +0000
- Revision:
- 110:d1da040a0cf2
- Parent:
- 84:80b15993944e
- Child:
- 114:554fa3a956b4
Stn32 (slow) with conf name. SD stall fix. No interface chip. Safety nets.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
uci1 | 84:80b15993944e | 1 | #ifndef SN_SnSigProcDataTable |
uci1 | 84:80b15993944e | 2 | #define SN_SnSigProcDataTable |
uci1 | 84:80b15993944e | 3 | |
uci1 | 84:80b15993944e | 4 | #include "SnPreCompOptions.h" |
uci1 | 84:80b15993944e | 5 | |
uci1 | 84:80b15993944e | 6 | #include <stdint.h> |
uci1 | 84:80b15993944e | 7 | |
uci1 | 84:80b15993944e | 8 | // use template specialization to cause a compiler |
uci1 | 84:80b15993944e | 9 | // error if we change the number of samples in the future |
uci1 | 84:80b15993944e | 10 | // and no appropriate data table is supplied |
uci1 | 84:80b15993944e | 11 | template<int NSMP> |
uci1 | 84:80b15993944e | 12 | struct SnSigProcDataTable { |
uci1 | 84:80b15993944e | 13 | }; |
uci1 | 84:80b15993944e | 14 | |
uci1 | 84:80b15993944e | 15 | // save RAM by not implementing data tables that won't be used |
uci1 | 84:80b15993944e | 16 | // (altho I guess they will be optimized away in any case) |
uci1 | 84:80b15993944e | 17 | #if CHIPBOARD==SST4CH |
uci1 | 84:80b15993944e | 18 | // hard code the number here because these tables are only valid for this value. |
uci1 | 84:80b15993944e | 19 | // use kNsamps when instantiating it, though, so a compiler error will happen |
uci1 | 84:80b15993944e | 20 | // if there's no data table for that number of samples. |
uci1 | 84:80b15993944e | 21 | template<> |
uci1 | 84:80b15993944e | 22 | struct SnSigProcDataTable<256> { |
uci1 | 84:80b15993944e | 23 | |
uci1 | 84:80b15993944e | 24 | // these are the pairs: (j, m) at each step of the loop over odd |
uci1 | 84:80b15993944e | 25 | // values of i in DiscreteCpxFFT |
uci1 | 84:80b15993944e | 26 | typedef uint8_t DfftDivideIndicies_t; // get away with only 8 bits for 256 samples |
uci1 | 84:80b15993944e | 27 | static const DfftDivideIndicies_t kDfftDivideIndicies[256]; |
uci1 | 84:80b15993944e | 28 | |
uci1 | 84:80b15993944e | 29 | // these are the twidle factors: wr, wi used in DiscreteCpxFFT |
uci1 | 84:80b15993944e | 30 | typedef float DfftTwidleFactor_t; |
uci1 | 84:80b15993944e | 31 | static const DfftTwidleFactor_t kDfftTwidleFactors[254]; |
uci1 | 84:80b15993944e | 32 | |
uci1 | 84:80b15993944e | 33 | typedef float RealDfftTwidleFactor_t; |
uci1 | 84:80b15993944e | 34 | static const RealDfftTwidleFactor_t kRealDfftTwidleFactor[126]; |
uci1 | 84:80b15993944e | 35 | |
uci1 | 84:80b15993944e | 36 | }; |
uci1 | 84:80b15993944e | 37 | #endif |
uci1 | 84:80b15993944e | 38 | |
uci1 | 84:80b15993944e | 39 | #if CHIPBOARD==ATWD4CH |
uci1 | 84:80b15993944e | 40 | // hard code the number here because these tables are only valid for this value. |
uci1 | 84:80b15993944e | 41 | // use kNsamps when instantiating it, though, so a compiler error will happen |
uci1 | 84:80b15993944e | 42 | // if there's no data table for that number of samples. |
uci1 | 84:80b15993944e | 43 | template<> |
uci1 | 84:80b15993944e | 44 | struct SnSigProcDataTable<128> { |
uci1 | 84:80b15993944e | 45 | // these are the pairs: (j, m) at each step of the loop over odd |
uci1 | 84:80b15993944e | 46 | // values of i in DiscreteCpxFFT |
uci1 | 84:80b15993944e | 47 | typedef uint8_t DfftDivideIndicies_t; // get away with only 8 bits for 256 samples |
uci1 | 84:80b15993944e | 48 | static const DfftDivideIndicies_t kDfftDivideIndicies[128]; |
uci1 | 84:80b15993944e | 49 | |
uci1 | 84:80b15993944e | 50 | // these are the twidle factors: wr, wi used in DiscreteCpxFFT |
uci1 | 84:80b15993944e | 51 | typedef float DfftTwidleFactor_t; |
uci1 | 84:80b15993944e | 52 | static const DfftTwidleFactor_t kDfftTwidleFactors[126]; |
uci1 | 84:80b15993944e | 53 | |
uci1 | 84:80b15993944e | 54 | typedef float RealDfftTwidleFactor_t; |
uci1 | 84:80b15993944e | 55 | static const RealDfftTwidleFactor_t kRealDfftTwidleFactor[62]; |
uci1 | 84:80b15993944e | 56 | }; |
uci1 | 84:80b15993944e | 57 | #endif |
uci1 | 84:80b15993944e | 58 | |
uci1 | 84:80b15993944e | 59 | |
uci1 | 84:80b15993944e | 60 | #endif // SnSigProcDataTable |