# Bode plot of transfer function

1. Apr 20, 2012

### Mitchy190

1. The problem statement, all variables and given/known data

I have the transfer function:

for the circuit:

The component values are know, and are:

R1 = 47kΩ
R2 = 4K7Ω
C = 10nF

2. Relevant equations

3. The attempt at a solution

I have derivied the transfer function but have become stuck on plotting the bode plot.

I understand that the function has one pole at

$\frac{-1}{R_{1}C}$

And one zero at

$\frac{-1}{R_{3}C}$

But I am unsure on the next step, and some advice would help. Thanks (:

2. Apr 20, 2012

### cathode-ray

Hi,

Can you be more specific about your doubt? What got you stuck in the plotting of the Bode plot?

3. Apr 20, 2012

### Mitchy190

I do not know how to go about approximating the magnitude (in dBs) and phase response from the transfer function I have.

I have to approximate the frequency response by using bode plots.

I think I can treat the numerator and denominator as separate fuctions H(jw)1 and H(jw)2

as

H(jw) = a + jwb/c + jwd
with one pole and one zero can be solved by taking it as the product of two separate functions:
H(jw) = H1(jw)H2(jw)
where
H1(jw) = a + jwb
and
H2(jw) = 1/c + jwd

But here I become stuck and confused. I dont know why the above is useful or how to work out the bode plot from it.

4. Apr 21, 2012

### cathode-ray

You can split your function in two new functions as you did. However you dont get any particular advantage by doing that, specially in this case where the transfer function is relatively simple. Essentially what you need to have in mind when doing the bode plot by hand is that:

-Either the amplitude and phase plots are asymptotic approximations of the real plot
-What you plot in the y axis of the amplitude plot is, like you said, |H(jw)| in dBs in other words 20log(|H(jw|)
-The x axis represents the frequency and is in a logarithmic scale
-In the phase plot what you represent in the y axis is arg(H(jw))
-The poles and zeros have different effects in the bode plot. To do the bode plot you have to know these effects. You can quickly search the web to find out this. If you want to know why the zeros and poles have these effects i can recommend you for example the book "Basic Engineering Circuit Analysis", J. David Irwin, pages 427-435, or try to find something in the web.

What i recommend you to do first is to read this pdf:

http://www.ece.utah.edu/~ee3110/bodeplot.pdf

It explains the basics and has some examples.

Hope this helps.

5. Apr 21, 2012

### Mitchy190

Thank you!

I am now unsure that my transfer function is actually right, I have plotted a bode for the magnitude and it does not compare to my real life results at all, which i am assuming are right.

I worked out the bode plot by

$|H(Jω)| = 20Log(|A|) + 20Log(|1 + jωRC|) - 20Log(|1 + jωR_{3}C|)$

And I got these results

View attachment 46466

The real measured results I obtained are:

View attachment 46467

As you can see they look completely different? Is my transfer function wrong, or is it the method in which I have plotted the bode?

Thanks.

6. Apr 21, 2012

### cathode-ray

It gave me the same transfer function you got with the only difference that $A=\frac{R_{2}}{R+R_{2}}$. However as $R=R_{2}=47[kΩ]$ this doesnt make any difference. So it seems to me that according to the data and circuit you gave that the transfer function is right

Regarding to the plots you posted i noticed the following:

-the static gain A is equal to 0.5 what implies that $20log(|A|)\approx -6.02$.However in the calculation you made it gave -20.8. It seems to me that is a wrong value.

-In the first post you made the frequency of the poles were in rad/sec, but in the plots the frequency is in Hertz.

-the zero is at the frequency $\frac{1}{RC}\approx 2127 [rad/sec] \approx 338[Hz]$ and the pole at the frequency $\frac{1}{R_{3}C}\approx 4255 [rad/sec] \approx 677[Hz]$. Using the asymptotic approximation the amplitude plot should remain constant with a value of $20log(|A|)$until the frequency of the zero. Then due to the zero it should start rising at 20 dB/dec until the frequency of the pole, remaining constant after that(because the pole adds -20dB/dec). When $w\rightarrow \infty \Rightarrow 20log(|H(jw)|)\rightarrow 0$, so the amplitude plot you measured seems to give what was predicted theoretically except in the fact that the static gain is of -12 instead of -6.

-after making the table for the numerator and the denominator of the transfer function as you did, it gave me different results. Try to recalculate the values to see if you get the correct amplitude plot.

-in the phase plot, it should begin by rising because the zero appears first than the pole, and then start falling one decade before the frequency of the pole. However in the phase plot you measured it starts by falling first. According to the circuit and the component values you gave this should not happen.

Note: Just to be sure by 4K7Ω you mean 47000 [Ω] right?

7. Apr 21, 2012

### Mitchy190

R1 = 47k = 47000 ohms

R2 = 4k7 = 4700 ohms

C = 10nF

And I think that is why you got -6.02 for the dc gain.

$\frac{R_{2}}{R + R_{2}}$ = $\frac{4700Ω}{4700Ω + 47000Ω} = \frac{1}{11}$

$\textit{-20log(A) = -20.828}$

Im still unsure where I have gone wrong, I just know I have, I think. I think the one where the frequency and phase response are given is right, but i didn't approximate that (which i need to do).

Have you gotten any ideas?

Last edited: Apr 21, 2012
8. Apr 21, 2012

### cathode-ray

Yup the error in the static gain was the resistance R2. Now the amplitude plot is equal to the one you measured. However the calculations you made in that table for the numerator and the denominator of the transfer function, are still giving me different results. Did you used w=1,10,..[rad/sec] or f=1,10,... [Hz]?

9. Apr 21, 2012

### Mitchy190

So you are getting the same result as me now? As in you are getting the shape of the black line for the overall magnitude response?

Everything is in hertz on both graphs, so I varied ω (f) over 10hz --> 1000000hz to get my results.. I get the same shape graph in radian/second anyway.

10. Apr 21, 2012

### cathode-ray

Nope im getting the blue one, in the real measure. Im seeing your other post at the same time too and the last plot you posted its what is giving to me. How are you calculating |1+jwRC| ?

11. Apr 21, 2012

### Mitchy190

$|H(Jω)| = 20Log(|A|) + 20Log(|1 + jωRC|) - 20Log(|1 + jωR_{3}C|)$

to get the equation above I did the below:

H(jω) = R2/(R2+(R*1/jωC)/(R+1/jωC)) (note that R1 is only named R in the picture)

pick the term (R*1/jωC)/(R+1/jωC) multiply nom. and denom. by jωC to get
(R*1/jωC)/(R+1/jωC) = R/(1+jωRC)

You now have H(jω) = R2/(R2+(R/(1+jωRC))

multiply nom. and denom. by (1+jωRC) and you'll get
H(jω) = (R2*(1+jωRC))/(R2*(1+jωRC)+R)

multiply the parentheses in the denom into the long form and you'll get
H(jω) = (R2+jωRR2C))/((R+R2)+jωRR2C)

now divide nom. and denom. by (R+R2) and get
H(jω) = (R2/(R+R2) * (1+jωRC)) / (1+(R2/(R+R2))*jωRC)

simplify by substituting (R2/(R+R2) = A, R3 = (RR2/(R+R2) to get
H(jω) = A *(1+jωRC) / (1+ jωCR3)

12. Apr 21, 2012

### cathode-ray

No I was asking if you are calculating 20log(|1+jwRC|) as 20log(sqrt(1+(wRC)^2))?

13. Apr 21, 2012

### Mitchy190

Oh sorry, yes I am.

20*LOG10(SQRT(1+w/2127.659))

2127.659 = 1/RC

14. Apr 21, 2012

### cathode-ray

Oh but is not 20*LOG10(SQRT(1+w/2127.659)) its 20*LOG10(SQRT(1+(w*47E3*10E-9)^2).

15. Apr 21, 2012

### Mitchy190

That may be where I'm wrong!

I thought it was 20*LOG10(SQRT(1+w/2127.659))

As I thought when the imaginary part is equal to the real you get the break frequencies, and the frequency at that point is w = 1/RC ?

Is this what you have?

View attachment 20log.doc

16. Apr 21, 2012

### cathode-ray

Yup, thinking that way, when the real part is equal to the imaginary you have either a pole or a zero.
I think you posted here the wrong attachment cause that one is the initial one...

17. Apr 21, 2012

### cathode-ray

I saw what you posted in the other thread and it is what i have.

18. Apr 21, 2012

### Mitchy190

Then I do not understand why the below is not correct

20*LOG10(SQRT(1+w/2127.659))

2127.659 = 1/RC

View attachment 20logg.pdf

19. Apr 21, 2012

### cathode-ray

The only mistake you made in 20*LOG10(SQRT(1+w/2127.659)) is that you not squared the imaginary part. I wrote 20*LOG10(SQRT(1+(w*47E3*10E-9)^2) which is equal to 20*LOG10(SQRT(1+(w/2127.659)^2). I used the multiplication because 2127.659 is an approximated value and 47E3*10E-9 is the exact value.

Note: |a+jb|=sqrt(a^2+b^2)

20. Apr 22, 2012

### Mitchy190

Ahh i see! Thanks for you help dude.

Managed to plot the phase response to I think.

What do you think?

View attachment phase1.pdf