Question: Here is a simple electronic circuit with one resistor and one capacitor. R Vin Vout 0 This circuit acts as a low-pass filter: you send

 Here is a simple electronic circuit with one resistor and one

Here is a simple electronic circuit with one resistor and one capacitor. R Vin Vout 0 This circuit acts as a low-pass filter: you send a signal in on the left and it comes out filtered on the right. Using Ohm's law and the capacitor law and assuming that the output load has very high impedance, so that a negligible amount of current flows through it, we can write down the equations governing this circuit as follows. Let I be the current that flows through-R and into the capacitor, and let Q be the charge on the capacitor. Then: IR = Vin - Vout Q = CVout do L = dt Substituting the second equation into the third, then substituting the result into the first equation, we find that Vin - Vout = RC (dVouldt), or equivalently dvout 1 (Vin - Vout) dt RC Write a program to solve this equation for Vou(t) using the fourth-order Runge--Kutta method when the input signal is a square-wave with frequency 1 and amplitude 1: Vin(t) = {-1 if [21] is even, if [21] is odd, [x] means x rounded down to the next lowest integer. Use the program to make plots of the output of the filter circuit from t = 0 to t = 10 when RC = 0.03, 0.15, and 0.75, with initial condition Vout(0) = 0. You should put all three plots in one graph. You will have to make a decision about what value of h to use in your calculation. Because you need to solve the system of ODE for three values for RC, put your vector function f in a class, as you saw in the lectures. A program similar to the one you wrote is running inside most stereos and music players, to create the effect of the "bass" control. In the old days, the bass control on a stereo would have been connected to a real electronic low-pass filter in the amplifier circuitry, but these days there is just a computer processor that simulates the behavior of the filter in a manner similar to your program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!