1.5.9 信号处理:scipy.signal

In [13]:

  1. from scipy import signal
  2. import matplotlib.pyplot as pl

In [14]:

  1. t = np.linspace(0, 5, 100)
  2. x = t + np.random.normal(size=100)
  3. pl.plot(t, x, linewidth=3)
  4. pl.plot(t, signal.detrend(x), linewidth=3)

Out[14]:

  1. [<matplotlib.lines.Line2D at 0x10781e590>]

1.5.9 信号处理:scipy.signal - 图1

In [15]:

  1. t = np.linspace(0, 5, 100)
  2. x = np.sin(t)
  3. pl.plot(t, x, linewidth=3)
  4. pl.plot(t[::2], signal.resample(x, 50), 'ko')

Out[15]:

  1. [<matplotlib.lines.Line2D at 0x107855cd0>]

1.5.9 信号处理:scipy.signal - 图2