METHOD AND APPARATUS FOR DETECTING A SEQUENCE OF CLOCK REFERENCE PULSES

Abstract: A clock run-in sequence of equally spaced similar input pulses is sampled at a much higher frequency and the samples converted to single bits. The resulting sequence of bits is fed into a shift register (7) the stages of which are connected to logic means (8) which produces indications when the bits stored in the register represent a centrally located input pulse or space between input pulses. The clock pulses driving the sampler are fed to frequency divider (18) which produces the local clock signal. The local clock signal is synchronised with the clock run-in sequence by deriving the average phase of the frequency divider at a number of indications and adjusting the phase of the divider accordingly.

Description: METHOD AND APPARATUS FOR DETECTING A SEQUENCE OF CLOCK REFRENCE PULSES This invention relates to a method and apparatus for the detection of a clock run-in sequence of equally spaced similar input pulses to derive therefrom a control signal for a locally generated clock signal. In teletext systems the data to be displayed as pages of information on the screen of a television receiver is conveyed in digital form in one or more of the lines of the composite video signal which are not used to convey video information for the conventional television picture. The digital data is coded in binary non-return to zero form and is preceded by a so-called clock run-in signal consisting of alternating ones and zeros and which appears as a succession of equally spaced pulses. A typical clock run-in sequence has eight such pulses. From the clock run-in sequence the phase of a locally generated clock is adjusted so that the decoding of the remainder of the digital data is correctly performed. Difficulties in synchronising locally generated oscillations with the incoming data arise from distortion and corruption by spurious noise pulses of the clock run- in sequence and it is an object of the present invention to provide an improved method and apparatus for detecting the clock run-in sequence and for synchronising the locally genera ad oscillation to the incoming data. According to one aspect of the present invention there is provided apparatus responsive to a clock run-in sequence of equally spaced similar input pulses for a binary data packet to derive therefrom a control signal for a locally generated clock signal, the apparatus including means for sampling the input pulses at much higher rate than the pulse repetition rate, means for comparing the samples with a threshold voltage and for producing a single bit output for each sample which depends on whether or not the sample exceeds the threshold, correlator means connected to receive the output bits in sequence from the comparing means and producing indications of the times of occurrence of the midpoints of the input pulses, oscillator means, divider means responsive to an oscillation from the oscillator means to provide the clock signal, and phase comparison means for comparing the phase of the clock signal from the divider means with the indications from the correlator means and producing a phase adjustment signal which is applied to the divider means to adjust the phase of the clock signal. The correlator means may include shift register means storing a plurality of bits from the comparing means together with logic means connected to certain stages of the shift register means for producing signals the value of which is a maximum when the bits derived from a single input pulse are symmetrically disposed in the shift register means. The detection of the maximum may be achieved by storing the values derived by the logic means as they are produced and comparing each stored value with the next subsequent value, the maximum being indicated the first time that the next subsequent value falls below the stored value. The logic means may also be arranged to produce indications of the times of occurrence of the midpoints of the spaces between pulses, the additional indications being used by the phase comparison means to adjust the phase of the clock signal. The correlator means may include means for producing an inhibit signal for blocking the operation of the logic means. The threshold value used by the comparing means may start from an initial value substantially equal to zero and increase to a value near to that of the middle of the height of the input pulses. The phase comparison means may include means for generating windows at predetermined time intervals determined by the oscillator means after the production of an indication, means for ascertaining the phases of the divider means concurrent with the occurrence of a plurality of subsequent indications during the windows, means for forming the average of the ascertained phases and means for resetting the divider means to a phase dependent on the average phase. The phase comparison means may include a state machine and an arithmetic logic unit, the state machine serving to cause the divider means to generate at least one narrow window and a plurality of further wider windows and providing output signals of a first kind when the subsequent indications occur within a window and an output signal of a second kind when one of the subsequent indications falls outside the window. The output signals of the first kind from the state machine may cause the divider means to produce signals representing the ascertained phases and the output signals of the second kind may be used to reset the divider means for generating the windows and the means for forming the average of the ascertained phases. According to a second aspect of the present invention there is provided a method of detecting and deriving a control signal for a locally generated clock from a clock run-in sequence of equally spaced similar input pulses for a binary data packet, the method including sampling the input pulses at a much higher rate than the pulse repetition rate, comparing the samples with a threshold voltage and producing a single bit output for each sample which depends on whether or not the sample exceeds the threshold, correlating the output bits in sequence and producing indications of the times of occurrence of the midpoints of the input pulses, providing a locally generated clock signal by frequency dividing an oscillation, comparing the phase of the locally generated clock with the indications produced by the correlation, and producing a phase adjustment signal, and adjusting the phase of the locally generated clock signal using the phase adjustment signal. An example of apparatus responsive to a clock run-in sequence to derive therefrom a control signal for a locally generated clock signal, and its method of operation will now be described with reference to the accompanying drawings, of which;- FIGURE 1 is a block diagram of the apparatus; FIGURE 2 is the circuit diagram of the correlator shown in Figure 1; FIGURE 3 is a diagram illustrating the operation of the maximum correlation detector; and FIGURE 4 is a diagram of the state machine and its associated components. In the drawings the same reference numerals are used for the same component when it appears in different ones of the figures. For simplicity, the means to determine when to start looking for teletext data are not shown, it being assumed that the operation of the state machine 12 is controlled by a signal which starts the operation of the machine when the clock run-in of a packet of teletext data is expected. When the phase of the locally generated clock signal has been adjusted to be synchronised with the clock run-in sequence, the phase is held for the remainder of the data packet and the apparatus is disabled for that period. Referring now to Figure 1, composite television signals enter via a conductor 1 and are applied to a pulse cleaning-up circuit 2 which also receives clamp switch control signals via a conductor 3. The cleaned-up pulses from the circuit 2 are fed out to a 69.375 MHz sampler 5, the output of which takes the form of a 0 if the input signal level is below a threshold value and a 1 if the input signal is above that threshold value at the sampling instant and which is applied in serial form to a 20-bit shift register 7. The output of the sampler 5 is also applied to a conductor 4. The pulse repetition frequency of the teletext signal is 6.9375 MHz so that ten samples are taken from each pulse of the teletext signal by the sampler 5. For convenience in the following description the teletext p.r.f. is taken as 7 MHz and the sampling frequency as 70 MHz. The states of the stages of the shift register 7 are combined by logic means 8 which feeds two outputs to a maximum detector circuit 9. The first output is a 4-bit parallel code on conductors 10 which has a maximum value when a pulse or a space between pulses of the composite video input signal is most centrally disposed in the shift register 7. The second output which appears on a single conductor 11 is an inhibit signal which responds to combinations of the shift register stages to prevent the maximum detector circuit 9 from responding to values on the conductors 10 when a pulse or space is not centrally disposed in the shift register 7. When the maximum detector circuit 9 detects a maximum value on the conductors 10, it produces a strobe output on conductor 15 which is applied to the state machine 12, a strobe pulse counter 14 and a mean phase ALU (arithmetic logic unit) 16. The state machine 12 produces an output on conductors 13 and 17 when it has received a strobe signal within a locking window produced by a divide-by-10 counter 18. The "locked on" signal on the conductors 13 and 17 free the strobe pulse counter 14 and the mean phase ALU 16 to start responding to the strobe signals. The divide-by- 10 counter 18 receives 70 MHz clock pulses from clock 6 via a conductor 19 and executes repeated cycles of counting through the range 0 to 9 in response to those clock pulses. The phase of the counter 18 which is equal to the particular number in the range 0 to 9 which it has reached at the time, is applied in parallel form via conductors 20 to the main phase ALU 16. In addition to the lock window, the counter 18 produces track windows as well. The track windows are wider than the lock windows. The state machine 12 indicates via a conductor 23 whether the counter 18 is to produce a lock window or a track window and a signal indicating when the required window is open is fed from the counter 18 via the conductor 24 back to the state machine 12. For the adjustment of the phase of the counter 18, the state machine 12 feeds a signal via a conductor 25 to the counter 18. The mean phase ALU 16 applies a signal to the state machine 12 via a conductor 26 when the phase of the counter 18 is equal to the mean phase calculated by the ALU 16; that signal is used for bringing the counter 18 into synchronism with the clock run-in pulses received via the conductor 1. A clamping signal is fed from the state machine 12 via a conductor 27 to a clamp control circuit 28 for opening and closing the clamp in the pulse clean-up circuit 2. The counter 18 produces the 7 MHz teletext data clock on the line 30, which is connected to a gate 31 receiving the output of the sampler 5. The clock signal on the line 30 is of the phase to select the one of the ten bits from the sampler 5 that is most likely to be correct for each pulse from the clean-up circuit 2. The teletext data from the gate 31 appears on a conductor 32. In the operation of the apparatus shown in Figure 1, the overall control of the apparatus is effected by the state machine 12 which receives as inputs signals representing particular conditions in different parts of the apparatus and produces control signals for starting the next operation to be executed. The state machine itself may be constructed of dedicated hardware consisting of logical elements and interconnected latches. Alternatively, the state machine may consist of a suitably programmed processor. The clock run-in sequence which forms the start of a teletext data packet consists of the code 1010101010101010 in a non-return to zero code so that it appears as eight pulses separated by spaces of the same duration. The mark to space ratio may depart considerably from one to one, for example as a result of signal filtering and slicing, and the correlation technique used renders the circuit insensitive to such a distortion of the pulse sequence. Initially, the clamp switch of the pulse clean-up circuit is open with the video input AC coupled to a comparator circuit having a differential threshold value of zero. Just before the clock run-in pulses begin, the clamp switch is closed and as pulses are received so the threshold level of the comparator rises progressively over a few cycles to the mean value of the pulses. The clamp switch is opened again when the threshold voltage has reached the average of the clock run-in waveform so as to hold that level for the remainder of the data packet. The output pulses from the circuit 2 are sampled at 70 MHz by the sampler 5, that is to say at ten times for each pulse and ten times for each space of the clock run-in waveform. The output signals from the sampler 5 pass in sequence into the shift register 7 and the logic means 8 connected to the shift register 7 in conjunction with the maximum detector circuit 9 looks for symmetrical patterns of l's and 0's in the register 7. There are two ideal symmetrical patterns, one consisting of five 0's, then ten l's and a further five 0's, and the other consisting of five l's, then ten 0's and a further five l's. Both patterns correspond respectively to pulses and spaces of the input composite signals, as represented by the sample values, being centrally disposed in the register 7, and when these patterns are detected or the nearest to them that appears, the maximum being affected by low signal values or noise pulses, the maximum detector circuit 9 produces a strobe output. The state machine 12 on receiving a strobe output obtains from the divide-by-10 counter 18 a lock window around the expected time of occurrence of the next strobe pulse. If the first strobe pulse were caused by noise, then the second strobe pulse would be unlikely to occur within that window and the apparatus would reset and await another strobe pulse. On the other hand, if the first strobe pulse has been produced in response to the irst pulse of the clock run-in sequence, then the second strobe pulse, that produced in response to the first space between pulses in the input signals, would occur within the lock window, and when this is detected by the state machine 12 a locked-on pulse is produced which releases the strobe pulse counter 14 to count and the mean phase ALU 16 to operate. The counter 14 will count the 1 for that strobe pulse and the mean phase ALU 16 will add into its accumulator the phase of the counter 10 at the time that the strobe signal is received via the conductors 20. Thereafter the state machine 12 will ask the counter 10 to provide some further track windows which are wider than the lock windows and will count the strobe signals falling within those windows and accumulate the phases of the counter 18 at the times of those strobe signals. In the example shown, the state machine produces a single lock window and three track windows, but other numbers of lock and track windows may be required by the state machine 12. When four strobe signals have occurred the counter 14 will indicate this fact to the state machine 12 and the mean phase ALU 16 will calculate automatically the mean of the phases of the counter 18 at the times of occurrence of the strobe signals. The next time that the counter 18 reaches the same phase as the mean phase calculated by the ALU 16, a signal is produced on the conductor 26 which causes the state machine 12 to send a reset signal via the conductor 25. The resetting of the counter 18 synchronises the phase of the teletext data clock on the line 30 with the maxima from the correlator. Figure 2 shows in detail ' the circuitry of the correlator formed by the shift register 7 and the logic means 8. In the production of the inhibit signal on the conductor 11, the first two and the last two stages of the shift register 7 are connected directly to inputs of an eight-input AND-gate 52 and through respective inverters 51 to inputs of a second eight-input AND-gate 53. The middle four stages of the shift register 7 are connected directly to inputs of the eight-input AND-gate 53 and through respective inverters 50 to inputs of the eight-input AND-gate 52. The outputs of the AND-gates 52 and 53 are connected through an OR-gate 54 to a conductor 55 feeding an inverter 56, the output of which is applied to the conductor 11. Symmetrically disposed pairs of stages of the shift register 7 are connected to the inputs of six exclusive NOR-gates 58, 59, 60, 61, 62 and 63, the outputs of which are applied to a binary adder 64, to inputs according to weighting factors applied to the outputs of the gates. The adder 64 has a four-bit parallel output. The four bits of the output from the adder 64 are applied as inputs to respective AND-gates 65, 66, 67 and 68, having their second inputs connected to the conductor 55. The outputs of the gates 65 to 68 are applied to the four conductors 10. In the operation of the circuit shown in Figure 2 , the inverters 50 and 51 and the gates 52, 53 and 54 serve to produce on the conductor 55 a 1 signal only if the middle four stages of the shift register 7 are in the same state and in a different state from that of the outer four stages of the register. Clearly, that situation should be reached whenever a pulse or a space between pulses of a clock run-in sequence has been received and is stored symmetrically in the register 7. The absence of a 1 on the conductor 55 is used to produce an inhibit pulse on the conductor 11. The inhibit pulses serve to reduce interference by spurious noise pulses which might otherwise appear as pulses of the clock run-in sequence. The exclusive NOR-gates 58 to 63 with the adder 64 serve to form a weighted sum of the symmetrically disposed pairs of stages having matching states of the shift register 7, the sum having a maximum value 4-bit output when a pulse or space is centrally disposed in the shift register 7. The weighting of the outputs of the gates 58 to 63 is selected so that there is a single position providing a maximum sum. The gates 65 to 68 provide the signal on the conductor 55 with the power to block the production of a value on the conductors 10 if signal on the conductor 55 is not a 1. Figure 3 shows in detail the operation of the maximum detector 9. The conductors 10 are applied to a 4-bit store 80 and a 4-bit comparator 82. The store 80 is connected to a second input of the comparator 82 through four conductors 81. The inhibit pulse on conductor 11 is applied to the store 80 to clear it and prevent operation of the circuit. If the input value on the conductors 10 is smaller or equal to the value stored in the store 80, then the comparator 82 applies an output to a strobe pulse generator 83 which generates the strobe signal on the conductor 15. A strobe signal is produced on only the first fall in value after an increase in value. The operation of the maximum detector shown in Figure 3 makes use of the fact that when a maximum value has been reached the next following value is either equal to or smaller than the maximum value. The store 80 is constructed so as to store the last value that occurred before the current one on the conductors 10 so that the comparator 82 provides the function of detecting the maximum value by comparing the earlier value from the store 80 with the later one on the conductor 10, and producing an output if the latter value is equal to or less than the stored value. Figure 4 is diagram showing the state machine 12 and the components most closely associated with it. In particular in Figure 4 the mean phase ALU 16 is shown as comprising an accumulator 90, a divide-by-4 circuit 91 and a comparator 92. As mentioned above with reference to Figure 1, the ALU 16 accumulates the phase values from the counter 18 which are present at the time of the strobe signals on the conductor 15. In Figure 4, that accumulation is performed by the accumulator 90 which receives the phase values via the conductors 20 and adds each of them to the accumulated total when the strobe signal appears on the conductor 15. The divide-by-4 circuit 91 receives the total from the accumulator 90 and divides it by four by the simple expedient of removing the two bits of least significance. The quotient of the division is applied to the comparator 92 where it is compared with the phase from the counter 18 appearing on the conductors 20. The operation of the comparator 92 is inhibited until the counter 14 produces an output indicating that it has received four strobe signals via the conductor 15 so that the total in the accumulator 90 will be of four phase values. When the phase values from the counter 18 is equal to the quotient produced by the divider 91 a signal is applied via the conductor 26 to the state machine 12 for the purpose of causing the appropriate adjustment of the phase of the counter 18. When that phase adjustment has been completed, the state machine terminates the operation of the apparatus, thereby holding the phase of the counter 18 and the output of the teletext data clock on the conductor 30. As described above, the division by four by the divider 91 does not take into account the possibility that the true value of the quotient may involve one-half or three-quarters over the value applied to the comparator 92. Rounding up of the value would give a more accurate setting of the phase of the counter 18 and such rounding up could conveniently be achieved by the selective introduction of a single clock pulse period delay (at 70 MHz) into the generation of the signal applied to the conductor 26 indicating the equivalence of the current phase value on the conductors 20 and the quotient from the divider 91. Such delay would be introduced if the larger of the two bits discarded to effect the division by four were a l. The operation of the delay would be equivalent to adding 1 to the phase value produced by the counter 18 because that value would be increased by 1 during the delay.

Claims: CLAIMS: 1. Apparatus responsive to a clock run-in sequence of equally spaced similar input pulses for a binary data packet to derive therefrom a control signal for a locally generated clock signal, the apparatus including means for sampling the input pulses at much higher rate than the pulse repetition rate, means for comparing the samples with a threshold voltage and for producing a single bit output for each sample which depends on whether or not the sample exceeds the threshold, correlator means connected to receive the output bits in sequence from the comparing means and producing indications of the times of occurrence of the midpoints of the input pulses, oscillator means, divider means responsive to an oscillation from the oscillator means to provide the clock signal, and phase comparison means for comparing the phase of the clock signal from the divider means with the indications from the correlator means and producing a phase adjustment signal which is applied to the divider means to adjust the phase of the clock signal. 2. Apparatus according to claim 1, wherein the correlator means includes shift register means for storing a plurality of bits from the comparing means, the plurality being derived from a longer time section of the input pulses than a single input pulse, logic means connected to certain stages of the shift register means for producing signals the value of which is a maximum when bits derived from a single input pulse are centrally disposed in the shift register means, and means for producing an indication when the signals produced * by the logic means reach a maximum value. 3. Apparatus according to claim 2, wherein the means for producing an indication when the signals produced by the logic means reach a value includes means for storing each value in turn and means for comparing the stored value with the next subsequent value and providing the indication the first time that the stored value exceeds the next subsequent value. 4. Apparatus according to claim 1, 2 or 3, wherein the correlator means is also responsive to the output bits in sequence to produce additional indications of the times of occurrence of the midpoints of the spaces between pulses, and the phase comparison means also compares the phase of the clock signal with the additional indications from the correlator means. 5. Apparatus according to claim 2, 3 or 4 wherein the correlator means includes second logic means responsive to stages of the shift register means other than the certain stages to produce an inhibit signal for blocking the operation of the first-mentioned logic means. 6. Apparatus according to any one of the preceding claims, wherein the phase comparison means includes means for generating windows at predetermined time intervals determined by the oscillator means after the production of an indication by the correlator means, means for ascertaining the phases of the divider means concurrent with a plurality of subsequent indications produced by the correlator means during the windows, means for forming the average of the ascertained phases of the divider means, and means for resetting the divider means to a phase dependent on the average phase. 7. Apparatus according to claim 6, wherein the number of ascertained phases is a power of two and the means for forming the average of the ascertained phases includes means for accumulating the ascertained phases in binary coded form and shifting the accumulated total the appropriate number of binary places to effect division by the number of ascertained phases. 8. Apparatus according to claim 7, wherein the means for forming the average of the ascertained phases includes means responsive to the magnitude of the remainder after shifting to effect division by the number of ascertained phases for delaying the resetting of the divider means by a single clock pulse interval so as selectively to round up or round down the average phase on which the resetting is dependent. 9. Apparatus according to claim 6, 7 or 8 wherein the phase comparison means includes a state machine, the state machine receiving the indications from the correlator means and operating to produce after one of the indications at least one narrow window and a plurality of further wider windows and providing output signals of a first kind when subsequent indications occur within the windows and an output signal of a second kind when one of the subsequent indications occurs outside a window, the output signals of the first kind from the state machine being applied to the divider means to cause it to produce signals representing the ascertained phases, and the output signals of the second kind from the state machine being applied to reset the means for generating the windows and the means for forming the average of the ascertained phases. 10. Apparatus according to any one of the preceding claims wherein the comparing means is such that the threshold voltage starts from an initial value substantially equal to zero and increases to a value near to that of the middle of the height of the input pulses. 11. Apparatus according to any one of the preceding claims for detecting and responding to the clock run-in sequence of teletext signals included with a broadcast composite television signal. 12. Apparatus for detecting and responding to a clock run-in sequence of equally spaced similar input pulses substantially as described herein and as illustrated by the accompanying drawings. 13. A method of detecting and deriving a control signal for a locally generated clock from a clock run-in sequence of equally spaced similar input pulses for a binary data packet, the method including sampling the input pulses at a much higher rate than the pulse repetition rate, comparing the samples with a threshold voltage and producing a single bit output for each sample which depends on whether or not the sample exceeds the threshold, correlating the output bits in sequence and producing indications of the times of occurrence of the midpoints of the input pulses, providing a locally generated clock signal by frequency dividing an oscillation, comparing the phase of the locally generated clock with the indications produced by the correlation, and producing a phase adjustment signal, and adjusting the phase of the locally generated clock signal using the phase adjustment signal. 14. A method according to claim 13, wherein the correlation of the output bits in sequence produces additional indications of the times of occurrence of the midpoints of the spaces between the input pulses, the production of the phase adjustment signal also taking into account the comparison of the phase of the locally generated clock with the additional indications. 15. A method according to claim 13 or 14, in which the comparing of the phase of the locally generated clock with the indications produced by the correlation is effected by generating windows at predetermined time intervals determined by the oscillation after the production of an indication by the correlation providing the locally generated clock signal, ascertaining the phases of the frequency division used to produce the locally generated clock signal which are concurrent with a plurality of subsequent indications produced by the correlation, forming the average of the ascertained phases and resetting the frequency division to a phase dependent on the average phase. 16. A method according to any one of claims 13, 14 or 15 in which the threshold start average starts from an initial value substantially equal to zero and increases to a value near to that of the middle of the height of the input pulses. 17. A method of detecting and responding to a clock run-in sequence of equally spaced similar input pulses substantially as described herein and as illustrated by the accompanying drawings.

Inventors: KORATZINOS VASSILIS, KORATZINOS, VASSILIS
Applicants: TEXAS INSTRUMENTS LTD, TEXAS INSTRUMENTS LIMITED
Application year: 1992
Main classification: H03L7
IPC codes: H03L7, H04L7, H04N7