Summary of the invention
Can't realize the control of broad gain ranging in order to solve the analog detection control method, AGC speed is slow, and Digital Detecting Method can't realize problems such as AGC sometimes, the invention provides a kind of mixed-mode AGC loop, described AGC loop comprises VGA module, peak detector, variable speed integrator, comparator, counter, threshold controller and gain controller;
Described VGA module, link to each other with described peak detector, variable speed integrator and gain controller, be used to receive external input signal, and input signal is amplified according to the size of described variable speed integrator output control signal, input signal after amplifying is sent to described peak detector, and the control signal that receives described gain controller output;
Described peak detector links to each other with variable speed integrator with described VGA module, is used to detect the peak value size of the output signal that described VGA module sends, and peak value is sent to described variable speed integrator;
Described threshold controller links to each other with described variable speed integrator, is used under the control of control signal externally, selects the different threshold value of output;
Described variable speed integrator, link to each other with comparator with described peak detector, threshold controller, VGA module, size between the threshold value that the peak value that is used for the output of more described peak detector and described threshold controller are exported, if the peak value of described peak detector output is greater than the threshold value of described threshold controller output, then bear integration according to the preference pattern of the external control signal of described threshold controller, otherwise carry out positive integration, and output control signal;
Described comparator links to each other with variable speed integrator with described counter, is used for the control signal of more described variable speed integrator output and the size of outside comparison signal, and transmits control signal to described counter according to comparative result;
Described counter links to each other with gain controller with described comparator, is used for counting according to control signal and external timing signal that described comparator sends, and count results is sent to described gain controller;
Described gain controller links to each other with the VGA module with described counter, is used for the count results according to described counter transmission, sends the control signal that expression increases gain or reduction gain to described VGA module.
Described VGA module comprises signal input part, signal output part and signal input end; Described signal input part input difference intermediate-freuqncy signal, the control signal of described signal input end input is analog gain control signal or digital gain control signal.
Described VGA module amplifies subelement by a plurality of numerals and a simulation amplification subelement is formed; The input of a numeral amplification subelement links to each other with the signal input part of described VGA module; Each numeral is amplified subelement and is interconnected with one another, and the output of last numeral amplification subelement links to each other with the input that subelement is amplified in described simulation; The output that subelement is amplified in described simulation links to each other with the signal output part of described VGA module.
Described peak detector comprises signal input part and signal output part; Described signal input part links to each other with the signal output part of described VGA module; Described peak detector sends to described variable speed integrator by described signal output part with peak information.
Described threshold controller comprises signal input end and output; Described signal input end links to each other with external control signal, the different threshold value of described output output.
Described variable speed integrator comprises signal input end, threshold value input, peak value input and integration output; Described signal input end is used to select different integral constants; The size of the signal of the signal of described peak value input input and the input of threshold value input is used for determining the direction of integration.
Described comparator comprises first comparator and second comparator; Described first comparator and second comparator comprise two inputs and an output respectively; An input termination external input signal, another input links to each other with the integration output of described variable speed integrator; The output of described first comparator is used for sending and increases progressively counting and enable control signal to described counter; The output of described second comparator is used to send countdown and enables control signal to described counter.
Described counter comprises first counter and second counter; Described first counter and second counter comprise input, input end of clock and signal output part respectively; The input of described first counter links to each other with the output of described first comparator; The input of described second counter links to each other with the output of described second comparator; Described input end of clock connects external timing signal; Described first counter determines whether to increase progressively counting according to the high-low level of the input signal of its input, and count results is sent to described gain controller; Described second counter determines whether countdown according to the high-low level of the input signal of its input, and count results is sent to described gain controller.
Described gain controller comprises input and output; Described gain controller carries out logical operation according to the input size of described input, sends the control signal that expression increases gain or reduces gain to described VGA module.
Described expression increases gain or reduces the control signal that gains is N position gain controlling word, and wherein N is a natural number.
Beneficial effect: the present invention is by VGA module, variable speed integrator and gain controller, and analog-and digital-double-mode control is carried out in gain to differential intermediate frequency, makes the amplitude output signal of VGA module not change with its input signal; The circuit structure of AGC loop provided by the invention is simple and flexibly, the AGC operating rate can be selected, thereby can satisfy the requirement of multiple systems.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Referring to Fig. 1, the embodiment of the invention provides a kind of mixed-mode AGC loop, comprises VGA module 100, peak detector 200, variable speed integrator 400, first comparator 500, second comparator 600, first counter 700, second counter 800, threshold controller 300 and gain controller 900;
VGA module 100, link to each other with peak detector 200, variable speed integrator 400 and gain controller 900, be used to receive external input signal, and input signal is amplified according to the size of variable speed integrator 400 output control signals (Vc), input signal after amplifying is sent to peak detector 200, and the control signal of receiving gain controller 900 outputs;
Peak detector 200 links to each other with variable speed integrator 400 with VGA module 100, is used to detect the peak value size of the output signal that VGA module 100 sends, and peak value is sent to variable speed integrator 400;
Threshold controller 300 links to each other with variable speed integrator 400, is used under the control of control signal externally, selects the different threshold value of output;
Variable speed integrator 400, link to each other with second comparator 600 with peak detector 200, threshold controller 300, VGA module 100, first comparator 500, be used for to threshold value and detected signal peak relatively after, just carrying out/bearing integration, and output control signal Vc;
First comparator 500 links to each other with variable speed integrator 400 with first counter 700, is used for comparison control signal Vc and outside comparison signal V
1Size, and transmit control signal to first counter 700 according to comparative result;
Second comparator 600 links to each other with variable speed integrator 400 with second counter 800, is used for comparison control signal Vc and outside comparison signal V
2Size, and transmit control signal to first counter 800 according to comparative result;
First counter 700 links to each other with gain controller 900 with first comparator 500, is used for counting according to the control signal that first comparator 500 sends, and count results is sent to gain controller 900;
Second counter 800 links to each other with gain controller 900 with second comparator 600, is used for counting according to the control signal that second comparator 600 sends, and count results is sent to gain controller 900;
Gain controller 900, link to each other with VGA module 100 with first counter 700, second counter 800, be used for count results, send the control signal that expression increases gain or reduction gain to VGA module 100 according to first counter 700 and 800 transmissions of second counter.
Wherein, VGA module 100 comprises signal input part 101 and 102, signal output part 103 and 104, and signal input end 105 and 106; Signal input part 101 and 102 input difference intermediate-freuqncy signals; The control signal Vc of signal input end 105 inputs is the analog gain control signal; The control signal of signal input end 106 inputs is the digital gain control signal; In actual applications, when AGC was used for receiver system, signal input part 101 linked to each other with frequency mixer with 102, i.e. the signal of signal input part input is the differential intermediate frequency after the mixing; VGA module 100 is determined input signal is carried out amplification multiple according to the size of control signal, thereby the signal after will amplifying is exported to peak detector 200; Fig. 2 shows the internal circuit theory structure schematic diagram of VGA module 100, the input signal of supposing signal input part 101 and 102 is Vin, signal output part 103 and 104 output signal are Vout, signal input part links to each other with the output of frequency mixer, VGA module 100 is amplified subelement (A1 by four numerals, A2, A3, A4) and a simulation amplify subelement (A5) and form, numeral is amplified the digital gain control signal (D0 that subelement is sent by gain controller 900, D1, D2 and D3) control its gain size, the control signal Vc that simulation amplification subelement is sent by variable speed integrator 400 controls its gain size; The gain ranging that numeral is amplified subelement A1, A2, A3 and A4 can require to be set to 0~10dB, perhaps other gain rangings according to real system; The figure place of digital gain control signal D0, D1, D2 and D3 also can require to be provided with according to real system; The gain of subelement A5 is amplified in simulation and the size of control signal Vc is directly proportional, and can dynamically adjust by Vc, and its gain ranging can require to be provided with according to real system.
Wherein, peak detector 200 comprises signal input part 201 and 202, and signal output part 203; Signal input part 201 links to each other with 104 with the signal output part 103 of VGA module 100 respectively with 202; Peak detector 200 sends to variable speed integrator 400 by signal output part 203 with peak information.
Wherein, threshold controller 300 comprises signal input end b1 and b0, and output 301; Signal input end b1 links to each other with external control signal with b0, the different threshold value of output 301 outputs, thereby the integrating rate of change variable speed integrator 400.
Wherein, variable speed integrator 400 comprises signal input end 403 and 404, threshold value input 402, peak value input 401 and integration output 405; Signal input end 403 links to each other with b1 with the signal input end b0 of threshold controller 300 respectively with 404, is used to select different integral constants, thereby selects different integrating rates; The size of peak value input 401 and threshold value input 402 can be determined the direction of integration, thereby the control signal Vc of output is increased or reduces; Fig. 3 shows the circuit principle structure schematic diagram of variable speed integrator 400, threshold value input 402 links to each other with the output 301 of threshold controller 300, peak value input 401 links to each other with the signal output part 203 of peak detector 200, variable speed integrator 400 is according to the size of peak value input 401 and threshold value input 402, and the selection of control signal b1 and b0 determines positive integration or negative integration, thereby determines integrating rate.
Wherein, first comparator 500 comprises input V
1With 502, and output 501; Input V
1Connect external input signal, input 502 links to each other with the integration output 405 of variable speed integrator 400; First comparator 500 is according to input V
1With 502 size, transmission increases progressively counting and enables control signal to first counter 700.
Wherein, second comparator 600 comprises input V
2With 602, and output 601; Input V
2Connect external input signal, input 602 links to each other with the integration output 405 of variable speed integrator 400; Second comparator 600 is according to input V
2Size with 602 sends countdown and enables control signal to second counter 800.
Wherein, first counter 700 comprises input 702, input end of clock and signal output part 701; Input 702 links to each other with the output 501 of first comparator 500; Input end of clock meets external timing signal CLK; First counter 700 determines whether to increase progressively counting according to the high-low level of the input signal of input 702, and count results is sent to gain controller 900.
Wherein, second counter 800 comprises input 802, input end of clock and signal output part 801; Input 802 links to each other with the output 601 of second comparator 600; Input end of clock meets external timing signal CLK; Second counter 800 determines whether countdown according to the high-low level of the input signal of input 802, and count results is sent to gain controller 900.
Wherein, gain controller 900 comprises input 901 and 902, and output 103; Gain controller 900 carries out logical operation according to the input size of input 901 and 902, sends the control signal that expression increases gain or reduces gain to VGA module 100.In actual applications, control signal can be N position gain controlling word, and wherein N is a natural number.
The operation principle of the mixed-mode AGC loop that the embodiment of the invention provides is: peak detector 200 detects the input range of VGA module 100 current times, and peak value is input to variable speed integrator 400; If variable speed integrator 400 comparator input signals 401 and 402 size 401 greater than 402, are then born integration according to the preference pattern of control signal b0 and b1, otherwise, then carry out positive integration, and output integral control signal Vc; Integral control signal Vc adjusts the gain of VGA module 100 on the one hand, is sent to first comparator 500 and second on the other hand and compares 600, if the adjustment of Vc can make VGA module 100 reach the requirement of output amplitude, then AGC has reached purpose; If the adjustment of Vc can not make VGA module 100 reach the requirement of output amplitude, then by first comparator, the 500 output increment signal or second comparator 600 outputs the successively decreasing signal, make first counter 700 begin to increase progressively counting or make second counter 800 beginning countdowns, and count results is sent to gain controller 900; Gain controller 900 carries out logical operation according to the count results of input, and the gain controlling word is adjusted in output, and then the gain of control VGA module 100.Fig. 4 is the computer artificial result of embodiment of the invention mixed-mode AGC loop, wherein input signal VT (/IN) be one continuously and the weak signal of minor variations arranged, VT (/OP) be the waveform of VGA module 100 output, VT (/Vtrl) be the waveform of the control signal Vc that exports of variable speed integrator 400.
The embodiment of the invention is by VGA module, variable speed integrator and gain controller, and analog-and digital-double-mode control is carried out in gain to differential intermediate frequency, makes the amplitude output signal of VGA module not change with its input signal; The circuit structure of AGC loop provided by the invention is simple and flexibly, the AGC operating rate can be selected, thereby can satisfy the requirement of multiple systems.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.