File tree Expand file tree Collapse file tree
examples/lines_bars_and_markers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515t = np .arange (0 , 30 , dt )
1616nse1 = np .random .randn (len (t )) # white noise 1
1717nse2 = np .random .randn (len (t )) # white noise 2
18- r = np .exp (- t / 0.05 )
1918
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
2622
2723fig , axs = plt .subplots (2 , 1 )
2824axs [0 ].plot (t , s1 , t , s2 )
29- axs [0 ].set_xlim (0 , 5 )
25+ axs [0 ].set_xlim (0 , 2 )
3026axs [0 ].set_xlabel ('time' )
3127axs [0 ].set_ylabel ('s1 and s2' )
3228axs [0 ].grid (True )
You can’t perform that action at this time.
0 commit comments