/********************************************************** DETREND is intended for detrending of simple vectors consisting of equally spaced data. The index serves as the x-coordinate. */ #include "common.h" #include "vector.h" void detrend(float array[], int n) { double x, y, a, b; double sy = 0.0, sxy = 0.0, sxx = 0.0; int i; for (i=0, x=(-n/2.0+0.5); i #include #include "prtarray.h" /* print_array_*() */ #define N 512 int main(int argc, char *argv[]) { float data[N]; int i; int n; double a, b; n = atoi(argv[1]); a = atof(argv[2]); b = atof(argv[3]); for (i=0; i