How do I determine the resistance for RLC low pass filter

Thread Starter

richard_w

Joined May 20, 2025
11
Hi, I am trying to build a RLC low pass filter that atenuates the frequency below 4500 Hz. However, I have encountered some problem when choosing the correct R to work with. Here is the original sound.
1761793651195.png

Here is my code
Code:
function Vout = myFilterCircuit(Vin,h)
n_V = length(Vin);
f_7 = 4500;; % Undesired frequency
h_7 = h; % delta time
% These are for the constant and initialization of the variables
t_7 = 0:h_7:(n_V-1)*h_7; % This is the independent variable

LC_2 = 1/((f_7*2*pi)^2);% This is for L C
R_7 = 0.0001; % This is R
L_7 = 1*10^-3; % This is L
C_7 = LC_2/L_7; % This is C
%
A_2 = [1,h_7/C_7;-h_7/L_7,1-h_7*R_7/L_7]; % This is the A matrix
B_2 = [0;h_7/L_7]; % This is the B matrix
C_2 = [1,0]; % This is the C matrix
D_2 = [0]; % This is the D matrix
%
sys_8 = ss(A_2,B_2,C_2,D_2,h_6); % This is the system
[y_8,tout_8,x_8] = lsim(sys_8, V_inter, t_7); % Simulate the system response
%
Vout = y_8(:,1); % This is the V_c output.

figure;
bode(sys_7, sys_8);
legend('60Hz LPF', '4470Hz LPF');
end;
Here is the Bode Diagram
1761793830596.png

So you can see I used the inductance of 1*10^-3, and capacitance around 1.26*10^-6. I try to use the resistance of 0.0001, but it does not work. And the system of equation eventually becomes not solvable. Please let me know what value of R I should choose.
 

MrAl

Joined Jun 17, 2014
13,680
Hi, I am trying to build a RLC low pass filter that atenuates the frequency below 4500 Hz. However, I have encountered some problem when choosing the correct R to work with. Here is the original sound.
View attachment 357908

Here is my code
Code:
function Vout = myFilterCircuit(Vin,h)
n_V = length(Vin);
f_7 = 4500;; % Undesired frequency
h_7 = h; % delta time
% These are for the constant and initialization of the variables
t_7 = 0:h_7:(n_V-1)*h_7; % This is the independent variable

LC_2 = 1/((f_7*2*pi)^2);% This is for L C
R_7 = 0.0001; % This is R
L_7 = 1*10^-3; % This is L
C_7 = LC_2/L_7; % This is C
%
A_2 = [1,h_7/C_7;-h_7/L_7,1-h_7*R_7/L_7]; % This is the A matrix
B_2 = [0;h_7/L_7]; % This is the B matrix
C_2 = [1,0]; % This is the C matrix
D_2 = [0]; % This is the D matrix
%
sys_8 = ss(A_2,B_2,C_2,D_2,h_6); % This is the system
[y_8,tout_8,x_8] = lsim(sys_8, V_inter, t_7); % Simulate the system response
%
Vout = y_8(:,1); % This is the V_c output.

figure;
bode(sys_7, sys_8);
legend('60Hz LPF', '4470Hz LPF');
end;
Here is the Bode Diagram
View attachment 357909

So you can see I used the inductance of 1*10^-3, and capacitance around 1.26*10^-6. I try to use the resistance of 0.0001, but it does not work. And the system of equation eventually becomes not solvable. Please let me know what value of R I should choose.
Hi,

You had shown everything except the schematic when that is the easiest to work from.
Show the schematic and this is easy.
 
Last edited:

simozz

Joined Jul 23, 2017
170
For the 1st plot you have a notch and a low pass, both labeled as LPF. The phase looks strange for the 4470 Hz LP.

RLC LP is a 2nd order TF. 1st solution is to do the math and solve the TF for R given L and C and the condition for 0.707 (-3dB ) at that frequency.

