Commit 487d0dd2 authored by STEPANYAN Anahit's avatar STEPANYAN Anahit
Browse files

Replace Rauch_HP.ipynb

parent 2231ce7f
%% Cell type:markdown id: tags:
# Rauch High Pass Filter
%% Cell type:code id: tags:
``` python
from numpy import *
from math import *
```
%% Cell type:markdown id: tags:
## Electronic Circuit
<img src="./img/MFB_HP.svg" width="300px">
%% Cell type:markdown id: tags:
* LT Spice (should be modified): [Rauch_HP.asc](./asc/Rauch_HP.asc)
* Transfer Function :
$$H(p)=?$$
$$H(p)=\frac{-R_1R_2C_1C_2p^2}{p^2R_1R_2C_2C_3+p(C_1R_1+C_2R_1+ C_3R_1) + 1}$$
%% Cell type:markdown id: tags:
## Parameter Identification
The function `compute_parameters` evaluates the filter parameters from the filter components.
%% Cell type:code id: tags:
``` python
def compute_parameters(R1,R2,C1,C2,C3):
# compute your parameter here
w0 = 0
f0 = 0
m = 0
Too = 0
Tw0 = 0
w0 = 1/(sqrt(C3*R1*R2*C2))
f0 = 1/(sqrt(R1*R2*C2*C3*4*pi**(2)))
m = w0*R1*(C1+C2+C3)*0.5
Too = -(C1/C3)
Tw0 = -C1/(C3*sqrt(R1/(C3*R2*C2)*(C1+C2+C3)))
return {"w0":w0,"f0":f0,"m":m,"Too":Too,"Tw0":Tw0}
# example
R1, R2, C1, C2, C3 = 1000, 5000, 10**-9, 2.2*(10**-8), 3.3*(10**-9)
parameters = compute_parameters(R1,R2,C1,C2,C3)
print(parameters)
```
%% Output
{'w0': 0, 'f0': 0, 'm': 0, 'Too': 0, 'Tw0': 0}
{'w0': 52486.38810814779, 'f0': 8353.468112451394, 'm': 0.6901960036221434, 'Too': -0.30303030303030304, 'Tw0': -3.5600942725445225e-05}
%% Cell type:markdown id: tags:
## Component Selection
The function `compute_component` compute the filter components from some filter specification.
%% Cell type:code id: tags:
``` python
def compute_component(f0,m,Too):
# compute your component here
R1 = 0
R2 = 0
C1 = 0
C2 = 0
C3 = 0
C3 = 3.3*(10**-9)
C2 = 2.2*(10**-8)
C1 = -Too*C3
R1 = m/(pi*f0*(C1+C2+C3))
R2 = 1/(4*f0**2*pi**2*R1*C2*C3)
return {"R1":R1,"R2":R2,"C1":C1,"C2":C2,"C3":C3}
# example
f0, m, Too = 0, 0, 0
f0, m, Too = 8353.468112451394, 0.6901960036221434, -0.30303030303030304
components = compute_component(f0,m,Too)
print(components)
```
%% Output
{'R1': 0, 'R2': 0, 'C1': 0, 'C2': 0, 'C3': 0}
{'R1': 1000.0, 'R2': 5000.0, 'C1': 1e-09, 'C2': 2.2000000000000002e-08, 'C3': 3.3e-09}
%% Cell type:code id: tags:
``` python
```
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment