APPENDIX C 



DESCRIPTION OF COMPUTER ROUTINE FOR IDENTIFYING 

 MAJOR PEAKS AND VALLEYS IN AN IRREGULAR SIGNAL 



The computer routine SMOOTH is useful for deleting small, inconsequential 

 peaks and valleys from an irregular digital signal. Peaks and valleys that 

 remain after application of SMOOTH represent major extrema which in many cases 

 are more meaningful than small wiggles in the signal. 



The operation of SMOOTH is most conveniently described in terms of its 

 application to a time series of sea-surface elevations, although its other 

 applications are analogous. The general scheme of operation consists of a 

 check on the time difference and elevation difference between successive 

 extrema. If either is less than the specified acceptable minimum, then one 

 peak and one valley are deleted from the time series. 



The input to SMOOTH consists of several control parameters and an array 

 (EXTIM) containing time and elevation for each extremum in the time series. 

 Figure C-1 shows five extrema in a hypothetical time series. If the point 

 labeled "-1" were the first point in the time series, then the first 10 values 

 in the EXTIM array would be 



t_i. Ti_^, t^, tIq, t^, n^, t^, n^. tg, and Hg 



where t. and n- are defined as the time and elevation associated with the 

 i'tti point. The control parameters which must be specified are 



FURST = time associated with the first point desired in the time 

 series. 



ITEMS = total number of values in EXTIM array (= twice the number of 

 extrema) . 



CHP = minimum acceptable time difference between successive points 

 (critical half period). 



HMIN = minimum acceptable elevation difference between successive 

 points. 



(t., ,'?.,) 



-I \ 



\ 



(t,,'? 



3"3' 



/ '\2/ 



A 



I 



^0 ' 



Figure C-1. Hypothetical time series (from Thompson, 1980). 



94 



