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 c89ce08 commit 9499793Copy full SHA for 9499793
examples/pylab_examples/spectrum_demo.py
@@ -0,0 +1,31 @@
1
+#!/usr/bin/env python
2
+# python
3
+
4
+from pylab import *
5
6
+dt = 0.01
7
+Fs = 1/dt
8
+t = arange(0, 10, dt)
9
+nse = randn(len(t))
10
+r = exp(-t/0.05)
11
12
+cnse = convolve(nse, r)*dt
13
+cnse = cnse[:len(t)]
14
+s = 0.1*sin(2*pi*t) + cnse
15
16
+subplot(3, 2, 1)
17
+plot(t, s)
18
19
+subplot(3, 2, 3)
20
+magnitude_spectrum(s, Fs=Fs)
21
22
+subplot(3, 2, 4)
23
+magnitude_spectrum(s, Fs=Fs, scale='dB')
24
25
+subplot(3, 2, 5)
26
+angle_spectrum(s, Fs=Fs)
27
28
+subplot(3, 2, 6)
29
+phase_spectrum(s, Fs=Fs)
30
31
+show()
0 commit comments