void main(void) { FPUEnable(); FPULazyStackingEnable(); SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); while(1) { delta_params params; params.a = 70, params.b = 200; params.c = 50; params.d = 70; float alpha, beta, gamma; float X, Y, Z; X = 20; Y = -40; Z = 186; delta_calc(params, X, Y, Z, 0, &alpha, &beta, &gamma); } }
/** Read in a set of equity time series file. Calculate the number of bits needed to represent the data without compression and after wavelet and wavelet packet compression. */ int main() { const char *files[] = { "aa", // Alcoa Aluminium "amat", // Applied Materials "ba", // Boeing "cof", // Capital One "ge", // General Electric "ibm", // IBM Corp. "intc", // Intel "mmm", // 3M "mrk", // Merck "wmt", // Wal-Mart 0 // The null pointer }; const size_t N = 512; double realVec[ N ]; int intVec[ N ]; // an instance of yahooTS with the path to the data directory const char *dataDirPath = "..\\data\\equities\\"; yahooTS ts( dataDirPath ); printf("Equity Uncompressed delta Haar line TS wavelet packet (line)\n"); for (size_t i = 0; files[i] != 0; i++) { size_t n = N; if (! ts.getTS( files[i], realVec, n, yahooTS::Close )) { break; } if (n != N) { printf("Error: %d out of %d data elements read\n", n, N ); break; } support::decimalToInt( intVec, realVec, N ); int *copyVec = copy( intVec, N ); const size_t beforeWidth = support::vecWidth( intVec, N ); const size_t deltaWidth = delta_calc( intVec, copyVec, N ); haar_int haar; const size_t haarWidth = wave_calc( intVec, copyVec, N, &haar ); line_int<int *> line; const size_t lineWidth = wave_calc( intVec, copyVec, N, &line ); ts_trans_int ts_trans; const size_t tsTransWidth = wave_calc( intVec, copyVec, N, &ts_trans); const size_t packetWidth = packet_calc( intVec, copyVec, N ); printf(" %4s %4d %4d %4d %4d %d %4d\n", files[i], beforeWidth, deltaWidth, haarWidth, lineWidth, tsTransWidth, packetWidth ); } return 0; }