Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Bode plot correct?

Status
Not open for further replies.

fouadalnoor

Member
Hey guys, I have calculated the transfer function of the simple circuit attached and also drew the bode plot, can you check if its correct?

Thanks.
 

Attachments

  • Capture.PNG
    Capture.PNG
    41.3 KB · Views: 350
  • photo.JPG
    photo.JPG
    1.9 MB · Views: 336
Which circuit? You posted three.

If the first one, I think it has -20dB gain at frequencies below about 16kHz. Above 16kHz it would be unity gain (0dB). The corner frequency is about 16kHz. Upward slope would be 20dB/decade going up through the transition region.
 
Last edited:
Hey guys, I have calculated the transfer function of the simple circuit attached and also drew the bode plot, can you check if its correct?

Thanks.


Hi,

It appears that you were trying to do the first one (C=1nf, R1=100k, R2=10k) so we'll do that one first. You'll want to note that the zero and the pole cause opposite sign slopes, one +20db/decade and the other -20db/decade.

The transfer function Hs is:
Hs=(s*C*R1*R2+R2)/(s*C*R1*R2+R2+R1)

At zero frequency the gain K is equal to:
K=R2/(R1+R2)

and dividing numerator and denominator by C*R1*R2 we get:
Numerator: N=1/(C*R1)+s
Denominator: D=1/(C*R2)+1/(C*R1)+s

So we have constant gain:
K=1/11

and the numerator is:
N=s+10000

and the denominator is:
D=s+110000

Thus we have a zero at w=10k and a pole at w=110k, and constant gain -21db.

The two frequencies are 10k and 110k, so we start out at w=0 with the constant gain of -21db which is a straight horizontal line (like you have drawn) and at the frequency of 10k we have a zero so we get a slope of +20db/decade starting at 10k. This continues until we reach 110k and there we have another frequency of 110k which is a pole so we get a slope of -20db/decade starting at 110k, and this added to the previous slope means we again get a line with a slope of 0 which is a horizontal line.

So the plot looks like a horizontal line at -21db that goes from w=0 to w=10k, then slopes upward at +20db/decade, then at 110k it becomes a horizontal line again. Since the slope of the upward line is +20db/decade and it starts at -21db and goes from 10k to 110k, that means it goes upward about +22db and this means we end up at +1db, but the horizontal portion from there is around 0db because since the cap conducts much more than the 10k resistor at infinite frequency, the response is clearly 0db above w=110k. Note that since the distance from the 10k to 110k is really 1.1 decades, we would multiply 20db times 1.1 and get 22db as the rise so this would lead us to +1db rather than 0db. But the quick check with the cap and 10k resistor shows this to really be 0db. So we've corrected this a little by doing that.

Also note that when you get a pole after a zero it cancels out the slope of the zero because the pole has the exact opposite slope as the zero.



So the plot looks like this:
Code:
   0                 ------------------
                    /
                   /
                  /
                 /
 -21  -----------
      0        10k  110k              +inf
 
Last edited:
To the questioner:

In order to avoid confusion on your side - just one short comment to the reply from MrAl:
The presented BODE scetch - together with the given explanations/calculations - shows the asymptotic behaviour of the transfer function only.
In reality, there are no "edges" in the magnitude response and the slope reaches +20 dB/dec in one single point only (approx. in the middle of the shown +20dB/dec line).
However, MrAl's contribution clearly has demonstrated the advantages connected with the principle of the BODE diagram:
Approximation of the transfer function magnitude response using piecewise straight lines serving as asymptotes.
 
Another hint: For such a simple circuit it is easy to find the asymptotes without the need to find the transfer function:
1) For very low frequencies there is a simple resistive divider with Vout/Vin=10/110) >>> -20.8 dB
2.)For very large frequencies the capacitor causes unity transfer >>> 0 dB
3.)The first "edge", which is equivalent to the transfer function zero is reached when |Xc|=1/wC=100k. Therefore: 1/w1=T1=RC=1E-9*1E5=1E-4 >>> w1=1/T1=10k.
4) The second "edge", which is equivalent to the transfer function pole is reached when |Xc|=1/wC=10k||100k=9.1k. Therefore: 1/w2=T2=RC=1E-9*9.1k=9.1E-6 >>> w2=1/T2=110k.
Based on these information it is simple to construct the Bode diagram (asymptotes).
 
