Commit 6256476e authored by choqueuse's avatar choqueuse
Browse files

Initial commit

parents
.DS_Store
__pycache__/
.ipynb_checkpoints
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
MANIFEST
build
dist
_build
docs/man/*.gz
docs/source/api/generated
docs/source/config.rst
docs/gh-pages
notebook/i18n/*/LC_MESSAGES/*.mo
notebook/i18n/*/LC_MESSAGES/nbjs.json
notebook/static/components
notebook/static/style/*.min.css*
notebook/static/*/js/built/
notebook/static/*/built/
notebook/static/built/
notebook/static/*/js/main.min.js*
notebook/static/lab/*bundle.js
node_modules
*.py[co]
__pycache__
*.egg-info
*~
*.bak
.ipynb_checkpoints
.tox
.DS_Store
\#*#
.#*
.coverage
.pytest_cache
src
*.swp
*.map
.idea/
Read the Docs
config.rst
*.iml
/.project
/.pydevproject
package-lock.json
geckodriver.log
*.iml
# jetbrains IDE stuff
*.iml
.idea/
# ms IDE stuff
*.code-workspace
.history
.vscode
\ No newline at end of file
all:
git add .
git commit -m "modif"
git push -u origin master
\ No newline at end of file
# Second Order Analog Filters
This repo contains some empty jupyter notebooks for students.
Each notebook describes a particular analog second order filter (RC-RC, RLC, Rauch, Sallen-Key). Then, the objective is to create two python functions :
* compute_parameters : this function compute the filter specifications from the filter components
* select_components : this function select the filter components from some filter specifications
## Getting started
* Fork the repo
* Clone the forked repo to your local machine
## How to make a pull request
* https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html
\ No newline at end of file
%% Cell type:markdown id: tags:
# Rauch Bandpass Filter
%% Cell type:code id: tags:
``` python
from numpy import *
```
%% Cell type:markdown id: tags:
## Electronic Circuit
<img src="./img/MFB_BP.svg" width="300px">
%% Cell type:markdown id: tags:
* LT Spice (should be modified): [Rauch_BP.asc](./asc/Rauch_BP.asc)
* Transfer Function :
$$H(p)=?$$
%% 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,R3,C1,C2):
# compute your parameter here
w0 = 0
f0 = 0
m = 0
Ti = 0
Tmax = 0
BP = 0
return {"w0":w0,"f0":f0,"m":m,"Ti":Ti,"Tmax":Tmax,"BP":BP}
# example
R1, R2, R3, C1, C2 = 10000, 20000, 10000, 10**-8, 3.3*(10**-9)
parameters = compute_parameters(R1,R2,R3,C1,C2)
print(parameters)
```
%% Output
{'w0': 0, 'f0': 0, 'm': 0, 'Ti': 0, 'Tmax': 0, 'BP': 0}
%% 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,Tmax):
# compute your component here
R1 = 0
R2 = 0
R3 = 0
C1 = 0
C2 = 0
return {"R1":R1,"R2":R2,"R3":R3,"C1":C1,"C2":C2}
# example
f0, m, Tmax = 2000, 1, -1.2
components = compute_component(f0,m,Tmax)
print(components)
```
%% Output
{'R1': 0, 'R2': 0, 'R3': 0, 'C1': 0, 'C2': 0}
%% Cell type:markdown id: tags:
# Rauch High Pass Filter
%% Cell type:code id: tags:
``` python
from numpy 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)=?$$
%% 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
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}
%% 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
return {"R1":R1,"R2":R2,"C1":C1,"C2":C2,"C3":C3}
# example
f0, m, Too = 0, 0, 0
components = compute_component(f0,m,Too)
print(components)
```
%% Output
{'R1': 0, 'R2': 0, 'C1': 0, 'C2': 0, 'C3': 0}