Abstract:
A digital data preprocessor is disclosed wherein consecutive samples of  ny raw digital data telemetered from a dropsonde and decommutated are stored in a first storage stack of registers. Adjacent samples are subtracted, the adjacent first-differences therefrom are subtracted, and the resulting second-differences are stored in a second storage stack of registers. By a comparison of raw data with the second-differences, raw data distorted by noise are measured and subsequently restored to a new value calculated from valid values of raw data samples adjacent to the distorted value. The second-differences are fed through a series of adders to provide a sequence of second-sliding-sums which are stored in a third stack of storage registers. A significant value selector tests the sliding-sums using three different criteria. The results of the tests are used as a basis for selecting raw data samples from the stack for pre-output smoothing of the raw data. The pre-output smoothing and value selection allow for a reduction in the number of data points fed to a processor such as a refraction calculator.

Description:
STATEMENT OF GOVERNMENT INTEREST 
     The invention described herein may be manufactured and used by or for the Government of the United States of America for governmental purposes without the payment of any royalties thereon or therefor. 
    
    
     BACKGROUND OF THE INVENTION 
     This invention relates to a real-time digital data preprocessor for a refraction sounding system, and more particularly for a digital data smoother and significant values selector for the system. 
     Radio propagation characteristics in the atmosphere can be determined by refraction calculations from suitable atmospheric measurements similar to those made for conventional meteorological soundings which determine temperature, pressure, and humidity along a vertical profile. Typically, atmospheric measurement devices commutate and transmit these parameters to a remote receiver via telemetry where they are decommutated and recorded. These telemetry systems, however, lack the accuracy and resolution needed for the refraction calculations because of the noisy data telemetered. At least two different noise conditions occur. One occurs when a strong noise burst having a short time duration distorts only one of the measured telemetered data samples; another occurs when signal strength fades typically for a few seconds or less. During this fade-out the telemetry system&#39;s ambient noise level is large in comparison with the faded signal and causes loss of synchronization of the decommutator at the receiver resulting in distortions in measurements that persist beyond the noise duration. Frequent and prolonged losses of decommutator synchronization create gaps in the data large enough to mask information of interest. Systems presently used for calculating the atmosphere&#39;s refractivity versus altitude characteristics are therefore inadequate for determining the operating characteristics of radio-frequency propagation systems with the requisite accuracy and resolution. 
     SUMMARY OF THE INVENTION 
     Accordingly, an object of the present invention is to provide conventional meteorological sounding data having improved accuracy and resolution needed for refraction calculations. Another object of the invention is to provide high-speed data validation, distortion detection, restoration, significant values selection, smoothing and trend-change compensation. Yet another object of the invention is to provide reliable circuitry for preprocessing, in real-time, raw digital data. A further object of the invention is to provide a reduction of data-storage and concomittant processing-time requirements by preprocessing data in its period or frequency state. Another object of the invention is to provide, in real-time, automatic selecting of significant values from raw digital data for data storage reduction. A further object of the invention is to provide automatic, real-time detection of distorted data and to provide restoration of the data to a more typical or normal value as determined by samples of data preceeding and following the distorted data. 
     Briefly, these and other objects of the present invention are accomplished as follows. Consecutive samples of noisy raw digital data telemetered from a dropsonde and decommutated are stored in a first storage stack of registers. Adjacent samples are subtracted, the adjacent first differences therefrom are subtracted, and the resulting second differences are stored in a second storage stack of registers. By a comparison of raw data with the second differences, raw data distorted by noise are measured and subsequently restored to a new value calculated from valid values of raw data samples adjacent to the distorted value. The second differences are fed through a series of adders to provide a sequence of second sliding sums which are stored in a third stack of storage registers. A significant value selector tests the sliding-sums using three different criteria. The results of the tests are used as a basis for selecting raw data samples from the first stack for pre-output smoothing of the raw data. The pre-output smoothing and value selection allow for a reduction in the number of data points fed to a processor such as a refraction calculator. 
    
    
     Other objects, advantages and novel features of the invention will become apparent from the following detailed description of the invention when considered in conjunction with the accompanying drawings wherein: 
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of a real-time data smoother and significant values selector according to the invention; 
     FIG. 2 is a block diagram of a distortion detector and data restorer of the invention shown in FIG. 1; 
     FIG. 3 is a block diagram of a significant value selector; 
     FIG. 4 is a timing diagram of clock signals according to the invention; 
     FIG. 5 is a logic diagram of an excessive difference set membership determiner of FIG. 2; 
     FIG. 6 is a logic diagram of a distortion verifier of FIG. 2; 
     FIG. 7 is a logic diagram of a set size storer of FIG. 2; 
     FIG. 8 is a logic diagram of a restorer of FIG. 2; 
     FIG. 9 is a logic diagram of a peak detection selector of FIG. 3; and 
     FIG. 10 is a logic diagram of a cumulative and force selection detector of FIG. 3. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Referring now to the drawings, wherein like reference characters designate like or corresponding parts throughout the several views, there is shown in FIG. 1 a real-time data smoother and significant values selector 10. A typical data source, not shown, provides an input signal of raw digital data samples comprising a sequence of parallel twelve-bit words S 1 , S 2  . . . S n  to a conventional input buffer 12, which compensates for rate of data flow differences between the source and circuit 10 and also isolates circuit 10 from the source. Buffer 12 receives the samples and passes them sequentially. Buffer 12 holds each sample until the processing of the previous sample is complete. A sample stack 14 comprising sixteen twelve-stage, parallel input/parallel output shift registers, 14a . . . 14p is connected to receive the samples from buffer 12. Each register of stack 14 is capable of storing one twelve-bit word and, when pulsed by clock signal T 1  from a controller 15 at the appropriate time, shifts the stored samples through registers 14a . . . 14p. The stored samples are shifted through registers 14a . . . 14p incrementally each time a new sample is received from buffer 12 and in synchronism with the signal T 1 . Stack 14 is designed to contain 16 consecutive samples in order to assure availability of three selectable consecutive samples, (e.g. after the sixteenth clock pulse S 1 , S 2  and S 3 ) for smoothing upon the event of a significant value detection further discussed hereinbelow. To aid understanding of the invention, data samples S 1  . . . S 16  are described as occupying registers 14p . . . 14a. Such a condition is true only after the occurrence of the sixteenth T 1  signal following entry of sample S 1  into input buffer 12. 
     A first or raw-data-sample subtractor 16 is connected to receive each word sample passing through registers 14a and 14b and to provide first-difference signals Δ 1 , Δ 2  . . . Δ n  by differencing adjacent samples, i.e., S 2  -S 1 , S 3  -S 2  . . . S n  -S n-1 , respectively. A first-difference stack 18 comprising two twelve-stage, parallel input/parallel output shift registers 18a and 18b are connected to receive signals Δ 1 , Δ 2  . . . Δ n  in register 18a and to shift them into the register 18b at the occurrence of a clock signal T 2 . A second difference subtractor 20, similar to first subtractor 16 is connected to receive adjacent signals from first-difference registers 18a and 18b and provide second-difference signals δ 1 , δ 2  . . . δ n , respectively by differencing adjacent first-difference signals, i.e., 2-1, 3-2, . . . n-n- 1. A second-difference stack 22 comprising eleven twelve-stage, parallel input/parallel output shift registers 22a . . . 22k is connected to receive the second-difference signals δ 1 , δ 2  . . . δ n . Each successive second-difference signal δ 1 , δ 2  . . . δ n  is stored in consecutive registers 22k . . . 22a. Referring to FIGS. 1 and 2, a distortion detector and data restorer 24 is connected to receive second-difference signals stored in registers 22g . . . 22a and raw data samples A stored in registers 14j . . . 14b for providing restored and strobe data B to registers 14h . . . 14d and a clear signal C to registers 22g . . . 22a. Referring now to FIG. 2, excessive difference comparators 36g . . . 36a are connected to receive second-difference signals from storage registers 22g . . . 22a and a distortion threshold reference R from a binary divider 37. Divider 37 is connected to receive sample S9 from storage register 14h and shift it to obtain the distortion threshold reference comprising a fractional value of the sample. Comparator 36g compares the second-difference signal δ 8  stored in register 22g with reference R. If the absolute value of the second-difference in 22g is greater than the absolute value of reference R, then the second-difference in register 22g is considered a first-signal 8x in a set of excessive second differences. The second-difference signals in registers 22f . . . 22a are also compared in comparators 36f . . . 36a respectively to determine which of second-difference signals δ 9  . . . δ 14  are also in excess of the distortion threshold reference R. A membership determiner 39 is connected to receive signals 8x . . . 14x and to provide a membership-set of excessive difference signals 8s . . . 14s. The following logic expressions for signals 8s . . . 14s are implemented in FIG. 5. 
     
         8.sub.s =8.sub.x 
    
     
         9.sub.s =10.sub.x +9.sub.x 
    
     
         10.sub.s =10.sub.x +9.sub.x 11.sub.x 
    
     
         11.sub.s =(9.sub.x +10.sub.x)11.sub.x+10.sub.x 12.sub.x 
    
     
         12.sub.s =(9.sub.x +10.sub.x) (10.sub.x +11.sub.x) (12.sub.x +11.sub.x 13.sub.x) 
    
     
         13.sub.s =(9.sub.x +10.sub.x)(10.sub.x +11.sub.x)(11.sub.x +12.sub.x)(13.sub.x +12.sub.x 14.sub.x) 
    
     
         14.sub.s =(9.sub.x +10.sub.x)(10.sub.x +11.sub.x)(11.sub.x +12.sub.x)(12.sub.x +13.sub.x)14.sub.x 
    
     Referring to FIG. 5, and using boolean algebra for descriptive purposes, OR gate 38a is connected to receive signals 9 x  and 10 x  and to provide signal (9 x  +10 x ). OR gate 38b is connected to receive signals 10 x  and 11 x  and to provide signal (10 x  +11 x ). OR gate 38c is connected to receive signals 11 x  and 12 x  and to provide signal (11 x  +12 x ). OR gate 38d is connected to receive signals 12 x  and 13 x  and to provide signal (12 x  +13 x ). AND gate 40a is connected to receive signals 9 x  and 11 x  and to provide (9 x  11 x ). AND gate 40b is connected to receive signals 10 x  and 12 x  and to provide signal (10 x  12 x ). AND gate 40c is connected to receive signal (9 x  +10 x ) and 11 x  and to provide signal [(9 x  + 10 x )11 x  ]. AND gate 40d is connected to receive signals 11 x  and 13 x  and to provide signal (11 x  13 x ). AND gate 40e is connected to receive signals 12 x  and 14 x  and to provide signal (12 x  14 x ). OR gate 42a is connected to receive signals 9 x  and 10 x  and to provide signal 9 s . OR gate 42b is connected to receive signal 10 x  and (9 x  11 x ) and to provide signal 10 s . OR gate 42c is connected to receive signals 10 x  12 x  and [(9 x  +10 x )11 x  ] and to provide signal 11 s . OR gate 42d is connected to receive signals 11 x  13 x  and 12 x  and to provide (12 x  +11 x  13 x ). OR gate 42e is connected to receive signal 12 x  14 x  and 13 x  and to provide signal (13 x  +12 x  14 x ). AND gate 44a is connected to receive signals (9 x  +10 x ), (10 x  +11 x ) and (12 x  +11 x  13 x ) and to provide signal 12 s . AND gate 44b is connected to receive signals (9 x  +10 x ), (10 x  +11 x ), (11 x  +12 x ) and (13 x  +12 x  14 x ) and to provide signal 13 s . AND gate 44c is connected to receive (9 x  +10 x ), (10 x  +11 x ), (11 x  +12 x ), (12 x  +13 x ) and 14 x  to provide signal 14 s . A single second-difference signal below threshold R is considered excessive if bounded by second-difference signals exceeding threshold R. The most recent of the consecutive excessive second-difference signals is a final value in the excessive second-difference signal set. Distortion verifier 47 is connected to receive the signals identified as sign bits 8 -  . . . 14 -  which indicates for each second-difference signal whether it is negative or not, the membership-set of excessive second-differences 8 s  . . . 14 s , and the second-difference signals 8 x  . . . 14 x  for providing a signal Z which indicates that distortion is present. If the membership-set consisting of the first and final values along with their intervening values, is found to contain at least two second-difference signals exceeding distortion threshold R and if at least two of them are of opposite sign, the samples in stack 14 from which the second-differences were derived are considered distorted, and the suspect samples are replaced with a set of values in better agreement with the validated samples bounding the suspect set. The validated samples are those associated with the top (first) and bottom (final) second-differences signals in the membership set. For example, if the excessive differences signals are comprised of second-differences 8x . . . 11x, inclusive, then samples S9 and S12 in registers 14h and 14e respectively are considered the bounding valid samples and are used to restore samples S10 and S11. The following logic expression was utilized to derive signal Z and to implement the function in hardware. 
     
         Z=8.sub.- (9.sub.- 9.sub.x 9.sub.s +10.sub.- 10.sub.x 10.sub.s +11.sub.- 11.sub.x 11.sub.s 
    
     
         +12.sub.- 12.sub.x 12.sub.s +13.sub.- 13.sub.x 13.sub.s +14.sub.- 14.sub.x 14.sub.s) 
    
     
         +8.sub.- (9.sub.- 9.sub.x 9.sub.s +10.sub.- 10.sub.x 10.sub.s +11.sub.- 11.sub.x 11.sub.s 
    
     
         +12.sub.- 12.sub.x 12.sub.s +13.sub.- 13.sub.x 13.sub.s +14.sub.- 14.sub.x 14.sub.s) 
    
     When Z is true, distortion is present. 
     Referring to FIG. 6, and using boolean algebra for descriptive purposes, AND gates 46a . . . 46g are connected to receive 8 x  and 8 s  . . . 14 x  and 14 s  respectively and to provide logic output signals of (8 x  8 s ) . . . (14 x  14 s ) respectively. AND gates 48a . . . 48g each have an inverting input and a noninverting input. The inverting input of AND gates 48a . . . 48g are connected to receive signals 8 -  . . . 14 -  respectively and the noninverting inputs are connected to receive signals (8 x  8 s ) . . . (14 x  14 s ) respectively and to provide (8 -  8 x  8 s ) . . . (14 -  14 x  14 s ) respectively. AND gates 50a . . . 50g are connected to receive signals 8 -  and (8 x  8 s ) . . . 14 -  and (14 x  14 s ) and provide (8 -  8 x  8 s ) . . . (14 -  14 x  14 s ) respectively. OR gate 52a is connected to receive signals (8 -  8 x  8 s ) . . . (14 -  14 x  14 s ) from AND gates 48a . . . 48g respectively, and to provide signal X indicative of at least one positive excessive set member consisting of (8 -  8 x  8 s )+(9 -  9 x  9 s )+(10 -  10 x  10 s )+(11 -  11 x  11 s )+(12 -  12 x  12 s )+(13 -  13 x  13 s )+(14 -  14 x  14 s ). OR gate 52b is connected to receive signals (8 -  8 x  8 s ) . . . (14 -  14 x  14 s ) from AND gates 50a . . . 50g respectively, and to provide signal Y indicative of at least one negative excessive set-member consisting of (8 -  8 x  8 s )+(9 -  9 x  9 s )+(10 -  10 x  10 s )+(11 -  11 x  11 s )+(12 -  12 x  12 s )+(13 -  13 x  13 s )+(14 -  14 x  14 s ). AND gate 54 is connected to receive signal X and Y and to provide signal Z consisting of signal (XY) indicating both that distortion is present and that data restoration should be enabled when at least two excessive set members of opposite signs are present. A set-size storer 58 is connected to receive membership-set signals 8 s  . . . 14 s , clock signals T 1  and T 4  and signal Z for determining and storing the number of excessive differences of the membership-set and providing set-size signls 1 . . . 7. Referring to FIG. 7, a flip-flop 57 is connected to receive signal Z and to clock it out as a function of inverted T 4  clock signal (T 4 ) providing therefrom signal Z 1 . AND gates 58a . . . 58f each have three inputs, two of which are noninverting and one of which is inverting. AND gates 58a . . . 58f are connected to receive signals 8 s  . . . 13 s  and Z 1  on the noninverting inputs respectively and 9 s  . . . 14 s  on the inverting inputs respectively. AND gate 58g is connected to receive signals Z 1  and 14 s  for providing set-size signal 7 therefrom. The noninverting inputs of 58a . . . 58g which receive signal Z 1 , clocked by T 4  enable the gate outputs when restoration is required. AND gates 58a . . . 58g provide set-size signals 1 . . . 7 respectively. Flip-flops 59a . . . 59g are connected to receive and store set-size signals 1 . . . 7 and to provide outputs thereof when they receive clock signal T 1  which is also connected thereto and to maintain those outputs while restoration is effected and until occurrence of the next T 1  signal. 
     Referring to FIG. 2, restorer 61 is connected to receive set-size signals 1 . . . 7, samples A, clock signals T 2 , T 3  and T 4 , to provide restored samples and restoration strobe B, and restored second-difference clear-signals C. The data restorer calculates an average of two values (one addition and one division by two) to make each restoration. Three methods are used to calculate the average-of-two: (1) using two first-neighbors; (2) using two second-neighbors; or (3) using two third-neighbors. A sample&#39;s two first-neighbors are the sample immediately preceding and the sample immediately following the sample to be restored. The second-neighbors are the second sample preceding and the second sample following the sample to be restored. For example, if sample S 10  is to be restored, it&#39;s first neighbors are samples S 9  and S 11  ; its second neighbors are S 8  and S 12  ; and its third neighbors are sample S 7  and S 13 . If a single sample is to be restored, it is set equal to the average of its two first (immediate) neighbors. If two samples are to be restored, each one is set equal to the average of its two second-neighbors. If three samples are to be restored, the center one is set equal to the average of its two second-neighbors then the remaining two samples are restored by setting each equal to the average of its two first-neighbors. If four samples are to be restored, the two central samples are restored by setting each equal to the average of its two third-neighbors, then the two remaining samples are restored by setting each equal to the average of its two first-neighbors. If five samples are to be restored, the central sample is restored by setting it equal to the average of its two third neighbors, then the two outer-most samples are restored by setting them equal to the average of their two second-neighbors and finally the remaining two samples are restored by setting them equal to their two first-neighbors. 
     Table 1 hereinbelow, using algebraic notations, shows the averages implemented for data restoration for set size 3, 4, 5, 6 or 7 and in terms of samples S 1  . . . S 16  occupying registers 14p . . . 14a after valid data have been shifted to fill all stacks. 
     
                       TABLE I______________________________________Set Sizes       Averages Implemented______________________________________ 3            ##STR1## 4            ##STR2##            ##STR3## 5            ##STR4##            ##STR5##            ##STR6## 6            ##STR7##            ##STR8##            ##STR9##            ##STR10## 7            ##STR11##            ##STR12##            ##STR13##            ##STR14##            ##STR15##______________________________________ 
    
     FIG. 8 shows restorer 61 in more detail and is herein described using boolean algebra notation. OR gate 71 is connected to receive clock signals T 2 , T 3  and T 4  for providing sample-restoration signal (T 2  +T 3  +T 4 ). OR gates 66a . . . 66f are connected to receive set-size signal 1 . . . 6 respectively on a first input. Each second input of OR gate 66a . . . 66e is connected to receive the output of the succeeding numbered OR gate 66b . . . 66f respectively. The second input of OR gate 66f is connected to receive set-size signal 7. OR gates 66a . . . 66f provide the respective set-size signals (1+2+3+4+5+6+7), (2+3+4+5+6&#39;7), (3+4+5+6+7), (4+5+6+7), (5+6+7) and (6+7). AND gates 72a . . . 72f  are connected receive the output signal respectively from OR gates 66a . . . 66f and AND gate 72g is connected to receive set-size signal 7 flip-flop; the other input of each AND gate 72a . . . 72g is connected to receive clock signal T 2  for providing a clear-strobe pulse to registers 22g . . . 22a. Dual-input AND gates 70a . . . 70e are connected to receive respectively the outputs of OR gates 66b, 66d, 66e, 66f and set-size signal 7; the other input of the AND gates is connected to receive signal (T 2  +T 3  +T 4 ) for providing strobe pulses respectively to registers 14h . . . 14d. OR gate 60a is connected to receive set-size signals 3, 5, and 6 and provide set-size signal (3+5+6). OR gate 60b is connected to receive set-size signals 4 and 7  and provide set size signal (4+7). OR gate 60c is connected to receive set-size signals 4 and 5 and provide set-size signal (4+5). OR gate 60d is connected to receive set-size signals 6 and 7 and provide set-size signal (6+7); this gate may be eliminated by obtaining its outputs from OR gate 66f. Averagers 62a through 62i comprise parallel-adders, a device whose output is a representation of the sum of the quantities represented by its inputs, and parallel-shifters for providing a one-bit transposition to accomplish the divide-by-two operation needed to compute the average of the two samples each averager used as inputs from stack 14. The outputs of averages 62a . . . 62i, each supply restored samples to stack 14 through AND gates 64a through 64i respectively. Averager 62a is connected to receive samples S 10  and S 8  and to provide sample S 8  plus S 10  divided by two. Averager 62b is connected to receive samples S 7  and S 11  and provide samples S 7  plus S 11  divided by two. Averager 62c is connected to receive samples S 9  and S 11  and to provide sample S 9  plus S 11  divided by two. Averager 62d is connected to receive samples S 8  and S 12  and to provide sample S 8  plus S 12  divided by two. Averager 62e is connected to receive samples S 13  and sample S 7  and to provide sample S 13  plus sample S 7  divided by two. Averager 62f is connected to receive samples S 10  and S 12  and provide sample S 10  plus S 12  divided by two. Averager 62g is connected to receive samples S 8  and S 14  and provide sample S 8  plus S 14  divided by two. Averager 62h is connected receive samples S 11  and S 13  and to provide sample S 11  plus S 13  divided by two. Averager 62i is connected to receive samples S 15  and S 11  and to provide sample S 15  plus S 11  divided by two. 
     AND gates 64a through 64i are twelve-bit, two input AND gates each connected to receive the twelve bits the output words from averagers 62a through 62i respectively. When gated with appropriate set-size signals they send the output words to the proper sample register for data restoration as a function of set-size signal. Set-size signal 3 gates the output of averager 62a through AND gate 64a; set size signal 4 gates the outputs of 62b and d through AND gates 64b, and d; set size signal 5 gates the outputs of averagers 62a, d and f through AND gates 64a, d, and f; set size signal 6 gates the outputs of averagers 62a, e, g and h; through AND gates 64a, e, g and h and set size signal 7 gates the outputs of averagers 62b, c, g, h and i through AND gates 64b, c, g, h  and i. OR gate 65a is connected to receive the outputs of AND gates 64a and 64b for providing restored data to register 14h. OR gate 65b is connected to receive the outputs of AND gates 64c, d and e for providing restored data to register 14g. OR gate 65c is connected to receive the outputs of AND gates 64f and g for providing restored data to register 14f. AND gates 64h and 64i provide restored data to registers 14e and 14d respectively. 
     Referring to FIG. 1, again at a time when normal processing has begun and samples S 1  . . . S 16  occupy registers 14p . . . 14a respectively, first adder 26 is connected to receive the second-difference signals δ 1 , δ 2  . . . δ n  passing through registers 22h . . . 22k and to provide first-sliding-sum signals σ 1 , σ 2  . . . σ n  representative of the sum of the second-difference signals at its inputs. σ n  is defined herein as equal to δ n  +δ n+1  +δ n+2  +δ n+3 . A first-sliding-sum stack 28 comprising four twelve-stage, parallel input/parallel output shift registers 28a . . . 28d is connected to receive signals σ 1 , σ 2  . . . σ n . Each register of stack 28 is capable of storing one twelve-bit word and when pulsed by clock signal T 1  from controller 15 at the appropriate time, shifts the stored first-sliding-sum signals σ 1 , σ 2  . . . σ n  through registers 28a . . . 28d. A second adder 30 is connected to receive signals σ 1 , σ 2  . . . σ n  and to provide second-sliding-sum signals Σ 1 , Σ 2  . . . Σ n . A second-sliding-sum stack 32 comprising four twelve-stage registers 32a . . . 32d is connected to receive signals Σ 1 , Σ 2  . . . Σ n  in registers 32a . . . 32d in synchronism with clock signal T 2  from controller 15. A significant-values selector 34 is connected to receive Σ 1 , Σ 2  . . . Σ n  and the samples stored in registers 14n, 14o and 14p and to provide a summed or smoothed output signal. 
     Referring to FIG. 3 in which the significant value selector 34 is shown in more detail, signals Σ 1 , Σ 2  . . . Σ n  are used by significant value selector 34 to make a selection by a peak, cumulative or force technique. The peak selection is made whenever the second-sliding-sum and its neighbors are all of the same sign and are displaced from zero by more than a selectable peak threshold T p  and the second-sliding-sum&#39;s absolute value is greater than its neighbors&#39; absolute values. A peak selector 90 is connected to receive the second sliding sum signals Σ 31  3 . . . Σ o  from second-sliding-sum stack registers 32d . . . 32a respectively for providing signals NOW and NEXT&#39;. Signal NOW is indicative that the peak selection technique criteria have been exceeded and signal NEXT&#39; is indicative that the peak selection technique criteria will be exceeded following the next shift of stack 32 by signal T 2 . Refer now to FIG. 9 wherein peak selector 90 is shown in more detail. Based on the definitions already given for Δ 1  . . . Δ n , δ 1  . . . δ n , σ 1  . . . σ n  and Σ 1  . . . Σ n , when samples S 1  . . . S 16  occupy the sample stack 14, stack 32 is occupied by second-sliding-sums Σ -3  . . . Σ o , which are examined to determine whether a selection should be made using samples S 1 , S 2  and S 3 . AND gates 92a and 92b are connected to receive from registers 32d . . . 32a the sign bits for signals Σ -3  . . . Σ o  represented by -3 -  . . . 0 -  to provide signal F comprising [(-3 - )(-2 - )(-1 - )(0 - )] and signal G comprising [(-3 - )(-2 - )(-1 - )(0 - )] respectively. OR gate 94 is connected to receive signal F and G and to provide peak-detect-enable signal H comprising signal (F+G). A peak-detection-threshold selector 95 comprises eleven independent switches each adjustable to provide in a first position a positive voltage sufficient to operate transistor transistor logic (TTL) and indicative of a Hi or one-bit and in a second position a ground or zero voltage indicative of a Low or zero-bit for providing signal T p . Comparators 96a, c, e and g are connected to receive signals |Σ -3  | . . . |Σ o  | respectively and signal T p  for making a comparison therebetween and providing signals I, J, K and L indicative that Σ -3 , Σ -2 , Σ -1  and Σ o  respectively have absolute value greater than signal T p . Comparators 96b, d, and f are connected to receive |Σ -3  |, |Σ -2  | and |Σ -1  | on a first input and |Σ -2  |, |Σ -1  | and |Σ o  | on a second input for making a comparison therebetween and providing signals M, N, and O indicative that |Σ -2  | is greater than |Σ -3  |, |Σ -1  | is greater than |Σ -2  |, and |Σ.sub. -1 | is greater than |Σ o  |, respectively. AND gate 97 is connected to receive signals I, J, K, and L to provide signal P indicative of signal (I·J·K·L). AND gate 98 is connected to receive signals P, M, O, and H and to provide signal Q. AND gates 99a and 99b are connected to receive signals N inverted and N respectively on a first input and Q on a second input and to provide the signals NOW and NEXT&#39; respectively. Refer now to FIG. 3, a flip-flop 80 is connected to receive signal NEXT&#39; and upon the receipt of clock signal T 3  providing an output signal NEXT. The cumulative selection is made if the quantity of shifts of second-sliding-sum stack 32 since the last selection exceeds a selectable cumulative shift threshold T s  and if the accumulation of the second-sliding-sums since the last selection exceeds a selectable cumulative threshold T c . Refer now to FIGS. 3 and 10. A cumulative and force selector 100 is connected to receive signals Σ -1 , T 1 , T 2   and GATE. An accumulator 102 is connected to receive signals Σ -1  T 1  and GATE to provide a signal ACCUM which represents an accumulation of second-sliding-sums occuring between successive T 1  signals. A cumulative second-sliding-sum threshold selector 101 provides signal Tc, a cumulative shift threshold selector 105 provides signal Ts, and a force threshold selector 107 provides signal T F . Selectors 101, 105 and 107 are similar to and operate in the same manner as selector 95. A comparator 104 is connected to receive signal ACCUM&#39;s absolute value and Tc for making a comparison therebetween and providing a signal, |ACCUM|&gt;Tc, indicative that the absolute value of the cumulative second-sliding-sum since the previous signal T 1  has exceeded the threshold signal Tc. A counter 103 is connected to receive signals T 1  and GATE to provide a signal COUNT indicative of the total number of shifts of sum stack 32 between each successive signal T 1 . A comparator 106 is connected to receive signals COUNT and Ts for making a comparison therebetween and providing a signal COUNT&gt;Ts indicative that the number of second-sliding-sum shifts has exceeded the cumulative shift threshold. An AND gate 109 is connected to receive signals |ACCUM|&gt;Tc and COUNT&gt;Ts to provide a signal CUM indicative that a cumulative selection should be made. A comparator 108 is connected to receive signals COUNT and T F  for making a comparison therebetween and providing a signal FORCE indicative that signal COUNT is greater than force threshold T F . An OR gate 81 is connected to receive signals NOW, NEXT, CUM and FORCE and to provide signal SEL&#39; indicative that signal (NOW+NEXT+CUM+FORCE) is present. A flip-flop 83 is connected to receive signals SEL&#39;, SEL and inverted T 2  (T 2 ). Signal SEL is the output of flip-flop 83 fed back at the occurrence of signal T 2 . An AND gate 84 is connected to receive signals SEL and T 2  and to provide signal GATE therefrom. An adder 85 is connected to receive signals S 1  and S 2  for providing a signal SUM indicative of the sum of signals S 1  and S 2 . A parallel input/output shift register 82 is connected to receive signal Σ -2  shift it to the right twice and provide signal Σ -2  /4. A subtractor 86 is connected to receive signals S 3  and Σ -2  /4 as minuend and subtrahend respectively and provide a signal DIFF indicative of the difference of signals S 3  and Σ -2  /4. An ADDER 87 is connected to receive signals SUM and DIFF for providing a signal AVG. An output buffer 88 having a gating function is connected to receive signals AVG and GATE and to provide signal AVG at the occurrence of signal GATE. Referring to FIGS. 1 and 4 controller 15 is connected to provide a control cycle comprising timing signals T 1 , T 2 , T 3  and T 4  in response to a READY signal from input buffer 12 which initiates controller 15. 
     In summary, operation of the present invention is explained with reference to FIG. 1. Consecutive samples of noisy raw digital data are stored in a sample storage stack 14. Adjacent samples are subtracted, the adjacent first-difference Δ 1 , Δ 2  . . . Δ n  therefrom are subtracted and the resulting second-differences δ 1 , δ 2  . . . δ n  are stored in a second-difference storage stack 22. A distortion detector and data restorer 24 compares the raw data samples A with the second-differences. Samples distorted by noise are subsequently restored to a new value calculated from valid values of raw samples adjacent to the stored values. The second-differences are fed through first and second adders 26 and 30 to provide a sequence of second-sliding-sums Σ 1 , Σ 2  . . . Σ n  which are stored in a second-sliding-sum stack 32. A significant value selector 34 tests the second-sliding-sums using three different criteria. The results of the test are used as a basis for selecting samples from stack 14 for preoutput smoothing. 
     It should be apparent that the invention as described hereinabove provides the accuracy, reliability and precision of digital circuitry to improve the accuracy and resolution necessary for refraction calculations. The apparatus provides high speed data validation, distortion detection, restoration, significant value selection, smoothing and trend-change compensation. The apparatus as described provides a reduction of data-storage and concomittant processing time requirements by preprocessing the data in its period or frequency state to provide restoration of distorted samples to a more typical or normal value as determined by valid samples measuremented adjacent thereto. 
     While the foregoing description and drawings, represent the preferred embodiment of the present invention, it will be obvious to those skilled in the art that various changes and modifications may be made therein without departing from the true spirit and scope of the present invention.