Hi,

Thanks for the notes Winter.

Im adding a little note too here...

The usual procedure used is where we would divide top and bottom by R1+R2 so that we can get it into the form:

[LATEX]
.\ \ \ \ H(s)=\frac{K(s\tau_{1}+1)}{(s\tau_{2}+1)}
[/LATEX]

This is probably the form he was after for starting the problem.
 
Last edited:
Hi,

Thanks for the notes Winter.

Im adding a little note too here...

The usual procedure used is where we would divide top and bottom by R1+R2 so that we can get it into the form:

[LATEX]
.\ \ \ \ H(s)=\frac{K(s\tau_{1}+1)}{(s\tau_{2}+1)}
[/LATEX]

This is probably the form he was after for starting the problem.

Hi, thanks for the response and explanations guys!
I keep struggling (and taking a long time) to draw these things by using algebraic manipulations and trying to actually compute values at different frequencies...
The way of just getting the poles and zeroes is much faster and easier!

I will try the second circuit now (sorry about the confusion earlier) and see how I get on.

Fouad.
 
Okay, for the second circuit I am a little confused about how to draw the bode plot. (note there is a typo, the voltage across the second capacitor should say Vout)

My transfer function is:

T(s) = R2C1s/((R1*R2*C1*C2)s^2 + (C1R1+C2R2+C1R2)s+1)

Now I can see that I have one zero at s = 0, and two complex poles at s= -0.015±10j

But you cant exactly compute what happens when w=0 since you cant do log(0) and also how do you deal with the complex poles?

PS: I also dont quite know how you knew that w=10k and w= 100k in the previous question, I mean don't you have to do s=jw and then re-arrange for w?
 
Last edited:
Hi again,


Show us the way you would prefer to do it and we'll go from there. Be as detailed as possible showing every little step.
By 'second circuit' i assume you mean the circuit on the right, not on the bottom.
Handling complex poles is a little more tricky, but it looks like the circuit on the right has two real poles anyway so you dont have to worry about that yet.
The corner frequencies come from the poles and zeros, so once you determine them you know the corner frequencies.
As you do more and more of these you'll get the hang of it.
 
Last edited:
Hi again,


Show us the way you would prefer to do it and we'll go from there. Be as detailed as possible showing every little step.
By 'second circuit' i assume you mean the circuit on the right, not on the bottom.

Yeah, the circuit on the right.

So, I would normally start off with getting the transfer function and then simplifying it as much as possible (put it into the correct form).

In this case I start off with:

Vo/Vin = Rp/ R1+(1/(C1s))+(Rp)

Rp = Parallel combination of the Capacitor (C2) and Resistor (R2) on the output.

In this case, it was easy enough as it simply forms a potential divider and when we simplify it we get the transfer function as shown above:

T(s) = R2C1s/((R1*R2*C1*C2)s^2 + (C1R1+C2R2+C1R2)s+1)

Also since R1=R2 and C1=C2 it does not really matter what you name the components.

Now, after getting the above transfer function, I need to take it's magnitude's logarithm (in decibels) and compute the result as I change the frequency ω.

So I need to take 20log(|T(s)|).

I split this up in two terms:

1. 20log(|R2C1s|)
2. -20log(|((R1*R2*C1*C2)s^2 + (C1R1+C2R2+C1R2)s+1)|)

Its at this point that I'm stuck. I don't think you can compute the value of the first term since you get a negative value inside the logarithm and the second term gives me weird values/

I don't think I'm approaching it correctly though, since this way of doing it seems to take too long...
 
Actually wait... the first term will simply be:

1. 20log|R2C2s| = (R2^2)*(C2)*w^2 = 10log(0.0001w^2) = +20dB/dec (when w =0.1, its -60dB)

The second term will be...

2. -20log(|((R1*R2*C1*C2)s^2 + (C1R1+C2R2+C1R2)s+1)|) = -10log((10^-10w+1)^2+(300x10^-6w)) = -20dB/dec (at w = 0, its equal to 0, w = 10, 000Hz its equal to -10 and then its -20dB/dec)


Does this seem right?
 

Attachments

  • photo.JPG
    photo.JPG
    2.3 MB · Views: 302
Last edited:
Hi fouadalnoor,
it is much simpler than you think.
At first - it is perhaps good to know that the circuit at right (your first posting) is the classical WIEN path with a bandpass characteristic, which is used in the well-known WIEN oscillator circuit.
At second, because it is an RC circuit without inductances the poles cannot be complex - there are two negative-real poles only.
These poles are located at (simply set denumerator=0):
s1=-0.38/RC and s2=-2.62/RC
______________________
BODE diagram: Poles are real. therefore set s=jw.
Mark both poles on the log-scaled w-axis and draw two asymptotic lines with a positive slope (+20 dB/dec) through s1 and with a negative slope (-20 dB/dec) through s2.
That's all. Remember: At the pole frequencies the asymptotic lines always decrease their slope by 20dB/dec. That's exactly what you have done (from +20dB/dec to 0db/dec and then to -20 dB/dec).
The starting point of the rising line is at w=0 with a magnitude of minus infinity, equivalent to the zero of the transfer function.
Regards

Added later: For your information, the third circuit (at the bottom of your drawing) has a similar BODE diagram. It is also a bandpass with two real poles - however, with other values due to other component values.
 
Last edited:
Hi fouad,

You seem to be having a problem with the gain so lets start with that.

To find the gain you factor the Hs into this form:

[LATEX]
\ \ \ \ H(s)=\frac{K(s\tau_{1}+1)(s\tau_{2}+1)...}{(s\tau_{3}+1)(s\tau_{4}+1)...}
[/LATEX]

If you look at that you'll see that the numerator is factored into terms with s times tau plus 1, and so is the denominator, and when factored like this the constant gain K stands out in the numerator as a single number.

To illustrate this with your next circuit (the one on the right) we start with the transfer function:
Hs=(s*C1*R2)/(s^2*C1*C2*R1*R2+s*C2*R2+s*C1*R2+s*C1*R1+1)

and yes because all the R's are the same and all the C's are the same this simplifies to:
Hs=(s*C*R)/(s^2*C^2*R^2+3*s*C*R+1)

but now we substitute the values for the components R and C and we get:
Hs=(1e-4*s)/(1e-8*s^2+3e-4*s+1)

Now we have numerator:
N=1e-4*s

and denominator:
1e-8*s^2+3e-4*s+1

First thing we'll do is multiply N and D by the reciprocal of the factor of s^2 which is 1e-8, so we get:

N=10000*s
D=s^2+30000*s+1e8

Now we factor D and we get two roots:
r1=-3819.660112501051
r2=-26180.33988749895

What this means is our transfer function can now be written as:
Hs=10000*s/((s-r1)*(s-r2))

(note we subtract the roots not add them to reconstruct the denominator, and since they were negative they now will come out positive)

which numerically is:
Hs=10000*s/((s+3819.660112501051)*(s+26180.33988749895))

From this we can see that we have two poles one at w=3819.660112501051 and one at w=26180.33988749895.

Now we want to get this new Hs into the form shown above with all the tau's in it, so we take the first pole in the denominator and divide that by the negative of the root:
(s+3819.660112501051)/(3819.660112501051)

and this of course gives us:
s/3819.660112501051+1

and you see now that part is in the "s times tau plus 1" form where tau=1/(-r1)=1/3819.660112501051.

