Background technology
AGC (Auto Gain Control, automatic gain control, down together) and be one of the most frequently used module of receiver, generally include two kinds of feed forward type and reaction types, though the feed forward type convergence rate is very fast, stability is not enough, the occasion that suitable variation is not frequent.Reaction type convergence rate comparatively speaking is slow, but stability will be got well much mobile TV transmission more complicated, thereby suitable reaction type AGC.
Reaction type AGC commonly used comprises that single step adjusting and dynamic step length regulate two kinds, single step is regulated and is realized simply, but be difficult to reach good compromise between precision and speed, dynamic step length has well remedied the shortcoming that single step is regulated, and the present invention promptly is the improvement of regulating AGC at dynamic step length.
Traditional dynamic step length control method has two kinds: a kind of is account form, and promptly according to the characteristic constructor of radio-frequency devices, its advantage is that precision is higher, and shortcoming is that the function of device is made up is Utopian, and has add up error; Another kind is a look-up table, and the advantage of look-up table is not have add up error, and speed is very fast, and shortcoming is to improve to take up room with precision significantly to improve.Conventional method takies excessive for fear of memory space, need to adopt calculation mode to try to achieve the target point of adjustment, but for radio frequency chip, its linear change is theoretic, and the control mode that exists rank to get over, usually rank are controlled more and need be combined with linear change, form whole linear change, but because can there be deviation in the linearity of radio frequency chip, there is precision problem in software simulation, if the compensation accumulated error, then inevitable raising greatly on complexity, if uncompensation, accumulated error can linearity is bad situation amplify, calculate simultaneously and need use complicated formula usually, the overlong time that can cause parameter to generate, thereby under the situation that run case is had relatively high expectations, simple calculating is also inapplicable.Employing is tabled look-up and can effectively be solved subproblem, and the speed of tabling look-up is fast, and as long as consider accumulated error tabulation the time, just can avoid being subjected to the influence of accumulated error.But the problem bad to linearity, the method for searching can only solve by the precision of raising table, but causes memory space excessive so again.
Summary of the invention
The invention provides a kind of device of mobile TV automatic gain control and the method that its dynamic step length is regulated,, adopt the add up error of single account form existence or adopt single look-up table to cause the excessive problem of memory space to solve when dynamic step length is regulated.
In order to solve the problems of the technologies described above, the invention provides the method that dynamic step length is regulated in a kind of mobile TV automatic gain control, described dynamic step length is regulated and is adopted look-up table will regulate in gain calculating to the adjusting gain threshold earlier, and then regulates gain parameter with interpolation algorithm calculating.
The method of the invention, wherein, described adjusting gain threshold is set to the minimum precision of the employed form of described look-up table.
The method of the invention, wherein, described interpolation algorithm is a linear interpolation algorithm.
Further, described linear interpolation algorithm is for to utilize formula a=(b+c)/2 to ask average interpolation algorithm, wherein, the first step in the interpolation method execution, described b, c are respectively and regulated gain results and its neighbor in the employed form of described look-up table the last time of utilizing look-up table to calculate, and a represents current adjusting gain calculating result; After this in the execution in step, described b, c represent to regulate last time gain results and its neighbor in the employed form of described look-up table respectively.
Further, there are two in described neighbor, and system of selection is the positive and negative selection according to the regulated quantity of described adjusting gain, as selecting than its big neighbor for canonical, as then selecting than its little neighbor for negative.
The present invention also provides a kind of device of mobile TV automatic gain control, comprise radio frequency initial configuration module, radio frequency receiving terminal, gain calculation module, filtration module, gain adjustment computing module and data transmitting module, wherein, computing module is adjusted in described gain, when being used for the dynamic step length adjusting, adopt look-up table will regulate gain calculating to earlier and regulate in the gain threshold, and then calculate the adjusting gain parameter with interpolation algorithm.
Device of the present invention, wherein, the minimum precision that the described adjusting gain threshold of computing module is set to the employed form of described look-up table is adjusted in described gain.
Device of the present invention, wherein, the interpolation algorithm that described gain adjustment computing module uses is linear interpolation algorithm.
Further, described gain is adjusted the described linear interpolation algorithm of computing module use and is asked average interpolation algorithm for utilizing formula a=(b+c)/2, wherein, the first step in the interpolation method execution, described b, c are respectively and regulated gain results and its neighbor in the employed form of described look-up table the last time of utilizing look-up table to calculate, and a represents current adjusting gain calculating result; After this in the execution in step, described b, c represent to regulate last time gain results and its neighbor in the employed form of described look-up table respectively.
Further, there are two in described neighbor, and system of selection is the positive and negative selection according to the regulated quantity of described adjusting gain, as selecting than its big neighbor for canonical, as then selecting than its little neighbor for negative.
The method of the invention at first adopts and tables look-up, though the initial table precision is not high, speed is very fast, and next step adopts the method for interpolation calculation, only needs simple addition and shifting function just can realize.Avoided the high problem of simple computation complexity like this.
Embodiment
The present invention is not high for fear of single look-up table precision, perhaps bad by the radio frequency chip power control line, or the not good and calculating add up error that causes of Multistage Control gain continuity is to the influence of system's implementation complexity, a kind of method with look-up table and calculations incorporated is proposed, based on look-up table, be calculated as auxilliary, the adverse effect of on the basis that does not increase implementation complexity, avoiding the front to carry.This invention can be used as the part of mobile TV.Method for designing clear in structure of the present invention, complexity is less relatively, helps realizing.
Below in conjunction with the drawings and specific embodiments technical scheme of the present invention is described in detail.
As shown in Figure 1, it is the apparatus structure schematic diagram of embodiment of the invention mobile TV automatic gain control, it is a reaction type AGC device that its main body constitutes, radio frequency part is regulated and is comprised voltage-regulation and digital regulated two parts, and hardware components is realized power calculation, and software section is realized the parameter initialization configuration, filtering, gain adjustment is calculated, and will regulate parameter at last and send radio frequency chip to level and digital form, thereby by feeding back the purpose that continuous adjustment reaches Gain Automatic adjustment.This device comprises radio frequency initial configuration module, radio frequency receiving terminal, gain calculation module, filtration module, gain adjustment computing module and data transmitting module, wherein:
Radio frequency initial configuration module is used to realize the initial configuration to radio frequency chip, and carries out power and transform, and is converted into db power by linear power;
The radio frequency receiving terminal, in the AGC correlation function, the radio frequency receiving terminal is used for receiving and transmits, and the generation digital signal sends gain calculation module to; In the present invention, at be the situation of Multistage Control, under the effect of regulatory factor, adjust signal power; The gain of radio frequency receiving terminal divides 3 grades of controls: radio frequency control, low noise amplifier control and base band control; Wherein radio frequency control and base band control are simulated, and adopt voltage control; Low noise amplifier control is digital control, is that get on rank; At first adopt the dynamic range of the 0-76db that the linear method that fits obtains expecting, make up the look-up table that precision is 1db then, be the software ready work of tabling look-up;
Gain calculation module is according to the power that calculates signal in this time period setup time; For IQ two-way baseband signal, promptly calculate its average mould value, basic ideas are according to setup time, and the IQ two paths of signals is added up respectively, after the end that adds up, according to carrying out dynamic cut position (promptly asking average power) setup time;
Filtration module is considered the sign mutation situation, for fear of gain fluctuation on a large scale, needs the auxiliary of filtration module;
Computing module is adjusted in gain, and the method according to computation of table lookup combines under the prerequisite that ensures governing speed, improves its degree of regulation; Be used for changing under the violent situation, during the dynamic step length adjusting, adopt look-up table will regulate gain calculating to earlier and regulate in the gain threshold, and then calculate the adjusting gain parameter with interpolation algorithm at signal; The minimum precision that the described adjusting gain threshold of computing module is set to the employed form of described look-up table is adjusted in described gain; The interpolation algorithm that described gain adjustment computing module uses is linear interpolation algorithm; Described linear interpolation algorithm is for to utilize formula a=(b+c)/2 to ask average interpolation algorithm, wherein, the first step in the interpolation method execution, described b, c are respectively and regulated gain results and its neighbor in the employed form of described look-up table the last time of utilizing look-up table to calculate, and a represents current adjusting gain calculating result; After this in the execution in step, described b, c represent to regulate last time gain results and its neighbor in the employed form of described look-up table respectively; There are two in described neighbor, and system of selection is the positive and negative selection according to the regulated quantity of described adjusting gain, as selecting than its big neighbor for canonical, as then selecting than its little neighbor for negative;
Data transmitting module, because radio frequency chip is Multistage Control and adopts analog-and digital-dual mode simultaneously, therefore this module is by IIC (International IC on the one hand with digital parameters, international integrated circuit) interface transmits, need on the other hand the digital signal of corresponding voltage is passed through PWM (PulseWidth Modulation, pulse-width modulation) is converted into voltage signal, sends the radio frequency receiving terminal to.
Though the way of hardware and software combination that the above embodiment of the present invention adopts in implementation procedure, it all is suitable for pure software, pure hardware and other way of hardware and software combination.
As shown in Figure 2, be embodiment of the invention mobile TV auto gain control method flow chart, comprise the steps:
Step 201, radio frequency initial configuration module is to radio frequency receiving terminal initial configuration; This part is directly related with the radio frequency chip that adopts, and its method is by IIC configuration radio frequency register according to handbook;
Step 202, the radio frequency receiving terminal receives and transmits, and radio frequency initial configuration module is carried out power transfer to received signal, is converted into db power by linear power; Filtering in the present embodiment is the filtering at the db value, because the power that hardware calculates is linear, therefore also needs to realize the conversion of linear power to db, based on the consideration that improves arithmetic speed, can adopt look-up table to realize;
Step 203, filtration module is carried out filter function; The unsettled phenomenon of Base-Band Processing end signal that filter causes for fear of the unexpected variation of signal source, adopt formula:
p=a·p(cur)+(1-a)·p(past)
Wherein, a is a normalized parameter, and p (cur) and p (past) represent current power and historical power respectively;
Step 204, gain are adjusted computing module when dynamic step length is regulated, and whether judging tables look-up carries out number of times greater than the execution number of times thresholding of tabling look-up, if then change step 206; If not, then change step 205; The described execution number of times thresholding of tabling look-up is an experience thresholding, and the precision of the table form of following through is relevant with the filtering factor of front filtering, if precision is low and the historical weight of filtering factor is low, then this thresholding number of times is very little.
Step 205 compares with adjusting gain target value, asks the adjusting parameter with look-up table, changes step 208 then;
Step 206 compares with adjusting gain target value, judges that whether regulated quantity is greater than regulating gain threshold, if change step 205; If not, then change step 207;
Step 207 is used the interpolation algorithm compute adjustment parameters, changes step 208 then;
Step 208, data transmitting module will be regulated parameter and send the radio frequency receiving terminal to, and analog quantity issues by the PWN module, and digital quantity issues by IIC, changes step 202 then.
Realize the gain-adjusted position calculation, carry out number of times and regulated quantity according to tabling look-up and decide employing to table look-up or the difference computational methods.The position of the index of look-up table for being adjusted to, the content of table is the corresponding parameters value, for the present embodiment, promptly three issue parameter: rf_agc, bb_agc and LNA (these three parameters are the intrinsic parameter of radio frequency chip, respectively corresponding radio frequency AGC regulates parameter, and base band AGC regulates parameter and low noise amplifier is regulated parameter).The difference computing method is to keep last history value, draw current location after, summation is averaged, because when using interpolation calculation, represent that most of bit is stable, can only carry out interpolation as required, promptly in hardware is realized, also have the space of further optimizing some positions.Change under the violent situation at signal, during the dynamic step length adjusting, adopt look-up table will regulate gain calculating to earlier and regulate in the gain threshold, and then calculate the adjusting gain parameter with interpolation algorithm; The minimum precision that the described adjusting gain threshold of computing module is set to the employed form of described look-up table is adjusted in gain; The interpolation algorithm that described gain adjustment computing module uses is linear interpolation algorithm; Described linear interpolation algorithm is for to utilize formula a=(b+c)/2 to ask average interpolation algorithm, wherein, the first step in the interpolation method execution, described b, c are respectively and regulated gain results and its neighbor in the employed form of described look-up table the last time of utilizing look-up table to calculate, and a represents current adjusting gain calculating result; After this in the execution in step, described b, c represent to regulate last time gain results and its neighbor in the employed form of described look-up table respectively; There are two in described neighbor, and system of selection is the positive and negative selection according to the regulated quantity of described adjusting gain, as selecting than its big neighbor for canonical, as then selecting than its little neighbor for negative.
The power calculation of hardware components gain calculation module adopts the approximate method of mould of asking to realize that its formula is as follows:
| i+jq| represents the mould of IQ two-way baseband signal, and max (I, q) and min (I, q) value that expression IQ component is bigger and less value.
In the design, because frequency requirement is not high, thereby adder does not adopt DSP (DigitalSingal Processor, digital signal processor) Unit 48 are realized, but adopt the elementary cell slice (being U.S. xilinx (match SEL) FPGA of company (Field Programmable GateArray, field programmable gate array) elementary cell) of xilinx device to realize (helping to realize application-specific integrated circuit (ASIC)).
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.