Phase detection method
BACKGROUND AND SUMMARY OF THE INVENTION 
     Phase detection of an electrical signal may be used to measure the real and imaginary components of the impedance of an electrical device under test. For convenience, it is desirable that the time necessary to perform the phase detection be kept short and for accuracy it is desirable that detection errors be kept to a minimum. 
     Phase detection, as performed in the prior art, has been accomplished with the use of a switched single detector as is described in Laid Open Japanese Patent No. 30375/1978. While high degrees of measurement accuracy may be achieved with the use of such a switched single detector, the phase detection method tends to be very time-consuming. 
     In accordance with the illustrated preferred embodiment of the present invention, a phase detection method permits rapid phase detection to be accomplished with a high degree of measurement accuracy. A dual detector apparatus is utilized to make phase measurements of two unknown signals relative to a reference signal. Repeated measurements of the two unknown signals are made and an incremental phase shift is injected between successive measurements. The individual measurements are averaged to yield a highly accurate phase measurement. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of a phase detection circuit which is constructed in accordance with the prior art. 
     FIG. 2 is a vector diagram which depicts the relationship between the two input signals shown in FIG. 1. 
     FIG. 3 is a schematic diagram of a circuit which may be used to generate the two input signals shown in FIG. 1. 
     FIG. 4 shows the operation of the circuit shown in FIG. 1. 
     FIG. 5 is a block diagram of another phase detection circuit which is constructed in accordance with the prior art. 
     FIG. 6 is a vector diagram which shows the relationship between the two input signals shown in FIG. 5. 
     FIGS. 7a and 7b show the operation of the circuit shown in FIG. 5. 
     FIG. 8 is a flow chart of the method in accordance with the preferred embodiment of the present invention. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Phase detection may be used to detect the 0° (in-phase) and the 90° (quadrature) components of an unknown signal with respect to a known reference signal. In an impedance measuring device, the unknown signal may represent the magnitude of the impedance of a device under test (such as a capacitor or an inductor) and the separate in-phase and quadrature components then correspond separately to the resistance and reactance of the device. In order to determine the resistance and reactance components precisely, the phase detection of the in-phase and quadrature components must be made accurately. 
     FIG. 1 shows a prior art phase detection circuit and FIG. 2 shows the relationship between the two input signals (unknown signals E 1  and E 2 ) shown therein. FIG. 3 shows a circuit which may be used to generate the two input signals, E 1  and E 2  in an impedance measurement system. An input signal source 4 is connected to a high gain operational amplifier 7 through a device to be tested 5 (capacitor, inductor or the like). Resistor 6 provides negative feed back around op amp 7. Signals E 1  and E 2  are related by: ##EQU1## wherein X is the resistance component of the impedance of the device 5, Y is the reactance component and R is the resistance of resistor 6. E 3  (in FIG. 2) is a reference signal which is supplied by signal source 4 as: 
     
         E.sub.3 =sin (ωt-θ) .                          (2) 
    
     Therefore, signals E 1  and E 2  may be expressed as: 
     
         E.sub.1 =A sin (ωt+φ.sub.A),                     (3) 
    
     
         E.sub.2 =B sin (ωt+φ.sub.B), (4) 
    
     wherein φ A  represents phase shifts caused by, e.g., long lead lines, and φ B  represents the phase shift of the reactance of the device under test 5. 
     In FIG. 1, either signal E 1  or signal E 2  may be applied through a switch 1 to an input of a phase detector 2. Reference signal E 3  may be applied to another input of the phase detector 2. The output signal of the phase detector 2 is applied to an output circuit 3 which may include an analog to digital converter as is described hereinafter. 
     Phase detection of the two unknown signals E 1  and E 2  is accomplished in accordance with the prior art by first setting the switch 1 to point v to apply the unknown signal E 1  to phase detector 2. The in-phase (θ=0°) component (a) of signal E 1  and then the quadrature (θ=90°) component (b) of E 1  are measured. The switch 1 is then set to point w to apply the unknown signal E 2  to phase detector 2 and the in-phase and quadrature components (c and d) of signal E 2  are measured. The various components (a, b, c, d) are obtained in a time-division manner. A dual slope integrator may be used to perform the analog to digital conversion in the output circuit 3 and the components a, b, c, d may be integrated for a predetermined time T 1  and may be then discharged at a DC voltage (e). The magnitudes of the components a, b, c, d are found by counting discharged times T 2 , T 3 , T 4 , and T 5  . 
     FIG. 4 depicts the operation of the output circuit 3 shown in FIG. 1. Using well-known dual-slope integration techniques, a vector voltage ratio and, thus, the resistance and reactance components of the impedance of the device 5 may be obtained in accordance with Equations 5-7: ##EQU2## The above-described technique is disclosed in Laid Open Japanese Pat. No. 30375/1978. Switching between θ=0° and θ=90° may be accomplished by clocking the reference signal E 3  as is disclosed in the method shown in Laid Open Japanese Pat. No. 72657/1979. Since the clock signal may be controlled very accurately, the necessary conditions of θ=0° and θ=90° may be held very accurately for a highly accurate phase detection measurement. However, since this prior art method utilizes a single phase detector for the measurement of components a, b, c, d, in a time-division manner, measurement speed is very low. 
     FIG. 5 shows another apparatus which is constructed in accordance with the prior art. Phase detectors 11 and 12 each have one input which is connected to switch 1 and another which is connected to a phase signal generator 13. The outputs of the phase detectors 11, 12 are connected to output circuits 14 and 15. Each of the output circuits 14 and 15 may include an analog to digital converter which may be similar to the converter discussed above with reference to FIG. 1. The phase signal generator 13 generates a reference signal E 4  and a shifted reference signal E 5  which is phase shifted from reference signal E 4  by 90°. 
     
         E.sub.4 =sin (ωt-φ) and E.sub.5 =(1+α) cos (ω-θ-ε),                              (8) 
    
     wherein ε is an error term representing the difference between the desired 90° phase shift and the phase shift actually existing between signals E 4  and E 5 . α is a calibration error term representing the difference in the accuracies of phase detectors 11 and 12. 
     FIG. 6 is a vector diagram which shows E 1  and E 2  with respect to the reference signal E 4  (θ=0°). When the switch 1 in FIG. 5 is set to point v, the outputs of phase detectors 11 and 12 are signals X A  and Y A , respectively. 
     
         X.sub.A =A cos (θ.sub.A +θ)                    (9) 
    
     
         Y.sub.A =A(1+α) sin (φ.sub.A +θ+ε) (10) 
    
     If θ=0°, then X A  =a=A cos φ A  and Y A  =g=A(1+α) sin (φ A  +ε) and it can be seen that errors α and ε are contained in g. Likewise, if switch 1 is set to point w (θ=0°) the outputs of phase detectors 11 and 12 are signals X B  and Y B , respectively. 
     
         X.sub.B =c+B cos φ.sub.B                               (11) 
    
     
         Y.sub.B =h=B(1+α) sin (φ.sub.B +ε)       (12) 
    
     Although this prior art phase detection method is faster than the prior art method first discussed above with reference to FIG. 1, it disadvantageously produces errors α and ε in the measurement of the absolute magnitude of the vector voltage ratio of E 2  /E 1  and in the measurement of signals X and Y. 
     The prior art phase detection apparatus shown in FIG. 5 may also be used in the performance of the method in accordance with the illustrated preferred embodiment of the present invention. If E 4  =sin (ωt-θ) and E 5  =(1+α) cos (ωt-θ-ε), then accurate measurements may be obtained from phase detectors 11 and 12 by phase shifting θ successively and accurately by a predetermined amount. θ and the total number of the measurements, N, are related by: 
     
         θ=i(1π/N),                                        (13) 
    
     wherein i is varied from 0 to N-1. For instance, if N=4 (i=0, 1, 2, 3), the phase detection measurement is made four times with θ shifted by 90° between succeeding measurements. Thus, X A  and Y A  are related by: ##EQU3## The vector voltage ratio between the unknown signals E 1  and E 2  is: ##EQU4## 
     For N=4, the four terms X A , Y A , and X B , Y B , are each measured at θ=0°, 90°, 180° and 270°, and four values of E 2  /E 1  are computed and the four values are then averaged in accordance with Equation 16. Thus, for N=4, the α and ε errors can each be reduced by a factor of approximately fifty, thereby improving the precision of the measurement by the same factor. For N=8, the α and ε errors can each be reduced by a factor of approximately 250,000. 
     Outputs circuits 14 and 15, shown in FIG. 5, include dual slope analog to digital converters which operate as is shown in FIGS. 7A-B for N=4. FIG. 7A shows the sequence of operations performed by the analog to digital converter of output circuit 14 and FIG. 7B depicts the sequence of operations performed by the analog to digital converter of output circuit 15 for the condition in which the switch 1 is set to point v. 
     The digital measurement of time intervals T 6  -T 13  digitizes terms X A  and Y A  by means of dual slope integration. The digitized X A  and Y A  terms may then be supplied to an arithmetic logic unit (not shown) for calculation of the desired phase or impedance quantity to a high degree of accuracy. 
     Because two phase detectors are used in the method according to the prepared embodiment of the present invention, instead of one as in the prior art methods, twice as much time may be spent on the measurement of each of the in-phase and quadrature components. Thus, for the same measurement speed as that obtained in the prior art, the measurement signal-to-noise ratio may be improved by a factor of two. Conversely, measurement speed may be doubled for the same measurement signal-to-noise ratio. 
     FIG. 8 is a flow chart of the steps of the method in accordance with the illustrated preferred embodiment of the present invention. In steps 33 and 35, the signals E 1 , E 4  and E 5  are applied to the two phase detectors 11, 12 shown in FIG. 5 by setting switch 1 to position v. Signals E 4  and E 5  are identical except that there is a relative phase shift of 90° therebetween. In step 37, N is selected for the desired increment by which successive phase shifts are to be made to signals E 4  and E 5 . In step 39, i is initialized. In step 41, the successive phase shift from the preceeding measurement set is made to signals E 4  and E 5 . Of course, in the initial measurement set the phase shift is zero. 
     In step 43, the desired measurements are made. Well-known dual slope integration techniques, such as that disclosed in U.S. Pat. No. 4,196,475 (incorporated herein by reference) and in &#34;An AC-DC Ratiometer And It&#39;s Use In A CRL Meter&#34; by Henry Hall in the December, 1973, IEEE Transactions on Instrumentation and Measurements, may be used. As described above, it may be desirable to measure the two quantities (defined in Equations 9 and 10) X A , Y A . In steps 45 and 47, i is incremented and new measurement sets are made if i is less than N. These new measurement sets are made with the phases of signals E 4  and E 5  shifted as defined above with respect to Equation 13. 
     Once i reaches N, no more measurement sets are made and, in step 49, the N individual computations of equation 16 are made for i=0 through i=N-1. Finally, in step 51, the average of Equation 16 over the N computations is made. Before step 49, the steps 31-47 may be repeated for signals E 2 , E 4 , E 5  in order to measure the in-phase and quadrature components of the signal E 2  in the manner in which the in-phase and quadrature components of the signal E 1  were measured.