But since we divided that by 3819.660112501051 to keep that part of the equation the same we have to also multiply by that, so we get this form for that one part of the denominator:
3819.660112501051*(s/3819.660112501051+1)

Now we have this in the form 1/tau times the "s times tau plus 1" form.

We have another pole, so we do the same thing with that one and we end up with:
26180.33988749895*(s/26180.33988749895+1)

Again note that this is also in the form (1/tau)*(s*tau+1).

Now we put the Hs back together and we have:
10000*s/((3819.660112501051*(s/3819.660112501051+1))*(26180.33988749895*(s/26180.33988749895+1)))

and since we have two constants in the denominator we can lump them together:
10000*s/(3819.660112501051*26180.33988749895*(s/3819.660112501051+1))*(s/26180.33988749895+1))

This is now in the form N/(Ka*Kb*(s*tau1+1)*(s*tau2+1))

so we simply multiply Ka times Kb which is 3819.660112501051*26180.33988749895 and we get a single number:
Ka*Kb=1e8

So now we have:
10000*s/(1e8*(s/3819.660112501051+1)*(s/26180.33988749895+1))

Now all we do is divide top and bottom by that 1e8 and we end up with:
1e-4*s/((s/3819.660112501051+1)*(s/26180.33988749895+1))

This is now in the form: Kn*s/((s*tau1+1)*(s*tau2+1)).

Since there is no additive term in the numerator we're just about done.
Now all we do is:
Kn(db)=20*log10(Kn)=20*log10(1e-4)=20*(-4)=-80db

so the constant gain is -80db.
 
Last edited:
Hi fouad,

perhaps you prefer another way to arrive at the form as suggested by MrAl. If you replace the symbols by actual numbers at the end of the manipulation, the procedure is as follows:
1.) The transfer function is easily found to be H(s)=sT/(1+3sT+ s^2*T^2)) with T=RC.
2.) This form can be compared with "factored" form (as suggested by MrAl): H(s)=sT/[(1+s*tau1)*(1+s*tau2)]=sT/[1 + s(tau1+tau2) + s^2*tau1*tau2] ; with poles p1=-1/tau1 and p2=-1/tau2 .
3.) Because both forms contain the fixed value "1" a direct comparison is possible. This directly leads to the "factor" in the numerator T=RC=1E-4 (named "Kn" by MrAl).

Remark: The above mentioned "factor" is given in "seconds" and, thus, is not dimensionless. Therefore, I am declined not to transfer it into a dB value.
 
Last edited:
If you are making this kind of plots then look at this graph paper.
I made several kinds of these but this one is best overall. Print the PDF.

A 1K resistor is a line from left to right through the center of the paper.
A 0.1uf cap is a line from top left to a point at the bottom in the center. "\"
Inductors are lines "/".

Draw a line for every L, C and R in your circuit.

For a 1k resistor and 0.1uf cap low pass filter; draw the lines for the two parts.
At low frequencies (at the left side) the capacitor has no effect so start with the 1k ohm line. Follow along that line until it hits the 0.1uF line then follow along the capacitor line.
 
Thank you!

I think I basically got it. From following your calculations I can see that we have one zero at w=0 (does not affect anything) and two poles at w=3819 and w=26180. We also have a constant gain of -80dB (from the calculated value of K).

The way to do it is just turning the transfer function into the appropriate form as you have shown above and then get the gain K with the poles and zeroes that will tell you where you add or take away the contribution of 20dB/dec. (for poles you do -20dB/dec and for zeroes you do +20dB/dec)

The bode plot would look like the one attached.

I just have one question, when you said

"Hs=10000*s/((s+3819.660112501051)*(s+26180.33988749895))

From this we can see that we have two poles one at w=3819.660112501051 and one at w=26180.33988749895."

How did you know that in that form, w = 3819.660112501051 and w=26180.33988749895 for the different poles? isnt s=jw, so how did you re-arrange for w?
 

Attachments

  • photo (1).JPG
    photo (1).JPG
    2 MB · Views: 306
