Time for action – plotting the Bartlett window

The Bartlett window is a triangular smoothing window:

Time for action – plotting the Bartlett window
  1. Call the NumPy bartlett() function:
    window = np.bartlett(42)
  2. Plotting is easy with matplotlib:
    plt.plot(window)
    plt.show()

    The following is the Bartlett window, which is triangular, as expected:

    Time for action – plotting the Bartlett window

What just happened?

We plotted the Bartlett window with the NumPy bartlett() function.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset