File tree 1 file changed +4
-8
lines changed
examples/lines_bars_and_markers 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 15
15
t = np .arange (0 , 30 , dt )
16
16
nse1 = np .random .randn (len (t )) # white noise 1
17
17
nse2 = np .random .randn (len (t )) # white noise 2
18
- r = np .exp (- t / 0.05 )
19
18
20
- cnse1 = np .convolve (nse1 , r , mode = 'same' ) * dt # colored noise 1
21
- cnse2 = np .convolve (nse2 , r , mode = 'same' ) * dt # colored noise 2
22
-
23
- # two signals with a coherent part and a random part
24
- s1 = 0.01 * np .sin (2 * np .pi * 10 * t ) + cnse1
25
- s2 = 0.01 * np .sin (2 * np .pi * 10 * t ) + cnse2
19
+ # Two signals with a coherent part at 10Hz and a random part
20
+ s1 = np .sin (2 * np .pi * 10 * t ) + nse1
21
+ s2 = np .sin (2 * np .pi * 10 * t ) + nse2
26
22
27
23
fig , axs = plt .subplots (2 , 1 )
28
24
axs [0 ].plot (t , s1 , t , s2 )
29
- axs [0 ].set_xlim (0 , 5 )
25
+ axs [0 ].set_xlim (0 , 2 )
30
26
axs [0 ].set_xlabel ('time' )
31
27
axs [0 ].set_ylabel ('s1 and s2' )
32
28
axs [0 ].grid (True )
You can’t perform that action at this time.
0 commit comments