Abstract:
A circuit for measuring the frequency of an electrical signal includes a detector that senses a reoccurring phase point the electrical signal. A divide-by-M counter is connected to the detector and produces a control signal upon every Mth occurrence of the indication, where M is a positive number greater than one. A clock signal generator is provided. An output counter counts cycles of the clock signal between occurrences of the control signal and divides the count by M to produce an output count that corresponds to the frequency of the electrical signal.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to apparatus which measure the frequency of an electrical signal; and particularly to such apparatus which detect a predefined reoccurring characteristic of the electrical signal. 
     The frequency of an electrical signal is measured by detecting a given reoccurring characteristic, such as a maximum, minimum or zero crossing point, in the signal waveform. The amount of time the elapses between each occurrence of such a signal characteristic indicates the period of the signal, which parameter corresponds to the frequency. 
     For example, a sinusoidal signal has two zero crossings per cycle, i.e. one crossing at the beginning of the cycle and another at the mid point of the cycle; of course there is another zero crossing at the end of the cycle when another signal cycle begins. Detecting one zero crossing per cycle can be employed to determine the frequency or the period of the signal. 
     Circuits have been developed to detect zero crossings of a signal. However, such prior circuits detected every zero crossing and could not distinguish the zero crossing at the beginning of a cycle from the one at the cycle mid point. 
     SUMMARY OF THE INVENTION 
     A general object of the present invention is to provide an electrical circuit which indicates frequency by detecting a predefined characteristic which regularly occurs in a periodic signal. 
     Another object is to provide a detection circuit that is able to distinguish the zero crossing at either the beginning or mid point of a signal cycle from the other zero crossing of the cycle. 
     A further object of the present invention is to average the time which elapses between several consecutive occurrences of the predefined signal characteristic over several signal cycles to negate effects that sporadic events may have on the frequency determination. 
     These and other objects are satisfied by a circuit for measuring the frequency of an electrical signal includes a detector that senses a reoccurring phase point the electrical signal. The detector comprises a divide-by-M counter is connected to the detector and produces a control signal upon every Mth occurrence of the indication, where M is a positive number greater than one. A clock signal generator is provided. An output counter counts cycles of the clock signal between occurrences of the control signal and divides the count by M to produce an output count that corresponds to the frequency of the electrical signal. 
     In the preferred embodiment of the present invention the detector comprises a rectifier stage that produces first and second complementary signals from a periodic input signal. A Schmitt circuit has an input which is coupled to the rectifier stage and produces a first intermediate signal in response to voltage variation of the first complementary signal. A complementary Schmitt circuit has an input connected to the rectifier stage and produces a second intermediate signal in response to the voltage level of the second complementary signal. 
     The Schmitt circuit is characterized by a voltage hysteresis transfer function which produces one of two discreet output voltages, e.g. circuit ground potential or Vcc, depending upon the relationship of the input voltage to lower and upper thresholds. As the input voltage increases from ground potential, the output voltage remains at ground potential as long as the input voltage is below the upper threshold. When the input voltage exceeds the upper threshold, the output voltage switches to Vcc where it remains until the input voltage falls below the lower threshold at which time the output voltage returns to ground potential. 
     The complementary Schmitt circuit functions whereby the output voltage remains at ground potential until the increasing input voltage level reaches the lower threshold when the output voltage switches to Vcc. Thereafter, the output voltage remains at Vcc until the input voltage level first exceeds and then decreases below the upper threshold at which occasion the output voltage returns to ground potential. 
     An output stage is connected to the Schmitt circuit and to the complementary Schmitt circuit to receive the first and second intermediate signals. The output stage responds to the relationship of the first and second intermediate signals by producing an output signal that indicates each occurrence of the reoccurring characteristic in the periodic input signal. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a schematic circuit diagram of a signal phase detector according to the present invention; 
     FIGS. 2A through 2J depict waveforms of signals at selected places in the signal phase detector of FIG. 1; and 
     FIG. 3 is a schematic diagram of a circuit which measures the period of a signal by using the present signal phase detector. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     With initial reference to FIG. 1, a phase detector, generally designated 10, has a pair of input terminals 11 and 12 across which is applied an electrical signal for processing. Although the phase detector is being described in terms of processing a time periodic electrical signal and detecting a reoccurring point, such as a zero crossing, in that signal, phase detector 10 can be used to detect an occurrence of a predefined point in other types of signals. 
     Terminals 11 and 12 are part of an input stage 13 which includes a pair of half-wave rectifiers formed by diodes D1-D4 that produce complementary DC signals at nodes N1 and N2. The rectified signals are scaled in attenuator circuits comprising resistors R1 and R2 along with Zener diode D5 for one circuit branch, and resistors R6 and R7 in conjunction with Zener diode D6 for the complementary branch. The attenuation produces signal levels which are compatible with the subsequent digital logic of a Schmitt circuit 14 and a complementary Schmitt circuit 15. 
     The Schmitt circuit 14 receives the signal from node N2 and applies that signal via resistor R3 to the non-inverting input of a first voltage comparator 16. A first reference voltage, produced by voltage divider 18, is applied to the inverting input of the first voltage comparator 16. The output of the first comparator 16 is applied through resistor R4 to the base of an NPN transistor Q1, which has an emitter connected directly to ground and a collector connected by resistor R5 to a source of positive voltage Vcc. 
     The collector of transistor Q1 also is connected to the input of an inverter 19 having an output at node N5 that is connected to the CLOCK input of a first D-type flip-flop 20. The D input to flip-flop 20 is tied to the positive voltage Vcc and the SET input is clamped to ground. The Q output of flip-flop 20 is directly connected to the RESET input of a second, or output, D-type flip-flop 22. 
     Returning to the input stage 13 of the phase detector 10, node N1 is connected to the input of the complementary Schmitt circuit 15. Specifically, resistor R8 couples node N1 to the non-inverting input of a second voltage comparator 24 which has an inverting input that receives a second reference voltage from voltage divider 26. The output of the second voltage comparator 24 is coupled by resistor R9 to the base of transistor Q2 which has an emitter connected directly to ground and a collector connected by resistor R10 to positive voltage Vcc. The collector of transistor Q2 also is connected to the input of a second inverter 28 which produces an output that is coupled at node N3 to the clock input of a third D-type flip-flop 30. The D input of the third flip-flop 30 is directly connected to the positive voltage Vcc, while the SET input is tied to ground. The Q output of the third flip-flop 30 is coupled via node N6 to the RESET input of the first flip-flop 20. 
     The Q output of the third flip-flop 30, at node N7, is applied to the clock input of the second flip-flop 22. The D input of the second flip-flop 22 is clamped to positive voltage Vcc and the SET input is tied to ground. The Q terminal of the second flip-flop 22 produces the output signal for the phase detector 10, as will be described. 
     Referring again to the input of the complementary Schmitt circuit 15, node N1 of the input stage 13 also is coupled by resistor R11 to the non-inverting input of a third voltage comparator 32. Voltage divider 34 produces a third reference voltage is applied to the inverting input of the third voltage comparator 32. The output of the third voltage comparator 32 is coupled through resistor R12 to the base of transistor Q3 which has an emitter tied directly to ground and a collector coupled by resistor R13 to supply voltage Vcc. The collector of transistor Q3 also is connected at node N4 to the RESET input of the third flip-flop 30. 
     The operation of the phase detector 10 will be described with reference to the circuit diagram in FIG. 1 and the waveform diagrams in FIGS. 2A-2J. Although a sinusoidal input signal is depicted in FIG. 2A, it is understood that the present invention can be utilized with other types of waveforms with a substantially constant first derivative in the region of the zero crossing point. The input signal is applied across terminals 11 and 12 and is partitioned by the pair of half-wave rectifiers, diodes D1-D4, into the two complementary signals at nodes N1 and N2 having the waveforms shown in FIGS. 2B and 2C. The signals at nodes N1 and N2 are applied to complementary Schmitt circuit 15 and the Schmitt circuit 14, respectively. 
     The Schmitt circuit 14 is characterized by a voltage hysteresis transfer function which produces one of two discreet output voltages, e.g. circuit ground potential or Vcc, depending upon the relationship of the input voltage to lower and upper thresholds. As the input voltage increases from ground potential, the output voltage remains at ground potential as long as the input voltage is below the upper threshold. When the input voltage exceeds the upper threshold, the output voltage switches to Vcc. Thereafter, the output voltage remains at Vcc until the input voltage falls below the lower threshold at which time the output voltage returns to ground potential. 
     In contrast, the complementary Schmitt circuit 15 operates whereby the output voltage remains at ground potential until the increasing input voltage level reaches the lower threshold when the output voltage switches to Vcc. Thereafter, the output voltage remains at Vcc until the input voltage level first exceeds and then decreases below the upper threshold at which occasion the output voltage returns to ground potential. 
     The Schmitt circuit 14 receives the signal at node N2 (FIG. 2C) and comparator 16 determines whether that signal exceeds a reference voltage level set by voltage divider 18. When that occurs the comparator 16 produces a high logic level output which turns on transistor Q1. When Q1 is conductive, the input to inverter 19 is grounded producing a high logic level at node N5 (FIG. 2F) which is applied to the clock input of the first flip-flop 20. The comparator 16 and associated output circuits produce the digital equivalent of the rectified input voltage at node N8. That is, the voltage at node N5 is a high logic level during the positive half cycle of the input signal applied across terminals 11 and 12. The rising edge of the waveform at node N5 causes the Q output of the first flip-flop 20 to go high as shown in the waveform for node N8 (FIG. 2I). This output signal from the Schmitt circuit 14 resets the second flip-flop 22 causing the output signal for the phase detector 10 to go to a low logic level, as shown in FIG. 2J. 
     At the same time, the complementary rectified input signal produced at node N1 (FIG. 2B) is applied to the input of the complementary Schmitt circuit 15. That signal is applied to a similar voltage comparator 24 to produce a digital equivalent of the rectified input voltage at node N3, as depicted in FIG. 2D. This digital equivalent is fed to the clock input of the third flip-flop 30. The rising edge of the waveform at node N3 causes the Q output of the third flip-flop 30 (FIG. 2G) to go to a high logic level. The Q output of the third flip-flop 30 at node N6 is connected to the RESET input of the first flip-flop 20 thereby causing the Q output of the first flip-flop at node N8 to go to a low logic level, as shown in FIG. 2I. Simultaneously, the Q output of the third flip-flop 30 as shown in the waveform at node N7 (FIG. 2H) goes low. 
     The complementary rectified signal at node N1 (FIG. 2B) also is applied to the third voltage comparator 32 within the complementary Schmitt circuit 15. This comparator 32 receives a reference voltage level from voltage divider that is lower than the reference voltage produced by voltage divider 26 and is applied to the second comparator 24 within complementary Schmitt circuit 15. As a consequence, the output of the third comparator 32 will go high before the output of the second comparator 24. The output of the third comparator 32 is inverted by resistor R13 and transistor Q3 to produce a waveform at node N4 as shown in FIG. 2E. This inverted waveform was applied to the RESET input of the third flip-flop 30. As a consequence, when the signal at node N1 falls below the reference voltage threshold produced by voltage divider 34, the voltage level at node N4 goes high resetting the third flip-flop 30. That action produces a low logic level at the Q output of the third flip-flop 30 (node N6) and a high logic level at the Q output (node N7). 
     In response to the signals from the two Schmitt circuits 14 and 15, the second flip-flop 22 produces a positive pulse at its Q terminal (OUT) upon the occurrence of the zero crossing at the beginning (0° phase) of each cycle of the input signal to the phase detector 10. There is no equivalent pulse at the mid cycle (180° phase) zero crossing of the input signal. Note that the 0° phase zero crossing of the input signal occurs at the center of the output signal pulse, thus the output pulse provides an accurately timed indication of the input signal phase. 
     By reversing the connection of nodes N1 and N2 to the Schmitt circuit 14 and complementary Schmitt circuit 15, the output pulses of the phase detector 10 will indicate the occurrence of a zero crossing at the 180° point of the input signal cycle. In this version of the phase detector, node N1 is connected to the input of the Schmitt circuit 14 and node N2 is connected to the input of the complementary Schmitt circuit 15. The present phase detector also can be configured to produce the output pulses at the maximum or minimum points of the input signal waveform. 
     FIG. 3 shows the use of the present phase detector to determine the period of a signal. That signal on line 50 is applied to the input terminals of a phase detector 52 of the type shown in FIG. 1. As noted previously, the phase detector 52 produces an output signal on line 54 whenever a predetermined point, such as at zero phase, occurs in the signal. Although one could simply measure the amount of time occurring between two consecutive pulses at the output of the phase detector 52, a more accurate determination of the signal period is produced by measuring the times between a defined number of consecutive output pulses from the phase detector 52 and averaging those times. 
     To this end, the output line 54 from the phase detector 52 is connected to the input of a first binary counter 56 which determines when the defined number (2 N ) of signal periods to be averaged have occurred. For example, when 64 signal periods are being averaged, N equals 6. The first binary counter 56 may be a implemented using any of several commercially available integrated circuits. The resultant count of input signal periods is produced by the first counter 56 on a plurality of binary output lines. The output line for the lowest order, or first bit, of the counter output is connected to the start control input of a second binary counter 58, and the output line of the first binary counter 56 for the Nth bit is connected to the stop control input of the second binary counter 58. 
     The CLOCK input to the second binary counter 58 is connected to the output of a oscillator clock circuit 60 which operates at a relatively high frequency as compared to the frequency of the input signal being measured on line 50. Thus ensures that the second binary counter, which counts the cycles of the CLOCK signal, will have a sufficient resolution to properly measure variations in the period of the input signal. The second binary counter 58 is configured to divide the count of CLOCK signal pulses by the number of input signal periods 2 N  which are being averaged. Because the number of input signal periods is a power of 2, the averaging is accomplished by ignoring the binary output lines of the second counter 58 which are below the value of 2 N . That is the lowest order bit for the quotient is the Nth output bit of the second counter 58. The higher order bits (above the Nth bit) form the remaining binary bits of the quotient. 
     The selected output lines of the second counter 58 are connected as inputs to a display circuit 62, The display circuit 62 also receives the Nth bit from the first binary counter 56 which indicates when 2 N  periods of the input signal have been received and thus when the output of the second binary counter 58 indicates the average input signal period. In response to the Nth bit from the first binary counter 56, the display circuit 62 converts the binary output from the second counter 58 into the decimal equivalent and applies it to drivers for display elements. Thus the display 62 presents to the user the average period of the input signal in terms of a count of the pulses from the clock circuit 60. By judiciously selecting the frequency of the CLOCK signal, the displayed period may have a known time relationship. For example, a clock frequency of 1 kilohertz would result in an output display in which the numerical value is a count of thousandths of a second which is easily displayed in a decimal format. 
     One skilled in the art would also appreciate that the circuit in FIG. 4 could also be utilized to determine the frequency of the input signal on line 50 by inverting the period measurement.