Seismic Code
/* determines the times of possible seismic events. */ #include <stdio.h> #define FILENAME "seismic1.txt" #define MAX_SIZE 1000 float THRESHOLD = 0; int x = 0; int main(void) { /* Declare variables and function prototypes. */ while(THRESHOLD <=2 1){ printf("Enter Threshold: \n"); scanf(" %f ", &THRESHOLD); printf("Threshold: %f \n", THRESHOLD); } int k, npts, short_window, long_window; double sensor[MAX_SIZE], time_incr, short_power, long_power, ratio; FILE *file_ptr; double power_w(double *ptr,int n); /* Read sensor data file. */ file_ptr = fopen(FILENAME,"r"); if (file_ptr == NULL) printf("Error opening input file. \n"); else { fscanf(file_ptr,"%d %lf",&npts,&time_incr); if (npts > MAX_SIZE) printf("Data file too large for array. \n"); else { /* Read data into an array. */ for (k=0; k<=npts-1; k++) fscanf(file_ptr,"%l...