Abstract:
The invention relates to a calibration method and a calibration arrangement for an active filter intended to be used especially in portable radio apparatus. The filter ( 100 ) according to the invention is an active RC filter and it is integrated except for one or more of its capacitances or one or more of its resistances. Advantageously the highest capacitance or the highest resistance is left unintegrated. When using an external capacitance, the principle of the calibration is as follows: The integrated resistances are corrected using a common coefficient such that the external capacitance together with the integrated resistances produces the correct time constants ( 1 ). Then the integrated capacitances are corrected using a common coefficient such that they together with the internal resistances that were corrected in the previous phase produce the correct time constants ( 2 ). If the filter comprises multiple circuit stages, the two-phase calibration process described above is repeated for each circuit stage.

Description:
FIELD OF THE INVENTION 
   The invention relates to a calibrating method for an active filter which may be used especially in, portable radio apparatus. The invention also relates to a calibration arrangement for an active filter. 
   BACKGROUND ART 
   Conventionally, low-frequency filters have been manufactured passive also. Their disadvantages include in particular the non-idealness caused by coils, the large size and relatively high production costs. Active filters realized using discrete components do not have the disadvantages caused by coils, but because of the number of components they, too, are space-consuming and have relatively high production costs. 
   An active filter can be realized in a small space by integrating it to a microcircuit. The problem with such filters is the large area required by the capacitances on the chip. Integration is possible if the capacitances are made very small and correspondingly the resistances very big. This means, however, that the signal level will drop and the noise level will increase and, therefore, this solution is usually unacceptable. Integration is possible also if small capacitances are used with very high virtual resistances based on the switched capacitor (SC) or switched current (SI) technology, for example. This eliminates high thermal noise levels, but the use of switches will result in the increase of noise level, increased current consumption and deterioration of the linearity of the filter. The latter will limit the dynamic range of the filter. If the apparatus in question is a radio device, the use of switches may also cause interference problems in the RF circuits of the apparatus. The filter may also be made such that the parts that are difficult to integrate are left outside the micro circuit. A disadvantage of such a construction is that calibration becomes more difficult; The filter requirements are usually so strict that, regardless of the construction, calibration is necessary because of the variation in component values. In the mixed construction mentioned above the deviations of the values of discrete and integrated components do not correlate, which means the calibration of filters in production may cause higher costs than totally discrete or totally integrated filters. 
   SUMMARY OF THE INVENTION 
   It is an object of the invention to eliminate above-mentioned disadvantages related to the prior art. The basic idea of the invention is as follows: The filter is an active RC filter and it is integrated except for one or more of its capacitances or one or more of its resistances. Advantageously the highest capacitance or highest resistance is left unintegrated, that is external to the filter. Each external capacitance is advantageously realized by a chip capacitor placed beside the integrated circuit. The principle of calibration, when using an external capacitance, is as follows: Integrated resistances are corrected by a common coefficient such that the external capacitance produces the correct time constants with them. Then the integrated capacitances are corrected by a common coefficient such that they produce the correct time constants with the internal resistances corrected in the previous phase. If the filter has multiple circuit stages, the two-phase calibration procedure described above is repeated for each circuit stage. 
   It is an advantage of the invention that the filter according to the invention can be made relatively small and it consumes a relatively small amount of energy. It is another advantage of the invention that the filter according to the invention is of good quality: It has a good signal-to-noise ratio, a large dynamic range, and it does not cause RF interference in its surroundings. It is a further advantage of the invention that the calibration of the filter can be adapted such that it is automatic and needs no external measuring instruments so that the calibration costs in the production are very low. 

   
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The invention will now be described in more detail with reference to the accompanying drawings wherein. 
       FIG. 1  shows a filter arrangement according to the invention, 
       FIG. 2  illustrates the calibrating principle according to the invention, 
       FIG. 2A  illustrates the calibrating principle for another embodiment of the invention. 
       FIG. 3  shows an example of a filter circuit and calibrating circuit according to the invention, 
       FIG. 3A  is a conceptual representation of a circuit in accordance with 
       FIG. 3 , which indicates that all capacitors are changed to resistors, and all resistors are changed to capacitors. 
       FIG. 4  illustrates in the form of flow diagram the operation of the calibrating circuit according to  FIG. 3 , 
       FIG. 5  shows another example of a filter circuit and calibrating circuit according to the invention, 
       FIG. 6  illustrates in the form of flow diagram the operation of the calibrating circuit according to  FIG. 5 , and 
       FIG. 7  shows an example of a way of adjusting resistance and capacitance. 
   

   DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 1  shows a filter arrangement according to the invention comprising a microcircuit  100  which comprises a filter circuit  200 , filter calibrating circuit  300  and possible other electronic circuits  400 .  FIG. 1  additionally shows a bus  150  for controlling the filter calibration and an external capacitor  201  of the filter, located outside the microcircuit. The external component in this example is a capacitor and there is just one of them. 
   The calibration of filters according to the invention is carried out by adjusting the time constants in phases.  FIG. 2  shows component parts of a filter comprising two circuit stages  210  and  220 . The detailed construction of The filter is of no significance at this point. Circuit stage  210  comprises variable resistances R 11  and R 12 , connected in series/longitudinally on the signal line, and variable capacitances C 11  and C 12 , connected in parallel/transversely to the signal line. The circuit stage further comprises an external capacitance C 1 , connected to the rest of the filter via connector pins  101 ,  102  of the integrated circuit, and an amplifier stage A 21 . The second circuit stage  220  includes variable resistances R 21  and R 22 , variable capacitances C 21  and C 22 , an external capacitance C 2  and an amplifier stage A 22 . Thus there are four phases in calibration of the filters. Let us assume that time constants R 11 ·C 1 =T 1 , R 12 ·C 11 =T 2 , R 21 ·C 2 =T 3  and R 22 ·C 21 =T 4  are critical for the filter&#39;s frequency response. In phase ( 1 ) the resistance R 11  is adjusted, as well as the other resistances in circuit  210 , until the time constant T 1  is correct. In phase ( 2 ) the capacitance C 11  is adjusted, as well as the other integrated capacitances in circuit  210 , until the time constant T 2  is correct. Correspondingly, in phase ( 3 ) the resistances in circuit  220  are adjusted until the time constant T 3  is correct, and in phase ( 4 ) the integrated capacitances in circuit  220  are adjusted until the time constant T 4  is correct. After that, the filter&#39;s frequency response is correct and the calibration of the filter is finished. 
     FIG. 3  shows a single-circuit-stage low-pass filter  200 ,  201 , and its calibrating circuit  300 . Both are examples of solutions according to the invention. The filter has an integrated part  200  and an external capacitor  201  (C 1 ). By means of change-over switches k 1   a  and k 1   b  the latter can be made part of the filter or the calibrating circuit. The calibrating circuit  300  has an integrator  310 , which comprises an amplifier A 1 , a comparator A 2 , logic unit  330  and a circuit  305  for generating reference voltages V ref1  and V ref2 . In the integrator  310  constant current is used to charge capacitance C 1  or C ref , depending on the phase of the calibration. The magnitude of the constant current depends on voltage V ref1  and resistance R ref . In parallel with the capacitance charged there is a switch k 3  by means of which the capacitance is discharged before a new charge cycle. Comparator A 2  compares the integrator&#39;s output voltage v 1  with voltage V ref2  which is greater than V ref1 . If during the integration cycle voltage v 1  reaches voltage V ref2 , the comparator&#39;s output signal A is set to “1”, otherwise it remains at “0”. Comparator A 2  is connected to the logic unit  330 . From outside the microcircuit  100  a control signal START is brought to the logic unit to start the calibration process. The logic unit  330  controls the flow of the calibration on the basis of the state of the comparator&#39;s output signal A by setting the switches k 1 , k 2  and k 3  as well as the integrated resistance values by setting a control word S r  and the integrated capacitance values by setting a control word S c . 
   Because of the manufacturing process the resistance values in the microcircuit deviate from their nominal values in the same direction and proportionally to the same extent. Similarly, the capacitance values deviate from their nominal values proportionally to the same extent. Because of this, the calibration may use the integrated reference resistance R ref  and capacitance C ref  instead of the component parts in the filter so that there will be no need to work with the integrated filter construction in order to adjust its component values. The resistances R 1  and R 2  in the filter construction and R ref  in the calibrating circuit are adjustable. The adjustment is carried out using a common control word S r  so that their values always change in proportion. Correspondingly, the capacitances C 11  and C 12  in the filter construction and C ref  in the calibrating circuit are adjustable by a common control word S c . 
     FIG. 4  shows a flow diagram of the calibration process of the circuit in FIG.  3 . After the start, in step  41  the external capacitance C 1  is connected to be the capacitance of the integrator in the calibrating circuit. In step  42 , the logic unit sends the value S rmax  representing the maximum resistances to the register controlling the resistance values. In step  43 , switch k 3  in parallel with the integrator&#39;s capacitance is closed, thereby discharging the possible charge of the capacitance and setting the integrator&#39;s output voltage v 1  to V ref1 . In step  44 , the values of the internal resistances in the microcircuit are decremented by one step. This is of no significance during the first cycle of the process. Next, in step  45 , switch k 3  is opened, starting the charging of capacitance C 1 . Time is counted in step  46 . After a predetermined time T 1  the state of the output signal A of the comparator A 2  is checked in step  47 . If the output voltage v 1  of the integrator has not yet reached V ref2 , signal A is in state “0” and the voltage integration cycle is repeated using a resistance R ref  value one step smaller than before (steps  43  to  47 ). Time constant R ref ·C 1  will then be a little smaller, making the voltage v 1  to increase a little faster than in the previous cycle. The cycle will be repeated until the voltage v 1  reaches V ref2  in time T 1 , indicated by state “1” of signal A. Parameter T 1  is chosen such that time constant R 1 ·C 1  will then conform to the desired transfer function. The microcircuit&#39;s internal resistance values, R 2  included, will not be changed after this. 
   Steps  48  to  54  in  FIG. 4  represent the second phase of the calibration process. Certain values have to be set for time constants R 2 ·C 11  and R 2 ·C 12  in order to fulfill the desired transfer function of the exemplary filter. First, in step  48 , external capacitance C 1  is connected to its place in the filter and internal capacitance C ref  is connected to the integrator. The ratio of capacitance C ref  to capacitance C 11  is known. Similarly, the ratio of resistances R ref  and R 2  is known. Thus it is possible to determine the time T 2  in which the integrator&#39;s output voltage should reach voltage V ref2  for time constant R 2 ·C 11  to be correct. The second phase of the calibration goes on in a similar manner as the first phase. Only, now the internal capacitances are first set to their maximum values, step  49 , and then gradually decreased until it is detected that signal A is in state “1”, steps  50  to  54 . Time constant R 2 ·C 11  is then correct. Time constant R 2 ·C 12  is also correct, because the ratio C 12 /C 1  was correct from the beginning and it is not changed during the calibration. The end result of the calibration is that individual component values are not known but all critical time constants and resistance ratios are substantially correct. 
     FIG. 5  shows another calibrating arrangement according to the invention. In this example the filter  200 ,  201 ,  202  to be calibrated is a third-order low-pass filter comprising a first circuit stage  210 , differential amplifier A 2  and a second circuit stage  220 . The first circuit stage  210  is a differential amplifier realized by transistors Q 1  and Q 2 . It is integrated except for an external capacitor  201  (C 1 ) which determines the cut-off frequency. Said capacitor can be connected by change-over switches k 1   a , k 1   b  either to the calibrating circuit or to the filter. Calibration is directed to collector resistors R 11 , R 12  in transistors Q 1 , Q 2 . The second circuit stage  220  is a second-order biquad-type filter realized by amplifier A 3 , as the filter in FIG.  3 . It is integrated except for an external capacitor  202  (C 2 ). Said capacitor can be connected by change-over switches k 2   a , k 2   b  either to the calibrating circuit or to the filter. Calibration is directed to resistors R 21 , R 22  and capacitors C 21 , C 22 . The calibrating arrangement in  FIG. 5  comprises an integrated calibrating circuit  300  and an external calibrating system  500 . The calibrating circuit  300  comprises a differential amplifier A 1 , reference resistor R ref , reference capacitor C ref , register unit  350  and switches k 3 , k 4  and k 5 . The register unit  350  comprises registers k, S r1 , S r2  and S c , S r1 , S r2  and S c  also represent the contents of the respective registers. The external system  500  comprises a control unit  510 , digital-to-analog converter  520 , analog-to-digital converter  530  and a bus  540 . The control unit  510  comprises a memory  511  in which a calibrating program PR is stored. The output voltage V g  of die digital-to-analog converter is taken to the differential amplifier A 1  in the calibrating circuit  300 . The calibration measurement voltage V m  is brought from the calibrating circuit  300  to the analog-to-digital converter  530 . Converter  520  is controlled and converter  530  is read through bus  540 . The bus  540  also extends to the register unit  350  in the calibrating circuit  300 . 
   If the filter to be calibrated belongs to a digital mobile communications device, the digital-to-analog converter  520  is preferably a converter in the modulator of the mobile communications device. Similarly, the analog-to-digital converter  530  is preferably a convener in the demodulator of the mobile communications device. The control unit  510  and its memory may in that case belong to the mobile communications device or they may reside in a separate apparatus. 
   Adjustment of filter time constants in the example of  FIG. 5  is based on checking the frequency responses of the first-order RC circuits from signal amplitudes. To that end, the external system  500  generates a sinusoidal voltage V g  such that the control unit  510  feeds to the digital-to-analog converter  520  a number sequence from the memory  511  which corresponds to samples taken from the sine wave. The converter  520  is controlled at such a rate that the frequency of the sine wave V g  generated is in the same order of magnitude as the cut-off frequency of the low-pass filter to be calibrated. The voltage V g  is taken via a differential amplifier A 1  to the input of a first-order RC low-pas filter. The low-pass filter comprises, series connected, resistor R ref  and one of capacitors C 1 , C 2  and C ref . Selection is made with switches k 1 , k 2 , k 3  and k 4 . The position of the switches depends on the number sent by the control unit  510  to register k in the register unit  350 . The output voltage V m  of the low-pass filter is taken from between resistor R ref  and capacitor C n  (n=1, 2, ref). The voltage V m  is led to the analog-to-digital converter  530 . The control unit  510  reads the converter  530  and produces on the basis of die numbers received a reference number that corresponds to the amplitude of voltage V m . 
   The calibrating circuit  300  includes a switch k 5  connected in parallel with resistor R ref . When the switch is closed, voltage V m  becomes the output voltage of the differential amplifier A 1 . Let this unattenuated voltage be V 0 . When switch k 5  is open, voltage V m  is smaller than voltage V 0  because of the attenuation caused by the filter R ref , C n . Let this attenuated voltage be V n . The control unit calculates on the basis of the values of voltages V 0  and V n  the time constant R ref ·C n =T n  of the filter R ref , C n  being measured. Naturally the frequency value, which is in the control unit&#39;s memory, is also needed in the calculation. From the time constants T n  the control unit further calculates coefficients for the integrated resistors and capacitors such that all time constants of the filter calibrated are substantially correct. The control unit  510  sends said coefficients to the register unit  350 . Number S r1  determines the resistance values R 11  and R 12  in circuit stage  210 , number S r2  determines the resistance values R 21  and R 22  in circuit stage  220 , and number S c  determines the capacitance values C 21  and C 22  in circuit stage  220 . 
   The calibrating process for the structure in  FIG. 5  is in accordance with  FIG. 6 , for example. Step  61  comprises preliminary actions such as activating the functional units and starting the generation of the sine wave used in the measurements. In step  62  variable n, which indicates the phase of the calibration, is set to state  0 . This causes switch k 5  to close so that the measurement signal V g  will bypass the filters used in the measurement. In addition, step  62  comprises a certain delay Δt 1  so that voltage V m  will have time to settle before the analog-to-digital converter  530  is read. That reading takes place in step  63 . As a result of the read, the calibration control program PR generates a voltage value V 0  in which there is no attenuation caused by the filter measured. In step  64  the value of variable n is increased by one, which represents a transition to the next calibration phase. In phases  1 ,  2  and  3  the process sets the registers in the register unit  350  as needed (step  66 ), waits for a certain period of time Δt 2  (step  67 ), reads the converter  530  (step  68 ) and generates a value V n  for the voltage measured. When n is one, change-over switches k 1   a , k 1   b  and k 3  are set to state  1  and switches k 4  and k 5  are set to “open” so that external capacitor C 1  of the microcircuit  100  is connected in series with resistor R ref  and the other end of the capacitor is connected to ground. On the basis of measurement result V 1  the program PR calculates a calibration coefficient for testators R 11 , R 12  in circuit stage  210 . When variable n is two, change-over switches k 2   a  and k 2   b  are set to state  1  and change-over switch k 3  to state  2  go that external capacitor C 2  of the microcircuit  100  is connected in series with resistor R ref  and the other end of the capacitor is connected to ground. On the basis of measurement result V 2  the program PR calculates a calibration coefficient for resistors R 21 , R 22  in circuit stage  220 . At this phase the value of resistance R ref  has to be chanced according to the coefficient mentioned above. When variable n is three, change-over switches k 1   a , k 1   b , k 2   a  and k 2   b  are set to state  2  and switch k 4  to state “closed” so that an integrated reference capacitor C ref  is connected in series with resistor R ref  such that the other end of said capacitor is fixed to ground. On the basis of measurement result V 3  the program PR calculates a calibration coefficient for capacitors C 21 , C 22  in circuit stage  220 . When variable n is four, the process in this example enters in accordance with step  65  the final calibration phase  69  in which the generation of the measurement signal V g  is ceased, among other things. The calibration coefficients loaded into registers Sr 1 , Sr 2  and Sc remain in the registers. 
   The examples depicted in  FIGS. 5 and 6  have one filter to be calibrated. If, for example, the apparatus has got quadrature branches for the baseband signal, there are two similar filters to be calibrated which are preferably integrated on one circuit. There will then be more calibration phases, of course. If, for example, the filters are as in  FIG. 5 , the calibration of the resistances of both circuit stages in both filters need phases of their own. However, one measurement will suffice to set the capacitances of the latter circuit stages. 
     FIG. 7  shows an example of how the internal resistances and capacitances in the microcircuit can be adjusted.  FIG. 7   a  shows a variable resistance. It comprises six resistances R a , R b , R c , R d , R e  and R f  in series which, except for resistance R a , can be short-circuited. Resistance R b  can be short-circuited by switch k b  which is controlled by a digital signal b 0 . Correspondingly, resistance R c  can be short-circuited by switch k c  controlled by a digital signal b 1 , etc. Thus the overall resistance R is derived as follows:
   R=R   a   +b   0 · R   b   +b   1 · R   c   +b   2 · R   d   +b   3 · R   e   +b   4 · R   f . 
   State “0” of bits b 0  to b 4  corresponds to open switch and state “1” corresponds to closed switch. Then the byte b 0  b 1  b 2  b 3  b 4  corresponds in  FIGS. 3  to  6  to the resistance control signal R r . When all bits are “ones”, the resistance is at the highest (R max =R a +R b +R c +R d +R e +R f ), and when all bits are zeros, the resistance is at the lowest (R min=R   a ). Let us assume that the overall tolerance of the product of the external capacitance and the integrated resistance is about ±25%. Then the circuit is manufactured e.g. in such a manner that R b =0.32R a , R c =0.16R a , R d =0.08R a , R e =0.04R a  and R f =0.02R a . Now the control byte b 0  . . . b 4  can be used to choose the resistance from the range R a  . . . 1.6R a  with a resolution of 0.02R a . The value 1.3R a  corresponds to the nominal value of the resistance in question. Naturally the resolution of the adjustment can be improved by increasing the number of resistances, switches and control bits. 
     FIG. 7   b  shows an example of a variable capacitance. The arrangement is similar to the one above. For the total capacitance we get
   C=C   a   +b   0 · C   b   +b   1 · C   c   +b   2 · C   d   +b   3 · C   e   +b   4 · C   f . 
   Byte b 0  b 1  b 2  b 3  b 4  now corresponds to the capacitance control signal S c  in  FIGS. 3  to  6 . The partial capacitances are chosen such that the adjustment range of the total capacitance covers the tolerance for the product of the integrated resistance and capacitance added to the tolerance for the external capacitance. 
   Above it was described examples of filter calibration according to the invention. The invention is not limited to the arrangements described above. The filter may as well be any analog active filter the operation of which is not based on clock signals such as the clock signals of SC filters. It is possible to have various implementations for the measuring circuits that are used in the calibration circuit of the filter for measuring the charging time of die capacitor or the attenuation of the sine voltage. It is possible to control the time constants of the filter directly by adding switches without using integrated reference components. Calibration can also be controlled using a program run in a separate processor circuit instead of the processor circuit belonging to the measured equipment. lie structures of the variable resistances and capacitances may differ from those described. The inventional idea can be applied in various cases defined by the claims set forth below.