Created
December 31, 2016 06:34
-
-
Save insom/46af7810b0b4d344659e6f6984d80ffc to your computer and use it in GitHub Desktop.
Bode Plot-ish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import matplotlib.pyplot as plt | |
x = ((10,1.03),(50,1.03),(100,1.01),(500,1.005),(1000,1.015),(2500,1.00),(5000,0.98),(10000,0.92),(15000,0.84),(20000,0.75),) | |
hzz=[] | |
dbs=[] | |
for hz, v in x: | |
hzz.append(hz) | |
db = 20*math.log10(v/0.1) | |
dbs.append(db) | |
plt.plot(hzz,dbs) | |
plt.ylabel('dB') | |
plt.xlabel('Frequency') | |
plt.xscale('log') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment