Inicio » Circuits

# Category Archives: Circuits

## Statistical analysis using Monte Carlo method (II)

**In the previous post, some single examples of the Monte Carlo method were shown. In this post it will be deeply analyzed, making a statistical analysis on a more complex system, analyzing its output variables and studying the results so that they will be quite useful. The advantage of simulation is that it is possible to get a random generation of variables, and also a correlation between variables can be set, achieving different effects in the analysis of the system performance. Thus, any system not only can be analyzed statistically using a random generation of variables, but also this random generation can be linked in a batch analysis or failures in production and in a post-production recovery.**

The circuits studied in the previous post were very simple circuits, allowing to see the allocation of random variables and their results when these random variables are integrated a more complex system. With this analysis, it is possible to check the performance and propose corrections which would limit statistically the variations in the final system.

In this case, the dispersive effect of the tolerances will be studied on one of the circuits where it is very difficult to achieve an stability in its features: an electronic filter. An electronic filter, passband type, will be designed and tuned to a fixed frequency, with a certain bandwidth in passband and stopband, and several statistical analysis will be done on it, to check its response with the device tolerances.

**DESIGN OF THE BANDPASS FILTER**

A bandpass filter design is done, with a 37,5MHz center frequency, 7MHz pass bandwidth (return losses ≥14dB) and a 19MHz stopband bandwidth (stopband attenuation >20dB). When the filter is calculating, three sections are got, and its schematic is

With the calculated values of the components, standard values which can make the filter transfer function are found, and its frequency response is

where it is possible to check that the center frequency is 37.5 MHz, the return losses are lower than 14dB at ± 3.5Mhz of the center frequency, and the stopband width is 18,8MHz, with 8,5MHz from the left of the center frequency and 10,3MHz to the right of the center frequency.

Then, once the filter is designed, a first statistical analysis is done, considering that the capacitor tolerance is ± 5% and the inductors are adjustable. In addition, there is not any correlation between the random variables, being able to take an random value independently.

**STATISTICAL ANALYSIS OF THE FILTER WITHOUT CORRELATION BETWEEN VARIABLES**

As it could be seen in the previous post, when there are random variables there is an output dispersion, so limits to consider a valid filter must be defined, from these limits, to analyze its valid frequency response. Yield analysis is used. This is an analysis using the Monte Carlo algorithm that it allows to check the performance or effectiveness of the design. To perform this analysis, the limits-for-validation specifications must be defined. The chosen specifications are return losses >13,5dB at 35÷40MHz, with a 2 MHzreduction in the passband width and an attenuation >20dB at frequencies ≤29MHz and ≥48MHz. By statistical analysis, it is got

whose response is bad: only 60% of possible filters generated by variables with a ±5% tolerance could be considered valid. The rest would not be considered valid by a quality control, which would mean that 40% defective material should be returned to the production, to be reprocessed.

It can be checked in the graph that the return loss are the primarily responsible for this bad performance. What could it be done to improve it? In this case, there are 4 random variables. However, two capacitors have of the same value (15pF), and when they are assembled in a production process, usually belong to the same manufacturing batch. If these variables show no correlation, variables can take completely different values. When they are not correlated, the following chart is got

However, when these assembled components belong to the same manufacturing batch, their tolerances vary always to the same direction, therefore there is correlation between these variables.

**STATISTICAL ANALYSIS OF THE FILTER WITH CORRELATION BETWEEN VARIABLES**

When the correlation is used, the influence of tolerances is decreased. In this case, it is not a totally random process, but manufacturing batches in which the variations happen. In this case, it is possible to put a correlation between the variables C1 and C3, which have the same nominal value and belong the same manufacturing batch, so now the correlation graph is

where the variation trend in each batch is the same. Then, putting a correlation between the two variables allows studying the effective performance of the filter and get

that it seems even worse. But what happens really? It must be taken into account that the variable correlation has allowed analyzing complete batches, while in the previous analysis was not possible to discern the batches. Therefore, 26 successful complete manufacturing processes have been got, compared to the previous case that it was not possible to discern anything. Then, this shows that from 50 complete manufacturing processes, 26 processes would be successful.

However, 24 complete processes would have to be returned to production with the whole lot. And it remains really a bad result. But there is a solution: the post-production adjustment.

**STATISTICAL ANALYSIS WITH POST-PRODUCTION ADJUSTMENT**

As it was said, at this point the response seems very bad, but remembering that the inductors had set adjustable. What happens now? Doing a new analysis, allowing at these variable to take values in ±10% over the nominal value, and setting the post-production optimization in the Monte Carlo analysis and voilà! Even with a very high defective value, it is possible to recover 96% of the filters within the valid values.

So an improvement is got, because the analysis is showing that it is possible to recover almost all of the batches with the post-production adjustment, so this analysis allows showing not only the defective value but also the recovery posibilities.

It is possible to represent the variations of the inductors (in this case corresponding to the serial resonances) to analyze what is the sensitivity of the circuit to the more critical changes. This analysis allows to set an adjustment pattern to reduce the adjustment time that it should have the filter.

So, with this analysis, done at the same time design, it is possible to take decisions which set the patterns of manufacturing of the products and setting the adjustment patterns for the post-production, knowing previously the statistic response of the designed filter. This analysis is a very important resource before to validate any design.

**CONCLUSIONS**

In this post, a more grade in the possibilities of using Monte Carlo statistical analysis is shown, using statistical studies. The algorithm provides optimal results and allows setting conditions for various analysis and optimizing more the design. Doing a post-production adjustment, it is possible to get the recovery grade of the proposed design. In the next post, another example of the Monte Carlo method will be done that allows seeing more possibilities over the algorithm.

**REFERENCES**

- Castillo Ron, Enrique,
*“Introducción a la Estadística Aplicada”,*Santander, NORAY, 1978, ISBN 84-300-0021-6. - Peña Sánchez de Rivera, Daniel,
*“Fundamentos de Estadística”,*Madrid, Alianza Editorial, 2001, ISBN 84-206-8696-4. - Kroese, Dirk P., y otros, “Why the Monte Carlo method is so important today”, 2014, WIREs Comp Stat, Vol. 6, págs. 386-392, DOI: 10.1002/wics.1314.

## Statistical analysis using Monte Carlo method (I)

**When any electronic device is designed, we can use several deterministic methods for calculating its main parameters. So, we can get the parameters that we measure physically in any device or system. These preliminary calculations allow the development and their results are usually agreed with the prediction. However, we know that everything we manufacture is always subject to tolerances. And these tolerances cause variations in the results that often can not be analyzed easily, without a powerful calculation application. In 1944, Newmann and Ulam developed a non-deterministic, statistical method called Monte Carlo. In the following blog post. we are going to analyze the use of this powerful method for predicting possible tolerances in circuits, especially when they are manufactured industrially.**

In any process, the output result is a function of the input variables. These variables generate a response which can be determined, both if the system is linear and if it is not linear. The relationship between the response and the input variables is called transfer function, and its knowledge allows us to get any result concerning the input excitation.

However, it must be taken in account that the input variables are random variables, with their own distribution function, and are subject to stochastic processes, although their behavior is predictable through the Theory of Probability. For example, when we make any measure, we get its average value and the error in which can be measured that magnitude. This allows to limit the environment in which it is correct and decide when the magnitude behaves incorrectly.

For many years, I have learned to successfully transform the results obtained by simulations in real physical results, with predictable behavior and I got valid conclusions, and I have noticed that in most cases the use of the simulation is reduced to get the desired result without studying the dependence of the variables in that result. However, most simulators have very useful statistical algorithms that, properly used, allow to get a series of data that the designer can use in the future, predicting any system behavior, or at least analyzing what it can happen.

However, these methods are not usually used. Either for knowledge lack of statistical patterns, or for ignorance of how these patterns can be used. Therefore, in these posts we shall analyze the Monte Carlo method on circuit simulations and we shall discover an important tool which is unknown to many simulator users.

**DEVICES LIKE RANDOM VARIABLES**

Electronic circuits are made by simple electronic devices, but they have a statistical behavior due to manufacturing. Device manufacturers usually show their nominal values and tolerances. Thus, a resistance manufacturer not only publishes its rating values and its dimensions. Tolerances, stress, temperature dependance, etc., are also published. These parameters provide important information, and propertly analyzed with a powerful calculation tool (such as a simulator), we can predict the behavior of any complex circuit.

In this post, we are going to analyze exclusively the error environment around the nominal value, in one resistor. In any resistor, the manufacturer defines its nominal value and its tolerance. We asume these values 1kΩ for the nominal value and ± 5% for its tolerance. It means the resistance value can be found between 950Ω and 1,05kΩ. In the case of a bipolar transistor, the current gain β could take a value between 100 and 600 (i.e. NXP BC817), which may be an important and uncontrollable variation of current collector. Therefore, knowing these data, we can analyze the statistical behavior of an electronic circuit through the Monte Carlo method.

