DAY 16 HW
/* */ /* This program reads a seismic data file and then */ /* determines the times of possible seismic events. */ #include <stdio.h> #define FILENAME "seismic1.txt" #define MAX_SIZE 1000 //#define THRESHOLD 1.5 int main(void) { /* Declare variables and function prototypes. */ int k,i, npts, short_window, long_window,thrsh,THRESHOLD; 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 { printf("Enter threshold value:"); scanf("%d",&THRESHOLD); if(THRESHOLD>1.00) { /* Read data into an array. */ for (k=0; k<=npts-1; k++) fscanf(file_ptr,...