Abstract:
Phase of first and second signals is compared by producing an output signal in the event of a predetermined phase relationship between the first and second signals and clearing the output signal at a predetermined phase during the cycle of the second signal regardless of the state of the first signal.

Description:
BACKGROUND OF THE INVENTION 
     This invention relates to a phase comparator for a biphase coded signal including a preamble with code violation. 
     One form of data coding is known as biphase coding. In biphase coding, a signal epoch is divided into time slots by a clock, and one source data bit occupies a single time slot. Each source data bit may be represented by a two-cell doublet. Each coding doublet begins, and therefore also ends, with a transition. A source data bit one generates a transition between the two cells of the doublet, whereas a source data bit zero does not. Thus, a source data bit zero is represented either as the doublet zero zero or the doublet one one, while a source data bit one is represented either by the doublet one zero or the doublet zero one. 
     In order to recover data from a biphase coded signal, it is necessary first to extract clock information from the signal. The biphase signal (FIG. 1, waveform A) is first differentiated and rectified, by applying the biphase signal and a delayed version thereof to respective inputs of an exclusive OR gate 2, so as to produce a signal (waveform B) that has one pulse for each transition of the biphase coded signal. The resulting pulse train is applied to a non-retriggerable one-shot 4 having a shot duration equal to approximately 75% of the clock period. On the pulse representing the second transition of the first source data bit zero (and the first transition of the next source data bit), the one-shot is set and its output remains high for 75% of the next clock period. If the next source data bit is also zero, the one-shot is set by the pulse representing the transition at the end of that bit, and if the next source data bit is one, the one-shot filters out the pulse that occurs between the two cells of the doublet and is set again by the pulse representing the transition at the end of that source data bit. The output of the one-shot is therefore a pulse train at the data clock frequency and having a 75% duty cycle (FIG. 1, waveform C). 
     As also shown in FIG. 1, the output of the one-shot may be applied to one input of a phase comparator 6 that is connected in a phase lock loop that also includes a voltage-controlled oscillator (VCO) 8, a frequency divider 10 and an inverting integrating error amplifier 12, connected as shown. The frequency range of the output signal of the VCO includes four times the clock frequency and the frequency divider 10 divides the frequency of the output signal of the VCO 8 by a factor of four. 
     The phase comparator examines the phase difference between the input signal and the feedback signal provided by the VCO 8 and provides an error signal representative of the phase difference. The error signal acts through the error amplifier to keep the feedback signal synchronized to the input signal. 
     The phase comparator comprises two D flip-flops 20 and 24, each receiving a logical one at its D input. The flip-flop 20 receives the input signal fin (the output of one-shot 4) at its clock input, and the flip-flop 24 receives the feedback signal f fb  provided by the VCO 8 and the frequency divider 10. The Q output of the flip-flop 20 is connected through an inverter 22 to the cathode of a diode 26, whose anode is connected to the error amplifier through a resistor 38, and the Q output of the flip-flop 24 is connected to the anode of a diode 28, whose cathode is connected to the error amplifier through a resistor 40. The Q outputs of the two flip-flops are connected as respective inputs to an AND gate 30, whose output is connected to the reset inputs of the flip-flops. 
     Operation of the phase comparator shown in FIG. 1 can be understood by considering the condition in which the feedback signal is at about the same frequency as the input signal but is not synchronized with the input signal. In this condition, a single clocking transition of the feedback signal will occur between each two successive clocking transitions of the input signal. If it is assumed that the two flip-flops are in the reset condition (both Q20 and Q24 are low) and that the next clocking transition that is received by the phase comparator is a transition of the input signal fin (FIG. 2A), flip-flop 20 is set high before flip-flop 24. During the time interval between the input signal transition and the subsequent feedback signal transition, the output of flip-flop 20 remains in the set condition while the output of flip-flop 24 remains in the reset condition. Consequently, inverter 22 pulls charge through diode 26 from the error amplifier during this time interval. Since the error amplifier is an inverting amplifier, the control voltage applied to the VCO 8 increases, so that the transitions of the feedback signal are advanced in time relative to what would happen if the control voltage remained constant. In this condition, the input signal f in  is said to lead the feedback signal. When the clocking transition of the feedback signal is received by flip-flop 24, AND gate 30 resets both flip-flops and inverter 22 stops pulling charge from the error amplifier. Conversely, if the next clocking transition received by the comparator when both flip-flops are in the reset condition is a transition of the feedback signal (FIG. 2B), then flip-flop 24 pumps charge through diode 28 into the error amplifier during the time interval between the feedback signal&#39;s clocking transition and the subsequent transition of the input signal. The control voltage applied to the VCO decreases, so that the transitions of the feedback signal are retarded in time. The input signal is said to lag the feedback signal. In this fashion, the phase comparator operates to adjust the VCO to synchronize the output signal of the frequency divider with the input signal (FIG. 2C) and the phase lock loop produces a regenerated clock that is coherently related to the clock information in the biphase coded signal and can be applied to a data recovery flip-flop 14 to recover data from the biphase coded signal. 
     The conventional phase comparator shown in FIG. 2 has a capture range of almost +/-2 π relative to the cycle of the feedback signal, i.e. the input signal can lead or lag the feedback signal by up to 2 π and the phase comparator will still function in the manner described above. If the input signal is leading (or lagging) the feedback signal by an angle approaching 2 π, and the angle increases to 2 π+Δ, the phase lock loop&#39;s behavior changes to treat the input signal as lagging (leading) the feedback signal by 2 π-Δ. 
     The Audio Engineering Society/European Broadcasting Union datastream for digital audio data consists of a biphase coded signal in which each audio sample is represented by a subframe containing 32 time slots. The Audio Engineering Society and European Broadcasting Union standards do not prescribe the clock frequency of the biphase coded signal used for the digital audio datastream. In different applications, clock frequencies ranging from 1.792 MHz to 3.456 MHz are employed. 
     In accordance with the Audio Engineering Society/European Broadcasting Union standards, the first four time slots of each subframe constitute a preamble containing at least one occurrence of the three cell sequence zero zero zero or one one one. This brief departure from the usual biphase coding rules is known as a code violation. If the circuit shown in FIG. 1 is used to extract clock information from an AES/EBU signal, the code violation results in a momentary change in the frequency of the clock signal provided by the one-shot 4, and in pumping of excess charge into, or pulling of excess charge from, the error amplifier 4. So long as the time constant of the error amplifier exceeds the duration of the preamble, the code violation does not cause the phase lock loop to lose lock. Nevertheless, the code violation causes an increase in jitter, and this can affect the accuracy with which data is extracted. 
     A duty-cycle sensitive phase comparator may be used in the circuit shown in FIG. 1 instead of the edge sensitive phase comparator 6 to provide improved immunity to the code violation, but this measure is subject to the disadvantage that the capture range of a duty-cycle sensitive phase comparator is only +/-π relative to the period of the feedback signal, so that if the input signal leads or lags the feedback signal by an angle greater than π radians, the phase lock loop cannot acquire lock. 
     The VCO 8 might be implemented using a crystal controlled oscillator, in which case the gain of the VCO (in radians per volt) is sufficiently small that the change in the control voltage due to the code violation would not normally disturb operation of the phase lock loop to such an extent as to prevent accurate recovery of data. However, a phase lock loop with a crystal controlled oscillator cannot operate over the frequency range from 1.792 MHz to 3.456 MHz. 
     A VCO that is implemented using an LC oscillator can operate over a much wider range of frequencies than a crystal controlled oscillator, but the gain of such a VCO is substantially higher than that of a crystal controlled oscillator so that although the code violation might not cause the phase lock loop to lose lock with the input signal, the amount of jitter introduced by the violation could interfere with accurate data recovery. 
     SUMMARY OF THE INVENTION 
     In accordance with a first aspect of the present invention there is provided a method of comparing phase of first and second signals, said method comprising producing an output signal in the event of a predetermined phase relationship between the first and second signals, and clearing the output signal at a predetermined phase during the cycle of the second signal regardless of the state of the first signal. 
     In accordance with a second aspect of the invention there is provided a method of comparing phase of first and second signals, wherein the first signal is composed of periodic frames each comprising a preamble and a data interval, said method comprising (a) producing an output signal according to the phase relationship between the first and second signals, and (b) disabling step (a) during the preamble of the first signal. 
     In accordance with a third aspect of the invention there is provided an apparatus for comparing phase of first and second signals, comprising means for producing an output signal in the event of a predetermined phase relationship between the first and second signals, and means for clearing the output signal at a predetermined phase during the cycle of the second signal regardless of the state of the first signal. 
     In accordance with a fourth aspect of the invention there is provided a phase comparison apparatus comprising a phase comparator means for receiving a first periodic signal having a first frequency, a second periodic signal having a second frequency closely matching said first frequency and a mask signal having an enable state and a disable state, and wherein said phase comparator means is operative to produce an output signal according to the phase relationship between the first periodic signal and the second periodic signal when the mask signal is in the enable state. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     For a better understanding of the invention, and to show how the same may be carried into effect, further reference will be made by way of example, to the accompanying drawings in which: 
     FIG. 1 is a diagram of a conventional circuit for extracting clock information from a biphase coded signal; 
     FIGS. 2A, 2B and 2C are timing diagrams illustrating operation of the circuit shown in FIG. 1; 
     FIG. 3 is a diagram of circuit embodying the invention; 
     FIG. 4 is a timing diagram illustrating certain aspects operation of the circuit shown in FIG. 3; and 
     FIG. 5 is a timing diagram illustrating other aspects of operation of the circuit shown in FIG. 3. 
    
    
     In the several figures of the drawings, like reference numerals designate like components. 
     DETAILED DESCRIPTION 
     The circuit illustrated in FIG. 3 comprises a clock extraction circuit 34, which may be as shown in FIG. 1. The clock extraction circuit 3 receives a biphase coded signal in accordance with the AES/EBU standard at its input. As shown in FIG. 5, the biphase coded signal is composed of periodic frames 60 (FIG. 5, waveform A) and each frame comprises a preamble 62 and a data interval 64 (FIG. 5, waveforms B and C). The clock extraction circuit 34 provides a 75% duty cycle extracted clock signal (FIG. 5 waveform D) at its output. The extracted clock signal is applied to one input of a phase comparator 6&#39; that is connected in a phase lock loop with an error amplifier 12, a VCO 8 and a frequency divider 10&#39;. 
     The frequency divider 10&#39; comprises two flip-flops 41, 42 that receive the signal f vco  provided by the VCO 8 at their clock inputs. The Q output of flip-flop 41 is connected to the inputs of inverters 46 and 47. The output of inverter 46 is tied to the D input of flip-flop 41. The Q output of flip-flop 41 is a pulse signal at one-half the frequency of the signal f vco . 
     The output of inverter 47 is tied to one input of an exclusive OR gate 52. The Q output of the flip-flop 42 is connected to the other input of the exclusive OR gate 52. The output of exclusive OR gate 52 is tied to the D input of flip-flop 42. The output signal from flip-flop 42 is the feedback signal f fb  and has a frequency one-fourth that of the signal f vco . The rising transitions of the feedback signal f fb  are delayed relative to rising transitions of the signal f vco  by one flip-flop clock-to-output propagation delay but this delay is not shown in FIG. 4 because it is not germane to the invention. The Q output of flip-flop 41 is connected to the clock input of a decoder 36, which receives the AES/EBU signal at its input, and to one input of an AND gate 54. The decoder 36, which may comprise a shift register and combinational logic elements, clocks the input datastream at twice the frequency of the AES/EBU clock. The decoder detects three consecutive samples of the same value followed by one of the opposite value, i.e. the sequence 1110 or the sequence 0001, and provides an output signal f pre  that is high during the preamble of the AES/EBU signal and is otherwise low. The signal f pre  is inverted to provide a preamble mask signal f msk  (FIG. 5, waveform E). 
     The Q output of flip-flop 42 is connected via an inverter 48 to the second input of the AND gate 54. The output of AND gate 54 is connected to the D input of flip-flop 43. The signal f vco  is also applied to the clock input of the flip-flop 43 via an inverter 49 and therefore flip-flop 43 operates on falling transitions of the signal f vco . The output signal from flip-flop 43 is a control signal f rst  at the same frequency as the feedback signal f fb  and having a 25% duty cycle. The rising transition of the control signal f rst  occurs about three-eighths period before the next rising transition of the feedback signal. Propagation delays in flip-flop 43 are not shown in FIG. 4. The frequency divider 10&#39; thereby not only divides the frequency of the signal f vco  by four to produce the signal f fb  but also divides the period of the signal f fb  into two intervals, depending on the state of the signal f rst . 
     The phase comparator 6&#39; is the same as that shown in FIG. 2 except that it includes an OR gate 32 that is connected between the output of the AND gate 30 and the reset input of flip-flop 24 and receives the control signal f rst  at its second input, and the D inputs of flop-flops 20, 24 are not connected to a logical one level but to the inverted output of the decoder 36. 
     When the signal f fb  is not locked to the signal f in , the code violation is generally not detected and accordingly f pre  remains low and the D inputs of flip-flops 20, 24 remain high. The preamble occupies four time slots in each subframe of the AES/EBU signal. Since the signal f fb  has one clocking transition for each time slot (assuming its frequency is close to the clock frequency of the AES/EBU signal), the signal f fb  has four clocking transitions during the preamble. The code violation results in the signal f in  having only three clocking transitions during the preamble. Therefore, during the preamble the flip-flop 24 will be set more often than the flip-flop 20. The signal f rst  ensures that flip-flop 24 is reset once per cycle of the signal f fb , regardless of the state of the signal f in , and thereby prevents the flip-flop 24 from adding excessive charge to the loop filter during the preamble, thereby delaying acquisition of lock. 
     When lock has been acquired, the decoder 36 is able to detect the code violation. Accordingly, the signal f msk , which is applied to the D inputs of the flip-flops 20, 24, is held low during the preamble, and so neither flip-flop is placed in the set condition and no charge is sent into or out of the error amplifier 12. In this manner the phase comparator 6&#39; is disabled during the preamble of the AES/EBU input signal and so the code violation is prevented from disturbing the synchronization of the VCO with respect to the input datastream as shown in FIG. 5 by the waveform F. 
     When lock has been acquired and the preamble mask signal f msk  is high, the D inputs of flip-flops 20 and 24 are loaded waiting for clocking transitions from the input signal f in  and the feedback signal f fb . When flip-flop 20 receives a clocking transition from the input signal f in , its output Q20 is set high; likewise the output Q24 of flip-flop 24 is set high upon receiving a clocking transition from the feedback signal f fb . Once the outputs of flip-flops 20 and 24 are clocked high, the AND gate 30 receives two ones at its inputs and produces a one at its output. Therefore, flip-flops 20 and 24 are both reset shortly after both clocking transitions have been received, as in the case of FIG. 1. However, due to the propagation delay in OR gate 32, Q24 will remain high slightly longer than Q20, and more charge will be pumped into than pulled from the error amplifier 12. This would tend to disturb lock, but may be compensated by selecting a slightly greater resistance value for resistor 40 than for resistor 38. 
     If the decoder 36 fails to detect a code violation when lock has been achieved, so that the flip-flops 20, 24 remain enabled during the preamble, the signal f rst  will function to reset flip-flop 24 and prevent excess charge being pumped into the error amplifier due to the greater number of clocking transitions in signal f fb  than in signal f in . 
     It will therefore be seen that both the signal f rst  and the signal f msk  act to limit the energy that can be introduced into the error amplifier due to the code violation. In this manner, the phase lock loop is effectively immunized from the violation, and accordingly the VCO 8 can be implemented using an LC oscillator without the feedback signal being subject to substantial jitter that would interfere with data recovery. Accordingly, the illustrated phase lock loop is able to lock to signals having a wide frequency range. 
     It will be appreciated that the capture range of the phase lock loop shown in FIG. 3 is from the signal f fb  lagging the signal f in  by up to 2 π to the signal f fb  leading the signal f in  by up to 1.25 π, but this is still better than can be achieved using a duty-cycle sensitive phase comparator. 
     It will be appreciated that the invention is not restricted to the particular embodiments that have been described, and that variations may be made therein without departing from the scope of the invention as defined in the appended claims and equivalents thereof.