"""
Rauschen normalvereteilt
@author: jbechtloff

magic Command:
     %matplotlib qt
     %matplotlib inline
"""
import numpy as np
from numpy.random import *

import matplotlib.pyplot as plt
plt.close('all')


n = 1000


# Rauschanteil
w = np.random.randn(n)

t = np.linspace(0,n-1,n)
    
   
# Rauschverhalten    
fig, ax = plt.subplots(2, 1, figsize = [6,6])  
  
k=0
ax[k].plot(t,w,color='dimgray', label='w(t)', linewidth=1)
ax[k].set_ylabel('w')
ax[k].grid()

k +=1
num_bins = 50
# the histogram of the data
m, bins, patches = ax[k].hist(w, num_bins, density=1)
ax[k].set_ylabel('Wahrscheinlichkeitsdichte')
ax[k].set_xlabel('w')
ax[k].grid()

plt.show()    
    
#fig.savefig(fname="z:ex_2.pdf")
