Automatic gain control device for video signals
TECHNICAL FIELD 
     The invention relates to automatic gain control (AGC) devices for video signals implemented in an integrated circuit. 
     BACKGROUND ART 
     An output video signal from various video signal sources, such as a TV receiver or a microprocessor or a video disk, presents variations on its peak to peak value. Therefore, the peripheral device using this video signal, for example a tape recorder for the TV receiver, has to comprise an AGC device for reducing this amplitude variation. 
     Conventional AGC devices are analog loop systems which compare a peak or quasi-peak value of the signal to a reference value. Such devices are chosen so that the gain modification time constant is sufficiently long, for example a plurality of lines of the video signal so that the video signal is not impaired during the gain modification. For this purpose, large capacitors are generally used and are not integrable. It is therefore necessary to add a capacitor externally to the integrated circuit and to provide for an additional connection pin in this purpose. However, when the image content is rapidly changing, distortion and overoscillation may occur. Therefore, very often, for improving the image quality, the time constant has to be shorter in case of gain reduction than in case of gain increase, and the circuit external to the integrated circuit has to be more complex. 
     A need therefore exists for an AGC circuit for video signals which avoids signal distortion and circuit overoscillation when the image content of the signal rapidly changes. 
     A need further exists for an AGC circuit for video signals which does not require an external capacitor. 
     Accordingly, an object of the invention is to provide an AGC circuit for video signals which has a time constant responsive to circuit gain variations. 
     Another object of the invention is to eliminate the need for an external capacitor. 
     DISCLOSURE OF THE INVENTION 
     The invention relates to an AGC device for video signals which does not comprise a capacitor external to the integrated circuit for obtaining the wished time constants. A first advantage of the invention is to free a connection pin of the integrated circuit. 
     The device according to the invention presents a different time constant according to the fact the gain is decreasing or increasing. The reductions of the gain are processed with a short time constant depending upon a clock signal present in the circuit and the increases of the gain are processed at the frame frequency during the frame return trace. Thus, the overoscillations of the loop and the image distortions are cancelled. 
     Accordingly, the invention provides for an automatic gain control circuit for video signals comprising : 
     a multiplier comprising two differential inputs, a first input receiving the video signal, a second input receiving the signal corresponding to the black level, and a third input for the gain setting ; 
     first comparison means receiving the video signal, first and second thresholds obtained from the signal providing the desired white level increased with first and second levels ; 
     second comparison means receiving the video signal, third and fourth thresholds obtained from the signal providing the desired white level decreased by the first and second levels ; 
     driving means receiving the output signals from the first and second comparison means, a frame return signal and a signal having a frequency higher than the frame return signal and providing pulse signals ; 
     counting means receiving the pulse signals, said signals being able to cause a count of a quantity proportional to the first or second level according to the comparison results and when the video signal is lower than the two thresholds, and to cause a count-down of a quantity proportional to the second or first level according to the comparison results and when the video signal is higher than the two thresholds ; the output signal of the counting means being received on the gain setting input of the multiplier for causing, according to the applied value, either a gain increase during frame return traces, or a decrease at an higher frequency. 
     Still other objects and advantages of the present invention will become readily apparent to those skilled in this art from the following detailed description, wherein only the preferred embodiments of the invention are shown and described, simply by way of illustration of the best mode contemplated of carrying out the invention. As will be realized, the invention is capable of other and different embodiments, and its several details are capable of modifications in various obvious respects, all without departing from the invention. Accordingly, the drawing and description are to be regarded as illustrative in nature, and not as restrictive. 
    
    
     BRIEF DESCRIPTION OF THE DRAWING 
     The FIG. is a block diagram of the automatic gain control circuit with a digital gain control loop. 
    
    
     BEST MODE FOR CARRYING OUT THE INVENTION 
     The invention will be better understood in view of the following description made in connection with the attached drawing that shows an embodiment of the AGC device according to the invention. 
     The gain setting device permits to normalize the video signals from various sources such as tuner, camera, video tape recorder, microprocessor. The device according to the invention implements a fully different design with respect to the prior art circuits because the gain regulation loop carries out a digital processing of the signals whereby the conventional advantages of this type of processing are obtained but mainly the following problems are solved : integration, cancellation of the parasitic effects of the gain modification when the modification consists in increasing the gain, and also overoscillations due to rapid changes of the image. 
     A multiplier 1 receives on two differential inputs E1, E2 the video signal V i  and the signal V n  corresponding to the black level and, on a third input E 3  , the multiplication factor for setting the gain. The output signal SR at the output S of multiplier 1 is applied to the input of an RC filter 2 which filters and smoothes the video signal, this filter having a determined cut-off frequency in the range of 500 KHz. This filter is implementable by means of an integrated capacity lower than 10 pF. The output signal from the filter is applied to the input of a comparator set. This set comprises a first group 3 of two comparators 30 and 31 and a second group 4 of two comparators 40 and 41. 
     The first comparator group compares the video signal V c  with two predetermined thresholds above which one wishes to set the gain, the one being lower than the other and permitting an accurate setting of the gain. The highest threshold corresponds to the level V b  of the desired maximum white level to which is added a level d which is preferentially equal to 1.1 dB of the desired value V b . The lowest threshold corresponds to the white level V b  to which is added a level c (c being lower than d) which is preferentially equal to 0.1 dB of the desired value V b . 
     The second comparator group compares the video signal V c  with two other thresholds below which a gain setting is desired, the one threshold being lower than the other to permit accurate setting of the gain. The highest threshold corresponds to the desired white level V b  from which is substracted the level c which is preferentially equal to 0.1 dB of the desired V b  value. The lowest threshold corresponds to the white level V b  from which is substracted the level d which is preferentially equal to 1.1 dB of the desired value V b . 
     A driving circuit 5 receives signals from the output signals of the comparators 30, 31, 40, to drive an updown counting circuit 6. The output of comparator 30 drives the down-counting input of an up-down counter 61 of circuit 6 through an AND gate 51 of circuit 5, the output of comparator 31 drives the down-counting input of an up-down counter 62 of circuit 6 through an AND gate 52 of circuit 5. Gates 51 and 52 receive on their second input a signal H, the frequency of which is higher than the frame frequency. 
     The output of comparator 40 drives the input R of an RS flip-flop 52 of circuit 5. The output of comparator 41 drives the input R2 of an RS flip-flop 54 of circuit 5. The inputs S1 and S2 of those two flip-flops receive a signal IT2 at the frame frequency, synchronized with the end of the frame-return signal (negative edge of the frame-return pulse). The output Q1 of flip-flop 53 is applied to an input of an AND gate 55, the output of which drives the up-counting input C2 of the up-down counter 62. The output of gate 56 drives the up-counting input C1 of the up-down counter 61. The data resulting from the up or down counting at the output of each counter are n-bits words, n being equal to 4. The four-bit word (nibble) corresponding to the highest weight p is applied to the input of a digital/analog converter (DAC) 63. The nibble corresponding to the lowest weight q is applied to the input of a DAC 64. The outputs of DACs 63 and 64 are applied to the inputs of an adder 65 which provides a gain setting signal to the multiplier 1. 
     The operation of the device is as follows: 
     The multiplier 1 applies a multiplying factor k to the voltage V i  -V n  received on its differential inputs E1, E2 and provides a voltage k (V i  -V n ) at its output S. The factor k is given by the counting circuit 6 and varies in correspondence with the results of the comparison circuits 3 and 4. When the signal V c  at the output of the integrating filter 2 is lower than V b  -1.1 dB, the outputs A1, A2 of comparators 40, 41, are, in this case, for example, equal to 0. Otherwise, an inverter should be arranged at the inputs R1 and R2 of the flip-flops. The inputs R1 and R2 of flip-flops 53 and 54 are at a zero level. The inputs C1 and C2 of counters 61 and 62 count one stroke as soon as a pulse IT1 is present, that is at the beginning of the frame return trace. The DACs 63 and 64 increase of one bit each, the gain increases by p+c, that is 1.1 dB (p=1 dB, c=0.1 dB) and the gain remains constant during the following frame. 
     When signal V c  is comprised between V b  -1.1 dB and V b  -0.1 dB, the output A1 of comparator 40 is zero, and the output A2 of comparator 41 is 1. The flip-flop 53 keeps the same state while the state of flip-flop 54 changes, Q1 is equal to 1, Q2 is equal to 0, the counter 62 counts once while the counter 61 no longer counts, the converter 64 increases of 1 bit, and the gain is increased of 0.1 dB. 
     When signal V c  is comprised between V b  -0.1 dB and V b  +0.1 dB, the output of comparator 40 passes to 1, the output Q1 passes to zero, the counters 61 and 62 do not count, the gain is unchanged, that is the amplitude of the video signal is in a satisfactory value range. 
     When signal V c  is comprised between V b  +0.1 dB and V b  +1.1 dB, the output A2 of comparator 31 is at 1, the output of comparator 30 is at 0. Gate 52 provides a 1 at its output as soon as a clock pulse H appears, the counter 62 counts down up to obtaining a gain permitting to the amplitude of the singal to be comprised between V b  -0.1 dB and V b  +0.1 dB. 
     When signal V c  is higher or equal to V b  +1.1 dB, the output of comparator 30 is at 1, the output of comparator 31 is also at 1, the counters 61 and 62 count down at each pulse of clock H. The gain H decreases until obtaining a level comprised between V b  +0.1 dB and V b  -0.1 dB. 
     The case of an undefinite output Q given by the inputs R and S at 1 cannot occur because the signal IT2 is at 1 at the end of the frame return trace, and at this instant there is no luminance signal. 
     The choice of two 4-bit counters rather than one 8-bit counter permits a decrease in the size of the circuit as it is then possible to associate to each 4-bit counter a 4-bit DAC, an 8-bit DAC being much more cumbersome than two 4-bit DACs. 
     The choice of thresholds equal to 1.1 dB and 0.1 dB provides the best operational conditions, that is for avoiding any loop oscillation. Of course, any other value close to those values should be appropriate. 
     The device according to the invention implements a digital gain setting loop for a video signal by applying this signal to the differential input of a multiplier, the multiplying factor which is used for setting the gain being obtained by an up-down counter. This structure increases circuit gain by incrementing the counters or decreases gain by decrementing the counters as a function of the comparison results between said video signal and an acceptable level close to the desired maximum white level value. Converters having various weights are chosen without increasing the number of bits of the counters and of the converters. Those weights are accordingly chosen so that the maximum content of the low weight counter (16×0.1 dB) has an higher value than the minimum weight (1 dB) of the high weight counter. According to this particular example, a weight p of 1 dB has been chosen for the converter 63 and a weight c of 0.1 dB for the converter 64. The gain decreases are synchronized with clock H which is a fast clock comprised for example between 50 and 500 KHz. The gain increases are synchronized with the frame return trace signal, which occurs during the frame return trace, this avoiding any risk of having spurious signals on the image The time constant for obtaining a maximum increase of the gain is equal to 8 frames, that is 160 ms. 
     In this disclosure, there is shown and described only the preferred embodiment of the invention, but, as aforementioned, it is to be understood that the invention is capable of use in various other combinations and environments and is capable of changes or modifications within the scope of the inventive concept as expressed herein.