Abstract:
A method of estimating a change of a variable over a measurement window, comprising the steps of taking multiple samples of the variable during the measurement window, defining a weight to be associated with each sample, the weight varying as a function of position of the sample within the measurement window, processing the samples taking account of their weight to form an estimate of the change in the variable.

Description:
[0001]    The present invention relates to a method of determining a change in a signal over a time period or the gradient of an over sampled signal, and to an apparatus including a circuit for determining the gradient or change of an over sampled signal. 
       BACKGROUND OF THE INVENTION 
       [0002]    It is often desirable to be able to estimate the parameter, such as a current, by integrating the current over time. The slope of the integral represents an average value of a current. The average value is then digitised, for example by taking a sample at a first instant in time, taking a sample at a second instant in time, and subtracting the difference between the two values to obtain the difference, and hence infer a gradient during the sample period. Relying on one or two samples like this may render the measurements susceptible to noise. Whilst over sampling a signal can provide improvements in measurements of a parameter, the over sampling can give rise to a computational overhead. 
       SUMMARY OF THE INVENTION 
       [0003]    According to the first aspect of the present invention there is provided a method of estimating a change of a variable over a measurement window, comprising the steps of:
   a) taking multiple samples of the variable during the measurement window;   b) defining a weight to be associated with each sample, the weight varying as a function of position of the sample within the measurement window;   c) processing the samples taking account of their weight to form an estimate of the change in the variable.   
 
         [0007]    According to a second aspect of the present invention there is provided an apparatus for estimating a change in a measurand during a measurement window, comprising the steps of:
   a) taking multiple samples of the measurand during the measurement window, and   b) processing the sample values in accordance with a weight associated with each sample, said weight varying as a function of position of the sample within the measurement window.   
 
         [0010]    It is thus possible to provide an improvement in the signal to noise ratio of the estimate of the variable/measurand whilst utilising a computationally simple technique which can be performed in dedicated hardware. 
         [0011]    Where the length of the measurement window may vary in time, perhaps because the measurement window represents a “view” from a computerised tomography scanner and the scan head is subject to speed changes, then it may be necessary to take account of the fact that each of the samples are not equally spaced apart in time. 
         [0012]    According to a third aspect of the present invention, there is provided a method of selecting samples for combination to form an estimate of a measurand, said samples occurring in a sequence, wherein a first parameter defines the length of a calculation window, a second parameter defines a number of measurements selected from opposing ends of the calculation window and a third parameter defines a separation between samples selected from the opposing ends of the calculation window. 
     
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0013]    The present invention will further be described, by way of example only, with reference to the accompanying drawings, in which: 
           [0014]      FIG. 1  schematically illustrates multiple samples for an over sampled signal within a sampling window W 1 ; 
           [0015]      FIGS. 2   a  and  2   b  schematically illustrate the calculation of gradient between sample S 1  and S 12 , and S 1  and S 8 , respectively, within the samples of  FIG. 1  together with the effect on calculation of errors within the gradient; 
           [0016]      FIG. 3  schematically illustrates the effect of sub-selecting from the samples in order to calculate average sample values; 
           [0017]      FIG. 4   a  reproduces the plot of over samples from  FIG. 1  and  FIG. 4   b  to  4   e  show examples of weighting functions to be applied within the sample window W; 
           [0018]      FIG. 5  schematically illustrates an apparatus including a processor adapted to implement the method of the present invention; 
           [0019]      FIG. 6   a  to  6   d  show alternative representations of the weighting functions shown in  FIGS. 4   b  to  4   e;    
           [0020]      FIG. 7  illustrates a sample sequence where a stretching of the inter-sample time period has occurred for the last sample within each measurement window; and 
           [0021]      FIGS. 8   a  and  8   b  illustrate parameterisation schemes for the sample sequence. 
       
    
    
     DESCRIPTION OF PREFERRED EMBODIMENTS 
       [0022]    Suppose that we have an ADC arranged to sample, at a regular sample rate such that we have series of measurements (x 1 , y 1 ), (x 2 , y 2 ) . . . (x n , y n ) and where we further assume that each of the y values has a measurement error σ i , but for simplicity we will assume each x value can be regarded as being error free. 
         [0023]    If it is desired to fit the measurements to a straight line, as represented by 
         [0000]    
       
      
       y=a+bx  
      
     
         [0000]    then a chi-squared function can be used where 
         [0000]    
       
         
           
             
               
                 χ 
                 2 
               
                
               
                 ( 
                 
                   a 
                   , 
                   b 
                 
                 ) 
               
             
             = 
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 N 
               
                
               
                 
                   ( 
                   
                     
                       
                         x 
                         i 
                       
                       - 
                       a 
                       - 
                       
                         bx 
                         i 
                       
                     
                     
                       σ 
                       i 
                     
                   
                   ) 
                 
                 2 
               
             
           
         
       
     
         [0024]    In the absence of measurement errors, the values of a and b can be estimated as the derivative with respect to these parameters can be minimised. 
         [0000]    
       
         
           
             
               
                 δ 
                  
                 
                     
                 
                  
                 
                   χ 
                   2 
                 
               
               
                 δ 
                  
                 
                     
                 
                  
                 a 
               
             
             = 
             
               0 
               = 
               
                 
                   - 
                   2 
                 
                  
                 
                   
                     ∑ 
                     i 
                     N 
                   
                    
                   
                     
                       
                         y 
                         i 
                       
                       - 
                       a 
                       - 
                       
                         bx 
                         i 
                       
                     
                     
                       σ 
                       i 
                       2 
                     
                   
                 
               
             
           
         
       
       
         
           
             
               
                 δ 
                  
                 
                     
                 
                  
                 
                   χ 
                   2 
                 
               
               
                 δ 
                  
                 
                     
                 
                  
                 b 
               
             
             = 
             
               0 
               = 
               
                 
                   - 
                   2 
                 
                  
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     N 
                   
                    
                   
                     
                       
                         x 
                         i 
                       
                        
                       
                         ( 
                         
                           
                             y 
                             i 
                           
                           - 
                           a 
                           - 
                           
                             bx 
                             i 
                           
                         
                         ) 
                       
                     
                     
                       σ 
                       i 
                       2 
                     
                   
                 
               
             
           
         
       
     
         [0025]    It is then further known (see for example P662 of “Numerical recipes in C: the art of scientific computing”, ISBN 0-521-43105-5) 
         [0000]    that the following definitions can be made 
         [0000]    
       
         
           
             S 
             = 
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 N 
               
                
               
                 1 
                 
                   σ 
                   i 
                   2 
                 
               
             
           
         
       
       
         
           
             Sx 
             = 
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 N 
               
                
               
                 
                   x 
                   i 
                 
                 
                   σ 
                   i 
                   2 
                 
               
             
           
         
       
       
         
           
             Sy 
             = 
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 N 
               
                
               
                 
                   y 
                   i 
                 
                 
                   σ 
                   i 
                   2 
                 
               
             
           
         
       
       
         
           
             Sxx 
             = 
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 N 
               
                
               
                 
                   x 
                   i 
                   2 
                 
                 
                   σ 
                   i 
                   2 
                 
               
             
           
         
       
       
         
           
             Sxy 
             = 
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 N 
               
                
               
                 
                   
                     x 
                     i 
                   
                    
                   
                     y 
                     i 
                   
                 
                 
                   σ 
                   i 
                   2 
                 
               
             
           
         
       
     
         [0026]    Then if we let 
         [0000]    
       
         
           
             Δ 
             = 
             
               SSxx 
               - 
               
                 
                   ( 
                   Sx 
                   ) 
                 
                 2 
               
             
           
         
       
       
         
           
             we 
              
             
                 
             
              
             get 
           
         
       
       
         
           
             a 
             = 
             
               
                 SxxSy 
                 - 
                 SxSxy 
               
               Δ 
             
           
         
       
       
         
           
             b 
             = 
             
               
                 SSxy 
                 - 
                 SxSy 
               
               Δ 
             
           
         
       
     
         [0027]    Suppose, for the sake of simplicity that we have 10 samples and that σ i  is assumed to be a constant. 
         [0028]    We see that:
       calculation of S requires a multiplication, a division and 10 summations or a further multiplication. This value needs to be calculated only once if σ can be assumed to be the same between measurement windows,   calculations of Sx can be simplified if       
 
         [0000]    
       
         
           
             1 
             
               σ 
               i 
               2 
             
           
         
       
       
         
           
              is pre-calculated from the preceding calculation of S. If this is the case then we can simplify to 10 multiplications and 10 summations, 
             calculation of Sy can similarly be simplified to 10 multiplications and 10 summations, 
             calculation of Sxx can also be simplified to 20 multiplications and 10 summations, 
             calculation of Sxy can also be simplified to 20 multiplications and 10 summations. 
           
         
       
     
         [0034]    The calculations of Δ is a further two multiplications and 1 subtraction. Calculation of a and b are a further two multiplies, one subtraction and a division each. 
         [0035]    Thus, to estimate the values a and b from ten samples requires 50 summations, 67 multiplies, 3 divisions and 3 subtractions. Even if we only want the gradient b, we see that we still have to calculate S, Sx, Sy, Sxx and Sxy so there is virtually no saving in processing power. 
         [0036]    Furthermore even if 
         [0000]    
       
         
           
             1 
             
               σ 
               2 
             
           
         
       
     
         [0000]    is simplified to equal unity then the estimation of b still involves 50 summations and over 20 multiplications. This is computationally expensive and also requires numerous memories to hold intermediate values. This is not appropriate for use in systems working in real time with large numbers of parallel data streams. 
         [0037]    In the absence of noise then there would be effectively no measurement error (except quantisation error) and it would be acceptable merely to take two measurements and to subtract one from the other, thereby avoiding, potentially, the overhead of the least squares approach described hereinbefore. 
         [0038]    However, in the presence of noise the result of such a simple process can result in an error. 
         [0039]    Consider  FIG. 1 . Here a sample window, W 1 , exists in which a plurality of samples, in this instance S 1  to S 12 , have been taken. Each sample has an error σ such that there is a statistical probability that each sample is within ±σ from its nominal value (typically 95% of samples satisfy this condition). 
         [0040]    The inventors have noted that other factors affect the error in a gradient calculation. If we now consider  FIGS. 2   a  and  2   b  we see that the error in the final result, i.e. the gradient of the line of the difference between the start and end values, depends not only on the individual error in the measurements but also the distance between the measurement points. 
         [0041]      FIG. 2   a  compares samples S 1  and S 12 . These samples are separated by 11 units in the x axis (which may represent time or distance or amount of rotation). 
         [0042]    Thus the gradient, as represented by chain line  20  is 
         [0000]    
       
         
           
             b 
             = 
             
               
                 
                   S 
                   1 
                 
                 - 
                 
                   S 
                   12 
                 
               
               11 
             
           
         
       
     
         [0000]    however, errors associated with the measurements could mean that the true gradient b′ could or should have been represented by the dotted line  22   
         [0000]    
       
         
           
             
               b 
               ′ 
             
             = 
             
               
                 
                   ( 
                   
                     
                       S 
                       1 
                     
                     - 
                     σ 
                   
                   ) 
                 
                 - 
                 
                   ( 
                   
                     
                       S 
                       12 
                     
                     + 
                     σ 
                   
                   ) 
                 
               
               11 
             
           
         
       
     
         [0000]    ∴the difference or error in the gradient could be 
         [0000]    
       
         
           
             
               Δ 
                
               
                   
               
                
               b 
             
             = 
             
               
                 
                   2 
                    
                   
                       
                   
                    
                   σ 
                 
                 11 
               
               = 
               
                 0.1818 
                  
                 
                     
                 
                  
                 σ 
               
             
           
         
       
     
         [0043]    Similar considerations apply in  FIG. 2   b   
         [0000]    
       
         
           
             b 
             = 
             
               
                 
                   
                     S 
                     1 
                   
                   - 
                   
                     S 
                     8 
                   
                 
                 7 
               
               = 
               
                 
                   
                     S 
                     1 
                   
                   - 
                   
                     S 
                     12 
                   
                 
                 11 
               
             
           
         
       
       
         
           
             
               b 
               ′ 
             
             = 
             
               
                 
                   ( 
                   
                     
                       S 
                       1 
                     
                     - 
                     σ 
                   
                   ) 
                 
                 - 
                 
                   ( 
                   
                     
                       S 
                       8 
                     
                     + 
                     σ 
                   
                   ) 
                 
               
               7 
             
           
         
       
       
         
           so 
         
       
       
         
           
             
               Δ 
                
               
                   
               
                
               b 
             
             = 
             
               
                 
                   2 
                    
                   
                       
                   
                    
                   σ 
                 
                 7 
               
               = 
               
                 0.2857 
                  
                 
                     
                 
                  
                 σ 
               
             
           
         
       
     
         [0044]    Therefore the estimate of the gradient is subject to more uncertainty as represented by Δb as the “distance” between measurements decreases. 
         [0045]    However, it is known that the effects of noise can be reduced by taking multiple samples of a signal as the signal power increases linearly with the number of samples taken whereas noise power for Gaussian noise increases as the square root of the number of samples taken. 
         [0046]    Taking multiple samples at points S 1  and S 12  may not be possible due to acquisition constraints, but taking multiple samples within the measurement window is. 
         [0047]    However, the samples need to be processed in a computationally simple way. The inventors have realised that acceptable estimates of the gradient can be obtained by mere addition and subtraction of the sample values—subject to the sample values being modified by a weighting function. 
         [0048]    If we consider  FIG. 3 , the values S 1 , S 2 , S 11 , and S 12  have been taken for processing. 
         [0049]    S 1  and S 2  can be averaged to give a new sample SA which can be regarded as being 
         [0000]    at 
         [0000]    
       
         
           
             
               
                 x 
                  
                 
                     
                 
                  
                 co 
                  
                 
                   - 
                 
                  
                 ordinate 
               
               = 
               
                 1 
                 2 
               
             
             , 
             
               
                 y 
                  
                 
                     
                 
                  
                 co 
                  
                 
                   - 
                 
                  
                 ordinate 
               
               = 
               
                 
                   
                     S 
                     1 
                   
                   + 
                   
                     S 
                     2 
                   
                 
                 2 
               
             
             , 
             
               i 
               . 
               e 
               . 
               
                   
               
                
               
                 
                   
                     x 
                     1 
                   
                   + 
                   
                     x 
                     2 
                   
                 
                 2 
               
             
             , 
             
               
                 
                   
                     y 
                     1 
                   
                   + 
                   
                     y 
                     2 
                   
                 
                 2 
               
               . 
             
           
         
       
     
         [0050]    Similarly S 11  and S 12  can be averaged to give a new sample SB which can be regarded as 
         [0000]    being 
         [0000]    
       
         
           
             
               x 
               = 
               10.5 
             
             , 
             
               y 
               = 
               
                 
                   
                     S 
                     11 
                   
                   + 
                   
                     S 
                     12 
                   
                 
                 2 
               
             
             , 
             
               
                 
                   i 
                   . 
                   e 
                   . 
                   
                       
                   
                    
                   
                     ( 
                     
                       
                         
                           
                             x 
                             11 
                           
                           + 
                           
                             x 
                             12 
                           
                         
                         2 
                       
                       , 
                       
                         
                           
                             y 
                             11 
                           
                           + 
                           
                             y 
                             12 
                           
                         
                         2 
                       
                     
                     ) 
                   
                   . 
                 
                  
                 
                   
 
                 
                 ∴ 
                 
                     
                 
                  
                 
                   gradient 
                    
                   
                       
                   
                    
                   b 
                 
               
               = 
               
                 
                   SB 
                   - 
                   SA 
                 
                 = 
                 
                   
                     
                       
                         
                           
                             S 
                             11 
                           
                           + 
                           
                             S 
                             12 
                           
                         
                         2 
                       
                       - 
                       
                         
                           ( 
                           
                             
                               S 
                               1 
                             
                             + 
                             
                               S 
                               2 
                             
                           
                           ) 
                         
                         2 
                       
                     
                     
                       10.5 
                       - 
                       0.5 
                     
                   
                   . 
                 
               
             
           
         
       
     
         [0051]    The gradient calculation will be the same as calculated in  FIGS. 2   a  and  2   b , and is represented by solid line  30 . 
         [0052]    If we now consider the effect of the errors σ has reduced by 
         [0000]    
       
         
           
             
               
                 2 
               
               2 
             
             , 
           
         
       
     
         [0000]    but the distance between the composite samples SA and SB has reduced from 11 in the case of  FIG. 2   a  to  10 . 
         [0000]    
       
         
           
             
               Δ 
                
               
                   
               
                
               b 
             
             = 
             
               
                 
                   
                     2 
                      
                     σ 
                   
                 
                 2.10 
               
               = 
               
                 0.0707 
                  
                 
                     
                 
                  
                 σ 
               
             
           
         
       
     
         [0053]    If we now include S 1 , S 2 , S 3  and S 10 , S 11 , S 12  then the value of σ reduces to 
         [0000]    
       
         
           
             
               3 
             
             3 
           
         
       
     
         [0000]    and the effective distance reduces to 9 units 
         [0000]    
       
         
           
             
               ∴ 
               
                 Δ 
                  
                 
                     
                 
                  
                 b 
               
             
             = 
             
               
                 
                   
                     3 
                   
                   3 
                 
                 × 
                 
                   σ 
                   9 
                 
               
               = 
               
                 0.06415 
                  
                 σ 
               
             
           
         
       
     
         [0054]    If we now include S 1 , S 2 , S 3  and S 4  against S 9 , S 10 , S 11 , S 12  then the value of σ reduces to 
         [0000]    
       
         
           
             
               4 
             
             4 
           
         
       
     
         [0000]    and the effective distance reduces to 8, so 
         [0000]    
       
         
           
             
               Δ 
                
               
                   
               
                
               b 
             
             = 
             
               
                 
                   
                     4 
                   
                   4 
                 
                 × 
                 
                   σ 
                   8 
                 
               
               = 
               
                 0.0625 
                  
                 σ 
               
             
           
         
       
     
         [0055]    If we now include S 1 , S 2 , S 3 , S 4 , S 5  and S 8 , S 9 , S 10 , S 11 , and S 12  then the value of σ reduces by 
         [0000]    
       
         
           
             
               5 
             
             5 
           
         
       
     
         [0000]    and the effective distance reduces to 7, so 
         [0000]    
       
         
           
             
               Δ 
                
               
                   
               
                
               b 
             
             = 
             
               
                 
                   
                     5 
                   
                   5 
                 
                 × 
                 
                   σ 
                   7 
                 
               
               = 
               
                 0.0639 
                  
                 σ 
               
             
           
         
       
     
         [0056]    It can be seen that even though more samples have been included, the error on the gradient has increased compared to the case of using four samples in each set of samples. 
         [0057]    If we pair of all samples into S 1  to S 6  and S 7  to S 12  then on each composite sample the error has reduced by 
         [0000]    
       
         
           
             
               6 
             
             6 
           
         
       
     
         [0000]    and the effective distance between the composite sample is 6 so 
         [0000]    
       
         
           
             
               Δ 
                
               
                   
               
                
               b 
             
             = 
             
               
                 
                   
                     6 
                   
                   6 
                 
                 × 
                 
                   σ 
                   6 
                 
               
               = 
               
                 0.0680 
                  
                 σ 
               
             
           
         
       
     
         [0058]    Which is worse than only using S 1 , S 2 , S 3  and S 10 , S 11 , and S 12 . 
         [0059]    This demonstrates the surprising result that using more of the samples can degrade the estimate of the gradient. 
         [0060]    The inventors, having realised this, propose that the contribution of the various readings should be weighted, such that the contributions from some of the samples can be ignored. 
         [0061]    The weighting occurs in both X and Y directions such that the position of the composite sample points reflects the relative contribution of each of the samples to it. 
         [0062]    In high through-put digital systems it is beneficial for the weighting function to be easy to implement. A particularly easy weighting function to implement is shown in  FIG. 4   b  where the weighting function either has a value of 0 or a value of 1. In the example shown in  FIG. 4   b  the weighting function has a value of 1 for samples S 1 , S 2 , S 3 , and S 10 , S 11 , and S 12 . For all other samples awaiting function has a value of 0. The weighting function is symmetric around the mid-point of the sampling window. This function can be implemented entirely in hardware using an adder to keep a running total of the value of the samples. Thus, for a single channel, a hardware adder can be initialised at the start of the window, and then as time progresses through the window can sum S 1 , S 2  and S 3 . The hardware adder then ignores samples S 4  to S 9  and is then set to a decrement mode such that as sample S 10  arrives it decrements it from the currently held sum of S 1 , S 2  and S 3 . Subsequently as sample S 11  occurs this is also decremented from the current total and finally as sample S 12  occurs this is also decremented. The output of the hardware summer then represents a scaled estimate of the gradient. In this example, the value in the hardware summer would represent the gradient measured effectively between S 2  and S 11 . The output then needs scaling, for example by a digital multiplication by a constant, to rescale the output to that which would have occurred when subtracting S 12  from S 1 . This value can then be passed to downstream processing circuits which had been expecting a single value corresponding to merely subtracting S 12  from S 1 . Thus an improvement in the signal to noise performance has been obtained while maintaining compatibility with older data processing systems. 
         [0063]    The weighting function shown in  FIG. 4   b  is particularly simple to implement and also lends itself to being parameterised by a single value representing the extent of the 0 period, either in totality, or measured from the mid-point of the window. In one example for parameterising the function shown in  FIG. 4   b , the function can be represented by 
         [0000]      Fn i (A,B) 
         [0000]    where A represents the number of samples that are taken in a measurement window and B represents the number of samples that occur in a first portion  41  (which may also be regarded as a sample set) where a non-zero weight is applied. From this parameterisation the hardware or system can deduce the existence of a second portion  42  within the measurement window where a non-zero weighting is applied. As will be shown later, this parameterisation scheme can be extended. 
         [0064]    The parameterisation allows the weighting function to be modified rapidly if a controller determines that a different weighting/result combining function is required. The weighting signal can be readily regenerated using a counter to count the samples as they occur and to decide on the basis of the control parameter whether the samples are to be multiplied by 1 or to be discarded for the purposes of calculating the gradient. 
         [0065]    More complex gradients may also be used and that shown in  FIG. 4   c  represents a step wise function where again a central portion of the function is zero valued but where samples towards the end of the function are given different weightings. The function shown in  FIG. 4   c  weights samples S 1  and S 12  by twice the values of samples S 2  and S 11 . All other samples S 3  to S 10  are 0 weighted. It can be seen that the effective X position of the composite samples would occur ⅓ of the way between S 1  and S 2  and ⅓ of the way between S 12  and S 11 , namely with X values of ⅓ and 10.67 respectively in the example shown here. 
         [0066]      FIG. 4   d  shows a further variation in which a linear function, which can be replicated to the digital domain by a staircase, extends in either direction from the mid-point of the window. Finally  FIG. 4   e  shows a smoothly varying function centred around the mid-point of the window. A generally parabolic function would be easy to implement within the digital domain as the scaling of ÷2, ÷4, ÷8 and so on could be accomplished merely by shifting the digital word from the analog to digital converter by 1, 2, 3 and so on bits towards the least significant bit. 
         [0067]      FIG. 5  schematically illustrates a measurement circuit including a processor adapted to implement the present invention. The measurement circuit may, for example, be a channel within a x-ray computerised tomography (CT) scanner. Typically a CT scanner has a scintillation crystal (not shown) in association with a photo diode array. The photo diode array typically comprises a large number such as 64 or 128, photo diodes.  FIG. 5  schematically illustrates one such photo diode  50 . In use the current from the photo diode  50  is integrated by an integrator  52  such that an estimate of the current flowing through the diode in the measurement window can be obtained. In prior art CT scanners a reset circuit is associated with the integrator  52  and is operated at the beginning of each measurement window such that only one sample, corresponding to sample S 12  of  FIG. 1  need be taken at the end of each measurement window and that the value of S 12  was directly related to the current through the photo diode  50 . However noise effecting the reset voltage and the single measurement of sample S 12  gives rise to the potential to miscalculate the gradient with the measurement window. 
         [0068]    In the present invention, the output of the integrator  52  is provided to an analog to digital converter  54  by way of a multiplexer  56 . The multiplexer allows signals from several, for example 64 or 128, photodiodes to be sent to a single analog to digital converter in time multiplexed fashion. For simplicity, we need only consider what occurs in a single one of the channels. 
         [0069]    As noted with respect to  FIGS. 1 and 4  the output from the integrator  52  is over sampled so that a plurality of samples are taken within a single measurement window W. Although  FIG. 1  has shown 12 such samples as being taken, this is only an exemplary number and the number of samples could typically range between 8 and 20. The output from the analog to digital converter is provided to a processor  60 . Typically the analog to digital converter might provide a conversion result every 300 to 350 nanoseconds or so. The processor  60  needs to work in real time in order to process the samples from each channel such that the channel outputs from each and every channel within the array can be made available at the end of every sampling window which might be in the range of 100 to 300 microseconds. In order to do this in a time efficient manner the processor accumulates in hardware a running total of the value for each channel and stores it to a channel memory. It is known to the person skilled in the art that memory occupies a relatively large volume on a silicon die compared to other components and it is therefore advantageous to keep the amount of memory required down to a minimum. The present invention keeps a running total for each channel and therefore requires only one memory per channel, the memory typically having the same number of bits as the analog to digital converter  54  plus potentially a couple of other bits to avoid memory overflow when forming the running total. Thus, for each channel, the processor takes the result stored in the memory of that channel and adds or subtracts the current sample value to it as appropriate. Thus each channel only requires a single memory to be associated with it. For a converter having, say, a 16 bit output each channel memory need only be a maximum of 18 bits wide. The invention, when implemented with the weighting function shown in  FIG. 4   b , only requires three additions, three subtractions and optionally one multiplication for rescaling purposes to be performed for each channel in order to obtain an estimate of the gradient having improved immunity to noise when compared with the prior art. 
         [0070]    The other functions are also describable in parameterised form or alternatively may be stored in a look-up table for use by the processor  60 . 
         [0071]    In some embodiments of the present invention the integrator is only reset when it gets close to the limits of its operation. A reset might occur during the measurement window thus, if a reset occurred between sample  6  and sample  7  then samples  7  to  12  would be offset from sample  6  by the size of the reset. This can be accommodated by storing a value for the integrator output value immediately following a reset and then adding a further offset representing the difference between the last sample value and the reset value to each of the subsequently sampled values for the remainder of the sample window. 
         [0072]    In  FIG. 4   b  to  4   e  the graphs represent the magnitude of the weighting factor—but the sign is implied from the position of a sample within the measurement window. The same weighting functions can be expressed to make the sign (add or subtract) of the weight explicit, as shown in  FIGS. 6   a  to  6   d . It can be seen that the weight varies monotonically within a window. 
         [0073]    It is thus possible to provide a method of calculating the gradient for an over sampled signal which is computationally fast and simple to do in hardware. 
         [0074]    So far we have assumed that the samples occur at equal separations in time within the measurement window. However, in the context of a computerised tomography scanner the scanning head is very heavy and is mechanically driven. Consequently the rate of rotation of the scanning head can vary. It is therefore desirable in order to trigger the over sampling from synchronisation pulses which occur when the scanning head has reached predetermined positions. Each synchronisation pulse marks the end of one measurement window and the beginning of the next. Given that the rate of rotation of the scanning head is reasonably well known, it is possible to set the rate of over sampling to ensure that all of the samples are taken within the measurement window. Nevertheless, it can be observed that the time period between the final over sampled sample, and the next sample which coincides with the synchronisation pulse could, and indeed almost certainly will, have a time period which is greater than the inter-sample time period for any of the other samples within the measurement window. The length of this period is the sum of the inter sample period and a stretch time. 
         [0075]    This can be seen more clearly in  FIG. 7  which shows the three synchronisation pulses P 1 , P 2  and P 3  defining measurement windows W 2  and W 3  between them. For simplicity we shall assume that only eight samples are used within each measurement window, with the samples designated S 7 - 0  to S 7 - 14  within  FIG. 7 . S 7 - 0  is coincident with the first trigger pulse P 1  and from then on samples occur every t s  seconds up to sample S 7 - 6  which is the last sample to occur before synchronisation pulse P 2 . Thus, if we regard P 1  as defining time t=0, then S 7 - 1  occurs at t=t s , S 7 - 2  occurs at t=2t s  and S 7 - 6  occurs at t=6t s . Sample S 7 - 7  can be seen to be separated from sample S 7 - 6  by more than the normal sampling period t s . Sample S 7 - 7  occurs at t=7t s +stretch old, where “stretch old” represents the additional time by which the sample period between S 7 - 6  and S 7 - 7  had been extended. Sample S 7 - 7  can be regarded as representing a sample at the end of measurement window W 2  and also commencing the start of measurement window W 3 . Following the occurrence of sample S 7 - 7  the samples are again taken at regular time periods separated by t s  until sample S 7 - 13  occurs which is the last sampling instance before the synchronisation pulse P 3 . Once again there is a larger separation between sample S 7 - 13  and sample S 7 - 14  than between any of the other samples occurring within measurement window W 3 . The sample periods can be regarded as being stretched, and for any given measurement window, especially window W 3  we can define two stretch periods with the period preceding the synchronisation pulse P 2  being “stretch old” and the stretch period occurring within the window W 3  and immediately preceding the synchronisation pulse P 3  as being “stretch new”. 
         [0076]    The calculation of the gradient can then be modified to take account of the stretch periods. 
         [0077]    This calculation can itself also be parameterised. 
         [0078]    First, second and third parameters can be used to describe the process for calculating the gradient. These have been given labels O, P and Q.
       O represents the number of samples within a sample window, or a repeat length defining the distance between similar points in consecutive calculation windows.   P indicates the number of samples that will be selected from the beginning and end of the sample window, and   Q represents the “distance” between samples which were paired off as part of the gradient calculation process.       
 
         [0082]    This can be seen more easily in  FIG. 8  where within each measurement window, as defined as the period between synchronisation pulse P 1  and synchronisation pulse P 2  we take samples S 0  to S 15 . For simplicity in this example, the pulse occurring in synchronism with each synchronisation pulse is labelled S 0 . Thus each sample window has sixteen samples in it, therefore O=16. We are using the first three samples and the last three samples so P=3. We effectively form three sample pairs with each pair being separated by fourteen samples so Q=14. Thus the sample pairs S 0  and S 14 , S 1  and S 15 , S 2  and S 0  (from the next window). As we form 
         [0000]      (S0−S14)+(S1−S15)+(S2−S0*). 
         [0000]    where “*” indicates that S 0  comes from the next sample window, i.e. it follows S 15  in  FIG. 8 . 
         [0083]    The result of this calculation is then scaled or normalised in order to give the gradient. It should be noted that this parameterisation scheme can be extended, as shown in  FIG. 8   b  which shows the sample pairs used for parameterisation O, P, Q=16, 3, 16. It can be seen that the samples remain symmetrically disposed around the mid-point of the measurement window. In such a circumstance it is useful to consider O as defining the length between similar points in consecutive calculation windows. 
         [0084]    Where we use samples from the preceding view then the algorithm needs to accommodate the “stretch old”, when we have the stretch preceding the first synchronisation pulse of the current view. If the gradient is calculated as described hereinbefore, that is just by forming running sums, then the normalisation factor needs to be modified to take into account the stretches that occur between some of the sample points. The normalisation factor F can be defined as: 
         [0000]    
       
         
           
             F 
             = 
             
               
                 
                   O 
                   . 
                   sub 
                 
                 + 
                 
                   “ 
                   
                     stretch 
                      
                     
                         
                     
                      
                     new 
                   
                   ” 
                 
               
               
                 
                   
                     
                       
                         ( 
                         
                           P 
                           . 
                           Q 
                           . 
                           
                               
                           
                            
                           sub 
                         
                         ) 
                       
                       + 
                       
                         ( 
                         
                           
                             ( 
                             
                               
                                 
                                   ( 
                                   
                                     Q 
                                     + 
                                     P 
                                     - 
                                     O 
                                   
                                   ) 
                                 
                                 / 
                                 2 
                               
                               - 
                               
                                 1 
                                 2 
                               
                             
                             ) 
                           
                            
                           
                             “ 
                             
                               stretch 
                                
                               
                                   
                               
                                
                               old 
                             
                             ” 
                           
                         
                         ) 
                       
                       + 
                     
                   
                 
                 
                   
                     
                       ( 
                       
                         
                           ( 
                           
                             
                               
                                 ( 
                                 
                                   Q 
                                   + 
                                   P 
                                   - 
                                   O 
                                 
                                 ) 
                               
                               / 
                               2 
                             
                             + 
                             
                               1 
                               2 
                             
                           
                           ) 
                         
                          
                         
                           “ 
                           
                             stretch 
                              
                             
                                 
                             
                              
                             new 
                           
                           ” 
                         
                       
                       ) 
                     
                   
                 
               
             
           
         
       
     
         [0085]    Where “sub” represents the time separation between data samples in the same units as the values “stretch old” and “stretch new”. The above formula works where the samples are selected to be symmetrically disposed around the window mid-point. 
         [0086]    This normalisation factor applies in the case where:
       the weighting factor applied to the data samples has values of only one or zero and the factor is correct for the constant slope (zero order curvature correction).       
 
         [0088]    It is useful to consider two examples to illustrate how the normalisation factor varies. 
         [0089]    Suppose that we sample every 300 nS, and that the conversion window has 16 samples, that the number of samples used at the beginning and end of each range is 3, and that the distance between paired off samples is 14. 
         [0090]    Thus
       O.sub=300 nS   O=16   P=3   Q=14       
 
         [0095]    If no stretching occurs at all then we have 
         [0000]    
       
         
           
             
               
                 ( 
                 
                   Q 
                   + 
                   P 
                   - 
                   O 
                 
                 ) 
               
               / 
               2 
             
             = 
             
               1 
               2 
             
           
         
       
       
         
           so 
         
       
       
         
           
             F 
             = 
             
               
                 
                   300 
                    
                   
                       
                   
                    
                   nS 
                 
                 
                   
                     3.300 
                      
                     
                         
                     
                      
                     nS 
                   
                   + 
                   
                     
                       ( 
                       
                         
                           1 
                           2 
                         
                         - 
                         
                           1 
                           2 
                         
                       
                       ) 
                     
                      
                     .0 
                   
                   + 
                   
                     
                       ( 
                       
                         
                           1 
                           2 
                         
                         + 
                         
                           1 
                           2 
                         
                       
                       ) 
                     
                      
                     .0 
                   
                 
               
               = 
               
                 1 
                 / 
                 3 
               
             
           
         
       
     
         [0096]    Which intuitively is correct as three sample pairs were used in place of one pair and no stretching occurred. 
         [0097]    If a stretching of 150 nS (i.e. half a sample period) occurs consistently at the end of each sample window, then in this example we see that the S 2  to S 0 * sample is too long. 
         [0000]    
       
         
           
             F 
             = 
             
               
                 
                   ( 
                   
                     300 
                     + 
                     150 
                   
                   ) 
                 
                  
                 
                     
                 
                  
                 nS 
               
               
                 
                   ( 
                   
                     3 
                     × 
                     300 
                      
                     
                         
                     
                      
                     nS 
                   
                   ) 
                 
                 + 
                 
                   ( 
                   
                     
                       1 
                       2 
                     
                     - 
                     
                       1 
                       2 
                     
                   
                   ) 
                 
                 + 
                 
                   
                     ( 
                     
                       
                         1 
                         2 
                       
                       + 
                       
                         1 
                         2 
                       
                     
                     ) 
                   
                    
                   .150 
                    
                   
                       
                   
                    
                   nS 
                 
               
             
           
         
       
       
         
           
             F 
             = 
             
               450 
               1050 
             
           
         
       
       
         
           
             F 
             = 
             0.428 
           
         
       
     
         [0098]    The value of the scaling factor has gone up because two of the sample pairs are effectively under weight compared to the final sample pair (the one including the stretch time) and hence a longer weighting factor is appropriate. 
         [0099]    The formula also works in the case illustrated in  FIG. 8   b  where samples come from the neighbouring measurement windows, and under these circumstances it becomes necessary to take account of fact that “stretch old” and “stretch new” can take different values. 
         [0100]    The value in the channel memory is then multiplied by the factor F to rescale the result. 
         [0101]    Other normalisation factors can be used where the weighting factors differ or where the curvature is non zero.