We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 063bccf commit f0d4080Copy full SHA for f0d4080
examples/pylab_examples/psd_demo_complex.py
@@ -11,11 +11,13 @@
11
import matplotlib.pyplot as plt
12
import matplotlib.mlab as mlab
13
14
+prng = np.random.RandomState(123456) # to ensure reproducibility
15
+
16
fs = 1000
17
t = np.linspace(0, 0.3, 301)
18
A = np.array([2, 8]).reshape(-1, 1)
19
f = np.array([150, 140]).reshape(-1, 1)
-xn = (A * np.exp(2j * np.pi * f * t)).sum(axis=0) + 5 * np.random.randn(*t.shape)
20
+xn = (A * np.exp(2j * np.pi * f * t)).sum(axis=0) + 5 * prng.randn(*t.shape)
21
22
fig, (ax0, ax1) = plt.subplots(ncols=2)
23
0 commit comments