Making Bode Amplitude Plot of LC Filter in Matlab

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 5K views
roam
Messages
1,265
Reaction score
12

Homework Statement



I'm trying to make a theoretical Bode Amplitude plot of the following circuit in Matlab:

sm6q6b.jpg


The transfer functions is given by

##T=\frac{V_{out}}{V_{in}}=\frac{R_2}{R_2+z_p}##

##z_p=R_p|| j \omega L || \frac{1}{j \omega C} = \frac{R_p}{1+ j R_p (\omega C - \frac{1}{\omega L})}##

Where ##R_p## is the parallel loss resistance of the inductor (~19.49 Ω). R2=300, C=22.09 nF, L=10.08 mH.

I know that the graph is supposed to look like a notch (trap) filter, here is an experimental graph of this same filter:

xcnh94.jpg


The Attempt at a Solution



Here is the code I used to make a theoretical plot:

R=1440.96;
C=22.09e-9;
Rp=19.49;
R2=300;
L=10.08e-3;

s = tf('s');
z=Rp/(1+(Rp*C)+(Rp/(s*L)));
sys = R2/(R2+z);
h = bodeplot(sys);
setoptions(h,'FreqUnits','Hz','PhaseVisible','off');
grid;

But my plot looks like this:

2vcdrm9.jpg


And after the 103 point it's completely flat.

What is wrong with my code? :confused:

Any help is appreciated.
 
Physics news on Phys.org
19.49Ω seems a disastrously low parallel resistance equivalent. I think it will wreak havoc on a filter's response. Are you sure that isn't meant to be a series resistance of 19.49Ω?

I can't comment on matlab.
 
Last edited:
  • Like
Likes   Reactions: 1 person
roam said:
Code:
z=Rp/(1+(Rp*C)+(Rp/(s*L)));
I think you forgot an 's' in there. It should be:
Code:
z=Rp/(1+(Rp*s*C)+(Rp/(s*L)));
But I doubt it makes any difference. Like NascentOxygen wrote, that RLC circuit will be extremely lossy, i.e. its Q factor will be very low/bandwidth will be very high.
 
  • Like
Likes   Reactions: 1 person
Judging by the "experimental graph of this same filter", Rp is likely closer to 20 kΩ than 20 Ω.
 
Thank you so much for the feedback.

NascentOxygen said:
19.49Ω seems a disastrously low parallel resistance equivalent. I think it will wreak havoc on a filter's response. Are you sure that isn't meant to be a series resistance of 19.49Ω?

I can't comment on matlab.
Yes, I think 19.49 Ω may be the series resistance of the inductor (I measured it using an RCL meter, I will double check this).

But according to my book the parallel resistance Rp may be calculated from the graph using the quality factor relationships:

##Q_p = \frac{R_p}{\omega_0 L}=\omega_0 R_p C##

##Q= Q_p \sqrt{1-2|T_{min}|^2}##

Qp being the quality factor of the parallel inductor-capacitor combination, and Q is the actual quality factor of the filter (a measure of the sharpness of the peak).

|Tmin| is the minimum value of the transfer function (minimum value of |T|), which occurs when |zp| is a maximum (at resonant frequency ##\omega_0 =1/\sqrt{LC}##).

In my plot Tmin is my last data point where it is equal to -0.080 dB (or 1.01 in linear magnitude), so

##1.01 = \frac{V_{out}}{V_{in}}= \frac{300}{300+z_p} \implies z_p = -2.97##

zp and Rp are related by:

##z_p=\frac{R_p}{1+jR_p(\omega C - \frac{1}{\omega L})}##

But then how do I solve for ##R_p## from this impedance? How can I get rid of the j's in the denominator? (I'm looking for a way to solve for Rp without actually having to measure it experimentally).

gneill said:
Judging by the "experimental graph of this same filter", Rp is likely closer to 20 kΩ than 20 Ω.

Yes, when I vary the resistance to to Rp≈1 kΩ, the theoretical graph starts to look right.
 
Last edited: