Optimization Problem with an RC BP filter

Click For Summary
The discussion centers on designing an RC bandpass filter that peaks at 10kHz while maintaining less than half peak voltage at 3kHz and 30kHz. The user is struggling with the optimization of component values, specifically resistors and capacitors, and is advised to use more sophisticated tools like R or Matlab instead of spreadsheets for better efficiency. Dimensional analysis of the transfer function reveals inconsistencies, prompting a reevaluation of the formula's correctness. The conversation also highlights the importance of approximating the behavior of the filter stages, suggesting that the impedance relationships between components are crucial for achieving the desired frequency response. Ultimately, the user is encouraged to refine their approach to selecting component values based on the filter's characteristics and performance requirements.
  • #31
Yes; plug them into your equation.

Actually, it might be helpful if you describe how you got that expression.

Do you know how to express impedances of capacitors using the Laplace "s" variable?

Did your professor tell you that you needed to use some sort of optimization procedure?

Here's the important hint; the "something else" is to cascade two circuits like you are using now. In other words, use 4 resistors and 4 capacitors.
 
  • Like
Likes donpacino
Engineering news on Phys.org
  • #32
It looks like you are taking a very analytical and overly complicated approach to solving this problem. Using optimization and variance is overkill for this type of problem. your making it hard on yourself. The architecture of the circuit is what really sets the gain values. solving this comes down to solving 2 equations.

just a hint. When doing frequency analysis it will often help to use the s operator from laplace. if you recall s=jw.

when analyzing the circuit, the transfer function is found seen below

Vo/Vin = [SC_2R_2 ] / [ S^2C_2^2R_2_2+S(2C_2R_2+C1R1)+1 ]

Now let's get to the best way of solving. do you recall what poles and zeros are? very simply a pole will cause the gain to decrease 10 dB per decade as frequency increase. a zero will cause the gain to increase 10 dB per decade as frequency increases.

this is a bandpass circuit given your requirements. There is one zero, so C2 and R2 will set your zero. This zero will control the rising part of the circuit. remember that it is a zero at the origin. because we don't have a voltage requirement for 3khz (other than half of 10 khz) the value of c2 and r2 don't actually matter (relative to the zero that is).

you need a 2x magnitude difference between the 3k and 10k points (about 6 dB). the same goes for 10k to 30k.

if you look at the poles we have a second order response (2 poles). We want to put these 2 poles at 10 khz to ensure the voltage peaks there. so the poles will be at

10+xj and 10-xj. with x being some number. normally this value matters, but in our case it doesn't matter at all

our pole equation is S^2C_2^2R_2_2+S(2C_2R_2+C1R1)+1. let's use the quadratic equation to solve for S=10
A=C_2^2R_2_2
B=2C_2R_2+C1R1
C=1

then, use the quadratic equation to solve for 10. You case use optimization methods, but remember you have 4 unknowns and less equations (2). This means you can simply set the values of the components to static values. I would set the capacitors to 10uf. This is a very common value. If you need to increase or decrease the capacitance. Keep in mind capacitors are usually harder to find specific values than resistors, so typically set the caps and vary the resistors. Then solve for the 2 resistors values (I'll let you figure that out).

let me know if you don't understand poles and zeros, and I can go into more detail. also keep in mind what the electrician said about the feasibility of this circuit. what i put down is just to get you started down an easier path to solve the problem
 
  • #33
wait. what is your actual assignment. Were you given that circuit, or were you given the task the meet the requirements, and you chose that circuit?

There are better topologys to solve this problem. Like the electrician stated you need to figure out what order filter you need.
 
  • #34
I chose this circuit to meet the requirements. So add in more stages to smooth the required points?
donpacino said:
Vo/Vin = [SC_2R_2 ] / [ S^2C_2^2R_2_2+S(2C_2R_2+C1R1)+1 ]
I don't see how you got this. Even so, you have a complex denominator, and I've never seen it left that way. Shouldn't you multiply by [s^2 C_2^2R_2^2 + 1 - s(2C_2R_2 +c_1R1)] / [s^2 C_2^2R_2^2 + 1 - s(2C_2R_2 +c_1R1)] to make the denominator real?

It's a fairly independent project, so we were given the requirements and left to choose a circuit ourselves.

As for how I arrived at the transfer function I have:
##I_0 =\frac{V_{in}}{R_1 + \frac{1}{\frac{1}{z_1}+\frac{1}{z_2 + R_2}}}## and algebra.
The step before subbing in z's you end up with
##\frac{V_{in}(z_1 +z_2 + R_2)}{R_1(z_1+z_2+R_2)+z_1(z_2+R_2)}##
I've seen S used, but I always just end up subbing in z_1 = 1/iwc_1 once I get to an appropriate form to do so.
 
  • #35
Your image in post #1 of the circuit you're analyzing doesn't show Io, so I can't comment about the correctness of your expression:

##I_0 =\frac{V_{in}}{R_1 + \frac{1}{\frac{1}{z_1}+\frac{1}{z_2 + R_2}}}##

Is Io the current in R2? If it is, then your expression is incorrect.

If you will show the step by step procedure you used to get it I can help you find your error.

Once you have a correct transfer function, how will you verify that it meets your problem requirements? I suppose you would evaluate the transfer function at 3 kHz, 10 kHz and 30 kHz. Do you know how to produce a plot of the transfer function vs. frequency?
 
  • #36
I0 is the current into the circuit, I1+I2. I can post it, but it will take me a while.
 
  • #37
What are I1 and I2? When you post a problem on the forum asking for help, giving as much detail as you can makes it easier and faster for those who would help you.
 
  • #38
I think a better method for you to use would be to consider your circuit to be two voltage dividers in cascade. Imagine that you designate the node at the top of C1 as Vx.

Now R1 and C1 form a voltage divider with input at Vin and output at Vx. Then C2 and R2 form another voltage divider with input at Vx and output at Vout.

But the situation is complicated. If the first voltage divider consisted only of R1 and C1 it would be trivial to derive the transfer function of that voltage divider; it would be z1/(R1+z1). The problem is that the output part of a voltage divider consisting of only R1 and C1 would be the shunt impedance z1.

Your actual circuit has more than just z1 as the output load of the R1 and C1 voltage divider, so that has to be accounted for. Do you know how to do that?
 
  • #39
  • #40
BiGyElLoWhAt said:
I chose this circuit to meet the requirements.
So it is not a requirement that you must use this particular arrangement as your 4-element filter?

Is it a requirement that you use a passive RC filter? Can it contain an inductance as well? Or are you allowed to use a filter containing OP-AMPs?

It is likely that this particular passive filter you have decided to use cannot meet the specs you have been set, as The Electrician helpfully pointed out when presenting its plot back in post #25.

Before going any further, you should post verbatim the assignment specifications and let others advise how you can start afresh.
 
  • Like
Likes donpacino
  • #41
BiGyElLoWhAt said:
I am assigned to design a circuit that peaks voltage at 10kHz and is less than half peak voltage at 3k and 30k. Only capacitors and resistors are allowed.
 
  • #42
BiGyElLoWhAt said:
I chose this circuit to meet the requirements. So add in more stages to smooth the required points?

I don't see how you got this. Even so, you have a complex denominator, and I've never seen it left that way. Shouldn't you multiply by [s^2 C_2^2R_2^2 + 1 - s(2C_2R_2 +c_1R1)] / [s^2 C_2^2R_2^2 + 1 - s(2C_2R_2 +c_1R1)] to make the denominator real?

It's a fairly independent project, so we were given the requirements and left to choose a circuit ourselves.

As for how I arrived at the transfer function I have:
##I_0 =\frac{V_{in}}{R_1 + \frac{1}{\frac{1}{z_1}+\frac{1}{z_2 + R_2}}}## and algebra.
The step before subbing in z's you end up with
##\frac{V_{in}(z_1 +z_2 + R_2)}{R_1(z_1+z_2+R_2)+z_1(z_2+R_2)}##
I've seen S used, but I always just end up subbing in z_1 = 1/iwc_1 once I get to an appropriate form to do so.
the impedance of a capacitor is z= 1/jwc. we know jw=s, so it can be rewritten as z=1/sc

the method i used is the standard method for representation in electrical engineering. If you don't mind me asking, what is your background, and what are you doing this class for.
 
  • #43
BiGyElLoWhAt said:
I've seen S used, but I always just end up subbing in z_1 = 1/iwc_1 once I get to an appropriate form to do so.

why, you are making life more difficult for yourself
 
  • #44
http://www.changpuak.ch/electronics/downloads/FilterDesignIn3oSeconds.pdf

This is a relatively good simple guide for designing ACTIVE filters using op amps. you'll want the narrow pass band filter. If it doesn't provide enough drop off, ass a second stage (read another circuit) to the end. Due to your requirements for your project, you can simply duplicate the circuit and put them in series. For the analysis, you multiply the results together. (results being the gain vo/vin)

choose the duel supply option.

i recommend you analysis these circuits for yourself. I prefer to use nodal analysis.

Your second order circuit might work, but it requires a very high Q
 
  • #45
OP-AMPs are not on the allowed component list—apparently.
 
  • #46
I'm a physics Major, and this class is electronics for scientists, and yes, I can't use op amps.
I wasn't aware that using s made it easier. Do you simply ignore the fact that the denominator is complex, then?
 
  • #47
By what date does this project need to be completed?
 
  • #48
I was supposed to have the circuit determined and the values chosen already. I'm shooting for having everything ready to go by tomorrow (our next meeting time). If I can't get a good analytical answer, I might try to make the conceptual argument made earlier with z1 = r1 at 3k and z2 = r2 at 30k. I'm not sure I understood the logic for z2+r2=10(z1+r1), however. @Tom.G
 
  • #49
Hmmm... Ok, so in taking this conceptual approach, I arrived somewhere weird.
I got ##6\pi x10^5 R_1 = \frac{1}{C_1}##
also ##6\pi x 10^4 R_2 = \frac{1}{C_2}##
However, the weird part is in solving for the values at 10k. My idea was to set the phase of the first circuit = phase of second circuit at 10k.
Phase of first circuit:
##V_{out_1} = V_{in}\frac{1}{R_1 + Z_1}z_1##
(drop V_in for now)
##=\frac{iwc}{Rwci +1}\frac{-i}{wc}##
##=\frac{1}{Rwci + 1} = \frac{1 - R_1C_1wi}{1+R_1^2C_1^2w^2}V_{in}##
##\phi_1 = tan^{-1}(-R_1C_1w)##
Phase of second circuit:
##V_{out_2} = I_{\text{through second circuit}}R_2 = V_{out_1}\frac{1}{R_2 + z_2}R_2 ##
##=\frac{R_2(iwc_2)}{Rwc_2i+1}V_{out_2}##
##=\frac{R_2^2C_2^2w^2 + R_2C_2w i}{R_2^2C_2^2w^2 + 1}\frac{-R_1C_1w i +1}{1+R_1^2C_1^2w^2}V_{in}##
##=\frac{R_2^2C_2^2w^2 + R_1R_2C_1C_2w^2 + (-R_1R_2^2C_1C_2^2w^3 +R_2C_2w)i}{\text{some denominator that I don't care about}}##
##\phi_2 = tan^{-1}(\frac{R_2C_2w - R_1R_2^2C_1C_2^2 w^3}{R_1R_2C_1C_2w^2 + R_2^2C_2^2w^2})##
Set the arguments equal to each other
##-R_1C_1w = \frac{R_2C_2w - R_1R_2^2C_1C_2^2 w^3}{R_1R_2C_1C_2w^2 + R_2^2C_2^2w^2}##
##-R_1C_1w(R_1R_2C_1C_2w^2 + R_2^2C_2^2w^2)=R_2C_2w - R_1R_2^2C_1C_2^2 w^3##
##-R_1C_1w(R_1R_2C_1C_2w^2 + R_2^2C_2^2w^2 - R_2^2C_2^2w^2) = R_2C_2w##
##-R_1C_1w(R_1R_2C_1C_2w^2) = R_1^2C_1^2[R_2C_2w^3] = R_2C_2w##
##R_1^2C_1^2 = \frac{-1}{w^2}##
Did I mess up or does this imply that they can't be in phase at a real frequency?
 
  • #50
There's no point in trying to optimize. Filters made using only R and C are very limited. They can have no complex poles; the poles are all on the negative real axis. The Q is limited. You have almost no degrees of freedom in your choices of values for R and C.

What you need to do for the circuit you have chosen is to place the corner frequencies at 10 kHz. This will put the frequency of the peak (as I showed in post #25) at exactly 10 kHz. You make the impedance of the R and C of the second part of the circuit (the high pass part) 10 or more times higher than the impedance of R and C of the first part. In other words, make R ten times larger, and C 10 times smaller. This makes the loading effect of the second part almost negligible.

Having done this, the attenuation at 3 kHz and 30 kHz will be what it is; you have no control over it. This is why it is a fool's errand to try to optimize anything. This is the case for the circuit you have chosen; I can't speak for any other circuit without analyzing the other circuit.

You will not be able to achieve your requirement with the circuit you have been analyzing. However, if you cascade two circuits of the type you're using, you will be able to meet your requirements, provided that you scale the impedance in successive stages of the circuit as I described above.

You're getting bogged down in math. Don't worry about phase, whether phases cancel, or whether one thing is in phase with another. Just calculate the magnitude of your transfer function vs. frequency.
 
  • Like
Likes donpacino and BiGyElLoWhAt
  • #51
Do you mean use a 4th order circuit?
If so, how would you recommend analyzing it? I'm assuming that there is an easier way than what I'm trying to do.
 
  • #52
Yes, the cascade of two of your existing circuit will give you a 4th order circuit.

As far as your question about analysis, yes there are easier ways to do it. I'm not sure how you are doing it, but whatever it is appears cumbersome.

Re-read post #23 and #38. Do they make sense to you?
 
  • #53
23 does for the most part. I 100% understand the first 2 listed statements, I don't quite see the 3rd. I also am not sure about the first statement as to how that gives me a peak at 10k. I'm assuming I pick some threshold for the voltage and solve for that voltage at 10k in the same sense that I did will do with voltage at 3 and 30k, setting r = z at 3 and 30k.

I think I used 38 in my most recent analysis. Using v_out_2 as my v_in for my 2nd circuit. I'm not sure what you meant by accounting for the second capacitor. Would you elaborate on that, please?
 
  • #54
Have a look at this thread: http://forum.allaboutcircuits.com/threads/rc-bandpass-filter-transfer-function-derivation.80000/

I'm home for the evening so I can respond quickly. Let me know if you don't understand all the details.

I gave you some R and C values in post #25, and showed a plot of the magnitude of the transfer function over a frequency range. Can you get those same values?
 
  • #55
BiGyElLoWhAt said:
I think I used 38 in my most recent analysis. Using v_out_2 as my v_in for my 2nd circuit. I'm not sure what you meant by accounting for the second capacitor. Would you elaborate on that, please?

When you have a low pass RC section followed by a high pass CR section, you can't calculate the transfer function for the R1, C1 section separately and then use the Vout of that section as the input for the next stage (CR stage). Doing that neglects the loading effect of the input impedance of the CR high pass section on the output of the first RC section. You have to calculate the transfer function of the whole thing with both sections connected together. I describe that in the linked thread I gave in the previous post.
 
  • #56
Yes, I see how my current could be messed up. Dang. So I need to work with my original analysis, or divide the current proportionally to the impedance. Let me go through, re analyze my circuit to see if I can get a neater looking transfer function, and go through the article. Then I'll check to see if I can get the values and post back. Thanks.
 
  • #57
I think I did that in my initial setup, but I didn't break it into pieces. I simply analyzed the whole thing as 1.
##V_{out}/V_{in} = \frac{Z_2}{R_1+\frac{1}{\frac{1}{Z_1}+\frac{1}{R_2 + Z_2}}}##
 
  • #58
Have a look at the result the TS got in that other link: http://forum.allaboutcircuits.com/attachments/results-transfer-function-pdf.51260/
 
  • #59
Any chance you could bring the picture here? I have to create an account to view attachments.
 
  • #60
Here it is:
 

Attachments

Similar threads

Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
8
Views
2K
  • · Replies 21 ·
Replies
21
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 42 ·
2
Replies
42
Views
3K