First, let us look resistance: we have said that the resistance has a ± 5% tolerance. Then, we will analyze the resistor behavior with the Monte Carlo method, using a circuit simulator. A priori, we do not know the probability function, although most common is a Gaussian function, whose expression is well known

being μ the mean and σ² the variance. Analyzing by the simulator, through Monte Carlo method and with 2000 samples, we can get a histogram of resistance value, like it is shown in the next figure

Monte Carlo algorithm introduces a variable whose value corresponds to a Gaussian distribution, but the values it takes are random. If these 2000 samples were taken in five different processes with 400 samples each one, we would still find a Gaussian tendency, but their distribution would be different

Therefore, working properly with the random variables, we can get a complete study of the feasibility of any design and the sensitivity that each variable shows. In the next example, we are going to analyze the bias point of a bipolar transistor, whose β variation is between 100 and 600, being the average value 350 (β is considered a Gaussian distribution), feeding it with resistors with a nominal tolerance of ± 5% and studying the collector current variation using 100 samples.

**STATISTICAL ANALYSIS OF A BJT BEHAVIOR IN DC**

Now, we are going to study the behavior of a bias circuit, with a bipolar transistor, like the next figure

where the resistors have a ±5% tolerance and the transistor has a β variation between 100 and 600, with a nominal value of 350. Its bias point is I_{c}=1,8mA, V_{ce}=3,2V. Making a Monte Carlo analysis, with 100 samples, we can get the next result

Seeing the graph form, we can check that the result converges to a Gaussian distribution, being the average value I_{c}=1,8mA and its tolerance, ±28%. Suppose now that we do the same sweep before processing, in several batches of 100 samples each one. The obtained result is

where we can see that in each batch we get a graph which converges to a Gaussian distribution. In this case, the Gaussian distribution has an average value μ=1,8mA and a variance σ²=7%. Thus, we have been able to analyze each process not only like a global statistical analysis but also like a batch. Suppose now that β is a random variable with an uniform distribution function, between 100 and 600. By analyzing only 100 samples, the next graphic is got

and it can be seen that the current converges to an uniform distribution, increasing the current tolerance range and the probability at the ends. Therefore, we can also study the circuit behaviour when it shows different distribution functions for each variable.

Seeing that, with the Monte Carlo method, we are able to analyze any complex circuit behavior in terms of tolerances, in the same way it will help us to study how we could correct those results. Therefore, in the next posts we shall analyzed deeply this method, increasing the study of its potential and what we can be achieved with it.

**CORRECTING THE TOLERANCES**

In the simulated circuit, when we have characterized the transistor β like an uniform random variable, we have increased the probability into unwanted current values (at the ends). This is one of the most problematic features, not only on bipolar transistors but also on field effect transistor: the variations of their current ratios. This simple example let see what happens when we use a typical correction circuit for the β variation, like the classic polarization by emitter resistance.

Using this circuit and analyzing by Monte Carlo, we can compare its results with the analysis obtained in the previous case, but using 1000 samples. The result is

where we can check that the probability values have increased around 2mA, reducing the probability density at the low values of current and narrowing the distribution function. Therefore, the Monte Carlo method is a method that not only enables us to analyze the behavior of a circuit when subjected to a statistical, but also allow us to optimize our circuit and adjust it to the desired limit values. Used properly, it is a powerful calculation tool that will improve the knowledge of our circuits.

**CONCLUSIONS**

In this first post, we wish to begin a serie dedicated to Monte Carlo method. In it, we wanted to show the method and its usefulness. As we have seen in the examples, the use of Monte Carlo method provides very useful data, especially with the limitations and variations of the circuit we are analyzing if we know how they are characterized. On the other hand, it allows us to improve it using statistical studies, in addition to setting the standards for the verification of in any production process.

In the next posts we shall go more in depth on the method, by performing a more comprehensive method through the study of a specific circuit of one of my most recent projects, analyzing what the expected results and the different simulations that can be performed using the method of Monte Carlo, like the worst case, the sensitivity, and the post-production optimization.

**REFERENCES**

- Castillo Ron, Enrique,
*“Introducción a la Estadística Aplicada”,*Santander, NORAY, 1978, ISBN 84-300-0021-6. - Peña Sánchez de Rivera, Daniel,
*“Fundamentos de Estadística”,*Madrid, Alianza Editorial, 2001, ISBN 84-206-8696-4. - Kroese, Dirk P., y otros, “Why the Monte Carlo method is so important today”, 2014, WIREs Comp Stat, Vol. 6, págs. 386-392, DOI: 10.1002/wics.1314.

## A 900Mhz Feedfordward Amplifier with MOSFET

*In this article, we are going to demonstrate a 900Mhz feedforward amplifier design. Feedforward is a linearization technique for the IM distortion, caused by the nonlinear feature of the active device. Lateral interference, generated by the IM distortion on both sides of the main frequency, affecting the Adjacent Channel. Decreasing this interference is the purpose of this entry*.

We are going start with * a LDMOS amplifier*, tuned to 900Mhz. The active device is a STMicroelectronics’ MOSFET, PD84001, It

operates at 8 V in common source mode at frequencies of up to 1 GHz. P

_{OUT}is 31dBm (I

_{DQ}=50mA) and Drain Efficiency, 60%. Once we have designed the amplifier, we’ll make the linearization of the IM products, using the feedforward technique.

**THE MOSFET AMPLIFIER**

The amplifier is designed in common source mode. The Operating Point is chosen as the optimal features of the manufacturer: V_{DS}=8V, I_{DQ}=50mA . At this OP, and at 900MHz, Z_{IN}=3,6+j·4,3Ω and Z_{OUT}= 3,9 + j·5,5Ω. Maximum power transfer is obtained with a conjugate matching network at the generator and load impedances, which are Z_{0}=50. Once the matching networks are calculated, the purposed schema for the amplifier is

Amplifier’s gain is * 34,3dB*, and its phase is

*. Input and Output Return Losses are respectively 30,7 and 39,8dB. Then, the amplifier is matched and the maximum power at 900MHz is 27dBm, for 1-Tone.*

**76,4deg**For a 2-Tone input, the IM distortion generates a power drop, caused by the Third Order Distortion. TOI (*Third Order Intercept*) is * 31,7dBm*, near of the maximum output power of the datasheet, and it causes the power drop.

Intermodulation products are * 12dB* below the carrier, and this value may cause interference on the Adjacent Channel. Therefore, we must reduce this value as much as possible, using a linearization technique.

There are many linearization techniques, but we are going to use the * feedforward technique*, because it is a technique that requires only the use of RF networks.

The amplifier gain, including the second and third order distortions, could be expressed by

Where the input signal P_{i} is a 2-Tone signal. In this case, * we will not take into consideration the second order distortion*, since the P

_{i }frequencies will be very close together.

**A bandpass filter could remove**the second order spurious.

The amplifier gain is complex, The coefficients **g _{1}** and

**g**could be expressed using the polar notation (in

_{3}*). Then, these are*

**mag/phase**These coefficients * are going to use to calculate the phase shifter of the first stage*. Now, we shall describe shortly the feedforward technique.

**FEEDFORWARD PRINCIPLE**

The Feedfordward Principle is based on * reducing the distortion by mixing in phase opposition with the same distortion*. In a RF amplifier, an output distorted signal is generated

*. It could be mixed with the input signal in phase opposition, adjusting the levels of both signals. So, we get the distorted signal on one port, and on the other port, only the distortion spurious.*

**due to the active device’s nonlinearity**Cancellation of the main signals on the second port is achieved * by placing a delay line* (

*), in the secondary network of the first stage. One sample of the signal output of the amplifier (*

**τ1***) is derived to combine with the secondary network, with a combiner. The levels of both signals are equalized by an inter-stage attenuator (*

**G1***). Then, both signals are combined. Then, the ouput signal of the amplifier is called*

**β***, and the combined signal,*

**MAIN***.*

**AUX**

** AUX** is now used as an error signal in the second stage, which

*(*

**is***mplified by an error amplifier***a***), while the*

**G2***(*

**MAIN is delayed with another delay line***). In this second stage, we want to get the same effect than the first stage: put both signals in phase opposition, and combine them. Then, the distortion is cancelled and reduced the interference on the Adjacent Channel.*

**τ2**The level at the output of the amplifier could be written as

and * P_{AUX1}* (the sample level before the error combiner) could be expressed by

The level * P_{AUX2}* at the secondary network is

In these expressions, * β* is the magnitude of the losses of the inter-stage attenuator and

*is its phase; and*

**θ**_{β}*is the phase of the delay line*

**θ**_{A2}*. It must be satisfied*

**τ1*** θ_{1}* is the phase of the linear gain of the amplifier. Then,

*, but also*

**not only the phases must be in phase opposition***. In magnitude, it must be satisfied*

**the delay time must be the same in every subnetworks****|**.

*β*·g_{1}|=1In the second stage, the gain of the amplifier must equalize the **g**** _{2}** and

**g**levels, and their phases must satisfy the same equations (absolute phase and delay time) of the first stage, to combine and cancel the distortions.

_{3}In RF designs, the adders must be replace by hybrid couplers or directional couplers, which have insertion and coupler losses. Using two hybrid couplers (3dB for insertion losses) to split * P_{i}* and combine

*and*

**P**_{AUX1}*, and two directional couplers (with*

**P**_{AUX2}*for coupler losses) to take the sample in the first stage and combine the error sample in the second stage, the expressions are now*

**C**at the first stage and

at the second stage.

In a narrowband amplifier, * delay time could not be considered*, because

*.*

**its phase slope will be smallest than the phase slope of a broadband amplifier****900MHz FEEDFORDWARD AMPLIFIER**

Now, we are going to design our feedforward amplifier, based in our two-stage LDMOS amplifier. In first, we must split the input signal in two outputs, one to the amplifier and the other to the phase shifter. We are going to use an * 180-deg hybrid coupler*, with 3dB of insertion losses. At this frequencies, hybrid couplers could be easily found in the market, as a

**S***(*

**urface Mounting Device****).**

*SMD**.*

**The designed amplifier is a narrowband amplifier**The output levels of the hybrid coupler are the same, in magnitude and phase. The phase of the amplifier gain was * 76,4deg* in linear mode, but in nonlinear mode, we have got a phase of

*, with 0dBm of input power. Taking a sample of the output level of the amplifier with a directional coupler, which introduces a*

**69,4deg***coupling phase, with 10dB of coupling level, we have got a sample level of 12dBm, with a phase of*

**90deg***.*

**159,4deg**Then, we are going to * combine with another hybrid coupler*, and as in the secondary network the level is -6dBm, we have to equalize both levels with the attenuator, whose attenuation must be ≈20dB. The phase shifter should be adjusted to a phase of ≈-12 deg.

Adjusting the phase and the level with the phase shifter and the attenuator, we are able to optimize the response for several input levels.

We are going to complete now the second stage amplifier, where an error amplifier increases the level of * AUX* spurious intermodulation to combine in phase opposition with the

*line. The error amplifier*

**MAIN***should not be a power amplifier, at this stage. A linear, general-purpose amplifier maybe used. The gain is calculated by the difference between the*

**G2***and*

**MAIN****IM spurious. This value is 45,5dB, because we are**

*AUX**in the*

**combining with a directional coupler, to reduce the insertion losses***line. Using an amplifier with a magnitude of*

**MAIN***and a phase of*

**45,5dB***, we have got a phase shifter with the same value, and after the coupler, the IM distortion decreases around*

**-145deg***. The output level is now*

**65dB***, and the TOI*

**31dBm***.*

**increases to 75dBm**The definitive amplifier is

**CONCLUSIONS**

With the amplifier designed we have achieved a significant improvement: increasing efficiency around * 40dB* for the same output level, on adjacent channel. Furthermore, the amplifier is very simple to realize

*. The design is*

**with a few RF devices***.*

**very easy and intuitive**However, the Feedforward has two serious disadvantages: on the PCB, * it needs a lot of surface*; and the input level

*above the input level that provides maximum output level of the MOSFET, because the distortion can be increased above the value we have corrected.*

**cannot be increased**In broadband we must take into consideration * not only the phase of the amplifiers but also the group delay*, because the phase slope of the amplifiers has to be compensated by the phase shifter. Then,

*, because it must be a delay line, too.*

**the phase shifter could have a larger surface dimensions****References**

- R. Cordell, “
*A MOSFET Power Amplifier with Error Correction*”; JAES, vol. 32, nr. 1/2, 1984 Jan/Feb - J. Vanderkooy, S.P. Lipshitz, “
*Feed-Forward Error Correction in Power Amplifiers*”, JAES, Vol. 28, Nr. 1/2, 1980 Feb - A.M. Sandman, “
*Reducing Distortion by ‘Error add-on*‘”, Wireless World, vol.79, p.32, 1974 Oct