Last edited:
I have now also done an example myself to see if I have understood it all correctly. If we take a simple low pass filter with R = 1000Ω and C = 1μF then we have the following transfer function:

H(s) = (1/Cs) /(R+1/Cs) = 1/(RCs+1)

This transfer function is already in the correct form, but just to make sure that I follow the same steps we did before, I will change it into the following form and find the poles:

H(s) = (1/RC)*1/(s+1/RC)

We know that there is a pole at w=1/RC = 1000Hz.
From this we also get a constant of 1/RC so, 20log(1/RC) = 60dB and we get the bode plot attached.

I do wonder though, shouldn't I have had the constant when the transfer function was in its first form: H(s)= 1/(RCs+1)?
 

Attachments

  • photo (1).JPG
    photo (1).JPG
    2 MB · Views: 303
Hi foudalnoor,

I'm afraid, you didn't get it. Both drawings are completely wrong.
I think, you got confused by the constant "gain" MrAl has introduced. For my opinion, you don't need it to construct the BODE diagram
1.) As I have mentioned before, the circuit at right (your first posting) is a bandpass - starting at minus infinity and reaching nearly 0 db at the frequency w=wo=1/RC. The asymptotic lines are touching the 0 dB line, but the real curve between the asymptotes has it maximum at 0.333 equivalent to -10 dB (see my instructions in post#12).

2.) Your second example is a passive lowpass that never can assumes a magnitude larger than 0 dB. What do you think where the gain should come from?
Why don`t you follow my instruction? Simply mark the pole on the log-scaled w-axis and draw a -20dB/dec line (starting at this point).
The other asymptotic line is directly on the w-axis from very low frequencies until wo. That`s all.
3.) I can tell you that the BODE diagram is well-known because of its simplicity. For a first order lowpass you need only one point (the pole frequency).
 
I have now also done an example myself to see if I have understood it all correctly. If we take a simple low pass filter with R = 1000Ω and C = 1μF then we have the following transfer function:

H(s) = (1/Cs) /(R+1/Cs) = 1/(RCs+1)

This transfer function is already in the correct form, but just to make sure that I follow the same steps we did before, I will change it into the following form and find the poles:

H(s) = (1/RC)*1/(s+1/RC)

We know that there is a pole at w=1/RC = 1000Hz.
From this we also get a constant of 1/RC so, 20log(1/RC) = 60dB and we get the bode plot attached.

I do wonder though, shouldn't I have had the constant when the transfer function was in its first form: H(s)= 1/(RCs+1)?

Hi,

Oh wow a passive RC filter with a gain of 60db! I love it :)
You might want to included what we sometimes call a 'sanity check' just to make sure you have something reasonable. I mention this because a 60db gain in a passive low pass filter is just not ever going to happen. I cant stress this enough. Once you have the solution, go over it briefly to see if you spot anything that looks like it wont work or is off by a large amount. Maybe it takes time to learn this kind of thing but it's worth thinking about.

You were going pretty good there, with your low pass example. You came up with:
Hs=1/(sRC+1)

and then you divided top and bottom by RC:
Hs=(1/RC)/(s+1/RC)

and you reasoned that you have a pole at 1/RC (of course you know this is really -1/RC). You did very well there.
But now you KEPT that form to figure out the gain, so you of course got the gain 1/RC.
BUT, in the previous discussion, we had to get the equation into the form with the factors (s*tau+1) in order to find the gain K. For some reason you skipped this step and that's how you got the gain of 1/RC, which of course isnt right.
Getting back into the s*tau+1 factors form, we have again:
Hs=1/(sRC+1)
with tau=RC. Now the only thing left in the numerator is the '1', so the gain K is equal to 1.
So try to remember which form is which, and that you need the transfer function in the s*tau+1 factors form to get the gain to stand alone in the numerator.
 
Hi foudalnoor,
For reference this image is the LTSpice plot for the 3 circuits, for comparison.

You should of course solve them using the appropriate formula and methods.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top