RFIC Design

RFInsights

A Journey from Resonance to Impedance Matching

Chp. 1: Origin of Q-Factor

The Deadly Beginnings

#1 When a Capacitor discharges through Resistor

Let’s start from a capacitor C. Charge it to 1V. Now connect it to a resistor R. What will happen? Capacitor will lose charge exponentially. You would say, ok, my time constant \(\tau\) is RC, so in about 5\(\tau\) seconds, my capacitor would have lost it all because that’s how an exponential function goes.

capacitor discharges through resistor in 5 time constants

Ever wonder though why did it have to be an exponential function? Why couldn’t it be linear or some other function for that matter? Asking such questions is important to build upon fundamentals. The way current is drawn from the capacitor depends on the load connected to it. A resistor is such a load which demands from the capacitor to send the charge in a way that rate of change of charge is equal to charge itself at any point in time. Let’s do some math to see this.

$$V_C+V_R=0$$ $$\frac{Q(t)}{C} + RI(t) = 0$$ $$\frac{Q(t)}{C} + R\frac{d}{dt}Q(t) = 0$$ $$\frac{d}{dt}Q(t) = \frac{-1}{RC} Q(t)$$ $$ \implies \frac{d}{dt}Q(t) = -Q(t) \;\;\;\;\;\;\text{(say R=C=1)} $$

What is something whose derivative is equal to its current value? Think about it. It’s an exponential function.

$$\implies Q(t) = e^{-t}$$ $$ \text{or}\;\;\; Q(t) = {\Large e^{\frac{-t}{RC}}} \;\;\;\;\text{(general solution)}$$

Therefore, the charge (or the derivative of charge which is current) decays exponentially. A resistor will always draw current from the capacitor exponentially. Story changes for an inductor.

#2 When a Capacitor discharges through an Inductor

Let’s start again from a capacitor C. Charge it to 1V. Now connect it to an inductor L. What will happen? Capacitor will lose charge in a sinusoid fashion.

 

When you connect this charged capacitor to an inductor, the capacitor will start losing its charge, so the voltage would start decreasing Current would start flowing and inductor will begin to expand its magnetic field. When the capacitor has lost it all (at T/4), and there is no charge to flow, current would have collapsed to zero except that inductor resists the sudden change in current (because of back EMF). So, the inductor keeps the current flowing in same direction and capacitor starts getting charge from inductor, and charges with opposite polarity now. A time (T/2) comes when inductor has lost it all (magnetic field has collapsed) and all the charge is transferred to capacitor. Capacitor will discharge through inductor again, then inductor discharges through capacitor again, and this goes on. The cycle repeats. We call this behavior resonance, and the LC tank as resonator.

Charge exchange between inductor and capacitor is sinusoid by nature

The questions arise:

  • Why is it sinusoid though, why couldn’t it be something else say a triangular waveform?
  • What is the time period of this energy exchange? How fast does capacitor gets discharged now?
$$V_C+V_L=0$$ $$\frac{Q(t)}{C} + L\frac{d}{dt}I(t) = 0$$ $$\frac{Q(t)}{C} + L\frac{d^2}{dt^2}Q(t) = 0$$ $$\frac{d^2}{dt^2}Q(t) = \frac{-1}{LC} Q(t)$$ $$ \implies \frac{d^2}{dt^2}Q(t) = -Q(t) \;\;\;\;\;\;\text{(say L=C=1)} $$
What is something whose derivative of derivative is equal to its current value? Think about it. It’s one and only a sinusoidal function. (Exponential was a good candidate here too but it failed the -ive sign, double deriv of \(e^{-x}\) is +ive \(e^x\))
$$\implies Q(t) = cos(t)$$ $$ \text{or}\;\;\; Q(t) = cos\left(\frac{t}{\sqrt{LC}}\right) \;\;\;\;\text{(general solution)}$$ $$ \text{or}\;\;\; Q(t) = cos(\omega_0t) \;\;\;\;\text{where}\;\; \omega_0 = \frac{1}{\sqrt{LC}}$$

Therefore, the charge on capacitor (or voltage as V=Q/C) is exchanged with inductor in a cosine fashion, and the time period of this exchange is T/4 (meaning 4 charge exchanges happened in one cycle)

How fast is the charge exchange in LC compared to RC? Assume R=C=L=1, the charge on capacitor would decay in 5 sec for RC and \(\frac{\pi}{2}\) sec for LC which is about \(\pi\) times faster than RC!

#3 When a Capacitor Discharges through Resistor and Inductor

#3.1 Qualitative Explanation

Let’s go back again. Charge the capacitor C to 1V. Connect it to a resistor R and inductor L. What will happen? Capacitor will exchange charge with inductor again in a sinusoid fashion except that resistor will demand the charge exponentially. Energy exchange may go on for a couple cycles until the resistor has dissipated all the charge away . We would call this a bad quality resonator which couldn’t sustain resonance. I think you are getting an idea where we are heading. Let’s keep developing our thought:

 

If we were to compare two resonators say L1C and L2C where L1>L2, say both have a resistor R in parallel to them. Do both these resonators have same quality (after all R is same)? No. Turns out that L2C is a better resonator than L1C (L2C sustained more oscillations). So, then that’s how folks started quantifying resonators. Look at how many oscillations, and that is the quality factor of a resonator (well sort of, not very precise, but visually if you were to look at a resonator response, you would just count the number of cycles it sustained oscillation, and that would be your approximate Q factor of circuit, and this is happens to be an interview question)

quality factor of resonator means number of cycle it takes charge to die out

Ok, visually we can determine Q-factor by looking at number of cycles. But how should we quantify it mathematically? Is there a way by looking at RLC values, we could tell the quality of a resonator? That is what folks also felt and ended up discovering Q=R/X relation. Here’s how it would have happened:

 

So, for resonator to be a good quality or let’s say have at least one cycle of oscillation, we would say, hey 5RC time of charge decay in a pure RC should be greater than T0 time of oscillation in a pure LC. This way we would make sure that at least one cycle of back and forth charge transfer between capacitor and inductor happened before resistor could lose it all away. Let’s write that down mathematically:

