# LP filter transfer function + Matlab Plot

Discussion in 'General Electronics Chat' started by Shagas, May 8, 2014.

1. ### Shagas Thread Starter Active Member

May 13, 2013
802
74
Hello ,

Could someone help me out plotting a Bode and nyquist diagram in matlab
of a simple R/c low pass filter?
I'm making a presentation of my semestral work in a few weeks of a very basic oscilloscope that I made in java and a small part of the presentation is the input analog ciruitry.

So first I have to find the transfer function. I've looked on this page and it says that the transfer function will be

1/(jwRC + 1)

I understand how they derived that but I don't understand what the j and w will be. Do I consider w as 2pi/T - (2*pi*F) ? What about the j , and how would I plot this function in matlab?

Also , I have two r/c stages for a steeper low pass but If I remember from the signals course lecture I can just multiply the two transfer functions that are in the S domain to get the total transfer function.
(I know that two cascaded R/C stages aren't optimal and that I should put a buffer in between but for simplicity sake I just cascaded them without a buffer)

2. ### ericgibbs AAC Fanatic!

Jan 29, 2010
2,593
392
hi,
I dont use Matlab, but these are the two questions you asked.

In this context the 'j' indicates advance the phase by 90 degrees.

The 'w' = 2 * pi * f

E

3. ### Shagas Thread Starter Active Member

May 13, 2013
802
74
Ok thanks for the answer ,
I will wait for someone who can advise how to punch that in to matlab

4. ### ericgibbs AAC Fanatic!

Jan 29, 2010
2,593
392
hi,
Does Matlab have an AC analysis function, similar to LTSpice.??

Thats the method used in LTS.
E

5. ### Veracohr Well-Known Member

Jan 3, 2011
559
77
For the Bode plot you can use the filter coefficients and the freqz function (it also creates a phase plot), but it would be easiest to just create an array for frequencies and plot the magnitude of the transfer function against that array.

I have no experience with Nyzquist diagrams.

Shagas likes this.
6. ### Shagas Thread Starter Active Member

May 13, 2013
802
74
I think I'll try it using an array of frequencies and ploting the h(s) against it,
thanks