TTT4260/Øvinger/Ø5/Frekvensrespons.py

45 lines
675 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 11:00:18 2019
@author: oyvind
"""
import numpy as np
import matplotlib.pyplot as plt
def H13(f):
w = 2 * np.pi * f
return np.arctan(1/(w * 10**-4)) * 180 / np.pi
def H2(f):
w = 2 * np.pi * f
return np.arctan(w * 100*10**(-9) * 10**4) * 180 / np.pi
def H4(f):
w = 2 * np.pi * f
R = 99.76
L = 100 * 10**(-3)
t = L / R
return np.arctan(w * t) * 180 / np.pi
frq = []
values = []
for i in range(1, 2*10**4):
frq.append(i)
value = H4(i)
values.append(value)
plt.plot(frq, values)
plt.xscale('log')
plt.gca().xaxis.grid(True)