Finding the bandwidth of a parallel RLC circuit (+MATLAB)

In summary, the conversation discusses how to construct the total impedance of a circuit using the formula $\frac{1}{Z_T}=\frac{1}{Z_R}+\frac{1}{Z_C}+\frac{1}{Z_L}$. The conversation also mentions using MATLAB code to find the magnitude of the impedance, the maximum impedance and its corresponding frequency, the -3db points and their corresponding frequencies, and the bandwidth. The speaker had been trying to find an error in their program that was causing the bandwidth to change drastically when varying the number of frequency samples. They eventually found the error and were able to solve the problem.
  • #1
ItsTheSebbe
10
1
Homework Statement
upload_2018-10-1_18-36-2.png

The attempt at a solution
Constructing the total impedance of the circuit as follows,
$$\frac{1}{Z_T}=\frac{1}{Z_R}+\frac{1}{Z_C}+\frac{1}{Z_L}$$
where $Z_R=R$, $Z_C=-j\frac{1}{\omega C}$ and $Z_L=j\omega L$.
$$\frac{1}{Z_T}=\frac{1}{R}+j\omega C+\frac{1}{j\omega L}$$
solving for $Z_T$ gives us,
$$Z_T=\frac{Rj\omega L}{j\omega L-RCL\omega^2+R}$$
where $\omega=2\pi f$
$$Z_T=\frac{2\pi fRLj }{2\pi fLj-RCL(2\pi f)^2+R}$$
Plotting this function over the frequencies, whilst $L=10\ \mu H$, $C=5\ pF$ and $R=10^6\ \Omega

From here, I created the following MATLAB code to find:
- The magnitude of the impedance (Z_Mag) for a range of frequencies.
- Finding the maximum of Z_mag and it's corresponding frequency.
- finding the -3db points and the frequencies that correspond to these points.
- taking the difference of said frequencies in order to calculate the bandwidth.
Code:
clear all 
close all

N=100000; %number of frequency samples
L=10*10^(-6); %inductance
C=5*10^(-12); %capacitance
R=10^6; %resistance
f=linspace(1,10^8,N); %frequency of 1 Hz to 100 MHz
df=f(2)-f(1);

Z_T=(2*pi*f*R*L*1i)./(2*pi*f*L*1i-R*C*L*(2*pi*f).^2+R); %impedance
Z_mag=abs(Z_T); %magnitude of the complex impedance

plot(f,Z_mag); %plotting the frequency against the total impedance
title('Total impedance per frequency')
xlabel('frequency')
ylabel('total impedance')

[max_Z, max_index]=max(Z_mag); %maximum value of impedance
threedb=max_Z*sqrt(2)/2; %the 3db point 

[Z_db,index_db] = min(abs(Z_mag-threedb)); %closest value and index to the 3db point
f1=index_db*df; %the first frequency at the 3db point 
%the second frequency at the 3db point (first frequency mirrored around the
%frequency at max magnitude
f2=(max_index+(max_index-index_db))*df; 

BW=abs(f2-f1); %the bandwidth

Now when I vary the N (number of frequency samples), the bandwidth I find seems to change quite drastically. Ideally, I would expect the bandwidth to asymptotically approach some value with a greater accuracy for a greater N.

I have been trying to found out what I did wrong for some time now, does anyone know where I went wrong? Thanks!
 

Attachments

  • upload_2018-10-1_18-35-59.png
    upload_2018-10-1_18-35-59.png
    53.7 KB · Views: 485
  • upload_2018-10-1_18-36-2.png
    upload_2018-10-1_18-36-2.png
    53.7 KB · Views: 1,121
Last edited:
Physics news on Phys.org
  • #2
I found an error in my program, which solved the problem.
 
  • Like
Likes berkeman

What is a parallel RLC circuit?

A parallel RLC circuit is an electrical circuit that contains a resistor (R), inductor (L), and capacitor (C) connected in parallel. This means that the components share the same voltage but have different currents flowing through them.

What is the purpose of finding the bandwidth of a parallel RLC circuit?

The bandwidth of a parallel RLC circuit determines the range of frequencies over which the circuit can effectively filter or amplify signals. It is an important parameter in designing and analyzing electronic circuits.

How can MATLAB be used to find the bandwidth of a parallel RLC circuit?

MATLAB has built-in functions and tools that can be used to analyze and simulate electronic circuits, including parallel RLC circuits. By inputting the circuit parameters into MATLAB, you can calculate the bandwidth and plot frequency response curves to visualize the circuit's behavior.

What factors affect the bandwidth of a parallel RLC circuit?

The bandwidth of a parallel RLC circuit is affected by the values of the resistor, inductor, and capacitor. A higher resistor value will result in a narrower bandwidth, while a higher inductor or capacitor value will result in a wider bandwidth. Additionally, the quality factor (Q) of the circuit also affects the bandwidth.

How do I interpret the bandwidth results of a parallel RLC circuit?

The bandwidth results of a parallel RLC circuit can be interpreted in terms of how well the circuit can filter or amplify signals within a specific frequency range. A wider bandwidth indicates a larger range of frequencies that can be effectively processed by the circuit, while a narrower bandwidth indicates a more limited range. This information can be useful in selecting components for a specific application.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
19
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
17
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
770
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
0
Views
516
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
955
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
Back
Top