# Bode plot of circuit with unknown values

I have the two following circuits with unknown values for $$\R_1\$$, $$\L\$$ and $$\C\$$, $$\R_2 = 1\text{ k}\Omega\$$. I have attempted to find the transfer functions for these circuits and ultimately want to produce two Bode plots from this. The purpose is to determine the configuration of a "black box" circuit by performing tests with either a DC source or signal generator and viewing the result on an oscilloscope. The circuits below are two of a number I want to test. How could I tell which circuit is which just by these tests.

My thoughts were to perform a frequency sweep from $$\1\Omega\$$ to $$\1000\Omega\$$ and then compare $$\V_{\text{in}}\$$ and $$\V_{\text{out}}\$$ and plot frequency response from that. But with unknown values I could get anything.

Is there any test I can perform with either a DC source or signal generator that would allow me to determine the configuration of either circuit? More broadly, for any black box with 1 resistor, 1 inductor and 1 capacitor what tests could you perform with a DC source or signal generator to determine the configuration?

Circuit 1: Transfer Function 1:

$$H(j\omega) = \frac{R_2}{R_1 + \frac{1}{j\omega C} + j\omega L + R_2} \to \frac{j\omega C R_2}{1 + j\omega R_1 + j\omega^2 L C + j\omega CR_2}$$

Circuit 2: Transfer Function 2:

$$H(j\omega) = \frac{R_2}{\frac{1}{j\omega C} + j\omega L \parallel R_1 + R_2} \to \frac{R_2}{\frac{1}{j\omega C} + \frac{1}{\frac{1}{j\omega L} + \frac{1}{R_1}} + R_2}$$

$$\V_{\text{out}}\$$ is across $$\R_2\$$. What I can't figure out is how do I produce a Bode plot if I don't know the values of $$\R_1\$$, $$\C_1\$$, and $$\L_1\$$?

The Bode plots I have seen so far do not include unknown values so I am not sure of what to do next, do I treat the knowns as 1?

• Which key points are usually there on a Bode plot? – Eugene Sh. May 22 '18 at 13:45
• You can't make a pie with no ingredients. Also your maths is wrong right from stage 1 = you forgot about R2 in the denominator. – Andy aka May 22 '18 at 13:56
• If you assign to the components a range of values, then a different bode plot will be obtained for every step of the range. If you set a nominal value to each parameter and a maximum expected deviation, this question becomes more meaningful. A bode plot without numeric data is just a guessing game. – Vicente Cunha May 23 '18 at 1:36
• I really appreciate your responses. @Eugene Sh. I believe you are referring to the poles and zeros? – ChilliC May 24 '18 at 1:33
• Sorry guys wouldn't let me keep editing last comment. First of all thank you for your responses much appreciated. Secondly I have updated the question with some more detail and corrected the transfer response . The main purpose is to develop tests to determine the configuration of a "black box" with 1 Resistor, 1 Capacitor and 1 inductor of unknown values. The above are two of a number of configurations I want to test. Using a DC source, signal generator and oscilloscope how would I test these two and based on their outputs and frequency response how would I know the difference? – ChilliC May 24 '18 at 1:41

Boy are you up for a treat...

If you are only searching for the right configuration, you can probably get away with roughly estimating the poles and zero's in the circuit. If you calculate correctly, your first circuit leads to:

$$TF(s) = \frac{R_2C_1s}{1+(R_1+R_2)C_1s + L_1C_1s^2}$$

For the second circuit:

$$TF(s) = \frac{R_2C_1s(R_1+L_1s)}{R_1 + (C_1R_1R_2+L_1)s + (R_1+R_2)C_1L_1s^2}$$

The second circuit has one extra zero. If this zero is absent, the first circuit is the one you want.

If you additionally want to find the coefficients of the transfer function, you'll have to work a bit more. It is technically not hard if you have numerical software available (eg. Matlab), but getting there is much harder.

Given a rational transfer function:

$$\hat H(j\omega)=\frac{\sum_{i=0}^mb_i(j\omega)^i}{\sum_{k=0}^na_k(j\omega)^k} = \frac{B(j\omega)}{A(j\omega)}$$

Where we choose $a_0 = 1$ (normalization). We can compare our model with the measured data (possibly noisy) to find the error we are making. We take a few frequency points $\omega_i$, and measure the frequency response $H_i$. The error our model makes can be estimated using the expression:

$$e_i = \lVert B(j\omega_i) - A(j\omega_i)H_i \rVert^2$$

$$e_{tot} = \sum_i e_i = \sum_i \lVert B(j\omega_i) - A(j\omega_i)H_i \rVert^2$$

Our job is then to minimize this error by choosing $a_n$ and $b_m$ carefully. This can be calculated by computing the partial derivatives to $a_n$ and $b_m$, which have to equal 0.

1. Construct the matrix $H$ with all your measurements:

$$H = \left[ \begin{matrix} H_1 \\ H_2 \\ \vdots \\ H_N \end{matrix} \right]$$

1. Construct the matrix $U$, which can compute estimates by multiplying with the unknown parameters $\theta$:

$$U = \left[ \begin{matrix} -j\omega_1 H_1 & -(j\omega_1)^2 H_1 & 1 & j\omega_1 & (j\omega_1)^2 \\ -j\omega_2 H_2 & -(j\omega_2)^2 H_2 & 1 & j\omega_2 & (j\omega_2)^2 \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ -j\omega_N H_N & -(j\omega_N)^2 H_N & 1 & j\omega_N & (j\omega_N)^2 \end{matrix} \right]$$

1. Compute the best estimate under least-squared error: $\hat \theta$.

$$\hat \theta = (\Re\{U^*\cdot U\})^{-1}\cdot \Re\{U^*\cdot H\}$$

Where

$$\hat \theta = \left[ \begin{matrix} a_1 \\ a_2 \\ b_0 \\ b_1 \\ b_2 \end{matrix}\right]$$

($\Re$ means real part, $\ ^*$ means conjugated)

which you can plug in the transfer function:

$$H(s) = \frac{b_0 + b_1s + b_2s^2}{1 + a_1s + b_2s^2}$$

If you are interested in how you get there: check here

These coefficients can then be used to find your component values.

Measuring the frequency response

Sweeping the frequency can work, but is not always a good idea as you always have to wait for transients to die out. Another way is by cramming in all frequencies at the same time, in which case you only have to wait only once for all transients to go away.

If you choose a random-phase multi-sine excitation signal, you can measure the input and output at the same sample rate and simply divide the output spectrum by the input spectrum. Please take care to avoid aliasing, eg. by an AA filter though.