Example #1
0
# coding=utf-8

from computar_maximos import conseguir_fp
from read_spice_montecarlo import read_file_spice
import seaborn as sns
import matplotlib.pyplot as plt

data = read_file_spice("montecarlo.txt")

arr = []

for i in range(len(data)):
    act = conseguir_fp(data[i], -3)

    arr.append(act)

min_v = 1e5
for i in arr:
    min_v = min(i, min_v)

fig = sns.distplot(arr, norm_hist=True)

y_vals = fig.get_yticks()

fig.set_yticklabels(
    ['{:3.0f}%'.format(x * 100 * (24369 - 23169)) for x in y_vals])

plt.xlabel("Frecuencia de corte (Hz)")
plt.ylabel("Casos")

plt.savefig("histograma.png")
Example #2
0
# coding=utf-8

from computar_maximos import conseguir_fp
from read_spice_montecarlo import read_file_spice
import seaborn as sns
import matplotlib.pyplot as plt

data = read_file_spice(
    "EJ1/Circuito con Legendre/Simulacion/BodeMontecarlo.txt")

arr = []

for i in range(len(data)):
    act = conseguir_fp(data[i], -3)

    arr.append(act)

min_v = 1e5
for i in arr:
    min_v = min(i, min_v)

fig = sns.distplot(arr, norm_hist=True)

y_vals = fig.get_yticks()

fig.set_yticklabels(
    ['{:3.0f}%'.format(x * 100 * (24369 - 23169)) for x in y_vals])

plt.xlabel("Frecuencia de corte (Hz)")
plt.ylabel("Casos")
Example #3
0
# coding=utf-8
from computar_maximos import computar_notch
from read_spice_montecarlo import read_file_spice
from make_histogram import make_histogram
from matplotlib import rc
#rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
## for Palatino and other serif fonts use:
#rc('font',**{'family':'serif','serif':['Arial']})
#rc('text', usetex=True)

data = read_file_spice("EJ4/simulaciones/UNIVERSAL_ETAPA2_MODIFICADO.txt")

arr = {"notch_f": [], "min": [], "bw": []}

for i in range(len(data)):
    info = computar_notch(data[i])

    arr["notch_f"].append(info["notch_f"])
    arr["min"].append(info["min"])
    arr["bw"].append(info["f2"] - info["f1"])

#print(arr)

make_histogram(variable="Notch frecuency",
               unidad="Hz",
               data=arr["notch_f"],
               filename="histograma_martu_notch_frecuency.png",
               bar_width=50741 - 50225)

make_histogram(variable="Notch depth",
               unidad="dB",