Making Bode Amplitude Plot of LC Filter in Matlab

Click For Summary

Discussion Overview

The discussion revolves around creating a theoretical Bode Amplitude plot for an LC filter using Matlab. Participants explore the transfer function, circuit parameters, and the resulting plot characteristics, including discrepancies between theoretical and experimental results.

Discussion Character

  • Homework-related
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant presents a transfer function for an LC filter and shares Matlab code to generate a Bode plot, noting that the output appears flat beyond a certain frequency.
  • Another participant questions the validity of a low parallel resistance value (19.49 Ω) and suggests it may be a series resistance instead, implying potential issues with the filter's response.
  • A different participant points out a possible error in the transfer function code, suggesting the inclusion of an 's' term, but expresses doubt about its impact on the overall filter performance.
  • Concerns are raised about the quality factor (Q) of the circuit, with suggestions that the parallel resistance might be closer to 20 kΩ based on experimental observations.
  • The original poster acknowledges the feedback and discusses the relationship between the quality factor and the parallel resistance, seeking clarification on how to derive the resistance from the impedance without experimental measurement.
  • It is noted that adjusting the resistance to approximately 1 kΩ improves the theoretical plot's appearance, indicating a potential resolution to the initial discrepancy.

Areas of Agreement / Disagreement

Participants express differing views on the correct interpretation of the resistance values and their implications for the filter's performance. There is no consensus on the correct value of the parallel resistance or its impact on the theoretical plot.

Contextual Notes

Participants reference the quality factor relationships and the transfer function's minimum value, indicating that assumptions about the circuit parameters may significantly affect the analysis. The discussion includes unresolved mathematical steps related to impedance calculations.

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:

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
9K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
Replies
1
Views
11K