-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Something I had used for analog electronics
- Loading branch information
1 parent
28e3a3e
commit 3e0728b
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
''' | ||
Author: Echedey Luis Álvarez | ||
Date: 06/11/2022 | ||
Project: Analog graph | ||
File: prev_bode.py | ||
Abstract: just another grapher | ||
Sources: | ||
''' | ||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import mplcyberpunk | ||
import scienceplots | ||
from scipy.stats import linregress | ||
from scipy import signal | ||
|
||
def main(): | ||
#plt.clf() | ||
plt.style.use(['science', 'bright']) | ||
fig, ax = plt.subplots() | ||
|
||
# Subtitle | ||
fig.suptitle('Circuito no inversor') | ||
|
||
system = signal.lti([67], [1/(17543*2*np.pi),1]) | ||
f = np.logspace(1, 5) | ||
w = 2 * np.pi * f | ||
w, mag, phase = signal.bode(system,w) | ||
ax.semilogx(f, mag, label='Ganancia') | ||
|
||
plt.xlabel(r"Frecuencia $f \, [Hz]$") | ||
plt.ylabel(r"Ganancia $A_v \, [dB]$") | ||
plt.grid() | ||
|
||
plt.show() | ||
|
||
if __name__ == '__main__': | ||
main() | ||
print('☭Data was analyzed successfully. Have a nice day☭') |