Skip to main content

Posts

Showing posts with the label scipy

scipy.optimize.curve_fit() in Python

scipi_curve_fit_for_3HP Python scipy.optimize.curve_fit() to Third-order High Pass Filter ¶ A third-order high pass filter or low pass filter is used as a feedback circuit in a phase-shift oscillator. Fig. The third-order High Pass Filter Circuit ¶ Eq. (1) gives voltage gain defined as the ratio of output over input for the 3rd order HP. $$ \cfrac{v_2}{v_1}=\cfrac{(\omega CR)^3} {{\{(\omega CR)^3-5\omega CR\}} -{j\{6(\omega CR)^2-1\}}} \qquad\dots(1) $$ The absolute value of the ratio is given by Eq. (2). $$ \left|\cfrac{v_2}{v_1}\right|=\cfrac{1}{\sqrt{1+26(\omega CR)^{-2}+13(\omega CR)^{-4}+(\omega CR)^{-6}}}\qquad\dots(2) $$ Fitting the curve obtained from Eq. (2) by using Python scipy.optimize.curve_fit is made as shown below. Measurement of voltage gain with 3rd order HP ¶ We took place measurements of voltage gain at each frequency. The result is given by pandas.DataFrame. In [1...