Making Bode Amplitude Plot of LC Filter in Matlab

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
4 replies · 5K views · last reply
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:

Circuit schematic of an LC notch filter: input V1 across a parallel network of inductor L, resistor Rp and capacitor C, feeding output V2 across series resistor R2 to ground.


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:

Log-frequency Bode amplitude plot titled Amplitude Response: gain in dB against frequency in Hz from 10^2 to 10^6. Gain is near 0 dB, dips sharply to about -23 dB near 10 kHz, then recovers to 0 dB.


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:

Bode magnitude plot titled Bode Diagram, log frequency axis from 10^2 to 10^3 Hz and magnitude in dB from -0.55 to -0.05, showing a smooth downward-sloping curve from about -0.05 dB to about -0.5 dB.


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: