Arianna autonomous DAQ firmware
Dependencies: mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW
SnSigProcDataTable.cpp@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 | #include "SnSigProcDataTable.h" |
uci1 | 84:80b15993944e | 2 | |
uci1 | 84:80b15993944e | 3 | // save RAM by not implementing data tables that won't be used |
uci1 | 84:80b15993944e | 4 | // (altho I guess they will be optimized away in any case) |
uci1 | 84:80b15993944e | 5 | #if CHIPBOARD==SST4CH |
uci1 | 84:80b15993944e | 6 | // hard code the number here because these tables are only valid for this value. |
uci1 | 84:80b15993944e | 7 | // use kNsamps when instantiating it, though, so a compiler error will happen |
uci1 | 84:80b15993944e | 8 | // if there's no data table for that number of samples. |
uci1 | 84:80b15993944e | 9 | |
uci1 | 84:80b15993944e | 10 | // these are the pairs: (j, m) at each step of the loop over odd |
uci1 | 84:80b15993944e | 11 | // values of i in DiscreteCpxFFT |
uci1 | 84:80b15993944e | 12 | const SnSigProcDataTable<256>::DfftDivideIndicies_t SnSigProcDataTable<256>::kDfftDivideIndicies[256] = { |
uci1 | 84:80b15993944e | 13 | 129, 128, 65, 64, 193, 128, 33, 32, 161, 128, 97, 64, 225, 128, 17, 16, 145, 128, 81, 64, 209, 128, 49, 32, 177, 128, 113, 64, 241, 128, 9, 8, 137, 128, 73, 64, 201, 128, 41, 32, 169, 128, 105, 64, 233, 128, 25, 16, 153, 128, 89, 64, 217, 128, 57, 32, 185, 128, 121, 64, 249, 128, 5, 4, 133, 128, 69, 64, 197, 128, 37, 32, 165, 128, 101, 64, 229, 128, 21, 16, 149, 128, 85, 64, 213, 128, 53, 32, 181, 128, 117, 64, 245, 128, 13, 8, 141, 128, 77, 64, 205, 128, 45, 32, 173, 128, 109, 64, 237, 128, 29, 16, 157, 128, 93, 64, 221, 128, 61, 32, 189, 128, 125, 64, 253, 128, 3, 2, 131, 128, 67, 64, 195, 128, 35, 32, 163, 128, 99, 64, 227, 128, 19, 16, 147, 128, 83, 64, 211, 128, 51, 32, 179, 128, 115, 64, 243, 128, 11, 8, 139, 128, 75, 64, 203, 128, 43, 32, 171, 128, 107, 64, 235, 128, 27, 16, 155, 128, 91, 64, 219, 128, 59, 32, 187, 128, 123, 64, 251, 128, 7, 4, 135, 128, 71, 64, 199, 128, 39, 32, 167, 128, 103, 64, 231, 128, 23, 16, 151, 128, 87, 64, 215, 128, 55, 32, 183, 128, 119, 64, 247, 128, 15, 8, 143, 128, 79, 64, 207, 128, 47, 32, 175, 128, 111, 64, 239, 128, 31, 16, 159, 128, 95, 64, 223, 128, 63, 32, 191, 128, 127, 64, 255, 128, 2, 1 |
uci1 | 84:80b15993944e | 14 | }; |
uci1 | 84:80b15993944e | 15 | |
uci1 | 84:80b15993944e | 16 | // these are the twidle factors: wr, wi used in DiscreteCpxFFT |
uci1 | 84:80b15993944e | 17 | const SnSigProcDataTable<256>::DfftTwidleFactor_t SnSigProcDataTable<256>::kDfftTwidleFactors[254] = { |
uci1 | 84:80b15993944e | 18 | 1.00000000000000e+00, 0.00000000000000e+00, 1.00000000000000e+00, 0.00000000000000e+00, 2.22044604925031e-16, 1.00000000000000e+00, 1.00000000000000e+00, 0.00000000000000e+00, 7.07106781186547e-01, 7.07106781186547e-01, 0.00000000000000e+00, 1.00000000000000e+00, -7.07106781186547e-01, 7.07106781186547e-01, 1.00000000000000e+00, 0.00000000000000e+00, 9.23879532511287e-01, 3.82683432365090e-01, 7.07106781186547e-01, 7.07106781186548e-01, 3.82683432365090e-01, 9.23879532511287e-01, -5.55111512312578e-17, 1.00000000000000e+00, -3.82683432365090e-01, 9.23879532511287e-01, -7.07106781186548e-01, 7.07106781186547e-01, -9.23879532511287e-01, 3.82683432365090e-01, 1.00000000000000e+00, 0.00000000000000e+00, 9.80785280403230e-01, 1.95090322016128e-01, 9.23879532511287e-01, 3.82683432365090e-01, 8.31469612302545e-01, 5.55570233019602e-01, 7.07106781186548e-01, 7.07106781186547e-01, 5.55570233019602e-01, 8.31469612302545e-01, 3.82683432365090e-01, 9.23879532511287e-01, 1.95090322016128e-01, 9.80785280403230e-01, 1.38777878078145e-16, 1.00000000000000e+00, -1.95090322016128e-01, 9.80785280403230e-01, -3.82683432365090e-01, 9.23879532511287e-01, -5.55570233019602e-01, 8.31469612302545e-01, -7.07106781186547e-01, 7.07106781186547e-01, -8.31469612302545e-01, 5.55570233019602e-01, -9.23879532511286e-01, 3.82683432365090e-01, -9.80785280403230e-01, 1.95090322016128e-01, 1.00000000000000e+00, 0.00000000000000e+00, 9.95184726672197e-01, 9.80171403295606e-02, 9.80785280403231e-01, 1.95090322016128e-01, 9.56940335732209e-01, 2.90284677254462e-01, 9.23879532511287e-01, 3.82683432365090e-01, 8.81921264348355e-01, 4.71396736825998e-01, 8.31469612302545e-01, 5.55570233019602e-01, 7.73010453362737e-01, 6.34393284163646e-01, 7.07106781186548e-01, 7.07106781186548e-01, 6.34393284163646e-01, 7.73010453362737e-01, 5.55570233019602e-01, 8.31469612302545e-01, 4.71396736825998e-01, 8.81921264348355e-01, 3.82683432365090e-01, 9.23879532511287e-01, 2.90284677254462e-01, 9.56940335732209e-01, 1.95090322016128e-01, 9.80785280403231e-01, 9.80171403295606e-02, 9.95184726672197e-01, 0.00000000000000e+00, 1.00000000000000e+00, -9.80171403295606e-02, 9.95184726672197e-01, -1.95090322016128e-01, 9.80785280403231e-01, -2.90284677254462e-01, 9.56940335732209e-01, -3.82683432365090e-01, 9.23879532511287e-01, -4.71396736825998e-01, 8.81921264348355e-01, -5.55570233019602e-01, 8.31469612302545e-01, -6.34393284163646e-01, 7.73010453362737e-01, -7.07106781186548e-01, 7.07106781186548e-01, -7.73010453362737e-01, 6.34393284163646e-01, -8.31469612302545e-01, 5.55570233019602e-01, -8.81921264348355e-01, 4.71396736825998e-01, -9.23879532511287e-01, 3.82683432365090e-01, -9.56940335732209e-01, 2.90284677254462e-01, -9.80785280403231e-01, 1.95090322016128e-01, -9.95184726672197e-01, 9.80171403295606e-02, 1.00000000000000e+00, 0.00000000000000e+00, 9.98795456205172e-01, 4.90676743274180e-02, 9.95184726672197e-01, 9.80171403295606e-02, 9.89176509964781e-01, 1.46730474455362e-01, 9.80785280403231e-01, 1.95090322016128e-01, 9.70031253194544e-01, 2.42980179903264e-01, 9.56940335732209e-01, 2.90284677254462e-01, 9.41544065183021e-01, 3.36889853392220e-01, 9.23879532511287e-01, 3.82683432365090e-01, 9.03989293123443e-01, 4.27555093430282e-01, 8.81921264348355e-01, 4.71396736825998e-01, 8.57728610000272e-01, 5.14102744193222e-01, 8.31469612302545e-01, 5.55570233019602e-01, 8.03207531480645e-01, 5.95699304492433e-01, 7.73010453362737e-01, 6.34393284163645e-01, 7.40951125354959e-01, 6.71558954847018e-01, 7.07106781186548e-01, 7.07106781186548e-01, 6.71558954847018e-01, 7.40951125354959e-01, 6.34393284163645e-01, 7.73010453362737e-01, 5.95699304492433e-01, 8.03207531480645e-01, 5.55570233019602e-01, 8.31469612302545e-01, 5.14102744193222e-01, 8.57728610000272e-01, 4.71396736825998e-01, 8.81921264348355e-01, 4.27555093430282e-01, 9.03989293123443e-01, 3.82683432365090e-01, 9.23879532511287e-01, 3.36889853392220e-01, 9.41544065183021e-01, 2.90284677254462e-01, 9.56940335732209e-01, 2.42980179903264e-01, 9.70031253194544e-01, 1.95090322016128e-01, 9.80785280403231e-01, 1.46730474455362e-01, 9.89176509964781e-01, 9.80171403295605e-02, 9.95184726672197e-01, 4.90676743274180e-02, 9.98795456205172e-01, -6.24500451351651e-17, 1.00000000000000e+00, -4.90676743274181e-02, 9.98795456205172e-01, -9.80171403295607e-02, 9.95184726672197e-01, -1.46730474455362e-01, 9.89176509964781e-01, -1.95090322016128e-01, 9.80785280403231e-01, -2.42980179903264e-01, 9.70031253194544e-01, -2.90284677254462e-01, 9.56940335732209e-01, -3.36889853392220e-01, 9.41544065183021e-01, -3.82683432365090e-01, 9.23879532511287e-01, -4.27555093430282e-01, 9.03989293123443e-01, -4.71396736825998e-01, 8.81921264348355e-01, -5.14102744193222e-01, 8.57728610000272e-01, -5.55570233019602e-01, 8.31469612302545e-01, -5.95699304492433e-01, 8.03207531480645e-01, -6.34393284163645e-01, 7.73010453362737e-01, -6.71558954847018e-01, 7.40951125354959e-01, -7.07106781186548e-01, 7.07106781186548e-01, -7.40951125354959e-01, 6.71558954847018e-01, -7.73010453362737e-01, 6.34393284163645e-01, -8.03207531480645e-01, 5.95699304492433e-01, -8.31469612302545e-01, 5.55570233019602e-01, -8.57728610000272e-01, 5.14102744193222e-01, -8.81921264348355e-01, 4.71396736825998e-01, -9.03989293123443e-01, 4.27555093430282e-01, -9.23879532511287e-01, 3.82683432365090e-01, -9.41544065183021e-01, 3.36889853392220e-01, -9.56940335732209e-01, 2.90284677254462e-01, -9.70031253194544e-01, 2.42980179903264e-01, -9.80785280403231e-01, 1.95090322016128e-01, -9.89176509964781e-01, 1.46730474455362e-01, -9.95184726672197e-01, 9.80171403295605e-02, -9.98795456205172e-01, 4.90676743274180e-02 |
uci1 | 84:80b15993944e | 19 | }; |
uci1 | 84:80b15993944e | 20 | |
uci1 | 84:80b15993944e | 21 | // these are the twidle factors: wr, wi used in RealFFT |
uci1 | 84:80b15993944e | 22 | const SnSigProcDataTable<256>::RealDfftTwidleFactor_t SnSigProcDataTable<256>::kRealDfftTwidleFactor[126] = { |
uci1 | 84:80b15993944e | 23 | 9.99698818696204e-01, 2.45412285229123e-02, 9.98795456205172e-01, 4.90676743274180e-02, 9.97290456678690e-01, 7.35645635996674e-02, 9.95184726672197e-01, 9.80171403295606e-02, 9.92479534598710e-01, 1.22410675199216e-01, 9.89176509964781e-01, 1.46730474455362e-01, 9.85277642388941e-01, 1.70961888760301e-01, 9.80785280403231e-01, 1.95090322016128e-01, 9.75702130038529e-01, 2.19101240156870e-01, 9.70031253194544e-01, 2.42980179903264e-01, 9.63776065795440e-01, 2.66712757474898e-01, 9.56940335732209e-01, 2.90284677254462e-01, 9.49528180593037e-01, 3.13681740398891e-01, 9.41544065183021e-01, 3.36889853392220e-01, 9.32992798834739e-01, 3.59895036534988e-01, 9.23879532511287e-01, 3.82683432365090e-01, 9.14209755703531e-01, 4.05241314004990e-01, 9.03989293123444e-01, 4.27555093430282e-01, 8.93224301195516e-01, 4.49611329654607e-01, 8.81921264348355e-01, 4.71396736825998e-01, 8.70086991108712e-01, 4.92898192229784e-01, 8.57728610000272e-01, 5.14102744193222e-01, 8.44853565249707e-01, 5.34997619887097e-01, 8.31469612302545e-01, 5.55570233019602e-01, 8.17584813151584e-01, 5.75808191417845e-01, 8.03207531480645e-01, 5.95699304492433e-01, 7.88346427626607e-01, 6.15231590580627e-01, 7.73010453362737e-01, 6.34393284163645e-01, 7.57208846506485e-01, 6.53172842953777e-01, 7.40951125354959e-01, 6.71558954847018e-01, 7.24247082951467e-01, 6.89540544737067e-01, 7.07106781186548e-01, 7.07106781186548e-01, 6.89540544737067e-01, 7.24247082951467e-01, 6.71558954847019e-01, 7.40951125354959e-01, 6.53172842953777e-01, 7.57208846506485e-01, 6.34393284163646e-01, 7.73010453362737e-01, 6.15231590580627e-01, 7.88346427626606e-01, 5.95699304492433e-01, 8.03207531480645e-01, 5.75808191417845e-01, 8.17584813151584e-01, 5.55570233019602e-01, 8.31469612302545e-01, 5.34997619887097e-01, 8.44853565249707e-01, 5.14102744193222e-01, 8.57728610000272e-01, 4.92898192229784e-01, 8.70086991108712e-01, 4.71396736825998e-01, 8.81921264348355e-01, 4.49611329654607e-01, 8.93224301195515e-01, 4.27555093430282e-01, 9.03989293123443e-01, 4.05241314004990e-01, 9.14209755703531e-01, 3.82683432365090e-01, 9.23879532511287e-01, 3.59895036534988e-01, 9.32992798834739e-01, 3.36889853392220e-01, 9.41544065183021e-01, 3.13681740398892e-01, 9.49528180593037e-01, 2.90284677254462e-01, 9.56940335732209e-01, 2.66712757474899e-01, 9.63776065795440e-01, 2.42980179903264e-01, 9.70031253194544e-01, 2.19101240156870e-01, 9.75702130038529e-01, 1.95090322016128e-01, 9.80785280403231e-01, 1.70961888760301e-01, 9.85277642388941e-01, 1.46730474455362e-01, 9.89176509964781e-01, 1.22410675199216e-01, 9.92479534598710e-01, 9.80171403295608e-02, 9.95184726672197e-01, 7.35645635996676e-02, 9.97290456678690e-01, 4.90676743274182e-02, 9.98795456205172e-01, 2.45412285229125e-02, 9.99698818696204e-01 |
uci1 | 84:80b15993944e | 24 | }; |
uci1 | 84:80b15993944e | 25 | |
uci1 | 84:80b15993944e | 26 | #endif // SST4CH |
uci1 | 84:80b15993944e | 27 | |
uci1 | 84:80b15993944e | 28 | |
uci1 | 84:80b15993944e | 29 | #if CHIPBOARD==ATWD4CH |
uci1 | 84:80b15993944e | 30 | // these are the pairs: (j, m) at each step of the loop over odd |
uci1 | 84:80b15993944e | 31 | // values of i in DiscreteCpxFFT |
uci1 | 84:80b15993944e | 32 | const SnSigProcDataTable<128>::DfftDivideIndicies_t SnSigProcDataTable<128>::kDfftDivideIndicies[128] = { |
uci1 | 84:80b15993944e | 33 | 65, 64, 33, 32, 97, 64, 17, 16, 81, 64, 49, 32, 113, 64, 9, 8, 73, 64, 41, 32, 105, 64, 25, 16, 89, 64, 57, 32, 121, 64, 5, 4, 69, 64, 37, 32, 101, 64, 21, 16, 85, 64, 53, 32, 117, 64, 13, 8, 77, 64, 45, 32, 109, 64, 29, 16, 93, 64, 61, 32, 125, 64, 3, 2, 67, 64, 35, 32, 99, 64, 19, 16, 83, 64, 51, 32, 115, 64, 11, 8, 75, 64, 43, 32, 107, 64, 27, 16, 91, 64, 59, 32, 123, 64, 7, 4, 71, 64, 39, 32, 103, 64, 23, 16, 87, 64, 55, 32, 119, 64, 15, 8, 79, 64, 47, 32, 111, 64, 31, 16, 95, 64, 63, 32, 127, 64, 2, 1 |
uci1 | 84:80b15993944e | 34 | }; |
uci1 | 84:80b15993944e | 35 | |
uci1 | 84:80b15993944e | 36 | // these are the twidle factors: wr, wi used in DiscreteCpxFFT |
uci1 | 84:80b15993944e | 37 | const SnSigProcDataTable<128>::DfftTwidleFactor_t SnSigProcDataTable<128>::kDfftTwidleFactors[126] = { |
uci1 | 84:80b15993944e | 38 | 1.00000000000000e+00, 0.00000000000000e+00, 1.00000000000000e+00, 0.00000000000000e+00, 2.22044604925031e-16, 1.00000000000000e+00, 1.00000000000000e+00, 0.00000000000000e+00, 7.07106781186547e-01, 7.07106781186547e-01, 0.00000000000000e+00, 1.00000000000000e+00, -7.07106781186547e-01, 7.07106781186547e-01, 1.00000000000000e+00, 0.00000000000000e+00, 9.23879532511287e-01, 3.82683432365090e-01, 7.07106781186547e-01, 7.07106781186548e-01, 3.82683432365090e-01, 9.23879532511287e-01, -5.55111512312578e-17, 1.00000000000000e+00, -3.82683432365090e-01, 9.23879532511287e-01, -7.07106781186548e-01, 7.07106781186547e-01, -9.23879532511287e-01, 3.82683432365090e-01, 1.00000000000000e+00, 0.00000000000000e+00, 9.80785280403230e-01, 1.95090322016128e-01, 9.23879532511287e-01, 3.82683432365090e-01, 8.31469612302545e-01, 5.55570233019602e-01, 7.07106781186548e-01, 7.07106781186547e-01, 5.55570233019602e-01, 8.31469612302545e-01, 3.82683432365090e-01, 9.23879532511287e-01, 1.95090322016128e-01, 9.80785280403230e-01, 1.38777878078145e-16, 1.00000000000000e+00, -1.95090322016128e-01, 9.80785280403230e-01, -3.82683432365090e-01, 9.23879532511287e-01, -5.55570233019602e-01, 8.31469612302545e-01, -7.07106781186547e-01, 7.07106781186547e-01, -8.31469612302545e-01, 5.55570233019602e-01, -9.23879532511286e-01, 3.82683432365090e-01, -9.80785280403230e-01, 1.95090322016128e-01, 1.00000000000000e+00, 0.00000000000000e+00, 9.95184726672197e-01, 9.80171403295606e-02, 9.80785280403231e-01, 1.95090322016128e-01, 9.56940335732209e-01, 2.90284677254462e-01, 9.23879532511287e-01, 3.82683432365090e-01, 8.81921264348355e-01, 4.71396736825998e-01, 8.31469612302545e-01, 5.55570233019602e-01, 7.73010453362737e-01, 6.34393284163646e-01, 7.07106781186548e-01, 7.07106781186548e-01, 6.34393284163646e-01, 7.73010453362737e-01, 5.55570233019602e-01, 8.31469612302545e-01, 4.71396736825998e-01, 8.81921264348355e-01, 3.82683432365090e-01, 9.23879532511287e-01, 2.90284677254462e-01, 9.56940335732209e-01, 1.95090322016128e-01, 9.80785280403231e-01, 9.80171403295606e-02, 9.95184726672197e-01, 0.00000000000000e+00, 1.00000000000000e+00, -9.80171403295606e-02, 9.95184726672197e-01, -1.95090322016128e-01, 9.80785280403231e-01, -2.90284677254462e-01, 9.56940335732209e-01, -3.82683432365090e-01, 9.23879532511287e-01, -4.71396736825998e-01, 8.81921264348355e-01, -5.55570233019602e-01, 8.31469612302545e-01, -6.34393284163646e-01, 7.73010453362737e-01, -7.07106781186548e-01, 7.07106781186548e-01, -7.73010453362737e-01, 6.34393284163646e-01, -8.31469612302545e-01, 5.55570233019602e-01, -8.81921264348355e-01, 4.71396736825998e-01, -9.23879532511287e-01, 3.82683432365090e-01, -9.56940335732209e-01, 2.90284677254462e-01, -9.80785280403231e-01, 1.95090322016128e-01, -9.95184726672197e-01, 9.80171403295606e-02 |
uci1 | 84:80b15993944e | 39 | }; |
uci1 | 84:80b15993944e | 40 | |
uci1 | 84:80b15993944e | 41 | // these are the twidle factors: wr, wi used in RealFFT |
uci1 | 84:80b15993944e | 42 | const SnSigProcDataTable<128>::RealDfftTwidleFactor_t SnSigProcDataTable<128>::kRealDfftTwidleFactor[62] = { |
uci1 | 84:80b15993944e | 43 | 9.98795456205172e-01, 4.90676743274180e-02, 9.95184726672197e-01, 9.80171403295606e-02, 9.89176509964781e-01, 1.46730474455362e-01, 9.80785280403231e-01, 1.95090322016128e-01, 9.70031253194544e-01, 2.42980179903264e-01, 9.56940335732209e-01, 2.90284677254462e-01, 9.41544065183021e-01, 3.36889853392220e-01, 9.23879532511287e-01, 3.82683432365090e-01, 9.03989293123443e-01, 4.27555093430282e-01, 8.81921264348355e-01, 4.71396736825998e-01, 8.57728610000272e-01, 5.14102744193222e-01, 8.31469612302545e-01, 5.55570233019602e-01, 8.03207531480645e-01, 5.95699304492433e-01, 7.73010453362737e-01, 6.34393284163645e-01, 7.40951125354959e-01, 6.71558954847018e-01, 7.07106781186548e-01, 7.07106781186548e-01, 6.71558954847018e-01, 7.40951125354959e-01, 6.34393284163645e-01, 7.73010453362737e-01, 5.95699304492433e-01, 8.03207531480645e-01, 5.55570233019602e-01, 8.31469612302545e-01, 5.14102744193222e-01, 8.57728610000272e-01, 4.71396736825998e-01, 8.81921264348355e-01, 4.27555093430282e-01, 9.03989293123443e-01, 3.82683432365090e-01, 9.23879532511287e-01, 3.36889853392220e-01, 9.41544065183021e-01, 2.90284677254462e-01, 9.56940335732209e-01, 2.42980179903264e-01, 9.70031253194544e-01, 1.95090322016128e-01, 9.80785280403231e-01, 1.46730474455362e-01, 9.89176509964781e-01, 9.80171403295605e-02, 9.95184726672197e-01, 4.90676743274180e-02, 9.98795456205172e-01 |
uci1 | 84:80b15993944e | 44 | }; |
uci1 | 84:80b15993944e | 45 | |
uci1 | 84:80b15993944e | 46 | #endif // ATWD4CH |
uci1 | 84:80b15993944e | 47 | |
uci1 | 84:80b15993944e | 48 |