APPENDIX D 



DESCRIPTION OF COMPUTER ROUTINE SMOOTH FOR IDENTIFYING 

 MAJOR PEAKS AND VALLEYS IN AN IRREGULAR SIGNAL 



The computer routine SMOOTH is useful for deleting small, inconse- 

 quential 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. 



SMOOTH is a very general routine which can be applied to many differ- 

 ent situations. It has been applied at CERC to the following three 

 situations: 



(a) Confutation of statistics on individual waves. SMOOTH was 

 applied to a time series of sea-surface elevations; 



(b) Confutation of statistics on tidal highs and lows. SMOOTH 

 was applied to a time series of tidal elevations. 



(c) Identification of major spectral peaks. SMOOTH was applied 

 to a wave energy spectrum. 



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 con- 

 sists of a check on the time difference and elevation difference between 

 successive extrema. If either is less than the specified acceptable min- 

 imum 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 D-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, n_i, tp, Hq, t^, rii, t2, r\2, t3, and 113, 



where t{, and n^ are defined as the time and elevation associated 

 with the i.th 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. 



145 