Second solution is more accurate.
For audio application you might prefer a delay filter (Bessel), but I don't know how much demanding is the request. Maybe a simple Butterworth filter is enough for you.
 

Ian0

Joined Aug 7, 2020
13,112
R is often the source impedance or the load impedance. Generally you already know R, because its the loading impedance of the line, 50Ω or 120Ω, for hf designs or the resistance of a loudspeaker for crossover designs,
 

MrAl

Joined Jun 17, 2014
13,680
Hi, I am trying to build a RLC low pass filter that atenuates the frequency below 4500 Hz. However, I have encountered some problem when choosing the correct R to work with. Here is the original sound.
View attachment 357908

Here is my code
Code:
function Vout = myFilterCircuit(Vin,h)
n_V = length(Vin);
f_7 = 4500;; % Undesired frequency
h_7 = h; % delta time
% These are for the constant and initialization of the variables
t_7 = 0:h_7:(n_V-1)*h_7; % This is the independent variable

LC_2 = 1/((f_7*2*pi)^2);% This is for L C
R_7 = 0.0001; % This is R
L_7 = 1*10^-3; % This is L
C_7 = LC_2/L_7; % This is C
%
A_2 = [1,h_7/C_7;-h_7/L_7,1-h_7*R_7/L_7]; % This is the A matrix
B_2 = [0;h_7/L_7]; % This is the B matrix
C_2 = [1,0]; % This is the C matrix
D_2 = [0]; % This is the D matrix
%
sys_8 = ss(A_2,B_2,C_2,D_2,h_6); % This is the system
[y_8,tout_8,x_8] = lsim(sys_8, V_inter, t_7); % Simulate the system response
%
Vout = y_8(:,1); % This is the V_c output.

figure;
bode(sys_7, sys_8);
legend('60Hz LPF', '4470Hz LPF');
end;
Here is the Bode Diagram
View attachment 357909

So you can see I used the inductance of 1*10^-3, and capacitance around 1.26*10^-6. I try to use the resistance of 0.0001, but it does not work. And the system of equation eventually becomes not solvable. Please let me know what value of R I should choose.
Hello again,

I took another look and I think I see what your problem is now. I did not look at the code you posted previously I was in a hurry.
With any nonzero value for R there should always be a solution, but with very small R it would be way too peaked.

Now it seems that you are designing a passive RLC circuit to ACT as a Low Pass Filter (LPF). There is a little bit more to it than just solving w=1/sqrt(LC) though, because any L and C by themselves cannot produce a LPF because they are totally reactive. That means they make up an oscillator, not an LPF.

That's without any series R at all. However, even with small R we can see almost the same thing. We don't get anything even near an LPF.
In fact, there is a R value that would be needed to turn it into a true LPF.
This value can come from the complete frequency domain solution:
Vout=Vin/sqrt(w^2*C^2*R^2+(1-w^2*C*L)^2)

I assume you know how to get that expression, but if not, we can go over that.
We can set that for Vout=1/sqrt(2) and solve for R. This gives a nice, smooth, flat curve with no attenuation that eventually tapers off, reaching the -3db frequency point at the value for the frequency you chose (such as 4500Hz).

That gives you a value for R, but it's not the only value you can use. For more attenuation you can set R higher, but you have to be careful if R is set lower because then you start to get a peaked response which is not always desirable. Your example of very small R would result in a very high peak which would be objectionable.
If you do go up in the value of R remember that the output will be more attenuated. If you need a value higher for R and still maintain the same output, then you would have to reduce the value of C. You could work that out, or you could solve for R and C simultaneously.

Also, as @Ian0 said, the series R is often part of the impedance of the previous stage. If you need a specific output with a specific input then that changes the way we have to calculate R, for one.

I almost forgot to mention, this would result in a Butterworth response. There is a formula for R, but it comes out of the expression for Vout above. See if you can calculate it, or you'll have to look it up.


See if you can solve that for the value of R, then do the calculations for the frequency response or plot it like you did before.
 
Last edited:
Top