$$5\tau = T_0 \;\;\;\;\;\text{where }5\tau\text{ is time it takes for charge to decay in pure RC and } T_0 \text{ is the time period of an oscillation in pure LC}$$ $$5f_0RC = 1 $$ $$5\omega_0RC = 2\pi$$ $$\omega_0RC = 1.25 \approx 1$$ $$\text{(don't mind our assumption of 1.25 almost 1. This is a just a qualitative discussion. We will arrive at precise relation in quantitative explanation soon)}$$

This tells us that if \(\omega_0\)RC is equal to one, we could hope to see at least one oscillation (because we would have ensured 5RC decay is longer than one oscillation time period). If it is two, we would see two oscillations. That’s it. We have arrived at our metric of Quality for resonators. The term \(\omega_0\)RC is what we can call as quality factor. You don’t need to count cycles now. Just evaluate \(\omega_0\)RC for resonator and that will be the number of cycles your resonator is going to survive. A little manipulation reveals, that \(\omega_0\)RC is actually a ratio of R and X.

$${\LARGE \textcolor{#40CE7F}{Q = \omega_0RC = \frac{R}{X}}}$$ $$\text{or}\;\;\; Q = \frac{1}{\sqrt{LC}}RC =R\sqrt{\frac{C}{L}}$$

So, quality of a resonator depends on all, R & C & L. It’s not just R, or RC time constant or LC resonance frequency. Everything put together in above expression is your measure of Quality. Now you can also appreciate why L2 in above example gave higher Q than L1. This concludes our discussion on how the term Quality factor originated, how was it used to compare resonators by looking at number of cycles, and how did those cycles ended up being equal to R/X. 

#3.2 Quantitative Explanation

(Caution: Lots of math coming, good if it has been long and you want to refresh couple things, best if you really want to see things through, bad if you are like young me who didn’t appreciate math)

Let’s try to derive response of a parallel RLC tank. We can write currents as:

$$i_c+i_R+i_L = 0$$ $$C\frac{d}{dt}V(t)+\frac{V(t)}{R}+\frac{1}{L}\int\,V(t)\,dt = 0$$ $$C\frac{d^2}{dt^2}V(t)+\frac{1}{R}\frac{d}{dt}V(t)+\frac{V(t)}{L} = 0$$ $$\frac{d^2}{dt^2}V(t)+\frac{1}{RC}\frac{d}{dt}V(t)+\frac{1}{LC}V(t) = 0$$ $$\frac{d^2}{dt^2}V(t)+\frac{\omega_0}{Q}\frac{d}{dt}V(t)+\omega_0^2 = 0 \;\;\;\;\text{where } Q=\omega_0RC \;\text{ & }\; \omega_0=\frac{1}{\sqrt{LC}}$$

This is a second order linear homogenous differential equation with constant coefficients.

  • Linear because it has a variable and its derivative, both present in this equation.
  • Homogenous because each term is only related to one variable or its derivative.
  • Constant co-efficient because \(\omega_0\) and Q are constants.


Linear homogenous differential equations with constant coefficients can be reduced to characteristic equations and solve algebraically as follows:

$$s^2+\frac{\omega_0}{Q}s+\omega_0^2$$ $$ \text{Using Quadratic formula}\;\; s_{1,2} = \frac{1}{2}\left[\frac{-\omega_0}{Q}\pm\sqrt{\frac{\omega_0^2}{Q^2}-4\omega_0^2}\right]$$ $$ \implies s_{1,2} =-\frac{\omega_0}{2Q}\pm\omega_0\sqrt{\frac{1}{4Q^2}-1}$$ $$ \text{or}\;\; s_{1,2} =-\frac{\omega_0}{2Q}\pm j\omega_0\sqrt{1-\frac{1}{4Q^2}} = -\alpha \pm j\omega_d$$
The general solution of 2nd order differential equation is a linear combination of exponentials (unless the roots are repeated which happens in case of critical damping i.e., when Q=0.5 in that case solution is little different)
$$V(t) = K_1e^{s_1t}+K_2e^{s_2t}$$

where K1 and K2 can be found through initial conditions. At t=0, we had capacitor charged to 1V (let’s say Vo to make it generic). Let’s put that in.

$$V(0) = K_1e^{s_1.0}+K_2e^{s_2.0}$$ $$V_o = K_1+K_2\;\;\;\;(1)$$

At t=0, the inductor had zero current flowing through. Let’s put that in.

$$I_L(t) = \frac{1}{L}\int V(t)dt$$ $$\implies \int V(t)dt = 0 \;\;\; \text{at t=0}$$ $$\frac{K_1}{s_1}+\frac{K_2}{s_2}+ 0= 0 \;\;\; \text{(const from indefinite integral is zero because there was no current before t=0)}$$ $$K_1 = -K_2\frac{s_1}{s_2}$$

Put this in (1), we get our K1 and K2

$$K_2 = -\frac{s_2V_o}{s_1-s_2}$$ $$K_1 = \frac{s_1V_o}{s_1-s_2}$$

Let’s plug these in our general solution, and simplify to see a more plausible form of V(t):

\begin{alignat*}{6} V(t) =&\; \frac{V_o}{s_1-s_2} \;[\; s_1e^{s_1t} \;-\; s_2e^{s_2t}\;]\\ =&\; \frac{V_o}{s_1-s_2} \;[\; s_1e^{s_1t} \;-\; s_2e^{s_2t}\;]\\ =&\; \frac{V_o}{2j\omega_d} \;[\; -\alpha(e^{s_1t}-e^{s_2t}) \;+\; j\omega_d(e^{s_1t}+e^{s_2t})\;]\\ =&\; \frac{V_o}{2j\omega_d} \;[\; -\alpha(e^{-\alpha t}e^{j\omega_dt}-e^{-\alpha t}e^{-j\omega_dt}) \;+\; j\omega_d(e^{-\alpha t}e^{j\omega_dt}+e^{-\alpha t}e^{-j\omega_dt})\;]\\ =&\; \frac{V_o}{2j\omega_d}e^{-\alpha t} \;[\; -\alpha(e^{j\omega_dt}-e^{-j\omega_dt}) \;+\; j\omega_d(e^{j\omega_dt}+e^{-j\omega_dt})\;]\\ =&\; V_oe^{-\alpha t} \;[\; -\frac{\alpha}{\omega_d}\frac{e^{j\omega_dt}-e^{-j\omega_dt}}{2j} \;+\; \frac{e^{j\omega_dt}+e^{-j\omega_dt}}{2}\;]\\ =&\; V_oe^{-\alpha t} \;[\; -\frac{\alpha}{\omega_d}sin(\omega_dt) \;+\; cos(\omega_dt)\;]\\ =&\; \frac{V_o}{\omega_d}e^{-\alpha t} \;[\; -\alpha sin(\omega_dt) \;+\; \omega_d cos(\omega_dt)\;]\;\;\;\text{(2)}\\ =&\; V_o\frac{\omega_o}{\omega_d}e^{-\alpha t} \;[\; -\frac{\alpha}{\omega_o}sin(\omega_dt) \;+\; \frac{\omega_d}{\omega_o}cos(\omega_dt)\;]\;\;\;\text{(multiply and divide by }\omega_o \text{ )}\\ \end{alignat*}
Say phi is angle between \(\omega_o\) and \(\omega_d\) as shown in image below:
poles location of a RLC circuit
$$\implies cos(\phi) = \frac{\omega_d}{\omega_o} \;\;\;\text{&}\;\;\; sin(\phi) = \frac{\alpha}{\omega_o} $$

Plug these in equation above:

$$V(t) =\; V_o\frac{\omega_o}{\omega_d}e^{-\alpha t} \;[\; -sin(\phi)sin(\omega_dt) \;+\; cos(\phi)cos(\omega_dt)\;]$$ $${\LARGE \textcolor{#40CE7F}{V(t) =\; V_o\,\frac{\omega_o}{\omega_d}\,e^{-\alpha t}\,cos(\omega_dt + \phi)}} $$

and finally, we have done it, we have our rigorous math exercise telling us exactly the same thing: your RLC is a resonator, oscillating at frequency \(\omega_{d}\) (which is lesser than \(\omega_o\)), with a starting phase of \(\phi\), and amplitude is scaled by a decaying exponential.

Also interesting to note that, in pure RC, voltage dies out in 5RC seconds, but in RLC, voltage dies out in 10RC.

$${\Large e^{-\frac{t}{RC}} \implies e^{-\frac{5RC}{RC}}} \;\;\; \text{(exponential took t=5RC to die out in pure RC)} $$ $${\Large e^{-\alpha t} \implies e^{-\frac{\omega_o t}{2Q}} \implies e^{-\frac{t}{2RC}} \implies e^{-\frac{10RC}{2RC}}} \;\;\; \text{(exponential took t=10RC to die out in RLC)} $$

#3.3 Precise Relation between Q and Number of Cycles

We said that Q is approximately equal to number of cycles it takes for your voltage to die out with time. Let’s figure out the exact relation between Q and number of cycles N.


For exponential e-t to die out, we consider t=5 to be sufficient time (remember 5 time constants in case of RC). So our, cosine will die out when:

$$e^{-\alpha t} = e^{-5}$$ $$\alpha t= 5$$ $$\frac{\omega_o}{2Q} t= 5$$ $$\frac{2\pi}{2Q}\frac{t}{T} = 5$$ $$t = \frac{5Q}{\pi}T$$
This means our voltage would die out after \(\dfrac{5Q}{\pi}\) time periods (or number of cycles).
$$ N = \frac{5Q}{\pi}$$ $${\LARGE \textcolor{#40CE7F}{N = 1.6\,Q}}$$

This is the precise relation between Q and N. Q is equal to 1.6 number of cycles. So for example, if Q is 5, you should see about 8 cycles of oscillation before it is all vanished.

(and by vanish we mean when it has reduced to e-5 which is 0.7% i.e., 7mV for 1V initial voltage)

We inserted V(t) equation in Desmos, go ahead and play with Q factor below, count the number of cycles.

#4 Origin of Classical Definition of Q

To close the topic, let’s now try to understand the origin of classical definition of Q (saying Q equals energy stored over energy destroyed). To do that, we need a little bit of more math. Bear with us. Let’s nail this down while we are at it. Current through capacitor can be written as:

$$ i_c(t) = C \frac{d}{dt}V(t)$$

Plug V(t) expression of Eq. (2) in

\begin{alignat*}{6} i_c(t) =&\; C \frac{d}{dt}\left[\frac{V_o}{\omega_d}e^{-\alpha t}\{\omega_d cos(\omega_d t)-\alpha sin(\omega_d t)\}\right]\\ =&\; C \frac{V_o}{\omega_d}\left[-\alpha e^{-\alpha t} \{ \omega_d cos(\omega_d t) -\alpha sin(\omega_d t)\}+e^{-\alpha t} \{-\omega_d^2 sin(\omega_d t) -\alpha \omega_d cos(\omega_d t)\}\right]\\ =&\; C \frac{V_o \omega_o}{\omega_d}\left[-\alpha e^{-\alpha t} \{ \frac{\omega_d}{\omega_o} cos(\omega_d t) -\frac{\alpha}{\omega_o} sin(\omega_d t)\}+e^{-\alpha t} \{-\frac{\omega_d}{\omega_o}\omega_d sin(\omega_d t) -\frac{\alpha}{\omega_o} \omega_d cos(\omega_d t)\}\right]\\ =&\; C \frac{V_o \omega_o}{\omega_d}\left[-\alpha e^{-\alpha t} \{ cos(\phi) cos(\omega_d t) -sin(\phi) sin(\omega_d t)\}-e^{-\alpha t}\omega_d \{+cos(\phi) sin(\omega_d t) +sin(\phi)cos(\omega_d t)\}\right]\\ =&\; C \frac{V_o \omega_o}{\omega_d}\left[-\alpha e^{-\alpha t} \{cos(\omega_d t + \phi)\}-e^{-\alpha t}\omega_d \{sin(\omega_d t + \phi)\}\right]\\ =&\; -C \frac{V_o \omega_o}{\omega_d}e^{-\alpha t}\left[\alpha \{cos(\omega_d t + \phi)\} + \omega_d \{sin(\omega_d t + \phi)\}\right]\\ =&\; -C \frac{V_o \omega_o^2}{\omega_d}e^{-\alpha t}\left[\frac{\alpha}{\omega_o} \{cos(\omega_d t + \phi)\}+ \frac{\omega_d}{\omega_o} \{sin(\omega_d t + \phi)\}\right]\\ =&\; -C \frac{V_o \omega_o^2}{\omega_d}e^{-\alpha t}\left[sin(\phi)cos(\omega_d t + \phi)+ cos(\phi)sin(\omega_d t + \phi)\right]\\ =&\; -C \frac{V_o \omega_o^2}{\omega_d}e^{-\alpha t}\left[sin(\omega_d t)\right]\\ =&\; -C \frac{V_o}{LC \omega_d}e^{-\alpha t}\left[sin(\omega_d t)\right]\\ =&\; -\frac{V_o}{L\omega_d}e^{-\alpha t}\left[sin(\omega_d t)\right] \end{alignat*}

We know, at resonance, inductor and capacitor currents are out of phase for parallel RLC (like cap current is -jI, ind current is +jI, thus 180 out of phase). Therefore, we can give inductor current by removing negative sign of capacitor current:

$${\LARGE \textcolor{#40CE7F}{i_L(t) =\; \frac{V_o}{L\omega_d}\,e^{-\alpha t}\,sin(\omega_d t)}}$$

Now, energy in the tank at any point in the time can be given as:

\begin{alignat*}{6} W_T(t) &= W_C(t) + W_L(t)\\ &= \frac{1}{2}CV^2(t) + \frac{1}{2}L\,i_L^2(t)\\ &= \frac{1}{2}C\left[V_o\,\frac{\omega_o}{\omega_d}\,e^{-\alpha t}\,cos(\omega_dt + \phi)\right]^2 + \frac{1}{2}L\left[\frac{V_o}{L\omega_d}\,e^{-\alpha t}\,sin(\omega_d t)\right]^2\\ &= \frac{1}{2}V_o^2e^{-2\alpha t}\left[C\frac{\omega_o^2}{\omega_d^2}cos^2(\omega_dt + \phi) + \frac{1}{L\omega_d^2}sin^2(\omega_d t)\right] \;\;\; \text{(3)}\\ &\approx \frac{1}{2}V_o^2e^{-2\alpha t}\left[C\frac{\omega_o^2}{\omega_o^2}cos^2(\omega_ot + 0) + \frac{1}{L\omega_o^2}sin^2(\omega_o t)\right] \;\;\; \text{(for Q>>1)}\\ &\approx \frac{1}{2}CV_o^2e^{-2\alpha t}\left[cos^2(\omega_ot) + sin^2(\omega_o t)\right]\\ \end{alignat*}
$$ {\LARGE \textcolor{#40CE7F}{\implies W_T(t) \approx \frac{1}{2}CV_o^2e^{-2\alpha t}}}$$

Rate of change of energy is power, so the power dissipated in the resistor can be given as:
(note -ive sign because energy decays with time)

$$ P_D(t) = -\frac{d}{dt}W_T(t) = 2\alpha W_T(t) = \frac{\omega_o}{Q}W_T(t) $$

Re-arranging the above equation takes us to the physical definition of Q

$$ Q = \omega_o \frac{W_T(t)}{P_D(t)} $$ $$ Q = \omega_o \frac{\frac{1}{T}\int_{0}^{T} W_T(t)dt}{\frac{1}{T}\int_{0}^{T} P_D(t)dt}$$ $$ Q = \omega_o \frac{\text{Avg. Energy Stored per Cycle}}{\text{Avg. Power Destroyed per Cycle}}$$ $$ Q = 2\pi \frac{\text{Avg. Energy Stored per Cycle}}{T_o \times \text{Avg. Power Destroyed per Cycle}}$$ $$ {\LARGE \textcolor{#40CE7F}{Q = 2\pi \frac{\text{Avg. Energy Stored per Cycle}}{\text{Energy Destroyed per Cycle}}}}$$

This is the classical definition of Q factor, and now we see how was it derived, and why did the factor 2\(\pi\) appear. It didn’t need to be there because one can already get an idea of the quality of a resonator by just dividing the energy stored by energy destroyed but the factor of 2\(\pi\) was added so that the math aligns (as you saw in derivation above that it just showed up).

We inserted W(t) and Q equations in Desmos graphing calculator below. You can see QF matches with Q  (see expressions list in graph below) saying that yes energy stored over energy destroyed multiplied by 2\(\pi\) is indeed equal to Q. Go ahead and play with Q slider in the graph below to see how stored and lost energies move.

We wanted to show that it is not just first cycle of resonator where energy stored over destroyed gives you Q. Pick any cycle. You get the same thing otherwise it would have been lame. We picked 2nd cycle in the graph below (and QF matches with Q again).

Also, you might wonder, ok I get that energy stored vs energy lost idea but I just want to know how much power is destroyed from starting point. Let’s say I have x power at beginning of cycle, how much would I be left at the end of cycle. Answer is straightforward, you know now it dies out exponentially.

$$\text{% Power left after time t} = 100 \times e^{-2\alpha t}$$ $$\text{% Power left after time t} = 100 \times e^{-\frac{2\pi}{Q} \frac{t}{T_o}}$$ $${\LARGE \textcolor{#40CE7F}{\implies \text{% Power left after a cycle} = 100 \times e^{-\frac{2\pi}{Q}}}}$$

For Q=10, this evaluates to be 53.3 % which means after each cycle you would be left with 53.3% of power at the start of that cycle.

RFInsights

Date Published: 09 Feb 2023
Last Edit: 09 Feb 2023