More Symbolic Processing & Frequency Response Plot

(Uses Matlab): solve, tf, ss, bode

(3rd Order Maximally Flat Low-Pass RLC Filter):
(REF: Active and Passive Analog Filter Design: An Introduction, by L. Huelsman, Fig.2.5.4, McGraw Hill, 1993.)

The nodal equations at nodes 2 & 3 can be written in Matlab, here denoted as symbolic expressions f2 & f3 or any other naming you wish. The actual expression are enclosed in a pair of single quote characters. Character s is the complex frequency and function solve is find the node voltages.



EDUğ f2='V2*(1+2/s) -2/s*V3';
EDUğ f3='-2/(3*s)*V1 - 2/s*V2 + V3*(4*s/3 + 2/(3*s) + 2/s)';
EDUğ AN=solve(f2,f3,'V2,V3')

AN =

V2: [1x1 sym]
V3: [1x1 sym]

EDUğ AN.V2

ans =

V1/(1+s^3+2*s^2+2*s)

Better yet, evaluate the voltage transfer function as given next. Observe 'V1', voltage V1 is quoted.

EDUğ V2V1=AN.V2/'V1'

V2V1 =

1/(1+s^3+2*s^2+2*s)

EDUğ


The above can be written and save as a script, say fig2_5_4.m. To execute select "Run Script..." from the "File" menu.

%fig2_5_4.m
f2='V2*(1+2/s) -2/s*V3';
f3='-2/(3*s)*V1 - 2/s*V2 + V3*(4*s/3 + 2/(3*s) + 2/s)';
AN=solve(f2,f3,'V2,V3')
AN.V2
V2V1=AN.V2/'V1'

Frequency Response Plot

Althought it is true that the voltage transfer function, V2V1 = 1/(1+s^3+2*s^2+2*s)
is in rational form, but is actually a "symbolic expression", not a "numeric rational expression". To create the Frequency Response Plot, we need it in numeric rational form and it can be obtained interactively by using tf function,

EDUğ T=tf(1,[1,2,2,1])

It produces,

Transfer function:
1
-------------------------
s^3 + 2 s^2 + 2 s + 1

Which is the same appearance as the original "symbolic" form, but now in "numeric".

Next, use ss function and convert it to 'State Space Representation",

EDUğ ssT=ss(T);

and draw the "frequency response" by using bode function,

bode(ssT)

The result plot,

The magnitude clearly shows a -60 dB per decade slope. Which is expected of a 3rd order low-pass filter.


(6th order Maximally Flat Band-Pass filter
(REF: fig.2.5.8, Huelsman)

script file,

% fig2_5_8.m

f2='V2*(1+ 2*s/(s^2+1)) - V3*2*s/(s^2+1)';
f3='V3*(2*s/(s^2+1) + 2*s/(3*(s^2+1)) + 4*(s^2+1)/(3*s)) - V1*2*s/(3*(s^2+1))- V2*2*s/(s^2+1)';
AN=solve(f2,f3,'V2,V3')
AN.V2
V2V1=AN.V2/'V1'

The result is,

EDUğ
AN =

V2: [1x1 sym]
V3: [1x1 sym]

ans =

V1*s^3/(5*s^4+5*s^2+5*s^3+2*s^5+1+2*s+s^6)

V2V1 =

s^3/(5*s^4+5*s^2+5*s^3+2*s^5+1+2*s+s^6)

For the Frequency Plot,

EDUğ T=tf([1,0,0,0],[1,2,5,5,5,2,1])

Transfer function:
s^3
---------------------------------------------
s^6 + 2 s^5 + 5 s^4 + 5 s^3 + 5 s^2 + 2 s + 1

EDUğ ssT=ss(T);
EDUğ bode(ssT)

The Plot,